From: Alan T. DeKok Date: Fri, 23 Dec 2011 14:26:23 +0000 (-0500) Subject: Use new dict_valnamebyattr function X-Git-Tag: release_3_0_0_beta0~439 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cec3b0dca538db0114d169e29575631c6d29447e;p=thirdparty%2Ffreeradius-server.git Use new dict_valnamebyattr function --- diff --git a/src/main/auth.c b/src/main/auth.c index 6a392be2ad4..2af6ce0616e 100644 --- a/src/main/auth.c +++ b/src/main/auth.c @@ -112,10 +112,11 @@ static int rad_authlog(const char *msg, REQUEST *request, int goodpass) auth_type = pairfind(request->config_items, PW_AUTH_TYPE, 0); - if (auth_type && (auth_type->vp_strvalue[0] != '\0')) { + if (auth_type) { snprintf(clean_password, sizeof(clean_password), "", - auth_type->vp_strvalue); + dict_valnamebyattr(PW_AUTH_TYPE, 0, + auth_type->vp_integer)); } else { strcpy(clean_password, ""); } @@ -184,14 +185,11 @@ static int rad_check_password(REQUEST *request) */ cur_config_item = request->config_items; while(((auth_type_pair = pairfind(cur_config_item, PW_AUTH_TYPE, 0))) != NULL) { - DICT_VALUE *dv; auth_type = auth_type_pair->vp_integer; auth_type_count++; - dv = dict_valbyattr(PW_AUTH_TYPE, - auth_type_pair->vp_integer, 0); RDEBUG2("Found Auth-Type = %s", - (dv != NULL) ? dv->name : "?"); + dict_valnamebyattr(PW_AUTH_TYPE, 0, auth_type)); cur_config_item = auth_type_pair->next; if (auth_type == PW_AUTHTYPE_REJECT) { @@ -426,8 +424,9 @@ int rad_postauth(REQUEST *request) */ vp = pairfind(request->config_items, PW_POST_AUTH_TYPE, 0); if (vp) { - RDEBUG2("Using Post-Auth-Type %s", vp->vp_strvalue); postauth_type = vp->vp_integer; + RDEBUG2("Using Post-Auth-Type %s", + dict_valnamebyattr(PW_POST_AUTH_TYPE, 0, postauth_type)); } result = module_post_auth(postauth_type, request); switch (result) { @@ -602,8 +601,9 @@ autz_redo: if (!autz_retry) { tmp = pairfind(request->config_items, PW_AUTZ_TYPE, 0); if (tmp) { - RDEBUG2("Using Autz-Type %s", tmp->vp_strvalue); autz_type = tmp->vp_integer; + RDEBUG2("Using Autz-Type %s", + dict_valnamebyattr(PW_AUTZ_TYPE, 0, autz_type)); autz_retry = 1; goto autz_redo; }