xfs: fix old fuzz test invocations of xfs_repair
[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
34 # real QA test starts here
35
36 rm -f $seqres.full
37
38 _require_scratch
39 _require_acls
40
41 _acl_setup_ids
42
43 _scratch_unmount >/dev/null 2>&1
44 echo "*** MKFS ***"                         >>$seqres.full
45 echo ""                                     >>$seqres.full
46 _scratch_mkfs                               >>$seqres.full 2>&1 \
47         || _fail "mkfs failed"
48 _try_scratch_mount                      >>$seqres.full 2>&1 \
49         || _fail "mount failed"
50
51 cd $SCRATCH_MNT
52
53 # create a dir with out execute perms
54 mkdir -m 600 subdir
55
56 # make it owned by $acl1
57 chown $acl1 subdir
58
59 # put a file in the directory
60 echo data > subdir/file
61 _ls_l subdir/file | awk '{ print $1, $3 }'
62
63 # add an ACL with a user ACE which has no exec permission 
64 setfacl -m u:$acl1:r subdir
65
66 # With the bug this gives: `ls: subdir/file: Permission denied'
67 # because one needs at least an exec perm somewhere in acl
68 # However, this should not hold true for directories.
69 _ls_l subdir/file | awk '{ print $1, $3 }'
70
71 # With the bug this gives: `subdir/file2: Permission denied'.
72 echo data2 > subdir/file2
73
74 # success, all done
75 status=0
76 exit