]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Fix can_delete_directory_fsp()
authorVolker Lendecke <vl@samba.org>
Fri, 6 Dec 2024 10:31:56 +0000 (11:31 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 17 Dec 2024 12:30:31 +0000 (12:30 +0000)
We should only ignore veto files if they are about to deleted anyway

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
source3/smbd/dir.c

index a9b6c1b8fb197a796a57c533e36df7719d027f1c..788d154f4c7aee4a28e7a6cbdc8bb43d1a5538c2 100644 (file)
@@ -1545,6 +1545,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
        const char *dname = NULL;
        char *talloced = NULL;
        struct connection_struct *conn = fsp->conn;
+       bool delete_veto = lp_delete_veto_files(SNUM(conn));
        struct smb_Dir *dir_hnd = NULL;
 
        status = OpenDir_from_pathref(talloc_tos(), fsp, NULL, 0, &dir_hnd);
@@ -1559,7 +1560,7 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
                        TALLOC_FREE(talloced);
                        continue;
                }
-               if (IS_VETO_PATH(conn, dname)) {
+               if (delete_veto && IS_VETO_PATH(conn, dname)) {
                        TALLOC_FREE(talloced);
                        continue;
                }