On 11/21/2013 03:51 PM, Tim Jones wrote:
> I was adding a Handler to deal with EAP-SIM requests, and tried to use
> the following regex to check the User-Name attribute:
>
> /^1\d{14,15}(\@.+)*$/
Hello Tim,
try this instead:
<Handler User-Name = "/^1\d{14,15}(\@.+)*$/">
That is, the value must be within double quotes since it contains a comma.
It can also be simplified a bit too:
<Handler User-Name = "/^1\d{14,15}(@.+)*$/">
> But my log file is throwing out "ERR: Bad attribute=value pair:
> 15}(\@.+)*$/", so it looks like Radiator is hitting the comma and trying
> to parse the rest of the regex as a regular "Check-Item=Value".
Yes, that's correct. The reference manual says Handler's checklist is
formatted the same as check items e.g., in file. The 'Check and Reply
items' section says that values with commas require double quotes.
> I changed my regex to:
>
> /^1\d{14}(\@.+)*$|^1\d{15}(\@.+)*$/
>
> which is working for me now.
>
> Is this a bug in the parsing of the regex, or have I misunderstood the
> formatting for variable-length repeating characters?
I think it works as intended and with the double quotes you can make it
work as you originally thought. The regexp looks fine.
Thanks,
Heikki
--
Heikki Vatiainen <[email protected]>
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS,
NetWare etc.
_______________________________________________
radiator mailing list
[email protected]
http://www.open.com.au/mailman/listinfo/radiator