]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Use "env" to invoke potential built-ins.
authorJim Meyering <meyering@redhat.com>
Sun, 20 Apr 2008 21:18:48 +0000 (23:18 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 20 Apr 2008 21:18:48 +0000 (23:18 +0200)
* tests/misc/pwd-unreadable-parent: Invoke pwd via "env -- pwd",
rather than via an absolute name.
* tests/touch/not-owner: Likewise for test.
* tests/chmod/setgid: Likewise.

tests/chmod/setgid
tests/misc/pwd-unreadable-parent
tests/touch/not-owner

index d5d35f97677655012594aa197fe461e3731beaa3..cee9ca6bbfb3c6bfc0460eb6dff30e824a911c0c 100755 (executable)
@@ -2,7 +2,7 @@
 # Make sure GNU chmod works the same way as those of Solaris, HPUX, AIX
 # wrt directories with the setgid bit set.
 
-# Copyright (C) 2001, 2004-2007 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2004-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,12 +25,10 @@ fi
 . $srcdir/../lang-default
 . $srcdir/../test-lib.sh
 
-test=$abs_top_builddir/src/test
-
 umask 0
 mkdir d || framework_failure
 
-chmod g+s d 2> /dev/null && "$test" -g d ||
+chmod g+s d 2> /dev/null && env -- test -g d ||
   {
     # This is required because on some systems (at least NetBSD 1.4.2A),
     # it may happen that when you create a directory, its group isn't one
@@ -44,7 +42,7 @@ chmod g+s d 2> /dev/null && "$test" -g d ||
   }
 
 # "chmod g+s d" does nothing on some NFS file systems.
-"$test" -g d ||
+env -- test -g d ||
   skip_test_ 'cannot create setgid directories'
 
 fail=0
index c7cde754293f631e38508e1ebf4f80cfa36625c9..370a0d0ad5c71010573340c7653f308ffa1cce4b 100755 (executable)
@@ -3,7 +3,7 @@
 # is unreadable.  Perform this test only on systems with a usable getcwd
 # function that has this capability.
 
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 
 if test "$VERBOSE" = yes; then
   set -x
-  pwd --version
+  env -- pwd --version
   readlink --version
 fi
 
@@ -38,10 +38,8 @@ mkdir -p a/b || framework_failure
 cd a/b || framework_failure
 chmod a=x .. || framework_failure
 
-pwd_exe="$abs_top_builddir/src/pwd"
-
 fail=0
-"$pwd_exe" > exp || fail=1
+env -- pwd > exp || fail=1
 readlink -ev . > out || fail=1
 
 compare out exp || fail=1
index 0723eade273561766be5cd5a1ac2bc63cf5beef5..3f133f1e30cad8b3fbdc3ee11ce76de0c958c166 100755 (executable)
@@ -25,12 +25,11 @@ fi
 . $srcdir/../lang-default
 . $srcdir/../test-lib.sh
 
-test=$abs_top_builddir/src/test
-if $test -w /; then
+if env -- test -w /; then
   skip_test_ you have write access to /.
 fi
 
-if $test -O / || $test -G /; then
+if env -- test -O / || env -- test -G /; then
   skip_test_ "you own /."
 fi