From: Alan T. DeKok Date: Sun, 24 Sep 2023 23:48:01 +0000 (-0400) Subject: allow TLVs for local dictionary definitions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f5f0a8bfbc9418be4a27d27874f73aeb5826d9e;p=thirdparty%2Ffreeradius-server.git allow TLVs for local dictionary definitions --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index a6fdfbfb5fd..5ee95ce0663 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -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;