regex not evaluated?
Hi - does anyone know why this does not work: basic-TP User-Password == "csetestp" User-Name =~ "^([aA-zZ]+)-([aA-zZ]+)$", Alc-Subsc-ID-Str := "%{NAS-Port-Id}", Alc-Subsc-Prof-Str := "%{1}", Alc-SLA-Prof-Str := "%{2}", Alc-MSAP-Serv-Id := "100", Alc-MSAP-Policy := "msaps", Alc-Default-Router := 20.0.0.1, Framed-IP-Address := 20.0.0.2, Framed-IP-Netmask := 255.255.0.0, Session-Timeout := 600, Fall-Through = Yes DEFAULT NAS-Port-Id =~ "^([^:]+):" Alc-MSAP-Interface := "port-%{1}" The request qoes through all lines but the Alc-Subsc-Prof-Str and Alc-Subsc-SLA-Str are empty. Obviously, the User-Name matches the regexpr, therefore, those two string should have returned values of %{1} and %{2}. This is the request: rad_recv: Access-Request packet from host 114.0.1.1:51080, id=29, length=90 User-Name = "basic-TP" User-Password = "csetestp" NAS-IP-Address = 1.1.1.1 DSL-Circuit-ID = "basic-TP" DSL-Remote-ID = "-0" NAS-Port-Type = Ethernet NAS-Port-Id = "1/1/1:10" This is what is returned: Sending Access-Accept of id 29 to 114.0.1.1 port 51080 User-Name =~ "^([aA-zZ]+)-([aA-zZ]+)$" Alc-Subsc-ID-Str := "1/1/1:10" Alc-Subsc-Prof-Str := "" Alc-SLA-Prof-Str := "" Alc-MSAP-Serv-Id := 100 Alc-MSAP-Policy := "msaps" Alc-Default-Router := 20.0.0.1 Framed-IP-Address := 20.0.0.2 Framed-IP-Netmask := 255.255.0.0 Session-Timeout := 600 Alc-MSAP-Interface := "port-1/1/1" Thanks, Marlon.
Hi,
The request qoes through all lines but the Alc-Subsc-Prof-Str and Alc-Subsc-SLA-Str are empty. Obviously, the User-Name matches the regexpr, therefore, those two string should have returned values of %{1} and %{2}.
obviously? that would assume that the filter engine stores the result of a regex across further values being checked - have you validated the code to see if thats what it does or is supposed to do? alan
Marlon Duksa wrote:
Hi - does anyone know why this does not work:
basic-TP User-Password == "csetestp" User-Name =~ "^([aA-zZ]+)-([aA-zZ]+)$",
$ man users or $ man 5 users The '=~' operator is not allowed to be used there. If you want that functionality, use "unlang" to write the rules. Alan DeKok.
participants (3)
-
Alan Buxey -
Alan DeKok -
Marlon Duksa