NAI policy should always return updated if the User-Name string matched the format
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Jul 2011 09:58:01 +0000 (11:58 +0200)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 3 Jul 2011 09:58:01 +0000 (11:58 +0200)
raddb/policy.conf

index a0f3d4c..e3b5e9f 100644 (file)
@@ -116,12 +116,15 @@ policy {
        #  regular expressions (or at least not a legible one).
        #
        split_username_nai {
-                       if(User-Name =~ /^([^@]*)(@([-[:alnum:]]+\\.[-[:alnum:].]+))?$/){
-                               update request {
-                                       Stripped-User-Name := "%{1}"
-                                       Stripped-User-Domain = "%{3}"
-                               }
+               if(User-Name =~ /^([^@]*)(@([-[:alnum:]]+\\.[-[:alnum:].]+))?$/){
+                       update request {
+                               Stripped-User-Name := "%{1}"
+                               Stripped-User-Domain = "%{3}"
                        }
+                       # If any of the expansions result in a null string, the update
+                       # section may return something other than updated...
+                       updated
+               }
                else{
                        noop
                }