Description of problem: passwd exits with status 1 when argument -S is passed. Version-Release number of selected component (if applicable): 5.X How reproducible: allways Steps to Reproduce: 1. passwd -S user 2. echo $? Actual results: 1 Expected results: 0
Please report the problem through the regular support channels so the fix can be properly prioritized for inclusion in future Red Hat Enterprise Linux update releases. Please refer to this bug number in the report. Thank you.
Created attachment 411227 [details] Proposed patch
I'll also display correct hash type for SHA-256 and SHA-512 password hash types in the passwd -S output.
The exit value is now correct and for SHA-256 (beginning with $5$) and SHA-512 ($6$) password hashes in /etc/shadow it will display correct password hash type in the status output.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: passwd -S was not able to display the correct password types for the new password hashes. It also returned nonzero exit values even when the password status was displayed successfully. With this update, the correct password type is shown in the output.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -passwd -S was not able to display the correct password types for the new password hashes. It also returned nonzero exit values even when the password status was displayed successfully. With this update, the correct password type is shown in the output.+Previously, passwd -S was not able to display the correct password types for the new password hashes. It also returned nonzero exit values even when the password status was displayed successfully. With this update, the correct password type is shown in the output.
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 therefore 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-2010-0620.html