summaryrefslogtreecommitdiff
path: root/source3/lib/dbwrap/dbwrap_open.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-16 13:37:39 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-18 12:04:59 +1000
commit338e5a1d35574dbd96bbbcf2a74fe33adc95cb8c (patch)
tree4206afcc1354276ab3d99fce23754430a3b0264d /source3/lib/dbwrap/dbwrap_open.c
parent235016bcf9c332f88d3aae68d0726d8bb2a64246 (diff)
downloadsamba-338e5a1d35574dbd96bbbcf2a74fe33adc95cb8c.tar.gz
samba-338e5a1d35574dbd96bbbcf2a74fe33adc95cb8c.tar.bz2
samba-338e5a1d35574dbd96bbbcf2a74fe33adc95cb8c.zip
s3-dbwrap: push lp_ctx up another layer in the stack
This will allow db_open_tdb() to be called from common code, which may already have a loadparm context loaded. It also slowly moves the lp_ctx up the stack, as required to remove the library loop between smbconf and the registry. Andrew Bartlett
Diffstat (limited to 'source3/lib/dbwrap/dbwrap_open.c')
-rw-r--r--source3/lib/dbwrap/dbwrap_open.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c
index 5491a1f56b..b7e6bd586f 100644
--- a/source3/lib/dbwrap/dbwrap_open.c
+++ b/source3/lib/dbwrap/dbwrap_open.c
@@ -24,6 +24,7 @@
#include "dbwrap/dbwrap_open.h"
#include "dbwrap/dbwrap_tdb.h"
#include "dbwrap/dbwrap_ctdb.h"
+#include "lib/param/param.h"
#include "util_tdb.h"
#ifdef CLUSTER_SUPPORT
#include "ctdb_private.h"
@@ -117,9 +118,11 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
#endif
if (result == NULL) {
- result = db_open_tdb(mem_ctx, name, hash_size,
+ struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_context());
+ result = db_open_tdb(mem_ctx, lp_ctx, name, hash_size,
tdb_flags, open_flags, mode,
lock_order);
+ talloc_unlink(mem_ctx, lp_ctx);
}
return result;
}