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_3_0_0_beta0~330 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b1ec5ce75e224bd1755650c18ccdaa6dc53e605;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 5c0fe0fc327..abec68c9d9d 100644 --- a/src/modules/rlm_unix/rlm_unix.c +++ b/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