[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Test failures in coreutils-5.3.0 on cygwin
From: |
Paul Eggert |
Subject: |
Re: Test failures in coreutils-5.3.0 on cygwin |
Date: |
Mon, 17 Jan 2005 14:42:56 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Eric Blake <address@hidden> writes:
> http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00063.html
Conceivably this problem could occur on Unix too. I installed this
patch to work around it (on Unix, anyway) by using group numbers
rather than names.
2005-01-17 Paul Eggert <address@hidden>
* tests/group-names: Use numeric group ids, not symbolic group names,
since the latter can have shell metacharacters in them (e.g., spaces).
Problem reported by Eric Blake.
* tests/chgrp/basic: Assume groups are numeric, not symbolic.
* tests/chgrp/deref: Likewise.
* tests/chgrp/posix-H: Likewise.
* tests/chgrp/recurse: Likewise.
Index: tests/group-names
===================================================================
RCS file: /fetish/cu/tests/group-names,v
retrieving revision 1.3
diff -p -u -r1.3 group-names
--- tests/group-names 23 Jun 2004 15:07:00 -0000 1.3
+++ tests/group-names 17 Jan 2005 22:37:32 -0000
@@ -2,7 +2,7 @@
# Set `groups' to a space-separated list of at least two groups of which
# the user is a member.
-groups=${FETISH_GROUPS-`(id -nG || /usr/xpg4/bin/id -nG) 2>/dev/null`}
+groups=${FETISH_GROUPS-`(id -G || /usr/xpg4/bin/id -G) 2>/dev/null`}
case "$groups" in
*' '*) ;;
*) cat <<EOF 1>&2
Index: tests/chgrp/basic
===================================================================
RCS file: /fetish/cu/tests/chgrp/basic,v
retrieving revision 1.19
diff -p -u -r1.19 basic
--- tests/chgrp/basic 19 Aug 2004 20:03:48 -0000 1.19
+++ tests/chgrp/basic 17 Jan 2005 22:37:32 -0000
@@ -84,7 +84,11 @@ test "$VERBOSE" = yes && set +x
chgrp '' f
ls -c -t f g
-) 2>&1 | sed "s/\([ :]\)$g1$/\1G1/;s/\([ :]\)$g2$/\1G2/" > actual
+) 2>&1 | sed "
+ s/' to .*[^0-9:].*/' to SOMENAME/
+ s/\([ :]\)$g1$/\1G1/
+ s/\([ :]\)$g2$/\1G2/
+" > actual
cat <<\EOF > expected
changed group of `f' to G1
@@ -92,7 +96,7 @@ changed group of `f' to G2
ownership of `f' retained
changed group of `f' to G1
group of `f' retained as G1
-changed group of `f' to G2
+changed group of `f' to SOMENAME
changed group of `d/f3' to G2
changed group of `d' to G2
changed group of `d/f3' to G1
Index: tests/chgrp/deref
===================================================================
RCS file: /fetish/cu/tests/chgrp/deref,v
retrieving revision 1.9
diff -p -u -r1.9 deref
--- tests/chgrp/deref 23 Jun 2004 15:07:04 -0000 1.9
+++ tests/chgrp/deref 17 Jan 2005 22:37:32 -0000
@@ -30,7 +30,7 @@ touch f
ln -s f symlink
chgrp -h $g2 symlink 2> /dev/null
-set _ `ls -l symlink`
+set _ `ls -ln symlink`
g=$5
test "$g" = $g2 || {
cat <<EOF 1>&2
@@ -43,25 +43,25 @@ EOF
fail=0
chgrp $g1 f
-set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
chgrp -h $g2 symlink || fail=1
-set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
# This should not change the group of f.
chgrp -h $g2 symlink || fail=1
-set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
chgrp $g2 f
-set _ `ls -l f`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln f`; g=$5; test "$g" = $g2 || fail=1
# This *should* change the group of f.
# Though note that the diagnostic you'd get with -c is misleading in that
# it says the `group of `symlink'' has been changed.
chgrp --dereference $g1 symlink
-set _ `ls -l f`; g=$5; test "$g" = $g1 || fail=1
-set _ `ls -l symlink`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
(exit $fail); exit $fail
Index: tests/chgrp/posix-H
===================================================================
RCS file: /fetish/cu/tests/chgrp/posix-H,v
retrieving revision 1.3
diff -p -u -r1.3 posix-H
--- tests/chgrp/posix-H 8 Jun 2004 15:25:59 -0000 1.3
+++ tests/chgrp/posix-H 17 Jan 2005 22:37:32 -0000
@@ -48,7 +48,7 @@ for i in $changed; do
# Filter out symlinks (entries that end in `s'), since it's not
# possible to change their group/owner information on some systems.
case $i in *s) continue;; esac
- set _ `ls -dg $i`; shift
+ set _ `ls -dgn $i`; shift
group=$3
test $group = $g2 || fail=1
done
@@ -64,7 +64,7 @@ for i in $not_changed; do
# Filter out symlinks (entries that end in `s'), since it's not
# possible to change their group/owner information on some systems.
case $i in *s) continue;; esac
- set _ `ls -dg $i`; shift
+ set _ `ls -dgn $i`; shift
group=$3
test $group = $g1 || fail=1
done
Index: tests/chgrp/recurse
===================================================================
RCS file: /fetish/cu/tests/chgrp/recurse,v
retrieving revision 1.4
diff -p -u -r1.4 recurse
--- tests/chgrp/recurse 23 Jun 2004 15:07:04 -0000 1.4
+++ tests/chgrp/recurse 17 Jan 2005 22:37:32 -0000
@@ -35,22 +35,22 @@ ln -s ../e d/s
chgrp -R $g1 e/ee || fail=1
# This should not should change the group of e/ee
chgrp -R $g2 d
-set _ `ls -l e/ee`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln e/ee`; g=$5; test "$g" = $g1 || fail=1
# This must change the group of e/ee, since -L makes
# chgrp traverse the symlink from d/s into e.
chgrp -L -R $g2 d
-set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
# This must *not* change the group of e/ee
chgrp -H -R $g1 d
-set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
ln -s d link
# This shouldn't change the group of e/ee either.
chgrp -H -R $g1 link || fail=1
-set _ `ls -l e/ee`; g=$5; test "$g" = $g2 || fail=1
+set _ `ls -ln e/ee`; g=$5; test "$g" = $g2 || fail=1
# But it *should* change d/dd.
-set _ `ls -l d/dd`; g=$5; test "$g" = $g1 || fail=1
+set _ `ls -ln d/dd`; g=$5; test "$g" = $g1 || fail=1
(exit $fail); exit $fail