From 1aeac2f85db045d565e30d8b94334366e39222e9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 17 Apr 2018 16:45:45 +0200 Subject: [PATCH] dbwrap: Remove calls to loadparm Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- auth/credentials/credentials_secrets.c | 1 - lib/dbwrap/dbwrap.h | 2 -- lib/dbwrap/dbwrap_local_open.c | 19 +++++++++---------- libcli/auth/netlogon_creds_cli.c | 1 - libcli/auth/schannel_state_tdb.c | 1 - source3/lib/dbwrap/dbwrap_open.c | 12 +++++++++--- source4/cluster/local.c | 1 - 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/auth/credentials/credentials_secrets.c b/auth/credentials/credentials_secrets.c index 23d28f1917d0..54f3ce2d0780 100644 --- a/auth/credentials/credentials_secrets.c +++ b/auth/credentials/credentials_secrets.c @@ -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, diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h index 1161bf0a4933..6a0f7b1ee2e5 100644 --- a/lib/dbwrap/dbwrap.h +++ b/lib/dbwrap/dbwrap.h @@ -25,7 +25,6 @@ #include #include "libcli/util/ntstatus.h" #include "tdb.h" -#include "lib/param/loadparm.h" struct db_record; struct db_context; @@ -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, diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c index c350fd3ea420..20c5fa0e1d21 100644 --- a/lib/dbwrap/dbwrap_local_open.c +++ b/lib/dbwrap/dbwrap_local_open.c @@ -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, @@ -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; } diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 9b7e4e2517cc..817d2cd041a0 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -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, diff --git a/libcli/auth/schannel_state_tdb.c b/libcli/auth/schannel_state_tdb.c index 15554b2ed488..ce20012ac225 100644 --- a/libcli/auth/schannel_state_tdb.c +++ b/libcli/auth/schannel_state_tdb.c @@ -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, diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index e05e011d0d4f..a4d5184396d7 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -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; diff --git a/source4/cluster/local.c b/source4/cluster/local.c index d871dcbd3f95..ea3666322a57 100644 --- a/source4/cluster/local.c +++ b/source4/cluster/local.c @@ -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, -- 2.34.1