Bug 240915
Summary: | [RHEL4] userdel/usermod infinite loop with duplicate names in /etc/group or /etc/gshadow | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Chris Lalancette <clalance> | ||||||||
Component: | shadow-utils | Assignee: | Peter Vrabec <pvrabec> | ||||||||
Status: | CLOSED ERRATA | QA Contact: | David Lawrence <dkl> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | 4.0 | CC: | mmalik, sgrubb, tao | ||||||||
Target Milestone: | --- | Keywords: | Reopened | ||||||||
Target Release: | --- | ||||||||||
Hardware: | All | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | RHBA-2007-0832 | Doc Type: | Bug Fix | ||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2007-11-15 16:08:25 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Bug Depends On: | |||||||||||
Bug Blocks: | 241585, 444107, 655088 | ||||||||||
Attachments: |
|
Description
Chris Lalancette
2007-05-22 20:43:31 UTC
Created attachment 155199 [details]
Patch to deal with multiple groups gracefully
This patch take approach 2), in that it attempts to deal with the multiple
groups gracefully. While looking at what gr_update (and hence commonio_update)
does, it does a "find_by_name" to find the entry to update. This is where the
problem stems from. If, instead, we use the pointer of the current entry we
are looking for, we will always update exactly the right entry. That's what
this patch does, by adding a new "commonio_update_entry" and the associated gr_
and gshadow_ equivalents.
Note that this is also a problem in RHEL-5 and upstream; however, I wanted to
get some feedback about whether this is the correct approach before I send it
there. (Coincidentally, where is the upstream for this sort of stuff; I tried
shadow.pld.org.pl as listed in the SPEC, but it didn't seem to be active?)
Chris Lalancette
Created attachment 155540 [details]
improved patch, which covers same problem in useradd(#151484)
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Since this bugzilla is in a component that is not approved for the current release, it has been closed with resolution deferred. You may reopen this bugzilla for consideration in the next release. shadow-utils-4.0.18.1-15.fc7 has been pushed to the Fedora 7 stable repository. If problems still persist, please make note of it in this bug report. Good that it is in F7, but we need this backported to RHEL-4. Re-opening. Chris Lalancette This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. Reviewing the improved patch. In lib/commonio.c is this: + tmp->eptr = db->ops->dup(newgr); + if (tmp->eptr == NULL) + return 1; Should that return 0 since its an error? 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-2007-0832.html Created attachment 303718 [details]
update grpconv to update_entry function
all commands that call gr_next after running gr_update on a dup group are at
risk.
at least grpconv is. patch attached.
groupadd - only update a non existant group, however broken nsswitch could make
getgrnam return 0, and find_by_name would get a dup. but luckily the gr_next
occurs before gr_update
newusers -similar to groupadd
grpunconv - needs to be fixed, can fix just like my attached patch, if it's
desirable.
|