dbwrap3: Call dbwrap_local_open with the correct hash size
authorVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2018 14:31:28 +0000 (16:31 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 23 Apr 2018 23:53:19 +0000 (01:53 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/dbwrap/dbwrap_open.c

index 658ccb602a89ec13f94c161289efaa17698f64cb..d6c19e3d10796a6062e78151f4d51d06844a63e6 100644 (file)
@@ -182,6 +182,11 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx,
 
        if (result == NULL) {
                struct loadparm_context *lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_helpers());
+
+               if (hash_size == 0) {
+                       hash_size = lpcfg_tdb_hash_size(lp_ctx, name);
+               }
+
                result = dbwrap_local_open(mem_ctx, lp_ctx, name, hash_size,
                                           tdb_flags, open_flags, mode,
                                           lock_order, dbwrap_flags);