]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Validate after we figure out it's a real pair list match
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 29 Oct 2021 05:38:41 +0000 (01:38 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 29 Oct 2021 05:38:41 +0000 (01:38 -0400)
src/lib/server/tmpl_tokenize.c

index f40186c3e0510fc28e7fdbf2e4043cb66ef3e761..6f8f9fc6c80caad68a5655022dbe8ef51c1162bc 100644 (file)
@@ -1905,13 +1905,6 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err,
        fr_sbuff_out_by_longest_prefix(&list_len, &vpt->data.attribute.list, pair_list_table,
                                       &our_name, t_rules->list_def);
 
-       if ((t_rules->attr_parent || t_rules->disallow_qualifiers) && (list_len > 0)) {
-               fr_strerror_const("It is not permitted to specify a pair list here");
-               if (err) *err = TMPL_ATTR_ERROR_INVALID_LIST_QUALIFIER;
-               talloc_free(vpt);
-               FR_SBUFF_ERROR_RETURN(&our_name);
-       }
-
        /*
         *      Check if we need to backtrack
         *
@@ -1929,6 +1922,13 @@ ssize_t tmpl_afrom_attr_substr(TALLOC_CTX *ctx, tmpl_attr_error_t *err,
                vpt->data.attribute.list = t_rules->list_def;
        }
 
+       if ((t_rules->attr_parent || t_rules->disallow_qualifiers) && (list_len > 0)) {
+               fr_strerror_const("It is not permitted to specify a pair list here");
+               if (err) *err = TMPL_ATTR_ERROR_INVALID_LIST_QUALIFIER;
+               talloc_free(vpt);
+               FR_SBUFF_ERROR_RETURN(&our_name);
+       }
+
        /*
         *      Parse the attribute reference
         *