Bug 153243 - newgrp gives misleading output
newgrp gives misleading output
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: util-linux (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
Depends On:
Blocks: 168429
  Show dependency treegraph
Reported: 2005-04-03 18:27 EDT by Stephen Gardner
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2006-0061
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-07 13:03:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0061 qe-ready SHIPPED_LIVE util-linux bug fix update 2006-03-06 00:00:00 EST

  None (edit)
Description Stephen Gardner 2005-04-03 18:27:09 EDT
Description of problem:
When the newgrp command is run with a non-existent group name it includes the
word "Success" which is misleading.

Version-Release number of selected component (if applicable):
RHEL4-AS-U0 (i386 & x86_64)  [also seen on RHEL3-AS-U4 (i386)]

How reproducible:
Always (whether newgrp is run as root or as a normal user)

Steps to Reproduce:
1. newgrp foo
Actual results:
[ output from command ]
newgrp: No such group.: Success

Expected results:
[ output from command ]
newgrp: No such group.

Additional info:
The path through the ifs in the source code (from the SRPM) looks fine and the
exit code (1) is set correctly. Although not a real fix if  perror  is replaced
with  puts  in  newgrp.c  the expected output is produced.
Comment 1 Stephen Gardner 2005-04-03 19:00:09 EDT
For clarity in the "Description of problem" I should have stated clearly that
the newgrp command returns the word "Success" in the output even though it
encounters an error.
Comment 2 Karel Zak 2005-07-29 05:28:00 EDT
It's bug in perror() usage. The getgrnam() function returns NULL _or_ en error.
I will fix it with something more important in some future update.
Comment 7 Red Hat Bugzilla 2006-03-07 13:03:52 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.