pwconv hangs in an infinite loop if there are more than one user with the same name in the unconverted passwd file
When you say "same name", do you mean same Full Name (ie Preston Brown for instance) or username (pbrown)? If it is username, this is undefined behaviour anyway -- you should never be able to have the same username in the passwd file. If the first situation is the case (full name) please reopen the bug with additional information.
The man page of pwconv says: ~~ BUGS Errors in the password or group files (such as invalid or duplicate entries) may cause these programs to loop forever or fail in other strange ways. Please run pwck and grpck to correct any such errors before converting to or from shadow passwords or groups. ~~ I know it is not normal for passwd file to have two users with same user name (can happen when some one manually edit the file), but my argument is that the tool should not hang is a loop forever in such a situation. Rather than pwconv hanging in a loop forever, it would be better to throw some error saying "passwd file has some invalid entries, please run pwck to clean up your data". Would it be possible to fix pwconv? Thanks Subin
This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux release for currently deployed products. This request is not yet committed for inclusion in a release.
this issue was fixed in one of the previous shadow-utils releases. wrabco:/home/pvrabec/rhel-git/shadow-utils/rhel-5.9/shadow-4.0.17/src # grep -E "nfsnobody|pulse" /etc/passwd pulse:x:998:996:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin pulse:x:998:996:PulseAudio System Daemon:/var/run/pulse:/sbin/nologin nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin wrabco:/home/pvrabec/rhel-git/shadow-utils/rhel-5.9/shadow-4.0.17/src # stat /etc/shadow stat: cannot stat `/etc/shadow': No such file or directory wrabco:/home/pvrabec/rhel-git/shadow-utils/rhel-5.9/shadow-4.0.17/src # ./pwconv configuration error - unknown item 'SYS_UID_MIN' (notify administrator) configuration error - unknown item 'SYS_UID_MAX' (notify administrator) configuration error - unknown item 'SYS_GID_MIN' (notify administrator) configuration error - unknown item 'SYS_GID_MAX' (notify administrator) # grep -E "nfsnobody|pulse" /etc/shadow pulse:x:15432:0:99999:7::: nfsnobody:x:15432:0:99999:7:::