Pattern Matching in users file
I have the following entry in my users file: DEFAULT Cisco-AVPair =~ "ssid=(.*)", Group := "%{1}" I added a perl module after files in my authorize section and data::dumper'ed %RAD_REQUEST, %RAD_CHECK and %RAD_CONFIG for debugging purposes. The Cisco-AVPair value in the request is "ssid=EE-Corp". I would expect that the value of Group would be "EE-Corp". Instead, the value of Group was "(.*)". I tried using backticks around the %{1}. I tried "=" as opposed to ":=". Also, the Group attribute was added to %RAD_CHECK as opposed to %RAD_REQUEST (Group was not an attribute in the original request). This prevented me from using module checkval to test it. I ended up using the attr_rewrite module to change Cisco-AVPair so it could be tested by checkval.. So, if it's supported, what is the syntax for regex pattern matching and substitution in the users file? Also, if it's possible, what is the syntax to create a new request attribute in the users file? Thank you for creating/supporting/maintaining the best and most flexible Radius server.
"Garber, Neal" <Neal.Garber@energyeast.com> wrote:
DEFAULT Cisco-AVPair =~ "ssid=3D(.*)", Group := "%{1}"
You can't use the Group attribute that way. It's for checking Unix groups. You'll have to create another attribute for your local groups.
Also, the Group attribute was added to %RAD_CHECK as opposed to %RAD_REQUEST (Group was not an attribute in the original request).
The "users" file is documented as behaving this way. If you want to add an attribute to the request, you have to use the "hints" file. Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
participants (2)
-
Alan DeKok -
Garber, Neal