]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
allow TLVs for local dictionary definitions
authorAlan T. DeKok <aland@freeradius.org>
Sun, 24 Sep 2023 23:48:01 +0000 (19:48 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Sep 2023 00:07:09 +0000 (20:07 -0400)
src/lib/server/cf_file.c

index a6fdfbfb5fd96bf4f7fb42bcf4511be703e856b1..5ee95ce066381882e8515cca614bdb2667b92e46 100644 (file)
@@ -2163,12 +2163,14 @@ static int parse_input(cf_stack_t *stack)
                        goto check_for_eol;
                }
 
-               if (!parent->allow_locals && (strcmp(parent->name1, "dictionary") != 0)) {
+               if (!parent->allow_locals && (cf_section_find_in_parent(parent, "dictionary", NULL) == NULL)) {
                        ERROR("%s[%d]: Parse error: Invalid location for variable definition",
                              frame->filename, frame->lineno);
                        return -1;
                }
 
+               if (type == FR_TYPE_TLV) goto parse_name2;
+
                /*
                 *      We don't have an operator, so set it to a magic value.
                 */
@@ -2223,6 +2225,7 @@ check_for_eol:
         */
        if ((*ptr == '"') || (*ptr == '`') || (*ptr == '\'') || ((*ptr == '&') && (ptr[1] != '=')) ||
            ((*((uint8_t const *) ptr) & 0x80) != 0) || isalpha((uint8_t) *ptr) || isdigit((uint8_t) *ptr)) {
+       parse_name2:
                if (cf_get_token(parent, &ptr, &name2_token, buff[2], stack->bufsize,
                                 frame->filename, frame->lineno) < 0) {
                        return -1;