s3: smbd: Don't allow setting the delete on close bit on a directory if it contains...
authorJeremy Allison <jra@samba.org>
Mon, 21 Mar 2022 20:50:56 +0000 (13:50 -0700)
committerJule Anger <janger@samba.org>
Thu, 24 Mar 2022 11:55:43 +0000 (11:55 +0000)
Remove knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15023

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 22 17:48:25 UTC 2022 on sn-devel-184

(cherry picked from commit 80503b46e7238d0796f5cc9eb6104958c3b3fcc7)

Autobuild-User(v4-16-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-16-test): Thu Mar 24 11:55:43 UTC 2022 on sn-devel-184

selftest/knownfail.d/smb2_del_on_close_nonwrite [deleted file]
source3/smbd/dir.c

diff --git a/selftest/knownfail.d/smb2_del_on_close_nonwrite b/selftest/knownfail.d/smb2_del_on_close_nonwrite
deleted file mode 100644 (file)
index 7e81a11..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smbtorture_s3.plain.SMB2-DEL-ON-CLOSE-NONWRITE-DELETE-NO.smbtorture\(fileserver\)
index 581ce5202ed790365fd40114f09483130353970d..01079bf7788200a236e86902f26590c08aa1cf7e 100644 (file)
@@ -2019,11 +2019,17 @@ NTSTATUS can_delete_directory_fsp(files_struct *fsp)
                }
 
                if (!is_visible_fsp(direntry_fname->fsp)) {
-                       TALLOC_FREE(talloced);
-                       TALLOC_FREE(fullname);
-                       TALLOC_FREE(smb_dname_full);
-                       TALLOC_FREE(direntry_fname);
-                       continue;
+                       /*
+                        * Hidden file.
+                        * Allow if "delete veto files = yes"
+                        */
+                       if (lp_delete_veto_files(SNUM(conn))) {
+                               TALLOC_FREE(talloced);
+                               TALLOC_FREE(fullname);
+                               TALLOC_FREE(smb_dname_full);
+                               TALLOC_FREE(direntry_fname);
+                               continue;
+                       }
                }
 
                TALLOC_FREE(talloced);