Commit report for master branch
Brian Candler
B.Candler at pobox.com
Thu Apr 11 13:02:11 CEST 2013
On Wed, Apr 10, 2013 at 12:41:43PM -0400, Arran Cudbard-Bell wrote:
> > Makes sense - like regcomp. (And of course, "files" could also precompile
> > the RHS of regexp match operators)
>
> No. Not unless the regexp library supports compiled, parameterised expressions.
I was thinking of something like
foo NAS-IP-Address =~ "^192\.0\.2\."
It never occurred to me that the RHS of a condition like that might include
xlats. Does the files module actually allow stuff like this?? e.g.
foo NAS-IP-Address == "%{Client-IP-Address}"
Reply-Message += "Hello %{Client-IP-Address}"
Now, a quick test with a master build from a month ago suggests that
Reply-Message += "Hello %{Client-IP-Address}",
works (which is new to me). However
steve Cleartext-Password := "testing", NAS-IP-Address =~ "%{Client-IP-Address}"
fails to start with the following error:
reading pairlist file /Users/brian/Build/freeradius-master/etc/raddb/users
/Users/brian/Build/freeradius-master/etc/raddb/users[76]: Parse error (check) for entry steve: dict_init: /Users/brian/Build/freeradius-master/etc/raddb/dictionary[65]: Couldn't open dictionary "/Users/brian/Build/freeradius-master/etc/raddb/dictionary.local": No such file or directory
Errors reading /Users/brian/Build/freeradius-master/etc/raddb/users
Very strange, the section in etc/raddb/dictionary says:
# Include dictionary.local, IF it exists. Otherwise, ignore it.
#
# This file WILL NOT EVER be created, edited, or modified
# by FreeRADIUS.
#
$INCLUDE- dictionary.local
so it shouldn't matter that the file doesn't exist. When if I comment out
this $INCLUDE- line, I get "unknown error" instead:
reading pairlist file /Users/brian/Build/freeradius-master/etc/raddb/users
/Users/brian/Build/freeradius-master/etc/raddb/users[76]: Parse error (check) for entry steve: (unknown error)
Errors reading /Users/brian/Build/freeradius-master/etc/raddb/users
But it works if I change the condition to a fixed string literal:
steve Cleartext-Password := "testing", NAS-IP-Address =~ "^192\."
Odd. I have to say I can't really see a need for expansions in check items,
and if they don't work today, maybe it's still reasonable to say that regexp
values could be precompiled.
Regards,
Brian.
More information about the Freeradius-Devel
mailing list