From: Volker Lendecke Date: Fri, 6 Dec 2024 10:31:56 +0000 (+0100) Subject: smbd: Fix can_delete_directory_fsp() X-Git-Tag: tdb-1.4.13~294 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f29b06760a46021dddeeddf94a422caf045120de;p=thirdparty%2Fsamba.git smbd: Fix can_delete_directory_fsp() We should only ignore veto files if they are about to deleted anyway Signed-off-by: Volker Lendecke Reviewed-by: Pavel Filipenský --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index a9b6c1b8fb1..788d154f4c7 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -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; }