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