From: Alan T. DeKok Date: Mon, 25 May 2026 15:24:52 +0000 (-0400) Subject: track reference braces. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff6201fbe6b22366dd1cf64186d7d5a1105df82b;p=thirdparty%2Ffreeradius-server.git track reference braces. so we can tell the difference between "close the at reference" and "close the parent section" --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index 7a832f6de62..76f001b7bb3 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -133,6 +133,7 @@ typedef struct { CONF_SECTION *parent; //!< which started this file CONF_SECTION *current; //!< sub-section we're reading CONF_SECTION *at_reference; //!< was this thing an @foo ? + int at_reference_braces; //!< braces when we found this thing int braces; bool from_dir; //!< this file was read from $include foo/ @@ -2406,7 +2407,7 @@ static int parse_input(cf_stack_t *stack) * section, before we were parsing the * @reference. */ - if (frame->at_reference) { + if (frame->at_reference && (frame->braces == frame->at_reference_braces + 1)) { frame->current = frame->parent = frame->at_reference; frame->at_reference = NULL; @@ -2887,6 +2888,7 @@ alloc_section: return -1; } frame->at_reference = frame->parent; + frame->at_reference_braces = frame->braces; name2_token = T_BARE_WORD; css = cf_section_alloc(parent, parent, value, NULL);