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

CVE-2021-44141: s3: torture: In test_smbclient_s3, change the error codes expected for test_widelinks() and test_nosymlinks() from ACCESS_DENIED to NT_STATUS_OBJECT_NAME_NOT_FOUND.

For SMB1/2/3 (minus posix) we need to treat bad symlinks
as though they don't exist.

Add to knwownfail.d/symlink_traversal

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

Signed-off-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Jeremy Allison 2021-12-07 12:56:51 -08:00 committed by Stefan Metzmacher
parent ea20599ff1
commit c6d70dad3a
3 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,5 @@
^samba3.blackbox.test_symlink_traversal.SMB2.symlink_traversal_SMB2\(fileserver\)
^samba3.blackbox.test_symlink_traversal.SMB1.symlink_traversal_SMB1\(fileserver_smb1_done\)
^samba3.blackbox.test_symlink_traversal.SMB1.posix.symlink_traversal_SMB1_posix\(fileserver_smb1_done\)
^samba3.blackbox.smbclient_s3.*.Ensure\ widelinks\ are\ restricted\(.*\)
^samba3.blackbox.smbclient_s3.*.follow\ symlinks\ \=\ no\(.*\)

View File

@ -2537,7 +2537,7 @@ sub provision($$)
create_file_chmod("$widelinks_target", 0666) or return undef;
##
## This link should get ACCESS_DENIED
## This link should get an error
##
symlink "$widelinks_target", "$widelinks_shrdir/source";
##

View File

@ -1044,12 +1044,12 @@ EOF
return 1
fi
# This should fail with NT_STATUS_ACCESS_DENIED
echo "$out" | grep 'NT_STATUS_ACCESS_DENIED'
# This should fail with NT_STATUS_OBJECT_NAME_NOT_FOUND
echo "$out" | grep 'NT_STATUS_OBJECT_NAME_NOT_FOUND'
ret=$?
if [ $ret != 0 ] ; then
echo "$out"
echo "failed - should get NT_STATUS_ACCESS_DENIED listing \\widelinks_share\\source"
echo "failed - should get NT_STATUS_OBJECT_NAME_NOT_FOUND listing \\widelinks_share\\source"
return 1
fi
}
@ -1168,11 +1168,11 @@ EOF
return 1
fi
echo "$out" | grep 'NT_STATUS_ACCESS_DENIED'
echo "$out" | grep 'NT_STATUS_OBJECT_NAME_NOT_FOUND'
ret=$?
if [ $ret -ne 0 ] ; then
echo "$out"
echo "failed - should get NT_STATUS_ACCESS_DENIED getting \\nosymlinks\\source"
echo "failed - should get NT_STATUS_OBJECT_NAME_NOT_FOUND getting \\nosymlinks\\source"
return 1
fi