summaryrefslogtreecommitdiff
path: root/tests/touch
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-05-10 13:30:39 +0000
committerJim Meyering <jim@meyering.net>2005-05-10 13:30:39 +0000
commit2113d67f696bfca8cde8121fe5318e151156cd74 (patch)
treef033679c9e68728e2064cbf29310c6a63ae6a013 /tests/touch
parentcd6c5b74228b749681fa7eb7ae5bbfc3d5edfe2f (diff)
downloadcoreutils-2113d67f696bfca8cde8121fe5318e151156cd74.tar.xz
Skip this test if the user running it owns `/' or has write access to it.
Diffstat (limited to 'tests/touch')
-rwxr-xr-xtests/touch/not-owner16
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/touch/not-owner b/tests/touch/not-owner
index c32547e66..1002c0cd9 100755
--- a/tests/touch/not-owner
+++ b/tests/touch/not-owner
@@ -11,6 +11,17 @@ fi
. $srcdir/../lang-default
PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
+test=../../src/test
+if $test -w /; then
+ echo Skipping because you have write access to /.
+ (exit 77); exit 77
+fi
+
+if $test -O / || $test -G /; then
+ echo Skipping because you own /.
+ (exit 77); exit 77
+fi
+
pwd=`pwd`
t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
@@ -25,11 +36,6 @@ if test $framework_failure = 1; then
(exit 1); exit 1
fi
-if test -w /; then
- echo Skipping because you have write access to /.
- (exit 77); exit 77
-fi
-
fail=0
# Before fileutils-4.1, we'd get the following misleading