libcli: Call dbwrap_local_open with the correct tdb flags
authorVolker Lendecke <vl@samba.org>
Tue, 17 Apr 2018 14:39:46 +0000 (16:39 +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>
libcli/auth/netlogon_creds_cli.c

index f3e8ed1209c237d1766a10a344c8ffa10fd46b2a..9b7e4e2517cca2a656ee60ea3a64df8cc1b8b033 100644 (file)
@@ -215,7 +215,7 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
 {
        char *fname;
        struct db_context *global_db;
 {
        char *fname;
        struct db_context *global_db;
-       int hash_size;
+       int hash_size, tdb_flags;
 
        if (netlogon_creds_cli_global_db != NULL) {
                return NT_STATUS_OK;
 
        if (netlogon_creds_cli_global_db != NULL) {
                return NT_STATUS_OK;
@@ -227,13 +227,16 @@ NTSTATUS netlogon_creds_cli_open_global_db(struct loadparm_context *lp_ctx)
        }
 
        hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
        }
 
        hash_size = lpcfg_tdb_hash_size(lp_ctx, fname);
+       tdb_flags = lpcfg_tdb_flags(
+               lp_ctx,
+               TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH);
 
        global_db = dbwrap_local_open(
                NULL,
                lp_ctx,
                fname,
                hash_size,
 
        global_db = dbwrap_local_open(
                NULL,
                lp_ctx,
                fname,
                hash_size,
-               TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
+               tdb_flags,
                O_RDWR|O_CREAT,
                0600,
                DBWRAP_LOCK_ORDER_2,
                O_RDWR|O_CREAT,
                0600,
                DBWRAP_LOCK_ORDER_2,