messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_init
authorVolker Lendecke <vl@samba.org>
Wed, 26 Mar 2014 14:35:31 +0000 (14:35 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 31 Mar 2014 20:52:13 +0000 (22:52 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/messages_local.c

index acc5ba6e7dabe2c209bd6f5c1b73fb186d5c1e91..295646a3a064db389246be09ffd7bd2959a201f9 100644 (file)
@@ -92,6 +92,7 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
        struct messaging_tdb_context *ctx;
        struct loadparm_context *lp_ctx;
        static bool have_context = false;
+       const char *fname;
 
        if (have_context) {
                DEBUG(0, ("No two messaging contexts per process\n"));
@@ -122,9 +123,14 @@ NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx,
        ctx->msg_ctx = msg_ctx;
        ctx->have_context = &have_context;
 
-       ctx->tdb = tdb_wrap_open(ctx, lock_path("messages.tdb"), 0,
-                                TDB_CLEAR_IF_FIRST|TDB_DEFAULT|TDB_VOLATILE|TDB_INCOMPATIBLE_HASH,
-                                O_RDWR|O_CREAT,0600, lp_ctx);
+       fname = lock_path("messages.tdb");
+
+       ctx->tdb = tdb_wrap_open_(
+               ctx, fname, lpcfg_tdb_hash_size(lp_ctx, fname),
+               lpcfg_tdb_flags(lp_ctx, TDB_CLEAR_IF_FIRST|TDB_DEFAULT|
+                               TDB_VOLATILE| TDB_INCOMPATIBLE_HASH),
+               O_RDWR|O_CREAT,0600);
+
        talloc_unlink(result, lp_ctx);
 
        if (!ctx->tdb) {