From 505e48439364c4027aa11aeda467bbd2060b89f4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 21 Oct 2021 15:06:20 -0700 Subject: [PATCH] s3: smbd: Add two tests showing recursive directory delete of a directory containing veto file and msdfs links over SMB2. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14878 Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme (cherry picked from commit ad0082d79a681b981154747dcde5713e1933b88f) (cherry picked from commit dab3fa1d8c27e696afa15e071331f646e06d9706) --- selftest/target/Samba3.pm | 16 ++ source3/script/tests/test_veto_rmdir.sh | 217 ++++++++++++++++++++++++ source3/selftest/tests.py | 3 + 3 files changed, 236 insertions(+) create mode 100755 source3/script/tests/test_veto_rmdir.sh diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 14a1f1223b1..bbff9d74817 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1460,6 +1460,9 @@ sub setup_fileserver my $bad_iconv_sharedir="$share_dir/bad_iconv"; push(@dirs, $bad_iconv_sharedir); + my $veto_sharedir="$share_dir/veto"; + push(@dirs,$veto_sharedir); + my $ip4 = Samba::get_ipv4_addr("FILESERVER"); my $fileserver_options = " kernel change notify = yes @@ -1568,6 +1571,19 @@ sub setup_fileserver comment = smb username is [%U] vfs objects = +[veto_files_nodelete] + path = $veto_sharedir + read only = no + msdfs root = yes + veto files = /veto_name*/ + delete veto files = no + +[veto_files_delete] + path = $veto_sharedir + msdfs root = yes + veto files = /veto_name*/ + delete veto files = yes + [homes] comment = Home directories browseable = No diff --git a/source3/script/tests/test_veto_rmdir.sh b/source3/script/tests/test_veto_rmdir.sh new file mode 100755 index 00000000000..d3df8f1bba0 --- /dev/null +++ b/source3/script/tests/test_veto_rmdir.sh @@ -0,0 +1,217 @@ +#!/bin/sh +# +# Check smbclient can (or cannot) delete a directory containing veto files. +# BUG: https://bugzilla.samba.org/show_bug.cgi?id=14878 +# + +if [ $# -lt 6 ]; then +cat < "$tmpfile" < "$tmpfile" < "$tmpfile" < "$tmpfile" < "$tmpfile" <