Bug 672510

Summary: newgrp command : Invalid password.
Product: Red Hat Enterprise Linux 6 Reporter: xingxing <itxx00>
Component: shadow-utilsAssignee: Peter Vrabec <pvrabec>
Status: CLOSED ERRATA QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: anthony, mvadkert
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 16:27:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description xingxing 2011-01-25 11:58:54 UTC
Description of problem:

[root@s14 etc]# groupadd haha
[root@s14 etc]# gpasswd haha
Changing the password for group haha
New Password: 
Re-enter new password: 
[root@s14 etc]# su - test
[test@s14 ~]$ newgrp haha
密码:
Invalid password.
[test@s14 ~]$ 

Version-Release number of selected component (if applicable):
[test@s14 ~]$ rpm -qf `which newgrp`
shadow-utils-4.1.4.2-8.el6.x86_64


How reproducible:


Steps to Reproduce:
1.groupadd haha
2.gpasswd haha
3.su - test
4.newgrp haha
  
Actual results:

invalid passwd
Expected results:
ok

Additional info:

Comment 2 RHEL Program Management 2011-01-25 12:28:26 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 3 Anthony Thyssen 2011-04-13 04:43:16 UTC
Debian also have bug reports for this.
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=569899
they report they uploaded a fix upstream!

Also see notes in the fedora Forum
  http://www.fedoraforum.org/forum/showthread.php?p=1460887#post1460887


Essentually newgrp command is not handling things correctly.  Either it is failing to actually open /etc/gshadow  for reading  (though it is supposed to be SUID to root) and then default to doing a password check in /etc/group.  OR its string buffers to hold the encrypted password is not large enough to handle the modern sha512 password.   Old DES or MD5 password work from /etc/group


Basically the command needs a overhaul.

Comment 7 errata-xmlrpc 2011-12-06 16:27:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1650.html