bug-coreutils
[Top][All Lists]
Advanced

[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 08:44:31 +0200

Iain Calder <address@hidden> wrote:
> OS:      GNU/Linux Debian 3.1 (sarge)
> Command: /usr/bin/groups
> Problem: Doesn't return failure when unable to display output.
> Notes:   groups(1) is a small shell script; 42 lines excluding
>          the copyright comments.
>
> The author went to great lengths to return failure when the
> program is unable to display output, but didn't do so on the main
> code path.  Thus the program's behaviour is inconsistent.  Witness:
>
>    $ groups --version; echo $?
>    groups (GNU coreutils) 5.2.1
>    0
>    $ groups --version >&-; echo $?
>    1                   <--- echo failure reflected in exit status
>
>    $ groups ic; echo $?
>    ic : ic dialout cdrom floppy audio src video plugdev
>    0
>    $ groups ic >&-; echo $?
>    0                   <--- echo failed, yet status is successful!
>
> The code was obfuscated.  I fixed the bug, made the script
> shorter as well as cleaner, then added a couple of comments.
> Is this code being maintained?  To whom should I send my diffs?

Thank you for the report.
This list is the place to send diffs.
But please send diffs against the latest (in the CVS repository
  http://savannah.gnu.org/cvs/?group=coreutils)
or at least against the latest test release: coreutils-6.2:
  ftp://alpha.gnu.org/gnu/coreutils/coreutils-6.2.tar.bz2

FYI, I cannot reproduce those problems with the groups
script from coreutils-6.2:

    $ groups --version >&-; echo $?
    /p/bin/groups: line 49: echo: write error: Bad file descriptor
    1

    $ groups ic >&-; echo $?
    id: ic: No such user
    1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]