generic/223: make sure all files get created on the data device
[xfstests-dev.git] / tests / generic / 128
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 128
6 #
7 # Test nosuid mount option modified from CXFSQA test mount_option_nosuid
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "exit \$status" 0 1 2 3 15
17
18 # get standard environment, filters and checks
19 . ./common/rc
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs generic
24
25 _require_scratch
26 _require_user
27 _require_chmod
28
29 _scratch_mkfs >/dev/null 2>&1
30 _scratch_mount "-o nosuid"
31
32 mkdir $SCRATCH_MNT/nosuid
33 cp `which ls` $SCRATCH_MNT
34 chmod 700 $SCRATCH_MNT/nosuid
35 chmod 4755 $SCRATCH_MNT/ls
36
37 su -s/bin/bash - $qa_user -c "$SCRATCH_MNT/ls $SCRATCH_MNT/nosuid >/dev/null 2>&1"
38 if [ $? -eq 0 ] ; then
39         echo "Error: we shouldn't be able to ls the directory"
40 fi
41 _scratch_unmount
42
43 status=0
44 exit