bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Found and fixed bug in groups(1). Want the diff?


From: Iain Calder
Subject: Found and fixed bug in groups(1). Want the diff?
Date: Mon, 25 Sep 2006 11:57:20 -0400

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?

-ic
--
Iain Calder  <address@hidden>




reply via email to

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