* tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Aug 2006 21:58:48 +0000 (21:58 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 16 Aug 2006 21:58:48 +0000 (21:58 +0000)
Skip this test if "chmod g+s d" silently does nothing.

ChangeLog
tests/chmod/setgid

index 90503d8..e456c5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix some problems reported by Bruno Haible.
+       * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
+       Skip this test if "chmod g+s d" silently does nothing.
+       * tests/ls-2/tests: Skip this test suite if we can't set up files
+       properly for the setuid-etc test.  This simplifies some of the
+       hacks we were using to work around porting problems.
+
 2006-08-16  Jim Meyering  <jim@meyering.net>
 
        * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
@@ -7,10 +16,6 @@
 
 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
 
-       * tests/ls-2/tests: Skip this test suite if we can't set up files
-       properly for the setuid-etc test.  This simplifies some of the
-       hacks we were using to work around porting problems.
-
        * tests/lang-default (LC_ALL): Set to "C", so we get
        English-language diagnostics.  Unset the other variables; it
        should be portable to use 'unset' for this stuff nowadays.
index 93a2c2e..67381fe 100755 (executable)
@@ -17,18 +17,15 @@ trap '(exit $?); exit' 1 2 13 15
 
 framework_failure=0
 
-# Record absolute path of srcdir and cd back to current dir.
-cd $srcdir || framework_failure=1
-abs_srcdir=`pwd`
-cd $pwd || framework_failure=1
-
 mkdir $tmp || framework_failure=1
 cd $tmp || framework_failure=1
 
+test=../../../src/test
+
 umask 0
 mkdir d || framework_failure=1
 
-chmod g+s d 2> /dev/null ||
+chmod g+s d 2> /dev/null && $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
@@ -46,6 +43,13 @@ if test $framework_failure = 1; then
   (exit 1); exit 1
 fi
 
+# "chmod g+s d" does nothing on some NFS file systems.
+$test -g d || {
+  echo 1>&2 "$0: cannot create setgid directories," \
+    "so can't run this test"
+  exit 77
+}
+
 fail=0
 
 chmod 755 d