]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_default: set cookie.allow_reconnect for PH already in vfs_default_durable_cookie()
authorRalph Boehme <slow@samba.org>
Tue, 2 Dec 2025 18:42:23 +0000 (19:42 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:36 +0000 (10:18 +0000)
For Durable Handles we set cookie.allow_reconnect in the SMB_VFS_DISCONNECT()
implemtation, but for Persistent Handles we can't rely on SMB_VFS_DISCONNECT()
being called in case of a server side process or node failure.

The whole disconnect/reconnect logic is therefor adjusted to make
SMB_VFS_DISCONNECT() a no-op for Persistent Handles.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/smbd/durable.c

index afefd7407de450a5cc31f2431cd4d46c20ec802e..e55a0c0d6bc38a065f828d1b6d197ff64bcf4ecd 100644 (file)
@@ -127,6 +127,10 @@ NTSTATUS vfs_default_durable_cookie(struct files_struct *fsp,
        cookie.stat_info.st_ex_blocks = fsp->fsp_name->st.st_ex_blocks;
        cookie.stat_info.st_ex_flags = fsp->fsp_name->st.st_ex_flags;
 
+       if (fsp->op->global->persistent) {
+               cookie.allow_reconnect = true;
+       }
+
        if (CHECK_DEBUGLVL(DBGLVL_DEBUG)) {
                DBG_DEBUG("Fresh cookie\n");
                NDR_PRINT_DEBUG(vfs_default_durable_cookie, &cookie);