]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Reference the correct list for comparisons in rlm_files data
authorNick Porter <nick@portercomputing.co.uk>
Thu, 13 Jul 2023 15:21:54 +0000 (16:21 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 13 Jul 2023 15:35:39 +0000 (16:35 +0100)
If it's internal attriubtes - stay with the control list
Protocol attributes are compared in the request list

src/lib/server/users_file.c

index 98aafb387cf843644704fef5b8f2457dc984b6fb..5fa108a7daefdfa4278dece197231533cf92392d 100644 (file)
@@ -421,15 +421,16 @@ check_item:
                        goto fail_entry;
                }
 
-               if (tmpl_contains_regex(new_map->rhs)) {
-                       /*
-                        *      The default rules say that the check
-                        *      items look at the control list, but
-                        *      for regexes we want to look at the
-                        *      request list.
-                        */
+               /*
+                *      The default rule says that the check
+                *      items look at the control list, but
+                *      protocol attributes should be compared in the request.
+                */
+               if (!tmpl_attr_tail_da(new_map->lhs)->flags.internal) {
                        tmpl_attr_set_list(new_map->lhs, request_attr_request);
+               }
 
+               if (tmpl_contains_regex(new_map->rhs)) {
                        if (tmpl_is_regex_uncompiled(new_map->rhs) &&
                            (tmpl_regex_compile(new_map->rhs, false) < 0)) {
                                ERROR("%s[%d]: Failed compiling regular expression /%s/ - %s",