diff options
author | Volker Lendecke <vl@samba.org> | 2014-03-26 14:26:24 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-31 22:52:13 +0200 |
commit | acbc1ed7037e5fab550ca33c8c86dd4d919cd59a (patch) | |
tree | 88daaf1e10f6a8c58686ca77fbcc5b5d186d361e | |
parent | db630a525348d84dcf572f8d55639071a798894c (diff) | |
download | samba-acbc1ed7037e5fab550ca33c8c86dd4d919cd59a.tar.gz samba-acbc1ed7037e5fab550ca33c8c86dd4d919cd59a.tar.xz samba-acbc1ed7037e5fab550ca33c8c86dd4d919cd59a.zip |
dbwrap: Avoid passing lp_ctx to tdb_wrap_open in db_open_tdb
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index 1b061e3fdf..82a9916e2f 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -25,6 +25,7 @@ #include "lib/util/util_tdb.h" #include "system/filesys.h" #include "ccan/str/str.h" +#include "lib/param/param.h" struct db_tdb_ctx { struct tdb_wrap *wtdb; @@ -427,8 +428,13 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, } result->lock_order = lock_order; - db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, tdb_flags, - open_flags, mode, lp_ctx); + if (hash_size == 0) { + hash_size = lpcfg_tdb_hash_size(lp_ctx, name); + } + + db_tdb->wtdb = tdb_wrap_open_(db_tdb, name, hash_size, + lpcfg_tdb_flags(lp_ctx, tdb_flags), + open_flags, mode); if (db_tdb->wtdb == NULL) { DEBUG(3, ("Could not open tdb: %s\n", strerror(errno))); goto fail; |