From: Ralph Boehme Date: Tue, 2 Dec 2025 18:42:23 +0000 (+0100) Subject: vfs_default: set cookie.allow_reconnect for PH already in vfs_default_durable_cookie() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea954b5a044ae51a853f1d51ba7f352a87c49ed9;p=thirdparty%2Fsamba.git vfs_default: set cookie.allow_reconnect for PH already in vfs_default_durable_cookie() 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 Reviewed-by: Anoop C S --- diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index afefd7407de..e55a0c0d6bc 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -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);