Bug 667593 - /usr/bin/sg has ceased to function for groups with a password; "Invalid password"
Summary: /usr/bin/sg has ceased to function for groups with a password; "Invalid passw...
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: shadow-utils
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-06 07:50 UTC by Tomas Mraz
Modified: 2011-12-06 16:27 UTC (History)
5 users (show)

(edit)
Clone Of: 665780
(edit)
Last Closed: 2011-12-06 16:27:41 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1650 normal SHIPPED_LIVE shadow-utils bug fix and enhancement update 2011-12-06 00:50:28 UTC

Description Tomas Mraz 2011-01-06 07:50:13 UTC
+++ This bug was initially created as a clone of Bug #665780 +++

Description of problem:

'switch-group' (sg) to a group with a password used to work in Fedora 10.  This use case no longer works in Fedora 13 & Fedora 14  I'm filing this against shadow-utils since that is where /usr/bin/sg lives but the issue may be in selinux-policy or even crypt(...) which is in glibc.

Best guess here is that it seems to be an selinux issue tied to the inability of /usr/bin/newgrp (/usr/bin/sg_ too read the gshadow file).

As exhibited, the problem occurs within-system, not across releases.  That is: while on the same system (same fedora release), it is not possible to establish a password for a group and then sg into that group by giving the password


Version-Release number of selected component (if applicable):

cogently:
works shadow-utils-4.1.2-9.fc10.i386, selinux-policy-targeted-3.5.13-74.fc10.noarch
fails shadow-utils-4.1.4.2-8.fc14.i686, selinux-policy-targeted-3.5.13-74.fc10.noarch

Perhaps the relevant selinux policy is usermanage.te?
Should there be mention of newgrp, sg, gpasswd therein?
./serefpolicy-3.9.7/policy/modules/admin/usermanage.te 


How reproducible:

100% deterministic

Steps to Reproduce:

Any group name will do.  We'll assign the password 'abcd' and try to sg into that group

--- Additional comment from tmraz@redhat.com on 2011-01-04 11:46:40 EST ---

Actually it is not related to SELinux at all.

It is caused by completely broken getsgent code in shadow-utils lib. Also it incorrectly uses this code although glibc contains fine implementation of all the required gshadow utilities because shadow-utils code incorrectly expects them in shadow.h when they are in gshadow.h. So as a fix although the broken getsgent in the shadow utils should be eventually fixed, I propose to fix the build process of shadow-utils to use functions from glibc.

--- Additional comment from tmraz@redhat.com on 2011-01-04 12:14:43 EST ---

Created attachment 471715 [details]
Patch making shadow utils to use gshadow functions from glibc

--- Additional comment from pvrabec@redhat.com on 2011-01-05 10:19:50 EST ---

Created attachment 471882 [details]
another fix

this patch is fixing gshadow functions from shadow-utils

--- Additional comment from pvrabec@redhat.com on 2011-01-05 10:44:43 EST ---

(In reply to comment #4)
> Created attachment 471882 [details]
> another fix
> 
> this patch is fixing gshadow functions from shadow-utils

There is a bug in the patch.

--- Additional comment from pvrabec@redhat.com on 2011-01-05 10:46:11 EST ---

Created attachment 471891 [details]
merge of both patches

Comment 2 RHEL Product and Program Management 2011-01-07 15:44:02 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 5 Suzanne Yeghiayan 2011-02-15 21:46:37 UTC
This issue was proposed for RHEL 6.1 FasTrack but did not get resolved in time.
It has been moved to RHEL 6.2 FasTrack.

Comment 12 errata-xmlrpc 2011-12-06 16:27:41 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


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