From: Nick Porter Date: Thu, 13 Jul 2023 15:21:54 +0000 (+0100) Subject: Reference the correct list for comparisons in rlm_files data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=443c557ba042d44e02558b249045a12f12867cbe;p=thirdparty%2Ffreeradius-server.git Reference the correct list for comparisons in rlm_files data If it's internal attriubtes - stay with the control list Protocol attributes are compared in the request list --- diff --git a/src/lib/server/users_file.c b/src/lib/server/users_file.c index 98aafb387cf..5fa108a7dae 100644 --- a/src/lib/server/users_file.c +++ b/src/lib/server/users_file.c @@ -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",