Using Client-Shortname within perl module

Arran Cudbard-Bell a.cudbardb at freeradius.org
Mon Jun 23 16:15:02 CEST 2014


On 23 Jun 2014, at 15:07, Alex Sharaz <alex.sharaz at york.ac.uk> wrote:

> Hi,
> 
> I'm using perl to convert various attributes into a standardised  XX-XX-XX-XX-XX-XX format e.g
> 
>        $RAD_REQUEST{'Calling-Station-Id'} = &formatMac($RAD_REQUEST{'Calling-Station-Id'});
>        $RAD_REQUEST{'Called-Station-Id'} = &formatMac($RAD_REQUEST{'Called-Station-Id'});
>        $RAD_REQUEST{'User-Name'} = &formatMac($RAD_REQUEST{'User-Name'});
> which works just fine. 
> 
> However, our Comp Science dept decided not to use the same hex formatting as us so when I proxy mac-auth requests off to their server, I need to make sure that I don't do the above. 
> 
> Is there any way I can wrap an 
> 
> if ( Client-Shortname != "cseswitches") {
> ...
> }
> round the above so that I only perform the conversion when processing non Comp Sci requests?

update request {
	Client-Shortname := "%{client:shortname}"
}

It'll then be available in the request list.

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20140623/c457b525/attachment-0001.pgp>


More information about the Freeradius-Users mailing list