Make "Strip-User-Name = No" work.
authoraland <aland>
Mon, 7 Feb 2005 20:04:47 +0000 (20:04 +0000)
committeraland <aland>
Mon, 7 Feb 2005 20:04:47 +0000 (20:04 +0000)
  Patch from sergvlab

src/main/valuepair.c

index ff9f7bd..7c50dde 100644 (file)
@@ -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);