]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
warn on "switch attribute" without "switch &attribute"
authorAlan T. DeKok <aland@freeradius.org>
Fri, 27 Aug 2021 22:07:33 +0000 (18:07 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 27 Aug 2021 22:07:33 +0000 (18:07 -0400)
src/main/modcall.c

index 839f5b09e73e2ab37cd60fb6bb4a1c2f6e8fe60a..aa6abf8fbf54432dd80fd990c13b85ef90e5cf9d 100644 (file)
@@ -1812,6 +1812,14 @@ static modcallable *do_compile_modswitch (modcallable *parent, rlm_components_t
                return NULL;
        }
 
+       /*
+        *      Warn about confusing things.
+        */
+       if ((vpt->type == TMPL_TYPE_ATTR) && (*name2 != '&')) {
+               WARN("%s[%d]: Please change \"switch %s\" to \"switch &%s\"",
+                    cf_section_filename(cs), cf_section_lineno(cs),
+                    name2, name2);
+       }
 
        /*
         *      Walk through the children of the switch section,