Work around Darwin9's set-GID-like group ownership inheritance.
authorJim Meyering <meyering@redhat.com>
Sat, 26 Jan 2008 17:28:43 +0000 (18:28 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 26 Jan 2008 22:05:01 +0000 (23:05 +0100)
This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
* tests/cp/preserve-gid: Accept a group ID of 0, as well.
Reported by Elias Pipping.

ChangeLog
tests/cp/preserve-gid

index 50a53e6..f89f684 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-01-26  Jim Meyering  <meyering@redhat.com>
 
+       Work around Darwin9's set-GID-like group ownership inheritance.
+       This avoids another spurious Mac OS 10.5.1 (Darwin 9.1) test failure.
+       * tests/cp/preserve-gid: Accept a group ID of 0, as well.
+       Reported by Elias Pipping.
+
        Emit "info coreutils 'PROG invocation'" into the man page,
        rather than just "info PROG".  The latter would often fail
        or simply display the man page.
index 9537dc0..516733f 100755 (executable)
@@ -33,8 +33,14 @@ t0() {
   "$@" "$f" b || exit 1
   s=`stat -c '%u %g' b`
   if test "x$s" != "x$u $g"; then
-    echo "$0: $* $f b: $u $g != $s" 1>&2
-    (exit 1); exit 1
+    # Allow the actual group to match that of the parent directory
+    # (it was set to 0 above).
+    if test "x$s" = "x$u 0"; then
+      :
+    else
+      echo "$0: $* $f b: $u $g != $s" 1>&2
+      (exit 1); exit 1
+    fi
   fi
 }