]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
fix parsing of &Outer-Realm-Name, with terminating characters
authorAlan T. DeKok <aland@freeradius.org>
Sat, 2 Jul 2022 12:20:47 +0000 (08:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 2 Jul 2022 15:18:59 +0000 (11:18 -0400)
It should not be

&Outer - Realm-Name

even if "-" is a terminating character.

The correct answer is "don't have ambiguous grammars", but it's
very difficult to fix that now

src/lib/server/tmpl_tokenize.c

index 9fc6fec9dcd34417159998e2aa6c6c72dfa8cdec..9e9156d3de169cb4e39e8643c04baa56504ed0f1 100644 (file)
@@ -630,7 +630,7 @@ static fr_slen_t tmpl_request_ref_list_from_substr(TALLOC_CTX *ctx, tmpl_attr_er
                 *      We don't want to misidentify the list
                 *      as being part of an attribute.
                 */
-               if (!fr_sbuff_is_char(&our_in, '.') && !tmpl_substr_terminal_check(&our_in, p_rules)) {
+               if (!fr_sbuff_is_char(&our_in, '.') && (fr_sbuff_is_in_charset(&our_in, fr_dict_attr_allowed_chars) || !tmpl_substr_terminal_check(&our_in, p_rules))) {
                        goto default_ref;
                }