From: Ralph Boehme Date: Wed, 1 Oct 2025 08:59:52 +0000 (+0200) Subject: smbd: deal with Persistent Handles in close_directory() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e13da6ebb036a00256581ee9c2a2091fca9a578d;p=thirdparty%2Fsamba.git smbd: deal with Persistent Handles in close_directory() Basically copying the logic from close_normal_file(). Signed-off-by: Ralph Boehme Reviewed-by: Anoop C S --- diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 6527d178523..49679fb018c 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1201,6 +1201,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, bool changed_user = false; struct smb_filename *parent_fname = NULL; struct smb_filename *base_fname = NULL; + bool is_durable; NTSTATUS status = NT_STATUS_OK; NTSTATUS status1 = NT_STATUS_OK; NTSTATUS notify_status; @@ -1216,6 +1217,16 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, assert_no_pending_aio(fsp, close_type); + is_durable = close_durable(req, fsp, close_type); + if (is_durable) { + return NT_STATUS_OK; + } + + if (fsp->op != NULL) { + fsp->op->global->durable = false; + fsp->op->global->persistent = false; + } + /* * NT can set delete_on_close of the last open * reference to a directory also.