dbwrap: Remove calls to loadparm
authorVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2018 14:45:45 +0000 (16:45 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 23 Apr 2018 23:53:19 +0000 (01:53 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
auth/credentials/credentials_secrets.c
lib/dbwrap/dbwrap.h
lib/dbwrap/dbwrap_local_open.c
libcli/auth/netlogon_creds_cli.c
libcli/auth/schannel_state_tdb.c
source3/lib/dbwrap/dbwrap_open.c
source4/cluster/local.c

index 23d28f1917d07966439af7e252429b63b535f7cc..54f3ce2d0780389f019e1168e3f943eef5bbe218 100644 (file)
@@ -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,
index 1161bf0a49333c020f1ed0880ec2b816dfbc0983..6a0f7b1ee2e56b557c8afe389e22a81f9fe27899 100644 (file)
@@ -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;
@@ -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,
index c350fd3ea420dc2168d63e77e30ab4ba39e39228..20c5fa0e1d21a8520de330ef7cc5c33b16ab322c 100644 (file)
 #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;
 }
index 9b7e4e2517cca2a656ee60ea3a64df8cc1b8b033..817d2cd041a0e78a1c311c1107eb7c5d57fb6d94 100644 (file)
@@ -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,
index 15554b2ed488f154f408b59e04c2f4963940caee..ce20012ac225d728195a5204aa00ef17b1b3101e 100644 (file)
@@ -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,
index e05e011d0d4f1de1b4e0a49b749f6f52f72913ab..a4d5184396d73c10fe8aa637afcbc25cea1d368a 100644 (file)
@@ -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;
index d871dcbd3f9552873557749addaa96d1235ac4e6..ea3666322a57bb1b8dc4e233295e3bca6dfd8aa6 100644 (file)
@@ -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,