From: Alan T. DeKok Date: Tue, 7 Feb 2012 19:58:52 +0000 (+0100) Subject: heck for account and password expiration X-Git-Tag: release_2_2_0~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d67bb66d12e87cb9277f0db30efcffa1bea63ff7;p=thirdparty%2Ffreeradius-server.git heck for account and password expiration --- diff --git a/src/modules/rlm_unix/rlm_unix.c b/src/modules/rlm_unix/rlm_unix.c index 3ba5acdd5d7..9caab7a1fe2 100644 --- a/src/modules/rlm_unix/rlm_unix.c +++ b/src/modules/rlm_unix/rlm_unix.c @@ -274,9 +274,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