regular expression grouping issue on attrs filter

Phil Mayers p.mayers at imperial.ac.uk
Wed Apr 18 17:35:37 CEST 2012


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.


More information about the Freeradius-Users mailing list