regex does not honour escaped characters?
Oliver Schröder
oliver.schroeder at versatel.de
Thu Jul 21 10:19:22 CEST 2011
Hello List,
I'm trying to match a User-Name attribute against a regex in the hints
file. I'm now stumbling over a regex which does not work as expected. It
looks like this:
DEFAULT User-Name =~ "(.*\.de\.de$)"
Hint := "Blacklist"
It is aimed to match User-Names like "x at whatever.de.de". To my
astonishment, it also matches usernames like "x at ende.de" (note the
missing dot).
I'm unsing a self-compiled freeradius from git-sources:
FreeRADIUS Version 2.1.12, for host i686-pc-linux-gnu
Looking at the config.log, I assume that the local posix regex functions
are used:
$ grep regex config.log
configure:23003: checking regex.h usability
configure:23044: checking regex.h presence
configure:23107: checking for regex.h
ac_cv_header_regex_h=yes
From my observations, it seems that backslashes are removed from the
regex string before the regex gets compiled, but I might be wrong.
Am I missing something or is this a (known) bug?
More information about the Freeradius-Users
mailing list