diff options
Diffstat (limited to 'lib')
-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; |