]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Silently skip empty subgroups
authorAlan T. DeKok <aland@freeradius.org>
Mon, 30 Sep 2013 19:57:32 +0000 (15:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 30 Sep 2013 19:59:28 +0000 (15:59 -0400)
src/main/modcall.c

index ca958a232bb84754bac4b279c11baa6640ef1131..44d9c868a65f7a8c13b72e6d8775ebede74131e2 100644 (file)
@@ -739,6 +739,19 @@ redo:
        do_children:
                g = mod_callabletogroup(c);
 
+               /*
+                *      This should really have been caught in the
+                *      compiler, and the node never generated.  But
+                *      doing that requires changing it's API so that
+                *      it returns a flag instead of the compiled
+                *      MOD_GROUP.
+                */
+               if (!g->children) {
+                       RDEBUG2("%.*s%s %s { ... } # empty sub-section is ignored",
+                               depth + 1, modcall_spaces, cf_section_name1(g->cs), c->name);
+                       goto next_sibling;
+               }
+
                MOD_LOG_OPEN_BRACE(cf_section_name1(g->cs));
                modcall_child(request, component,
                              depth + 1, entry, g->children,