Skip to content
Permalink
Browse files Browse the repository at this point in the history
heck for account and password expiration
  • Loading branch information
alandekok committed Feb 7, 2012
1 parent f7235e7 commit 1b1ec5c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/modules/rlm_unix/rlm_unix.c
Expand Up @@ -272,9 +272,17 @@ static int unix_getpw(UNUSED void *instance, REQUEST *request,
/*
* Check if password has expired.
*/
if (spwd && spwd->sp_lstchg > 0 && spwd->sp_max >= 0 &&
(request->timestamp / 86400) > (spwd->sp_lstchg + spwd->sp_max)) {
radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name);
return RLM_MODULE_REJECT;
}
/*
* Check if account has expired.
*/
if (spwd && spwd->sp_expire > 0 &&
(request->timestamp / 86400) > spwd->sp_expire) {
radlog_request(L_AUTH, 0, request, "[%s]: password has expired", name);
radlog_request(L_AUTH, 0, request, "[%s]: account has expired", name);
return RLM_MODULE_REJECT;
}
#endif
Expand Down

0 comments on commit 1b1ec5c

Please sign in to comment.