From: Alan T. DeKok Date: Thu, 10 Oct 2019 17:01:36 +0000 (-0400) Subject: set name / debug_name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c3fad8740fe6cdfa6e6a43e110f55da676a1e1bb;p=thirdparty%2Ffreeradius-server.git set name / debug_name --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index ef1351f0227..865ae8e6e84 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -2107,9 +2107,10 @@ static unlang_t *compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, { CONF_ITEM *ci; FR_TOKEN type; - char const *name2; + char const *name1, *name2; bool had_seen_default = false; unlang_group_t *g; + unlang_t *c; ssize_t slen; vp_tmpl_rules_t parse_rules; @@ -2136,6 +2137,9 @@ static unlang_t *compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, /* * Create the template. All attributes and xlats are * defined by now. + * + * The 'case' statements need g->vpt filled out to ensure + * that the data types match. */ type = cf_section_name2_quote(cs); slen = tmpl_afrom_str(g, &g->vpt, name2, strlen(name2), type, &parse_rules, true); @@ -2163,7 +2167,6 @@ static unlang_t *compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, ci != NULL; ci = cf_item_next(cs, ci)) { CONF_SECTION *subcs; - char const *name1; if (!cf_item_is_section(ci)) { if (!cf_item_is_pair(ci)) continue; @@ -2195,6 +2198,10 @@ static unlang_t *compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, } } + c = unlang_group_to_generic(g); + c->name = "switch"; + c->debug_name = talloc_typed_asprintf(c, "switch %s", cf_section_name2(cs)); + /* * Fixup the template before compiling the children. * This is so that compile_case() can do attribute type @@ -3013,6 +3020,9 @@ static unlang_t *compile_subrequest(unlang_t *parent, unlang_compile_t *unlang_c c = compile_children(g, parent, &unlang_ctx2); if (!c) return NULL; + c->name = "subrequest"; + c->debug_name = talloc_typed_asprintf(c, "subrequest %s", cf_section_name2(cs)); + g->dict = dict; g->attr_packet_type = da; g->type_enum = type_enum;