From: Jeremy Allison Date: Thu, 21 Oct 2021 22:06:20 +0000 (-0700) Subject: s3: smbd: Add two tests showing recursive directory delete of a directory containing... X-Git-Tag: ldb-2.5.0~341 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad0082d79a681b981154747dcde5713e1933b88f;p=thirdparty%2Fsamba.git 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 --- diff --git a/selftest/knownfail.d/veto_rmdir b/selftest/knownfail.d/veto_rmdir new file mode 100644 index 00000000000..ecced55d794 --- /dev/null +++ b/selftest/knownfail.d/veto_rmdir @@ -0,0 +1 @@ +^samba3.blackbox.test_veto_rmdir.rmdir can delete directory containing a veto file\(fileserver\) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index fdbba8411bc..2fdab781fda 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1614,6 +1614,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 @@ -1722,6 +1725,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" <