diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c index af6f989fb48c..6f8c0b454ff0 100644 --- a/lib/libpam/modules/pam_unix/pam_unix.c +++ b/lib/libpam/modules/pam_unix/pam_unix.c @@ -152,6 +152,8 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) retval = strcmp(encrypted, pwd->pw_passwd) == 0 ? PAM_SUCCESS : PAM_AUTH_ERR; + if (pwd->pw_expire && time(NULL) >= pwd->pw_expire) + retval = PAM_AUTH_ERR; } else {