Hello,
I sent many times the SAME feature to the list, but project
leaders (or leader, I can't remember) said, we should make a general
architecture for this type of hacks and not do with rlm_preprocess.
So it is not in the CVS (but It should from a long time...).
Perhaps you will have success :)
I would like to see this improvement in FR.
Regards,
Thomas
On Tue, 4 Feb 2003, Vladimir Kravchenko wrote:
>
> I offer to add functionality in the function "cisco_vsa_hack".
>
> Example value pair:
> Cisco-AVPair = "h323-incoming-conf-id=cc0576cf 379011d7 95c8ef6a 9f419c36"
> I can not will address to attribute h323-incoming-conf-id through macro
> %{h323-incoming-conf-id}
> Offer: if "h323-incoming-conf-id" exists in dictonary then replace
> attribute & value.
>
> Example patch:
>
> oracle[jimson]:.../radiusd $ cat ../cisco_vsa_hack.patch
> --- src/modules/rlm_preprocess/rlm_preprocess.c.orig Tue Feb 4 21:26:05 2003
> +++ src/modules/rlm_preprocess/rlm_preprocess.c Tue Feb 4 21:27:22 2003
> @@ -112,7 +112,9 @@
> {
> int vendorpec, vendorcode;
> char *ptr;
> - char newattr[MAX_STRING_LEN];
> + char nattr[MAX_STRING_LEN];
> + char nvalue[MAX_STRING_LEN];
> + DICT_ATTR *dattr;
>
> for ( ; vp != NULL; vp = vp->next) {
> vendorcode = (vp->attribute >> 16); /* HACK! */
> @@ -123,16 +125,21 @@
>
> if (vendorpec != 9) continue; /* not a Cisco VSA, continue */
>
> - if ((vp->attribute & 0xffff) == 1) continue; /* Cisco-AVPair */
> -
> /*
> * We strip out the duplicity from the value field,
> * we use only the value on the right side of = character.
> */
> - if ((ptr = strchr(vp->strvalue, '=')) != NULL) {
> - strNcpy(newattr, ptr + 1, sizeof(newattr));
> - strNcpy((char *)vp->strvalue, newattr,
> - sizeof(vp->strvalue));
> + if (vp->type == PW_TYPE_STRING && (ptr = strchr(vp->strvalue, '='))
>!= NULL) {
> + if ((vp->attribute & 0xffff) == 1) {
> + /* Cisco-AVPair */
> + strNcpy(nattr, vp->strvalue, ptr - (char
>*)vp->strvalue + 1);
> + if ((dattr = dict_attrbyname(nattr)) != NULL &&
>dattr->type == PW_TYPE_STRING) {
> + vp->attribute = dattr->attr;
> + strNcpy(vp->name, dattr->name,
>sizeof(vp->name));
> + } else continue;
> + }
> + strNcpy(nvalue, ptr + 1, sizeof(nvalue));
> + strNcpy((char *)vp->strvalue, nvalue, sizeof(vp->strvalue));
> vp->length = strlen((char *)vp->strvalue);
> }
> }
> oracle[jimson]:.../radiusd $
>
> Your opinion?
>
> P.S. To add check dattr vendor whether or not? :)
> --
> Vladimir Kravchenko / PK Mostcom JSC / system engineer
> Tel: +7 095 2312255 / UIN: 132038843 / Email: [EMAIL PROTECTED]
>
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html