summaryrefslogtreecommitdiffstats
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-03-26 14:32:58 +0000
committerJeremy Allison <jra@samba.org>2014-03-31 22:52:13 +0200
commit994d75574b695bd335aa3bb1c9c9334c5a6b4b19 (patch)
treeae4c5f6a683231df16dee8c21f3f42094068eaf9 /source3/lib
parent604b970d676fa9561781b0be6b373283410fa8ea (diff)
downloadsamba-994d75574b695bd335aa3bb1c9c9334c5a6b4b19.tar.gz
samba-994d75574b695bd335aa3bb1c9c9334c5a6b4b19.tar.xz
samba-994d75574b695bd335aa3bb1c9c9334c5a6b4b19.zip
dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_ctdb
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap/dbwrap_ctdb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index b1133445342..32d044628d1 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1661,8 +1661,13 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
lp_ctx = loadparm_init_s3(db_path, loadparm_s3_helpers());
- db_ctdb->wtdb = tdb_wrap_open(db_ctdb, db_path, hash_size, tdb_flags,
- O_RDWR, 0, lp_ctx);
+ if (hash_size == 0) {
+ hash_size = lpcfg_tdb_hash_size(lp_ctx, db_path);
+ }
+
+ db_ctdb->wtdb = tdb_wrap_open_(db_ctdb, db_path, hash_size,
+ lpcfg_tdb_flags(lp_ctx, tdb_flags),
+ O_RDWR, 0);
talloc_unlink(db_path, lp_ctx);
if (db_ctdb->wtdb == NULL) {
DEBUG(0, ("Could not open tdb %s: %s\n", db_path, strerror(errno)));