regex does not honour escaped characters?
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@whatever.de.de". To my astonishment, it also matches usernames like "x@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?
Try double escaping Arran Cudbard-Bell a.cudbardb@freeradius.org RADIUS - Half the complexity of Diameter
I also tried double backslashes, but the result is the same. DEFAULT User-Name =~ "(.*\\.de\\.de$)" Hint := "Blacklist" This is the reason which makes me believe that backslahes are stripped all together. Am 21.07.2011 10:27, schrieb Arran Cudbard-Bell:
Try double escaping
Arran Cudbard-Bell a.cudbardb@freeradius.org
RADIUS - Half the complexity of Diameter
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Arran Cudbard-Bell -
Oliver Schröder