Hi,

i am using that with a cvs version from september, but it worked with
all version up to from 0.5

Regards,
 Christian.

On Wed, Nov 06, 2002 at 10:10:27PM +0200, Alexey Chetroi wrote:
>  Hello Christian,
>  I'd like to have that patches regarding converting of the
> cisco-avpair attributes, if it is possible. you may use
> this email.
> 
> -- 
> 
>   Best regards,
>   Alexey Chetroi
> 
> ---
> Smile... Tomorrow will be worse.   (c) Murphy's law
--- freeradius-0.7.1/src/modules/rlm_preprocess/rlm_preprocess.c        Wed Sep 11 
06:49:12 2002
+++ freeradius-snapshot-20020923/src/modules/rlm_preprocess/rlm_preprocess.c    Mon 
+Sep 23 21:57:06 2002
@@ -115,51 +115,52 @@
        char            *ptr;
        char            newattr[MAX_STRING_LEN];
 
-        for ( ; vp != NULL; vp = vp->next) {
-                vendorcode = (vp->attribute >> 16); /* HACK! */
-                if (vendorcode == 0) continue;  /* ignore non-VSA attributes */
-
-                vendorpec  = dict_vendorpec(vendorcode);
-                if (vendorpec == 0) continue; /* ignore unknown VSA's */
-
-                if (vendorpec != 9) continue; /* not a Cisco VSA, continue */
-
-                /* no = seperator in value */
-                if ((ptr = strchr(vp->strvalue, '=')) == NULL) continue;
-
-                /* ugly sip-hdr hack */
-                if ((strncmp(vp->strvalue,"sip-hdr=",8) == 0) && 
(strchr(vp->strvalue, ':') != NULL)) {
-                        DEBUG2("cisco_vsa_hack: found sip_hdr %s", vp->strvalue);
-                        *ptr = '-';
-                        ptr = strchr(vp->strvalue, ':');
-                        *ptr = '=';
-                        DEBUG("cisco_vsa_hack: rewrote %s", vp->strvalue);
-                }
-
-                /* Cisco-AVPair
-                 * We take the lvalue look it up in the dictionary and
-                 * when found overwrite the attribute of Cisco-AVPair with it.
-                 */
-                if ((vp->attribute & 0xffff) == 1) {
-                        strNcpy(newattr, vp->strvalue, vp->length - strlen(ptr) + 1 );
-                        DEBUG2("cisco_vsa_hack: attr : %s to %s",vp->strvalue, 
da->name);
-                        if (( da = dict_attrbyname((char *)newattr) ) == NULL )
-                                continue;
-                        vp->attribute = da->attr;
-                        DEBUG2("cisco_vsa_hack: attr : %s found in dictionary", 
da->name);
-                }
-
-                /*
-                 *  We strip out the duplicity from the value field,
-                 *  we use only the value on the right side of
-                 *  = character.
-                 */
-                strNcpy(newattr, ptr + 1, sizeof(newattr));
-                DEBUG2("cisco_vsa_hack: value: %s to %s",(char *)vp->strvalue,(char 
*) newattr);
-                strNcpy((char *)vp->strvalue, newattr,
-                        sizeof(vp->strvalue));
-                vp->length = strlen((char *)vp->strvalue);
-        }
+
+       for ( ; vp != NULL; vp = vp->next) {
+               vendorcode = (vp->attribute >> 16); /* HACK! */
+               if (vendorcode == 0) continue;  /* ignore non-VSA attributes */
+
+               vendorpec  = dict_vendorpec(vendorcode);
+               if (vendorpec == 0) continue; /* ignore unknown VSA's */
+
+               if (vendorpec != 9) continue; /* not a Cisco VSA, continue */
+
+               /* no = seperator in value */
+               if ((ptr = strchr(vp->strvalue, '=')) == NULL) continue; 
+
+               /* ugly sip-hdr hack */
+               if ((strncmp(vp->strvalue,"sip-hdr=",8) == 0) && (strchr(vp->strvalue, 
+':') != NULL)) {
+                       DEBUG2("cisco_vsa_hack: found sip_hdr %s", vp->strvalue);
+                       *ptr = '-';
+                       ptr = strchr(vp->strvalue, ':');
+                       *ptr = '=';
+                       DEBUG("cisco_vsa_hack: rewrote %s", vp->strvalue);
+               }
+
+               /* Cisco-AVPair 
+                * We take the lvalue look it up in the dictionary and
+                * when found overwrite the attribute of Cisco-AVPair with it.
+                */
+               if ((vp->attribute & 0xffff) == 1) { 
+                       strNcpy(newattr, vp->strvalue, vp->length - strlen(ptr) + 1 );
+                       DEBUG2("cisco_vsa_hack: attr : %s to %s",vp->strvalue, 
+newattr);
+                       if (( da = dict_attrbyname((char *)newattr) ) == NULL )
+                               continue;
+                       vp->attribute = da->attr;
+                       DEBUG2("cisco_vsa_hack: attr : %s found in dictionary", 
+da->name);
+               }
+                       
+               /*
+                *  We strip out the duplicity from the value field,
+                *  we use only the value on the right side of 
+                *  = character.
+                */
+               strNcpy(newattr, ptr + 1, sizeof(newattr));
+               DEBUG2("cisco_vsa_hack: value: %s to %s",(char *)vp->strvalue,(char *) 
+newattr);
+               strNcpy((char *)vp->strvalue, newattr,
+                       sizeof(vp->strvalue));
+               vp->length = strlen((char *)vp->strvalue);
+       }
 }
 
 /*

Reply via email to