More tests for the NULL files problem
[xfstests-dev.git] / 128
1 #! /bin/sh
2 # FSQA Test No. 128
3 #
4 # Test nosuid mount option modified from CXFSQA test mount_option_nosuid
5 #
6 #
7 #-----------------------------------------------------------------------
8 #  Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
9 #-----------------------------------------------------------------------
10 #
11 # creator
12 owner=allanr@sgi.com
13
14 seq=`basename $0`
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24     cd /
25     _cleanup_testdir
26 }
27
28 # get standard environment, filters and checks
29 . ./common.rc
30 . ./common.filter
31
32 # real QA test starts here
33 _supported_fs xfs udf nfs
34 _supported_os Linux
35
36 _setup_testdir
37 _require_scratch
38 _require_user
39
40 _scratch_mkfs >/dev/null 2>&1
41 _scratch_mount "-o nosuid"
42
43 mkdir $SCRATCH_MNT/nosuid
44 cp `which ls` $SCRATCH_MNT
45 chmod 700 $SCRATCH_MNT/nosuid
46 chmod 4755 $SCRATCH_MNT/ls
47
48 su -s/bin/sh - $qa_user -c "$SCRATCH_MNT/ls $SCRATCH_MNT/nosuid >/dev/null 2>&1"
49 if [ $? -eq 0 ] ; then
50         echo "Error: we shouldn't be able to ls the directory"
51 fi
52 umount $SCRATCH_DEV
53
54 status=0
55 exit