2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
10 _begin_fstest auto quick richacl
12 # Import common functions.
14 # real QA test starts here
19 _require_scratch_richacl
23 _scratch_mkfs_richacl >> $seqres.full
30 echo "--- runas -u 99 -g 99 $*"
31 _runas -u 99 -g 99 -- "$@"
37 mkdir d1 d2 d3 d4 d5 d6 d7
38 touch d1/f d1/g d2/f d3/f d4/f d5/f d6/f d7/f d7/g d7/h
43 $SETRICHACL_PROG --set 'u:99:wx::allow' d4
44 $SETRICHACL_PROG --set 'u:99:d::allow' d5
45 $SETRICHACL_PROG --set 'u:99:xd::allow' d6
46 $SETRICHACL_PROG --set 'u:99:D::allow' d7/f d7/g d7/h
49 mkdir s2 s3 s4 s5 s6 s7
50 chmod +t s2 s3 s4 s5 s6 s7
51 touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g s7/h
55 $SETRICHACL_PROG --set 'u:99:wx::allow' s4
56 $SETRICHACL_PROG --set 'u:99:d::allow' s5
57 $SETRICHACL_PROG --set 'u:99:xd::allow' s6
58 $SETRICHACL_PROG --set 'u:99:D::allow' s7/f s7/g s7/h
61 # Cannot delete files with no or only with write permissions on the directory
64 # Can delete files in directories we own
67 # Can delete files in non-sticky directories we have write access to
70 # "Write_data/execute" access does not include delete_child access, so deleting
74 # "Delete_child" access alone also is not sufficient
77 # "Execute/delete_child" access is sufficient for non-sticky directories
80 # "Delete" access on the child is sufficient, even in sticky directories.
83 # Regression: Delete access must not override add_file / add_subdirectory
89 # A chmod turns off the "delete" permission