Andreas Schwab <[EMAIL PROTECTED]> wrote:
> You should of course try with an existing user.
>
> $ groups root >&-; echo $?
> /usr/bin/groups: line 64: echo: write error: Bad file descriptor
> 0

Ah.  Um, of course :)

Thanks.
Here's a patch:

2006-09-26  Jim Meyering  <[EMAIL PROTECTED]>

        * src/groups.sh: Don't hide a write failure.
        Reported by Iain Calder <[EMAIL PROTECTED]>.

Index: src/groups.sh
===================================================================
RCS file: /fetish/cu/src/groups.sh,v
retrieving revision 1.19
diff -u -r1.19 groups.sh
--- src/groups.sh       14 May 2005 07:58:37 -0000      1.19
+++ src/groups.sh       26 Sep 2006 09:24:05 -0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 # groups -- print the groups a user is in
-# Copyright (C) 1991, 1997, 2000, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1997, 2000, 2002, 2004, 2006 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
@@ -61,7 +61,7 @@
     groups=`id -Gn -- $name`
     status=$?
     if test $status = 0; then
-      echo $name : $groups
+      echo $name : $groups || fail=1
     else
       fail=$status
     fi


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to