summaryrefslogtreecommitdiff
path: root/tests/xfs/512
blob: 4595770e5a1c8eca47e1bf56977dc66873f9d42e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 Christoph Hellwig
#
# FS QA Test 512
#
# Ensure that removing the access ACL through the XFS-specific attr name removes
# the cached ACL as well
#
. ./common/preamble
_begin_fstest auto quick acl attr

# Override the default cleanup function.
_cleanup()
{
	cd /
	rm -f $FILE
}

# Import common functions.
. ./common/filter
. ./common/attr

# real QA test starts here
_supported_fs xfs

_require_test
_require_runas
_require_acls
_require_attrs
_require_user

FILE=$TEST_DIR/foo

echo "This is a test" > ${FILE}
chmod g-r $FILE
chmod o-r $FILE
chmod u-r $FILE

echo "No ACL: "
_user_do "cat $FILE"

echo "With ACL: "
setfacl -m u:$qa_user:r $FILE
_user_do "cat $FILE"

echo "ACL Removed through attr:"
$SETFATTR_PROG -x trusted.SGI_ACL_FILE ${FILE}
_user_do "cat $FILE"

status=0
exit