xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / generic / 105
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 105
6 #
7 # Test fix of bug:
8 #   930290 - xfs directory with no exec perm in ACL denies access
9 #            and breaks CAPP evaluation
10 #   which pulls out an earlier mod
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20
21 _cleanup()
22 {
23     cd /
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29 . ./common/attr
30
31 # Modify as appropriate.
32 _supported_fs generic
33 _supported_os Linux
34
35 # real QA test starts here
36
37 rm -f $seqres.full
38
39 _require_scratch
40 _require_acls
41
42 _acl_setup_ids
43
44 _scratch_unmount >/dev/null 2>&1
45 echo "*** MKFS ***"                         >>$seqres.full
46 echo ""                                     >>$seqres.full
47 _scratch_mkfs                               >>$seqres.full 2>&1 \
48         || _fail "mkfs failed"
49 _try_scratch_mount                      >>$seqres.full 2>&1 \
50         || _fail "mount failed"
51
52 cd $SCRATCH_MNT
53
54 # create a dir with out execute perms
55 mkdir -m 600 subdir
56
57 # make it owned by $acl1
58 chown $acl1 subdir
59
60 # put a file in the directory
61 echo data > subdir/file
62 _ls_l subdir/file | awk '{ print $1, $3 }'
63
64 # add an ACL with a user ACE which has no exec permission 
65 setfacl -m u:$acl1:r subdir
66
67 # With the bug this gives: `ls: subdir/file: Permission denied'
68 # because one needs at least an exec perm somewhere in acl
69 # However, this should not hold true for directories.
70 _ls_l subdir/file | awk '{ print $1, $3 }'
71
72 # With the bug this gives: `subdir/file2: Permission denied'.
73 echo data2 > subdir/file2
74
75 # success, all done
76 status=0
77 exit