RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 787742 - pwconv/grpconv skips 2nd of consecutive failures
Summary: pwconv/grpconv skips 2nd of consecutive failures
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: shadow-utils
Version: 6.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On: 787736 832995
Blocks: 727267 782183 844280 947775 947782
TreeView+ depends on / blocked
 
Reported: 2012-02-06 16:08 UTC by Martin Poole
Modified: 2018-12-01 18:44 UTC (History)
6 users (show)

Fixed In Version: shadow-utils-4.1.4.2-14.el6
Doc Type: Bug Fix
Doc Text:
Cause: pwconv/grpconv improperly parsed shadow/gshadow files with errors. Consequence: When writing corrected shadow/gshadow files only first error on two consecutive erroneous lines was corrected. Fix: pwconv/grpconv now parses the files with errors correctly. Result: All lines are corrected in the newly written files.
Clone Of: 787736
: 844280 (view as bug list)
Environment:
Last Closed: 2014-10-14 07:16:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to avoid skiping entries (3.42 KB, patch)
2012-02-06 16:08 UTC, Martin Poole
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1522 0 normal SHIPPED_LIVE shadow-utils bug fix update 2014-10-14 01:22:10 UTC

Description Martin Poole 2012-02-06 16:08:04 UTC
Created attachment 559672 [details]
patch to avoid skiping entries

+++ This bug was initially created as a clone of Bug #787736 +++

Created attachment 559668 [details]
patch to avoid skiping entries

Description of problem:

If /etc/shadow (or /etc/gshadow) contains consecutive bad lines pwconv only fixes the first, skipping the 2nd.


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

shadow-utils-4.1.4.2-13.el6

How reproducible:

Always.

Steps to Reproduce:

echo 'example1:!!:15372:0:99999:7:::' >> /etc/shadow
echo 'example2:!!:15372:0:99999:7:::' >> /etc/shadow

pwck -r

pwconv

pwck -r

  
Actual results:

# echo 'example1:!!:15372:0:99999:7:::' >> /etc/shadow
# echo 'example2:!!:15372:0:99999:7:::' >> /etc/shadow

# pwck -r
no matching password file entry in /etc/passwd
delete line 'example1:!!:15372:0:99999:7:::'? No
no matching password file entry in /etc/passwd
delete line 'example2:!!:15372:0:99999:7:::'? No
pwck: no changes

# pwconv

# pwck -r
no matching password file entry in /etc/passwd
delete line 'example2:!!:15372:0:99999:7:::'? No
pwck: no changes

Expected results:

# echo 'example1:!!:15372:0:99999:7:::' >> /etc/shadow
# echo 'example2:!!:15372:0:99999:7:::' >> /etc/shadow

# pwck -r
no matching password file entry in /etc/passwd
delete line 'example1:!!:15372:0:99999:7:::'? No
no matching password file entry in /etc/passwd
delete line 'example2:!!:15372:0:99999:7:::'? No
pwck: no changes

# pwconv

# pwck -r
pwck: no changes


Additional info:

Problem is due to structure of layer fetch routines.  pwconv does a loop via spw_next()  and when it finds an error deletes the entry by name.

Unfortunately the delete routine checks whether a deleted item corresponds to the current fetch item and if so does an internal next, then the main loop runs and this subsequent entry is skipped.

Comment 1 RHEL Program Management 2012-07-10 06:22:42 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 2 RHEL Program Management 2012-07-11 01:58:04 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 4 Tom Lavigne 2012-09-18 15:26:24 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 unable to address this
request at this time.
    
Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 7 RHEL Program Management 2013-10-14 00:48:23 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 unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 11 errata-xmlrpc 2014-10-14 07:16:29 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-2014-1522.html


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