fbc573c40cd67e4095968b90986fb10db1f0cd2c
[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-2004 Silicon Graphics, Inc.  All Rights Reserved.
11
12 # This program is free software; you can redistribute it and/or modify it
13 # under the terms of version 2 of the GNU General Public License as
14 # published by the Free Software Foundation.
15
16 # This program is distributed in the hope that it would be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
20 # Further, this software is distributed without any warranty that it is
21 # free of the rightful claim of any third person regarding infringement
22 # or the like.  Any license provided herein, whether implied or
23 # otherwise, applies only to this software file.  Patent licenses, if
24 # any, provided herein do not apply to combinations of this program with
25 # other software, or any other product whatsoever.
26
27 # You should have received a copy of the GNU General Public License along
28 # with this program; if not, write the Free Software Foundation, Inc., 59
29 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
30
31 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
32 # Mountain View, CA  94043, or:
33
34 # http://www.sgi.com 
35
36 # For further information regarding this notice, see: 
37
38 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
39 #-----------------------------------------------------------------------
40 #
41 # creator
42 owner=fsgqa@snap.melbourne.sgi.com
43
44 seq=`basename $0`
45 echo "QA output created by $seq"
46
47 here=`pwd`
48 tmp=/tmp/$$
49 status=1        # failure is the default!
50 trap "_cleanup; exit \$status" 0 1 2 3 15
51
52 _cleanup()
53 {
54     cd /
55 }
56
57 # get standard environment, filters and checks
58 . ./common.rc
59 . ./common.filter
60 . ./common.attr
61
62 # Modify as appropriate.
63 _supported_fs xfs udf
64 _supported_os IRIX Linux
65
66 # real QA test starts here
67
68 rm -f $seq.full
69
70 _require_scratch
71
72 _acl_setup_ids
73 _acl_requirements
74
75 umount $SCRATCH_DEV >/dev/null 2>&1
76 echo "*** MKFS ***"                         >>$seq.full
77 echo ""                                     >>$seq.full
78 _scratch_mkfs                               >>$seq.full 2>&1 \
79         || _fail "mkfs failed"
80 _scratch_mount                              >>$seq.full 2>&1 \
81         || _fail "mount failed"
82
83 cd $SCRATCH_MNT
84
85 # create a dir with out execute perms
86 mkdir -m 600 subdir
87
88 # make it owned by $acl1
89 chown $acl1 subdir
90
91 # put a file in the directory
92 echo data > subdir/file
93 ls -l subdir/file | awk '{ print $1, $3, $4 }'
94
95 # add an ACL with a user ACE which has no exec permission 
96 setfacl -m u:$acl1:r subdir
97
98 # With the bug this gives: `ls: subdir/file: Permission denied'
99 # because one needs at least an exec perm somewhere in acl
100 # However, this should not hold true for directories.
101 ls -l subdir/file | awk '{ print $1, $3, $4 }'
102
103 # With the bug this gives: `subdir/file2: Permission denied'.
104 echo data2 > subdir/file2
105
106 # success, all done
107 status=0
108 exit