From: Arran Cudbard-Bell Date: Tue, 19 Feb 2013 02:21:39 +0000 (-0500) Subject: Cleanup chap X-Git-Tag: release_3_0_0_beta1~1021 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07d10dd6cdc8bc278638ea4db16cd6616f82e9a9;p=thirdparty%2Ffreeradius-server.git Cleanup chap --- diff --git a/src/modules/rlm_chap/rlm_chap.c b/src/modules/rlm_chap/rlm_chap.c index 8e5313594ae..2f674306616 100644 --- a/src/modules/rlm_chap/rlm_chap.c +++ b/src/modules/rlm_chap/rlm_chap.c @@ -27,13 +27,9 @@ RCSID("$Id$") #include #include -static rlm_rcode_t chap_authorize(void *instance, REQUEST *request) +static rlm_rcode_t chap_authorize(UNUSED void *instance, + UNUSED REQUEST *request) { - - /* quiet the compiler */ - instance = instance; - request = request; - if (!pairfind(request->packet->vps, PW_CHAP_PASSWORD, 0, TAG_ANY)) { return RLM_MODULE_NOOP; } @@ -46,6 +42,7 @@ static rlm_rcode_t chap_authorize(void *instance, REQUEST *request) RDEBUG("Setting 'Auth-Type := CHAP'"); pairadd(&request->config_items, pairmake("Auth-Type", "CHAP", T_OP_EQ)); + return RLM_MODULE_OK; } @@ -56,17 +53,14 @@ static rlm_rcode_t chap_authorize(void *instance, REQUEST *request) * from the database. The authentication code only needs to check * the password, the rest is done here. */ -static rlm_rcode_t chap_authenticate(void *instance, REQUEST *request) +static rlm_rcode_t chap_authenticate(UNUSED void *instance, + UNUSED REQUEST *request) { VALUE_PAIR *passwd_item, *chap; uint8_t pass_str[MAX_STRING_LEN]; VALUE_PAIR *module_fmsg_vp; char module_fmsg[MAX_STRING_LEN]; - /* quiet the compiler */ - instance = instance; - request = request; - if (!request->username) { radlog_request(L_AUTH, 0, request, "rlm_chap: Attribute \"User-Name\" is required for authentication.\n"); return RLM_MODULE_INVALID; @@ -96,13 +90,13 @@ static rlm_rcode_t chap_authenticate(void *instance, REQUEST *request) if ((passwd_item = pairfind(request->config_items, PW_CLEARTEXT_PASSWORD, 0, TAG_ANY)) == NULL){ if (pairfind(request->config_items, PW_USER_PASSWORD, 0, TAG_ANY) != NULL){ - RDEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - RDEBUG("!!! Please update your configuration so that the \"known !!!"); - RDEBUG("!!! good\" clear text password is in Cleartext-Password, !!!"); - RDEBUG("!!! and NOT in User-Password. !!!"); - RDEBUG("!!! !!!"); - RDEBUG("!!! Authentication will fail because of this. !!!"); - RDEBUG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + RDEBUGE("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); + RDEBUGE("!!! Please update your configuration so that the \"known !!!"); + RDEBUGE("!!! good\" clear text password is in Cleartext-Password, !!!"); + RDEBUGE("!!! and NOT in User-Password. !!!"); + RDEBUGE("!!! !!!"); + RDEBUGE("!!! Authentication will fail because of this. !!!"); + RDEBUGE("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); } RDEBUG("Cleartext-Password is required for authentication"); snprintf(module_fmsg, sizeof(module_fmsg),