Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 153243 - newgrp gives misleading output
Summary: newgrp gives misleading output
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: util-linux
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
Depends On:
Blocks: 168429
TreeView+ depends on / blocked
Reported: 2005-04-03 22:27 UTC by Stephen Gardner
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: RHBA-2006-0061
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-03-07 18:03:51 UTC
Target Upstream Version:

Attachments (Terms of Use)

System 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 05:00:00 UTC

Description Stephen Gardner 2005-04-03 22:27:09 UTC
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 23:00:09 UTC
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 09:28:00 UTC
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 18:03:52 UTC
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.