]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
push the SUB section rules, not the PARENT section rules
authorAlan T. DeKok <aland@freeradius.org>
Sat, 20 Feb 2021 12:10:28 +0000 (07:10 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 20 Feb 2021 12:10:28 +0000 (07:10 -0500)
This bug has been the bane of my existence for quite a while now.

src/lib/server/cf_util.c

index b693c69c004a65b0dc5e8be47548a297124c9ef2..27340b43bee8cbba4f7fb55b729edbfb28eb72c8 100644 (file)
@@ -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;
                        }
                }