Bug 153243

Summary: newgrp gives misleading output
Product: Red Hat Enterprise Linux 4 Reporter: Stephen Gardner <stephen-rhel>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0061 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-03-07 18:03:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 168429    

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)]
util-linux-2.12a-16.EL4.6

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.

http://rhn.redhat.com/errata/RHBA-2006-0061.html