Hide Forgot
Description of problem: When the usermod is requested to change the password of a user that is not listed in /etc/shadow it returns exit code 0 although it fails. Version-Release number of selected component (if applicable): shadow-utils-4.1.4.2-13.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Create a local user: # useradd -M -u 99999 -g 99 -c 'Test Local User' testluser [root@jumphost ~]# id testluser uid=99999(testluser) gid=99(nobody) groups=99(nobody) 2. Set a password (optional): # echo "pass" | passwd --stdin testluser Changing password for user testluser. passwd: all authentication tokens updated successfully. 3. Verify: # grep testluser /etc/shadow testluser:$6$z4ZsFGEN$Tlp8Nrhe53RIp8XdgiNBSb0g1o./4kXh7vWgCH2Bn1Pc/7sNJ8/hE9KbNUBbUz3L/rmGNry8Ma4JewvwzSX1F.:15978:0:99999:7::: # grep testluser /etc/passwd testluser:x:99999:99:Test Local User:/home/testluser:/bin/bash 4. Remove user's entry from /etc/shadow: # sed -i -e '/^testluser:/d' /etc/shadow # grep testluser /etc/shadow 5. Attempt to set user password with usermod: # usermod -p 'XinvalidX' testluser # echo $? 0 6. Check the shadow file: # grep testluser /etc/shadow Actual results: No entries returned in /etc/shadow and no error code in usermod Expected results: Either an error message in usermod or a new entry in /etc/shadow Additional info:
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.
The backported fix causes usermod to create new shadow entry if it is missing if the contents of the passwd entry indicates that the user has shadow password. Otherwise the passwd entry is modified with the new password.
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