cluster4: Call dbwrap_local_open with the correct hash size
authorVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2018 14:25:19 +0000 (16:25 +0200)
committerJeremy Allison <jra@samba.org>
Mon, 23 Apr 2018 23:53:18 +0000 (01:53 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/cluster/local.c

index 5ef58c91bf6e80b1ab91e6e0764c72638f66b7ba..d4c16b00ccec1daafb57d9da26040e4fddea6b60 100644 (file)
@@ -55,12 +55,24 @@ static struct db_context *local_db_tmp_open(struct cluster_ops *ops,
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
        char *path, *dbname;
        struct db_context *db;
+       int hash_size;
 
        dbname = talloc_asprintf(mem_ctx, "%s.tdb", dbbase);
 
        path = smbd_tmp_path(tmp_ctx, lp_ctx, dbname);
-       db = dbwrap_local_open(mem_ctx, lp_ctx, path, 0, flags, O_RDWR|O_CREAT,
-                              0600, DBWRAP_LOCK_ORDER_NONE, DBWRAP_FLAG_NONE);
+
+       hash_size = lpcfg_tdb_hash_size(lp_ctx, path);
+
+       db = dbwrap_local_open(
+               mem_ctx,
+               lp_ctx,
+               path,
+               hash_size,
+               flags,
+               O_RDWR|O_CREAT,
+               0600,
+               DBWRAP_LOCK_ORDER_NONE,
+               DBWRAP_FLAG_NONE);
        talloc_free(tmp_ctx);
        return db;
 }