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? Rgds A
Yes. ... but this can all be done in freeradius and unlang without touching perl. Use the canonicalize policy module to adjust the MAC format and wrap your unlang around a call to that policy OR (and better) is ensure those requests go to a new virtual server and don't call that policy in that virtual server (its better because if those requests are just mac auth you can remove a whole lot of stuff from the virtual server) alan -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On 23 Jun 2014, at 15:07, Alex Sharaz <alex.sharaz@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@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (3)
-
Alan Buxey -
Alex Sharaz -
Arran Cudbard-Bell