regular expression grouping issue on attrs filter
Ivo Vastert
ivo at vastert.nl
Wed Apr 18 20:04:26 CEST 2012
Hi Phil,
Thank you for your answer.
I just try'd your rule but this one is refused aswell (Freeradius won't start with it, giving a parse error).
Framed-IP-Address =~ /^172\.(1[6-9]|2[0-9]|3[01])\./
I still have the feeling ( ) is not accepted, when we don't use themthe grouping characters, the line is accepted.
Do you have any other suggestions we can try?
Best regards,
Ivo
On Apr 18, 2012, at 5:35 PM, Phil Mayers wrote:
> On 18/04/12 15:30, Ivo Vastert wrote:
>> Hi,
>>
>> I'm currently having a issue implementing a regular expression within the attrs configuration file.
>> When i try to group entry's within a regular expression the configuration is rejected:
>
> What does that mean? "Rejected" how?
>
>>
>> For example:
>>
>> This entry works:
>> Framed-IP-Address =~ /^172\.1[6-9]|2[0-9]|3[0-1]\.[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]\.[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]$/
>>
>> This entry doesn't work:
>> Framed-IP-Address =~ /^172\.(1[6-9]|2[0-9]|3[0-1])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/
>>
>
> Doesn't work how?
>
>> Does anyone know the correct syntax for grouping a entry within a regular expression?
>> It looks like grouping by () is not supported by freeradius?
>
> Not correct; () is the grouping operator.
>
> I suspect you just have the syntax of your regexp wrong. Either that, or your system regexp library is broken - FreeRADIUS just uses that.
>
> The regexp you list above is more complex than it needs to be IMO; Framed-IP-Address can't have the "wrong" syntax because the server enforces it.
>
> Try the simpler:
>
> Framed-IP-Address =~ /^172\.(1[6-9]|2[0-9]|3[01])\./
>
>> freeradius: FreeRADIUS Version 2.0.4, for host i486-pc-linux-gnu, built on Sep 7 2008 at 23:35:34
>
> It is unrelated to your problem, but that is an old version. Upgrade to 2.1.12.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list