Skip to content

Commit

Permalink
dbwrap: Remove calls to loadparm
Browse files Browse the repository at this point in the history
Signed-off-by: Volker Lendecke <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
  • Loading branch information
vlendec authored and jrasamba committed Apr 23, 2018
1 parent 812312c commit 1aeac2f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion auth/credentials/credentials_secrets.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ _PUBLIC_ NTSTATUS cli_credentials_set_machine_account(struct cli_credentials *cr

db_ctx = dbwrap_local_open(
cred,
lp_ctx,
secrets_tdb_path,
hash_size,
tdb_flags,
Expand Down
2 changes: 0 additions & 2 deletions lib/dbwrap/dbwrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <tevent.h>
#include "libcli/util/ntstatus.h"
#include "tdb.h"
#include "lib/param/loadparm.h"

struct db_record;
struct db_context;
Expand Down Expand Up @@ -231,7 +230,6 @@ TDB_DATA dbwrap_merge_dbufs(TALLOC_CTX *mem_ctx,
* This opens a tdb file
*/
struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
Expand Down
19 changes: 9 additions & 10 deletions lib/dbwrap/dbwrap_local_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
#include "dbwrap/dbwrap.h"
#include "dbwrap/dbwrap_tdb.h"
#include "tdb.h"
#include "lib/param/param.h"

struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx,
const char *name,
int hash_size, int tdb_flags,
int open_flags, mode_t mode,
Expand All @@ -34,14 +32,15 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx,
{
struct db_context *db = NULL;

if (hash_size == 0) {
hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
}

db = db_open_tdb(mem_ctx, name, hash_size,
lpcfg_tdb_flags(lp_ctx, tdb_flags),
open_flags, mode,
lock_order, dbwrap_flags);
db = db_open_tdb(
mem_ctx,
name,
hash_size,
tdb_flags,
open_flags,
mode,
lock_order,
dbwrap_flags);

return db;
}
1 change: 0 additions & 1 deletion libcli/auth/netlogon_creds_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)

global_db = dbwrap_local_open(
NULL,
lp_ctx,
fname,
hash_size,
tdb_flags,
Expand Down
1 change: 0 additions & 1 deletion libcli/auth/schannel_state_tdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ struct db_context *open_schannel_session_store(TALLOC_CTX *mem_ctx,

db_sc = dbwrap_local_open(
mem_ctx,
lp_ctx,
fname,
hash_size,
tdb_flags,
Expand Down
12 changes: 9 additions & 3 deletions source3/lib/dbwrap/dbwrap_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,15 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
}
tdb_flags = lpcfg_tdb_flags(lp_ctx, tdb_flags);

result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
tdb_flags, open_flags, mode,
lock_order, dbwrap_flags);
result = dbwrap_local_open(
mem_ctx,
name,
hash_size,
tdb_flags,
open_flags,
mode,
lock_order,
dbwrap_flags);
talloc_unlink(mem_ctx, lp_ctx);
}
return result;
Expand Down
1 change: 0 additions & 1 deletion source4/cluster/local.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,

db = dbwrap_local_open(
mem_ctx,
lp_ctx,
path,
hash_size,
tdb_flags,
Expand Down

0 comments on commit 1aeac2f

Please sign in to comment.