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
36 _require_scratch_richacl
40 _scratch_mkfs_richacl >> $seqres.full
47 echo "--- runas -u 99 -g 99 $*"
48 _runas -u 99 -g 99 -- "$@"
54 mkdir d1 d2 d3 d4 d5 d6 d7
55 touch d1/f d1/g d2/f d3/f d4/f d5/f d6/f d7/f d7/g d7/h
60 $SETRICHACL_PROG --set 'u:99:wx::allow' d4
61 $SETRICHACL_PROG --set 'u:99:d::allow' d5
62 $SETRICHACL_PROG --set 'u:99:xd::allow' d6
63 $SETRICHACL_PROG --set 'u:99:D::allow' d7/f d7/g d7/h
66 mkdir s2 s3 s4 s5 s6 s7
67 chmod +t s2 s3 s4 s5 s6 s7
68 touch s2/f s3/f s4/f s5/f s6/f s7/f s7/g s7/h
72 $SETRICHACL_PROG --set 'u:99:wx::allow' s4
73 $SETRICHACL_PROG --set 'u:99:d::allow' s5
74 $SETRICHACL_PROG --set 'u:99:xd::allow' s6
75 $SETRICHACL_PROG --set 'u:99:D::allow' s7/f s7/g s7/h
78 # Cannot delete files with no or only with write permissions on the directory
81 # Can delete files in directories we own
84 # Can delete files in non-sticky directories we have write access to
87 # "Write_data/execute" access does not include delete_child access, so deleting
91 # "Delete_child" access alone also is not sufficient
94 # "Execute/delete_child" access is sufficient for non-sticky directories
97 # "Delete" access on the child is sufficient, even in sticky directories.
100 # Regression: Delete access must not override add_file / add_subdirectory
106 # A chmod turns off the "delete" permission