]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: move notify_fname() out of rmdir_internals() up to close_directory()
authorRalph Boehme <slow@samba.org>
Sat, 7 Sep 2024 14:24:01 +0000 (16:24 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
This way we've already dropped the sharemode lock.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/close.c

index b14955c511e480ec05a9c79358525197705378d4..8909cd99c44610b4251e41b5bfbe6b970c558f0b 100644 (file)
@@ -1125,9 +1125,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp)
                               unlink_flags);
        if (ret == 0) {
                TALLOC_FREE(parent_fname);
-               notify_fname(conn, NOTIFY_ACTION_REMOVED,
-                            FILE_NOTIFY_CHANGE_DIR_NAME,
-                            smb_dname->base_name);
                return NT_STATUS_OK;
        }
 
@@ -1460,10 +1457,6 @@ static NTSTATUS rmdir_internals(TALLOC_CTX *ctx, struct files_struct *fsp)
                return status;
        }
 
-       notify_fname(conn, NOTIFY_ACTION_REMOVED,
-                    FILE_NOTIFY_CHANGE_DIR_NAME,
-                    smb_dname->base_name);
-
        return status;
 }
 
@@ -1599,6 +1592,13 @@ done:
 
        remove_pending_change_notify_requests_by_fid(fsp, notify_status);
 
+       if (lck_state.delete_object) {
+               notify_fname(conn,
+                            NOTIFY_ACTION_REMOVED,
+                            FILE_NOTIFY_CHANGE_DIR_NAME,
+                            fsp->fsp_name->base_name);
+       }
+
        status1 = fd_close(fsp);
 
        if (!NT_STATUS_IS_OK(status1)) {