2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
7 # RichACL auto-inheritance test
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
38 _scratch_mkfs_richacl >> $seqres.full
46 $SETRICHACL_PROG --modify owner@:rwpxd:fd:allow,u:101:rw:fd:deny d1
47 $SETRICHACL_PROG --modify u:102:rw:f:deny d1
48 $SETRICHACL_PROG --modify u:103:rw:d:deny d1
49 $SETRICHACL_PROG --modify g:101:rw:fdi:deny d1
51 $SETRICHACL_PROG --modify flags:a d1
53 $GETRICHACL_PROG --numeric --raw d1
58 # Mode bits derived from inherited ACEs
59 $GETRICHACL_PROG --numeric --raw d1/d2
61 $GETRICHACL_PROG --numeric --raw d1/d3
70 $GETRICHACL_PROG --numeric --raw d1/d2/d4
72 $GETRICHACL_PROG --numeric --raw d1/d2/d4/d5
74 # Clear protected flag from all the ACLs
75 $SETRICHACL_PROG --modify flags:a d1/d2
76 $SETRICHACL_PROG --modify flags:a d1/d3
77 $SETRICHACL_PROG --modify flags:a d1/d2/d4
78 $SETRICHACL_PROG --modify flags:a d1/d2/d4/d5
80 $GETRICHACL_PROG --numeric d1 | sed -e 's/:fd:deny/:fd:allow/' > acl.txt
83 $SETRICHACL_PROG --set-file acl.txt d1
85 $GETRICHACL_PROG --numeric --raw d1
87 $GETRICHACL_PROG --numeric --raw d1/d2
89 $GETRICHACL_PROG --numeric --raw d1/d3
91 $GETRICHACL_PROG --numeric --raw d1/d2/d4
93 $GETRICHACL_PROG --numeric --raw d1/d2/d4/d5
95 # No automatic inheritance for protected files
96 $GETRICHACL_PROG --numeric --raw d1/d6
98 $GETRICHACL_PROG --numeric --raw d1/d7