--- util-linux-2.12/login-utils/login.c +++ util-linux-2.12/login-utils/login.c @@ -627,16 +627,16 @@ main(int argc, char **argv) pam_end(pamh, retcode); exit(0); } + } - retcode = pam_acct_mgmt(pamh, 0); - - if(retcode == PAM_NEW_AUTHTOK_REQD) { - retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK); - } + retcode = pam_acct_mgmt(pamh, 0); - PAM_FAIL_CHECK; + if(retcode == PAM_NEW_AUTHTOK_REQD) { + retcode = pam_chauthtok(pamh, PAM_CHANGE_EXPIRED_AUTHTOK); } + PAM_FAIL_CHECK; + /* * Grab the user information out of the password file for future usage * First get the username that we are actually using, though.