From: Alan T. DeKok Date: Wed, 5 Aug 2020 18:11:04 +0000 (-0400) Subject: print policies as "policy foo" instead of just "foo" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa91a4e5e95e619fcd49e121b27571f25e6acf05;p=thirdparty%2Ffreeradius-server.git print policies as "policy foo" instead of just "foo" --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 376f8b1f3e6..c8fe7759230 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -2044,8 +2044,16 @@ static unlang_t *compile_section(unlang_t *parent, unlang_compile_t *unlang_ctx, name2 = cf_section_name2(cs); c->name = name1; - if (!name2) { + /* + * Make sure to tell the user that we're running a + * policy, and not anything else. + */ + if (mod_type == UNLANG_TYPE_POLICY) { + MEM(c->debug_name = talloc_typed_asprintf(c, "policy %s", name1)); + + else if (!name2) { c->debug_name = c->name; + } else { MEM(c->debug_name = talloc_typed_asprintf(c, "%s %s", name1, name2)); }