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
36 _require_scratch_richacl
39 _scratch_mkfs_richacl >> $seqres.full
47 $SETRICHACL_PROG --modify owner@:rwpxd:fd:allow,u:101:rw:fd:deny d1
48 $SETRICHACL_PROG --modify u:102:rw:f:deny d1
49 $SETRICHACL_PROG --modify u:103:rw:d:deny d1
50 $SETRICHACL_PROG --modify g:101:rw:fdi:deny d1
52 $SETRICHACL_PROG --modify flags:a d1
54 $GETRICHACL_PROG --numeric --raw d1
59 # Mode bits derived from inherited ACEs
60 $GETRICHACL_PROG --numeric --raw d1/d2
62 $GETRICHACL_PROG --numeric --raw d1/d3
71 $GETRICHACL_PROG --numeric --raw d1/d2/d4
73 $GETRICHACL_PROG --numeric --raw d1/d2/d4/d5
75 # Clear protected flag from all the ACLs
76 $SETRICHACL_PROG --modify flags:a d1/d2
77 $SETRICHACL_PROG --modify flags:a d1/d3
78 $SETRICHACL_PROG --modify flags:a d1/d2/d4
79 $SETRICHACL_PROG --modify flags:a d1/d2/d4/d5
81 $GETRICHACL_PROG --numeric d1 | sed -e 's/:fd:deny/:fd:allow/' > acl.txt
84 $SETRICHACL_PROG --set-file acl.txt d1
86 $GETRICHACL_PROG --numeric --raw d1
88 $GETRICHACL_PROG --numeric --raw d1/d2
90 $GETRICHACL_PROG --numeric --raw d1/d3
92 $GETRICHACL_PROG --numeric --raw d1/d2/d4
94 $GETRICHACL_PROG --numeric --raw d1/d2/d4/d5
96 # No automatic inheritance for protected files
97 $GETRICHACL_PROG --numeric --raw d1/d6
99 $GETRICHACL_PROG --numeric --raw d1/d7