From: Alan T. DeKok Date: Sat, 20 Feb 2021 12:10:28 +0000 (-0500) Subject: push the SUB section rules, not the PARENT section rules X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f5c487a0180689167ed54a0edbfc485160ac2a7;p=thirdparty%2Ffreeradius-server.git push the SUB section rules, not the PARENT section rules This bug has been the bane of my existence for quite a while now. --- diff --git a/src/lib/server/cf_util.c b/src/lib/server/cf_util.c index b693c69c004..27340b43bee 100644 --- a/src/lib/server/cf_util.c +++ b/src/lib/server/cf_util.c @@ -796,15 +796,16 @@ CONF_SECTION *_cf_section_alloc(TALLOC_CTX *ctx, CONF_SECTION *parent, /* * Or, the parent may already have parse rules - * for this new child. In which case we run - * those rules. + * for this new child. In which case we push the + * child rules for this section, and then do the + * on_read callback. */ cd = cf_data_find(CF_TO_ITEM(parent), CONF_PARSER, name1); if (cd) { rule = cf_data_value(cd); if ((FR_BASE_TYPE(rule->type) == FR_TYPE_SUBSECTION) && rule->on_read) { - if (cf_section_rules_push(cs, rule) < 0) goto error; + if (cf_section_rules_push(cs, rule->subcs) < 0) goto error; if (rule->on_read(ctx, NULL, NULL, cf_section_to_item(cs), rule) < 0) goto error; } }