Semantics of !~ operator
vogt at spamcop.net
Fri Apr 24 14:20:01 CEST 2015
On 24.04.15 13:58, Alan DeKok wrote:
> On Apr 24, 2015, at 1:14 AM, Gerald Vogt <vogt at spamcop.net> wrote:
>> I don't quite understand the semantics of !~. So far I though it would be the negated result of =~, i.e. if (a =~ b) is true (a !~ b) is false and v.v.
> It's supposed to be. If this is for version 2, we should take a look at fixing it.
> If it's for v3, regexes no longer work in the "users" file.
Interesting. I am using FreeRADIUS 3.0.4 on CentOS 7 and it's still in
the manual page. Should there be an error message if it doesn't work?
And why is it working with =~ then?
I am using regexes a lot in my users file. What would be the indented
way to do the same without regexes? I currently use regexes to check the
realm if it is my own "Realm =~ example.com|NULL" and also to check for
the SSID to which a user connects to on my wifi: e.g.,
"Called-Station-Id =~ "[-A-Fa-f0-9]+:eduroam$" as the controller puts
the MAC address of the access point before the SSID.
So how do I check that instead now without regexes in the users file?
More information about the Freeradius-Users