]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Create test directory and file prior to revoking permissions
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 25 Aug 2022 01:56:47 +0000 (13:56 +1200)
committerJeremy Allison <jra@samba.org>
Thu, 25 Aug 2022 17:01:31 +0000 (17:01 +0000)
If 'chmod 0' is performed first, then we won't have the required
permissions for the subsequent 'mkdir' and 'touch', and they will fail.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/script/tests/test_symlink_traversal_smb2.sh

index 971d534421619edbb4611f61e0c092d0155c36c5..a67341d1f9a532621d7ea5ebbedf5ca01f5cf4e7 100755 (executable)
@@ -140,10 +140,10 @@ chmod 0 "$dir_outside_share_noperms"
        ln -s "file_inside_share_noperms" "symlink_file_inside_share_noperms"
        mkdir "dir_inside_share_noperms"
        touch "dir_inside_share_noperms/noperm_file_exists"
-       chmod 0 "dir_inside_share_noperms"
        ln -s "dir_inside_share_noperms" "symlink_dir_inside_share_noperms"
        mkdir "dir_inside_share_noperms/noperm_subdir_exists"
        touch "dir_inside_share_noperms/noperm_subdir_exists/noperm_subdir_file_exists"
+       chmod 0 "dir_inside_share_noperms"
 )
 
 #