]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: use DBWRAP_STORE_PERSISTENT in smbXsrv_open_global_store()
authorRalph Boehme <slow@samba.org>
Wed, 26 Feb 2025 17:03:15 +0000 (18:03 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:37 +0000 (10:18 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/smbXsrv_open.c

index c234e7aa4f6a7b617e0d22438cc5b28411ea76a8..aa0e3f4c347c888ac2783b7318d481dff89ac1f2 100644 (file)
@@ -361,6 +361,7 @@ static NTSTATUS smbXsrv_open_global_store(
        TDB_DATA val = { .dptr = NULL, };
        NTSTATUS status;
        enum ndr_err_code ndr_err;
+       int dbwrap_flags = DBWRAP_REPLACE;
 
        /*
         * TODO: if we use other versions than '0'
@@ -388,7 +389,11 @@ static NTSTATUS smbXsrv_open_global_store(
        }
 
        val = make_tdb_data(blob.data, blob.length);
-       status = dbwrap_record_store(rec, val, DBWRAP_REPLACE);
+
+       if (global->persistent) {
+               dbwrap_flags |= DBWRAP_STORE_PERSISTENT;
+       }
+       status = dbwrap_record_store(rec, val, dbwrap_flags);
        TALLOC_FREE(blob.data);
        if (!NT_STATUS_IS_OK(status)) {
                DBG_WARNING("key '%s' store - %s\n",