2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
27 # remove previous $seqres.full before test
30 # real QA test starts here
35 _require_scratch_richacl
39 _scratch_mkfs_richacl >> $seqres.full
46 echo "--- runas -u 99 -g 99 $*"
47 _runas -u 99 -g 99 -- "$@"
53 mkdir d1 d2 d3 d4 d5 d6 d7
54 touch d1/f d1/g d2/f d3/f d4/f d5/f d6/f d7/f d7/g d7/h
59 $SETRICHACL_PROG --set 'u:99:wx::allow' d4
60 $SETRICHACL_PROG --set 'u:99:d::allow' d5
61 $SETRICHACL_PROG --set 'u:99:xd::allow' d6
62 $SETRICHACL_PROG --set 'u:99:D::allow' d7/f d7/g d7/h
65 mkdir s2 s3 s4 s5 s6 s7
66 chmod +t s2 s3 s4 s5 s6 s7
67 touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g s7/h
71 $SETRICHACL_PROG --set 'u:99:wx::allow' s4
72 $SETRICHACL_PROG --set 'u:99:d::allow' s5
73 $SETRICHACL_PROG --set 'u:99:xd::allow' s6
74 $SETRICHACL_PROG --set 'u:99:D::allow' s7/f s7/g s7/h
77 # Cannot delete files with no or only with write permissions on the directory
80 # Can delete files in directories we own
83 # Can delete files in non-sticky directories we have write access to
86 # "Write_data/execute" access does not include delete_child access, so deleting
90 # "Delete_child" access alone also is not sufficient
93 # "Execute/delete_child" access is sufficient for non-sticky directories
96 # "Delete" access on the child is sufficient, even in sticky directories.
99 # Regression: Delete access must not override add_file / add_subdirectory
105 # A chmod turns off the "delete" permission