]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
print policies as "policy foo" instead of just "foo"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 5 Aug 2020 18:11:04 +0000 (14:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 5 Aug 2020 18:11:31 +0000 (14:11 -0400)
src/lib/unlang/compile.c

index 376f8b1f3e62f850703ef3070dc830096bca746a..c8fe775923077e48e3f15d01169b8fd824306ca8 100644 (file)
@@ -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));
        }