[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Found and fixed bug in groups(1). Want the diff?
From: |
Jim Meyering |
Subject: |
Re: Found and fixed bug in groups(1). Want the diff? |
Date: |
Tue, 26 Sep 2006 11:25:34 +0200 |
Andreas Schwab <address@hidden> 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 <address@hidden>
* src/groups.sh: Don't hide a write failure.
Reported by Iain Calder <address@hidden>.
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