From: Jeremy Allison Date: Thu, 11 Aug 2022 16:51:11 +0000 (-0700) Subject: s3: tests: Add samba3.blackbox.test_veto_files. X-Git-Tag: talloc-2.4.0~1426 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c6933673222ea9ae2eb74d5586c9495269f51ea0;p=thirdparty%2Fsamba.git s3: tests: Add samba3.blackbox.test_veto_files. Shows we currently don't look at smb.conf veto files parameter when opening a file or directory. Checks multi-component paths. Also checks veto files that might be hidden behind a mangled name. Add knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15143 Signed-off-by: Jeremy Allison Reviewed-by: Stefan Metzmacher --- diff --git a/selftest/knownfail.d/veto_files b/selftest/knownfail.d/veto_files new file mode 100644 index 00000000000..ad7d841a033 --- /dev/null +++ b/selftest/knownfail.d/veto_files @@ -0,0 +1 @@ +^samba3.blackbox.test_veto_files.get_veto_file\(fileserver\) diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 387856e07a0..88898807428 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1916,6 +1916,10 @@ sub setup_fileserver path = $veto_sharedir delete veto files = yes +[veto_files] + path = $veto_sharedir + veto files = /veto_name*/ + [delete_yes_unwrite] read only = no path = $delete_unwrite_sharedir diff --git a/source3/script/tests/test_veto_files.sh b/source3/script/tests/test_veto_files.sh new file mode 100755 index 00000000000..9f0526bd54c --- /dev/null +++ b/source3/script/tests/test_veto_files.sh @@ -0,0 +1,201 @@ +#!/bin/sh +# +# Check smbclient cannot get a file that matches a veto files +# parameter, or inside a directory that matches a veto files +# parameter. +# +# BUG: https://bugzilla.samba.org/show_bug.cgi?id=15143 +# + +if [ $# -lt 6 ]; then + cat <"$tmpfile" <