]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check the right parent
authorAlan T. DeKok <aland@freeradius.org>
Wed, 11 Sep 2024 13:27:57 +0000 (09:27 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 11 Sep 2024 20:48:37 +0000 (16:48 -0400)
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

src/lib/unlang/compile.c

index 48949f6279de5bb24417115e3df5e56655f4eeac..7648252ceed80ae18edcee6fc51714ca4ed438b1 100644 (file)
@@ -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);
 
        /*