From: aland Date: Mon, 7 Feb 2005 20:04:47 +0000 (+0000) Subject: Make "Strip-User-Name = No" work. X-Git-Tag: release_1_0_2~8 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;h=ebf1cbff45c994d1610bda0088d67b7cfeedca66;p=freeradius.git Make "Strip-User-Name = No" work. Patch from sergvlab --- diff --git a/src/main/valuepair.c b/src/main/valuepair.c index ff9f7bd..7c50dde 100644 --- a/src/main/valuepair.c +++ b/src/main/valuepair.c @@ -570,13 +570,17 @@ static int presufcmp(void *instance, if (ret != 0) return ret; - if (pairfind(check_pairs, PW_STRIP_USER_NAME)) { - /* - * I don't think we want to update the User-Name - * attribute in place... - atd - */ - strcpy((char *)request->strvalue, rest); - request->length = strlen(rest); + if ((vp = pairfind(check_pairs, PW_STRIP_USER_NAME)) != NULL) { + if (vp->lvalue == 1) { + /* + * I don't think we want to update the User-Name + * attribute in place... - atd + */ + strcpy((char *)request->strvalue, rest); + request->length = strlen(rest); + } else { + return ret; + } } else { if ((vp = pairfind(check_pairs, PW_STRIPPED_USER_NAME)) != NULL){ strcpy((char *)vp->strvalue, rest);