From: Ralph Boehme Date: Wed, 26 Feb 2025 17:03:15 +0000 (+0100) Subject: smbd: use DBWRAP_STORE_PERSISTENT in smbXsrv_open_global_store() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1aa1e4e510364ad36031a75bc3d40ff949bae92;p=thirdparty%2Fsamba.git smbd: use DBWRAP_STORE_PERSISTENT in smbXsrv_open_global_store() Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/smbXsrv_open.c b/source3/smbd/smbXsrv_open.c index c234e7aa4f6..aa0e3f4c347 100644 --- a/source3/smbd/smbXsrv_open.c +++ b/source3/smbd/smbXsrv_open.c @@ -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",