summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-26 14:35:31 +0000
committerJeremy Allison <jra@samba.org>2014-03-31 22:52:13 +0200
commitd169d0d9e2a22b96d1d41e9e4adde524965509c7 (patch)
tree6b33745a0e966f13a13480d1d5776991a3f9be80
parentacbc1ed7037e5fab550ca33c8c86dd4d919cd59a (diff)
downloadsamba-d169d0d9e2a22b96d1d41e9e4adde524965509c7.tar.gz
samba-d169d0d9e2a22b96d1d41e9e4adde524965509c7.tar.xz
samba-d169d0d9e2a22b96d1d41e9e4adde524965509c7.zip
messaging: Avoid passing lp_ctx to tdb_wrap_open in messaging_tdb_init
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/lib/messages_local.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source3/lib/messages_local.c b/source3/lib/messages_local.c
index acc5ba6e7d..295646a3a0 100644
--- a/source3/lib/messages_local.c
+++ b/source3/lib/messages_local.c
@@ -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) {