From e5e00e20f111a784dc40665147fd44097a208741 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 29 Oct 2010 14:07:37 -0400 Subject: [PATCH] Do checks on attribute *and* vendor. Doing it on just attr is no longer appropriate in 2.2 --- src/main/evaluate.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/evaluate.c b/src/main/evaluate.c index 77df822..365e463 100644 --- a/src/main/evaluate.c +++ b/src/main/evaluate.c @@ -882,6 +882,8 @@ static void fix_up(REQUEST *request) request->password = NULL; for (vp = request->packet->vps; vp != NULL; vp = vp->next) { + if (vp->vendor) continue; + if ((vp->attribute == PW_USER_NAME) && !request->username) { request->username = vp; @@ -892,6 +894,8 @@ static void fix_up(REQUEST *request) } else if (vp->attribute == PW_USER_PASSWORD) { request->password = vp; } + + if (request->username && request->password) continue; } } @@ -985,7 +989,8 @@ void radius_pairmove(REQUEST *request, VALUE_PAIR **to, VALUE_PAIR *from) /* * Attributes aren't the same, skip them. */ - if (from_list[i]->attribute != to_list[j]->attribute) { + if ((from_list[i]->attribute != to_list[j]->attribute) && + (from_list[i]->vendor != to_list[j]->vendor)) { continue; } @@ -1318,7 +1323,8 @@ int radius_update_attrlist(REQUEST *request, CONF_SECTION *cs, cp = cf_itemtopair(ci); #ifndef NDEBUG - if (debug_flag && radius_find_compare(vp->attribute)) { + if (debug_flag && (vp->vendor == 0) && + radius_find_compare(vp->attribute)) { DEBUG("WARNING: You are modifying the value of virtual attribute %s. This is not supported.", vp->name); } #endif -- 2.1.4