From: Alan T. DeKok Date: Wed, 11 Sep 2024 13:27:57 +0000 (-0400) Subject: check the right parent X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0bde65e2511e53140703694d6cac33a044e2f69;p=thirdparty%2Ffreeradius-server.git check the right parent the outer parent_map is taken from starting to parse the section. map_afrom_cs() will parse multiple child sections, and call the validation function for each one. But will only pass the top-level parent_map. So fixup the ref to use the actual parent when there are multiple levels --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 48949f6279d..7648252ceed 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -1298,6 +1298,11 @@ static int unlang_fixup_edit(map_t *map, void *ctx) return -1; } + /* + * map_afrom_cs() will build its tree recursively, and call us for each child map. + */ + if (map->parent && (map->parent != parent_map)) parent_map = map->parent; + parent = tmpl_attr_tail_da(parent_map->lhs); /*