From: Arran Cudbard-Bell Date: Thu, 29 Aug 2019 01:33:17 +0000 (-0400) Subject: Fix Auth-Type checks in rlm_pap and rlm_chap X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e3a0ae2f32eaa4e7811b6b7c2dd24feace7cd65;p=thirdparty%2Ffreeradius-server.git Fix Auth-Type checks in rlm_pap and rlm_chap They were looking in the wrong list, and the output should not have been an error --- diff --git a/src/modules/rlm_chap/rlm_chap.c b/src/modules/rlm_chap/rlm_chap.c index a2140eacfe2..d16ffc669fc 100644 --- a/src/modules/rlm_chap/rlm_chap.c +++ b/src/modules/rlm_chap/rlm_chap.c @@ -65,17 +65,17 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t rlm_chap_t *inst = instance; VALUE_PAIR *vp; + if (fr_pair_find_by_da(request->control, attr_auth_type, TAG_ANY) != NULL) { + RDEBUG3("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name); + return RLM_MODULE_NOOP; + } + /* * This case means the warnings below won't be printed * unless there's a CHAP-Password in the request. */ if (!fr_pair_find_by_da(request->packet->vps, attr_chap_password, TAG_ANY)) return RLM_MODULE_NOOP; - if (fr_pair_find_by_da(request->packet->vps, attr_auth_type, TAG_ANY) != NULL) { - REDEBUG("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name); - return RLM_MODULE_NOOP; - } - /* * Create the CHAP-Challenge if it wasn't already in the packet. * diff --git a/src/modules/rlm_pap/rlm_pap.c b/src/modules/rlm_pap/rlm_pap.c index 1847a0742d0..3ff97e9d02f 100644 --- a/src/modules/rlm_pap/rlm_pap.c +++ b/src/modules/rlm_pap/rlm_pap.c @@ -172,8 +172,8 @@ static rlm_rcode_t CC_HINT(nonnull) mod_authorize(void *instance, UNUSED void *t rlm_pap_t const *inst = instance; VALUE_PAIR *password; - if (fr_pair_find_by_da(request->packet->vps, attr_auth_type, TAG_ANY) != NULL) { - REDEBUG("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name); + if (fr_pair_find_by_da(request->control, attr_auth_type, TAG_ANY) != NULL) { + RDEBUG3("Auth-Type is already set. Not setting 'Auth-Type := %s'", inst->name); return RLM_MODULE_NOOP; }