]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default: fill delete-on-close stuff for Persistent Handles
authorRalph Boehme <slow@samba.org>
Tue, 2 Dec 2025 18:41:53 +0000 (19:41 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:36 +0000 (10:18 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/durable.c

index 1cda565fe968771b80af57a784e33e75f5252194..afefd7407de450a5cc31f2431cd4d46c20ec802e 100644 (file)
@@ -105,6 +105,10 @@ NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp,
        cookie.initial_allocation_size = fsp->initial_allocation_size;
        cookie.position_information = fh_get_position_information(fsp->fh);
        cookie.write_time_forced = fsp->fsp_flags.write_time_forced;
+       if (fsp->op->global->persistent) {
+               cookie.initial_delete_on_close =
+                       fsp->fsp_flags.initial_delete_on_close;
+       }
 
        cookie.stat_info.st_ex_dev = fsp->fsp_name->st.st_ex_dev;
        cookie.stat_info.st_ex_ino = fsp->fsp_name->st.st_ex_ino;
@@ -669,6 +673,12 @@ static void vfs_default_durable_reconnect_fn(struct share_mode_lock *lck,
        fsp->initial_allocation_size = state->cookie.initial_allocation_size;
        fh_set_position_information(fsp->fh, state->cookie.position_information);
        fsp->fsp_flags.write_time_forced = state->cookie.write_time_forced;
+       if (state->op->global->persistent) {
+               fsp->fsp_flags.initial_delete_on_close =
+                       state->cookie.initial_delete_on_close;
+               fsp->fsp_flags.delete_on_close = is_delete_on_close_set(
+                       lck, fsp->name_hash);
+       }
 
        state->op->compat = fsp;
        fsp->op = state->op;