Permalink
Browse files

heck for account and password expiration

  • Loading branch information...
1 parent f7235e7 commit 1b1ec5ce75e224bd1755650c18ccdaa6dc53e605 @alandekok committed Feb 7, 2012
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/modules/rlm_unix/rlm_unix.c
@@ -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

0 comments on commit 1b1ec5c

Please sign in to comment.