From: Ralph Boehme Date: Tue, 2 Dec 2025 18:44:44 +0000 (+0100) Subject: vfs_default: make disconnect a no-op for Persistent Handles X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bca4efedc4b60981d1ff3307b99e3f85b341f1f0;p=thirdparty%2Fsamba.git vfs_default: make disconnect a no-op for Persistent Handles Basically just copy the existing initial cookie and call it a day. That way the resulting overall disconnect/reconnect behaviour is the same for Persistent Handles regardless of a server side process or node crash, or a TCP disconnect. Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c index e55a0c0d6bc..c5eef93ae41 100644 --- a/source3/smbd/durable.c +++ b/source3/smbd/durable.c @@ -218,6 +218,14 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp, return NT_STATUS_INVALID_PARAMETER; } + if (fsp->op->global->persistent) { + new_cookie_blob = data_blob_dup_talloc(mem_ctx, old_cookie); + if (new_cookie_blob.data == NULL) { + return NT_STATUS_NO_MEMORY; + } + goto do_close; + } + if ((fsp_lease_type(fsp) & SMB2_LEASE_HANDLE) == 0) { return NT_STATUS_NOT_SUPPORTED; } @@ -308,6 +316,7 @@ NTSTATUS vfs_default_durable_disconnect(struct files_struct *fsp, NDR_PRINT_DEBUG(vfs_default_durable_cookie, &cookie); } +do_close: status = fd_close(fsp); if (!NT_STATUS_IS_OK(status)) { data_blob_free(&new_cookie_blob);