Bug 560202 - pwck and grpck loop forever
pwck and grpck loop forever
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-01-30 05:17 EST by DaveG
Modified: 2010-11-04 11:32 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-04 11:32:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Failing passwd file (2.21 KB, text/plain)
2010-01-30 05:18 EST, DaveG
no flags Details
Failing group file (1.03 KB, text/plain)
2010-01-30 05:19 EST, DaveG
no flags Details
strace of the pwck while stalling. (6.08 KB, application/octet-stream)
2010-03-10 20:47 EST, Stephen John Smoogen
no flags Details

  None (edit)
Description DaveG 2010-01-30 05:17:37 EST
Description of problem:
After installing virtualization pacakges and deciding to tidy up the password files, pwck -s and grpck -s just sat looping and generating very large files.

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

How reproducible:
Appears to be sensitive to account ordering so I'll attach copies of the password and group files that caused trouble.

Steps to Reproduce:
1. Copy example files to a fresh directory and change to it.
2. Run pwck -s <example passwd file> and grpck -s <example group file>.
3. Hit CTRL-C when you have had enough and list directory contents (ls -l).
Actual results:
Password and group file sorts loop, producing large "{passwd,group}+" files.

Expected results:
Both should simply sort the respective file by user/group ID and exit.

Additional info:
Both utilities run as expected after manually re-ordering the files (vipw, vigr).
Verified the fault exists for me with the example files attached.
For reference, after running in a subdirectory of /root:
[root testdir]# ls -lZ
-rw-r--r--. root root system_u:object_r:etc_t:s0       group
-rw-------. root root system_u:object_r:etc_t:s0       group-
-rw-r--r--. root root system_u:object_r:etc_t:s0       group+
-rw-------. root root unconfined_u:object_r:admin_home_t:s0 group.lock
-rw-r--r--. root root system_u:object_r:etc_t:s0       passwd
-rw-------. root root system_u:object_r:etc_t:s0       passwd-
-rw-r--r--. root root system_u:object_r:etc_t:s0       passwd+
-rw-------. root root unconfined_u:object_r:admin_home_t:s0 passwd.lock
[root testdir]# ls -l
-rw-r--r--. 1 root root      1057 2010-01-30 10:01 group
-rw-------. 1 root root      1057 2010-01-30 10:01 group-
-rw-r--r--. 1 root root 169189376 2010-01-30 10:02 group+
-rw-------. 1 root root         6 2010-01-30 10:02 group.lock
-rw-r--r--. 1 root root      2265 2010-01-30 09:51 passwd
-rw-------. 1 root root      2265 2010-01-30 09:51 passwd-
-rw-r--r--. 1 root root 383266816 2010-01-30 09:51 passwd+
-rw-------. 1 root root         6 2010-01-30 09:51 passwd.lock
Comment 1 DaveG 2010-01-30 05:18:43 EST
Created attachment 387718 [details]
Failing passwd file
Comment 2 DaveG 2010-01-30 05:19:20 EST
Created attachment 387719 [details]
Failing group file
Comment 3 Stephen John Smoogen 2010-03-10 20:46:30 EST

An gdb strace shows

(gdb) where
#0  __strcmp_ssse3 () at ../sysdeps/x86_64/strcmp.S:2073
#1  0x00000000004048f6 in commonio_sort_wrt (shadow=0x608da0, passwd=0x608900) at commonio.c:747
#2  0x0000000000402d68 in main (argc=<value optimized out>, argv=<value optimized out>) at pwck.c:689

pwck    3355 root  cwd    DIR  253,1     4096  98305 /root
pwck    3355 root  rtd    DIR  253,1     4096      2 /
pwck    3355 root  txt    REG  253,1    44096 272743 /usr/sbin/pwck
pwck    3355 root  mem    REG  253,1   184984 133574 /lib64/ld-2.11.1.so
pwck    3355 root  mem    REG  253,1  2410232 133580 /lib64/libc-2.11.1.so
pwck    3355 root  mem    REG  253,1    30736 133871 /lib64/libdl-2.11.1.so
pwck    3355 root  mem    REG  253,1   120480 171012 /lib64/libselinux.so.1
pwck    3355 root  mem    REG  253,1 98765792 185716 /usr/lib/locale/locale-archive
pwck    3355 root    0u   CHR  136,0      0t0      3 /dev/pts/0
pwck    3355 root    1u   CHR  136,0      0t0      3 /dev/pts/0
pwck    3355 root    2u   CHR  136,0      0t0      3 /dev/pts/0
pwck    3355 root    3wW  REG  253,1        0   7599 /etc/.pwd.lock
pwck    3355 root    4u   REG  253,1     2845  33923 /etc/passwd
pwck    3355 root    5u   REG  253,1     1621  85196 /etc/shadow

Am attaching an strace with passwords X'd out.
Comment 4 Stephen John Smoogen 2010-03-10 20:47:21 EST
Created attachment 399221 [details]
strace of the pwck while stalling.
Comment 5 JM 2010-04-07 15:03:35 EDT
pwck and grpck are still broken... I checked the repo "updates-testing" but there is no new version of shadow-utils... is there a change that the bug will be fixed in Fedora 12?
Comment 6 Bug Zapper 2010-11-03 19:32:31 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 7 Stephen John Smoogen 2010-11-04 11:32:15 EDT
Does not happen in F13. Will consider it closed next release.

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