From: Arran Cudbard-Bell Date: Sat, 9 Jul 2011 21:07:28 +0000 (+0200) Subject: Use config value expansion instead of xlat expansion X-Git-Tag: release_3_0_0_beta0~707 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0301b8c5873de8de67a9794e89156a8d595c20da;p=thirdparty%2Ffreeradius-server.git Use config value expansion instead of xlat expansion --- diff --git a/raddb/policy.conf b/raddb/policy.conf index 79899a0457a..8732e82f342 100644 --- a/raddb/policy.conf +++ b/raddb/policy.conf @@ -19,6 +19,8 @@ # If policy A calls policy B, then B MUST be defined before A. # policy { + # We check for this prefix to determine whether the class value was generated by the server. + class_value_prefix = 'ai:' # # Overload the default acct_unique module, it's not smart enough # @@ -39,7 +41,7 @@ policy { # or the client roams to a different 'port' whilst maintaining its initial authentication # session (Common in a wireless environment). # - if("%{string:Class}" =~ /auth_id:([0-9a-f]{32})/i) { + if("%{string:Class}" =~ /${policy.class_value_prefix}([0-9a-f]{32})/i) { update request { Acct-Unique-Session-Id := "%{md5:%{1}%{Acct-Session-ID}}" } @@ -60,7 +62,7 @@ policy { # insert_acct_class { update reply { - Class = "auth_id:%{md5:%t%{request:NAS-Identifier}%{NAS-Port-ID}%{NAS-Port}%{Calling-Station-ID}%{reply:User-Name}}" + Class = "${policy.class_value_prefix}%{md5:%t%{request:NAS-Identifier}%{NAS-Port-ID}%{NAS-Port}%{Calling-Station-ID}%{reply:User-Name}}" } } @@ -106,7 +108,7 @@ policy { } # - # Split User-Name in NAI format (RFC 4282) into components + # Split User-Name in NAI format (RFC 4282) into components # # This policy writes the Username and Domain portions of the NAI into the # Stripped-User-Name and Stripped-User-Domain attributes. @@ -257,7 +259,7 @@ policy { # Add "rewrite_called_station_id" in the "authorize" and "preacct" sections. # rewrite_called_station_id { - if(Called-Station-Id =~ /^%{config:policy.mac-addr-regexp}(:(.+))?$/i) { + if(Called-Station-Id =~ /^${policy.mac-addr-regexp}(:(.+))?$/i) { update request { Called-Station-Id := "%{tolower:%{1}-%{2}-%{3}-%{4}-%{5}-%{6}}" } @@ -279,7 +281,7 @@ policy { # Add "rewrite_calling_station_id" in the "authorize" and "preacct" sections. # rewrite_calling_station_id { - if(Calling-Station-Id =~ /^%{config:policy.mac-addr-regexp}$/i) { + if(Calling-Station-Id =~ /^${policy.mac-addr-regexp}$/i) { update request { Calling-Station-Id := "%{tolower:%{1}-%{2}-%{3}-%{4}-%{5}-%{6}}" }