summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/session.c b/session.c
index dacb6a099..fc56c2732 100644
--- a/session.c
+++ b/session.c
@@ -720,6 +720,17 @@ do_login(Session *s)
720 record_login(pid, s->tty, pw->pw_name, pw->pw_uid, 720 record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
721 get_remote_name_or_ip(), (struct sockaddr *)&from); 721 get_remote_name_or_ip(), (struct sockaddr *)&from);
722 722
723#ifdef USE_PAM
724 /*
725 * If password change is needed, do it now.
726 * This needs to occur before the ~/.hushlogin check.
727 */
728 if (pam_password_change_required()) {
729 print_pam_messages();
730 do_pam_chauthtok();
731 }
732#endif
733
723 /* Done if .hushlogin exists. */ 734 /* Done if .hushlogin exists. */
724 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); 735 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
725#ifdef HAVE_LOGIN_CAP 736#ifdef HAVE_LOGIN_CAP
@@ -730,9 +741,8 @@ do_login(Session *s)
730 return; 741 return;
731 742
732#ifdef USE_PAM 743#ifdef USE_PAM
733 print_pam_messages(); 744 if (!pam_password_change_required())
734 /* If password change is needed, do it now. */ 745 print_pam_messages();
735 do_pam_chauthtok();
736#endif /* USE_PAM */ 746#endif /* USE_PAM */
737#ifdef WITH_AIXAUTHENTICATE 747#ifdef WITH_AIXAUTHENTICATE
738 if (aixloginmsg && *aixloginmsg) 748 if (aixloginmsg && *aixloginmsg)