regular expression problem on 2.1.3
Hi, I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file. If I provide a simple example users file I am testing against: DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1" Service-Type = Framed-User, Framed-Protocol = PPP, Fall-Through = Yes tim Cleartext-Password := "test123" this gives the following debug output with a test client... [suffix] No '@' in User-Name = "tim", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [files] expand: %{NAS-IP-Address} -> 192.168.1.1 [files] Invalid regular expression : empty (sub)expression <== problem here [files] users: Matched entry tim at line 10 ++[files] returns ok ++[expiration] returns noop ++[logintime] returns noop [pap] Found existing Auth-Type, not changing it. ++[pap] returns noop Found Auth-Type = CHAP +- entering group CHAP {...} [chap] login attempt by "tim" with CHAP password [chap] Using clear text password "test123" for user tim authentication. [chap] chap user tim authenticated succesfully ++[chap] returns ok Login OK: [tim] (from client sotalan port 0) +- entering group post-auth {...} ++[exec] returns noop Sending Access-Accept of id 29 to 192.123.126.98 port 47875 Finished request 0. Even a simpler expression like NAS-IP-Address =~ "192.168" fails with the same message "Invalid regular expression : empty (sub)expression". The same style expressions have been in active use on 2.0.3 and 2.0.5, can anyone offer any advice? Thanks in advance Tim
Hi,
Hi,
I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file.
If I provide a simple example users file I am testing against:
DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1"
"(192.168.1.1|10.0.1.1)" ? alan
Thanks for the suggestion - this also gives the same result: [files] Invalid regular expression : empty (sub)expression Tim -----Original Message----- From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradi us.org] On Behalf Of A.L.M.Buxey@lboro.ac.uk Sent: 24 January 2009 00:07 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3 Hi,
Hi,
I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file.
If I provide a simple example users file I am testing against:
DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1"
"(192.168.1.1|10.0.1.1)" ? alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
when i use regex, i use it with unlang so it might differ from a users file but here is how i would write it for unlang: DEFAULT NAS-IP-Address =~ /192.168.1.1|10.0.1.1/ Le 23.01.2009 14:18, Tim Lightfoot a écrit :
Thanks for the suggestion - this also gives the same result:
[files] Invalid regular expression : empty (sub)expression
Tim
-----Original Message----- From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradi us.org] On Behalf Of A.L.M.Buxey@lboro.ac.uk Sent: 24 January 2009 00:07 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3
Hi,
Hi,
I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file.
If I provide a simple example users file I am testing against:
DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1"
"(192.168.1.1|10.0.1.1)" ?
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thank you, I tried it as /expr/ and also "/expr/" both have the same result. I use these regular expressions within both users file and MySQL on my live Radius box, its failing within both modules. Would it be unlang processing the expressions here. ________________________________ From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org] On Behalf Of Alexandre Chapellon Sent: 24 January 2009 00:30 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3 when i use regex, i use it with unlang so it might differ from a users file but here is how i would write it for unlang: DEFAULT NAS-IP-Address =~ /192.168.1.1|10.0.1.1/ Le 23.01.2009 14:18, Tim Lightfoot a écrit : Thanks for the suggestion - this also gives the same result: [files] Invalid regular expression : empty (sub)expression Tim -----Original Message----- From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradi us.org] On Behalf Of A.L.M.Buxey@lboro.ac.uk Sent: 24 January 2009 00:07 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3 Hi, Hi, I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file. If I provide a simple example users file I am testing against: DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1" "(192.168.1.1|10.0.1.1)" ? alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi,
I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file.
If I provide a simple example users file I am testing against:
DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1"
Something is wrong with your installation. From my test system: [files] expand: %{NAS-IP-Address} -> 192.168.1.1 [files] users: Matched entry DEFAULT at line 1 ++[files] returns ok It works with and without quotes. Ivan Kalik Kalik Informatika ISP
I don't think unlang is used for processing users file (an thus neither mysql as it's supposed to mirror user file) but you could add an update clause (which uses unlang) to add your reply items. something like: if (request:NAS-IP-Address =~ /192.168.1.1|10.0.1.1/) { update reply { Service-Type := Framed-User Framed-Protocol := PPP Fall-Through := Yes } } But i don't know how clever it is as DEFAULT entry in users file are supposed to do the job, but behaviour related to nas-ip-address is even more a matter of huntgroups. Le 23.01.2009 14:45, Tim Lightfoot a écrit :
Thank you, I tried it as /expr/ and also "/expr/" both have the same result.
I use these regular expressions within both users file and MySQL on my live Radius box, its failing within both modules. Would it be unlang processing the expressions here.
________________________________
From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org] On Behalf Of Alexandre Chapellon Sent: 24 January 2009 00:30 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3
when i use regex, i use it with unlang so it might differ from a users file but here is how i would write it for unlang:
DEFAULT NAS-IP-Address =~ /192.168.1.1|10.0.1.1/
Le 23.01.2009 14:18, Tim Lightfoot a écrit :
Thanks for the suggestion - this also gives the same result:
[files] Invalid regular expression : empty (sub)expression
Tim
-----Original Message----- From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradi us.org] On Behalf Of A.L.M.Buxey@lboro.ac.uk Sent: 24 January 2009 00:07 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3
Hi,
Hi,
I have updated my Freeradius from 2.0.5 to 2.1.3 and am having a problem with the regular expressions I am using in the users file.
If I provide a simple example users file I am testing against:
DEFAULT NAS-IP-Address =~ "192.168.1.1|10.0.1.1"
"(192.168.1.1|10.0.1.1)" ?
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Tim Lightfoot wrote:
[files] expand: %{NAS-IP-Address} -> 192.168.1.1 [files] Invalid regular expression : empty (sub)expression <== problem here
This error is being produced by the regular expression library on your system. FreeRADIUS is just asking the library to use the regular expression... and it says no. The "users" file parser was changed in 2.1.x, but that was only to deal with back-slashed. It shouldn't be affecting this. Try using "unlang", as suggested elsewhere. Alan DeKok.
Thanks for suggestions on this, i will be looking into unlang... I reverted my Radius box to 2.0.5 and did some digging into this problem on another server. It seems to be fail at line 83 of valuepair.c compiling the regular expression. /* * Include substring matches. */ compare = regcomp(®, (char *)check->vp_strvalue, REG_EXTENDED); if (compare != 0) { char buffer[256]; regerror(compare, ®, buffer, sizeof(buffer)); RDEBUG("Invalid regular expression %s: %s", check->vp_strvalue, buffer); return -1; The debug output "Invalid regular expression : empty (sub)expression" should show the contenst of the regex being passed to regcomp, it appears as if check->vp_strvalue is an empty string, where it should contain the regular expression, hence the failure in regcomp. In 2.0.5 values do get through in check->vp_strvalue. Tim -----Original Message----- From: freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradius.org [mailto:freeradius-users-bounces+tim.lightfoot=sota.co.uk@lists.freeradi us.org] On Behalf Of Alan DeKok Sent: 24 January 2009 06:50 To: FreeRadius users mailing list Subject: Re: regular expression problem on 2.1.3 Tim Lightfoot wrote:
[files] expand: %{NAS-IP-Address} -> 192.168.1.1 [files] Invalid regular expression : empty (sub)expression <== problem
here
This error is being produced by the regular expression library on your system. FreeRADIUS is just asking the library to use the regular expression... and it says no. The "users" file parser was changed in 2.1.x, but that was only to deal with back-slashed. It shouldn't be affecting this. Try using "unlang", as suggested elsewhere. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (5)
-
A.L.M.Buxey@lboro.ac.uk -
Alan DeKok -
Alexandre Chapellon -
Tim Lightfoot -
tnt@kalik.net