]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use config value expansion instead of xlat expansion
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 9 Jul 2011 21:07:28 +0000 (23:07 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 9 Jul 2011 21:07:28 +0000 (23:07 +0200)
raddb/policy.conf

index 79899a0457a47417b0b153b9851c4d19608dc495..8732e82f3426beddd4d1ee6834b4ab3252ba9b37 100644 (file)
@@ -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}}"
                        }