]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: deal with Persistent Handles in close_directory()
authorRalph Boehme <slow@samba.org>
Wed, 1 Oct 2025 08:59:52 +0000 (10:59 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 17 Jul 2026 10:18:36 +0000 (10:18 +0000)
Basically copying the logic from close_normal_file().

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

index 6527d178523c6d1bec8f6591e359ae3ad71f37de..49679fb018c5b5166a1a9e88db88e017f3ead84e 100644 (file)
@@ -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.