1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00

s3:tests: Add test that veto files works for hidden files

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit a2acbd3f3c)
This commit is contained in:
Andreas Schneider 2023-04-19 15:35:47 +02:00 committed by Jule Anger
parent 647c7c75f8
commit c13b5b7dc8
3 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1 @@
^samba3.blackbox.test_veto_files.list.files.fileserver

View File

@ -1974,6 +1974,10 @@ sub setup_fileserver
path = $veto_sharedir
delete veto files = yes
[veto_files_nohidden]
path = $veto_sharedir
veto files = /.*/
[veto_files]
path = $veto_sharedir
veto files = /veto_name*/

View File

@ -22,10 +22,14 @@ SHAREPATH=${5}
SMBCLIENT=${6}
shift 6
SMBCLIENT="$VALGRIND ${SMBCLIENT}"
# Used by test_smbclient()
# shellcheck disable=2034
smbclient="$VALGRIND ${SMBCLIENT}"
ADDARGS="$@"
incdir=$(dirname "$0")/../../../testprogs/blackbox
. "$incdir"/subunit.sh
. "${incdir}/common_test_fns.inc"
failed=0
@ -45,6 +49,8 @@ do_cleanup()
rm -rf "$SHAREPATH/veto_name_dir\"mangle"
rm -f "$SHAREPATH/veto_name_file"
rm -f "$SHAREPATH/veto_name_file\"mangle"
rm -f "${SHAREPATH}/regular_file"
rm -f "${SHAREPATH}/.hidden_file"
)
}
@ -185,6 +191,25 @@ test_create_veto_file()
do_cleanup
echo "regular_file" > "${SHAREPATH}/regular_file"
echo "hidden_file" > "${SHAREPATH}/.hidden_file"
test_smbclient "download regular file" \
"get regular_file" "//${SERVER}/veto_files_nohidden" \
-U"${USERNAME}%${PASSWORD}" ||
failed=$((failed + 1))
rm -f regular_file
test_smbclient_expect_failure "hidden file can't be downloaded" \
"get .hidden_file" "//${SERVER}/veto_files_nohidden" \
-U"${USERNAME}%${PASSWORD}" ||
failed=$((failed + 1))
test_smbclient "list files" \
"ls" "//${SERVER}/veto_files_nohidden" \
-U"${USERNAME}%${PASSWORD}" ||
failed=$((failed + 1))
do_cleanup
# Using hash2, veto_name_file\"mangle == VHXE5P~M
# Using hash2, veto_name_dir\"mangle == VF5SKC~B