2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Test nosuid mount option modified from CXFSQA test mount_option_nosuid
10 _begin_fstest perms auto quick
12 # Import common functions.
15 # real QA test starts here
22 _scratch_mkfs >/dev/null 2>&1
23 _scratch_mount "-o nosuid"
25 mkdir $SCRATCH_MNT/nosuid
26 cp "$(type -P ls)" $SCRATCH_MNT
27 chmod 700 $SCRATCH_MNT/nosuid
28 chmod 4755 $SCRATCH_MNT/ls
30 su -s/bin/bash - $qa_user -c "$SCRATCH_MNT/ls $SCRATCH_MNT/nosuid >/dev/null 2>&1"
31 if [ $? -eq 0 ] ; then
32 echo "Error: we shouldn't be able to ls the directory"