From: Alan T. DeKok Date: Fri, 27 Aug 2021 22:07:33 +0000 (-0400) Subject: warn on "switch attribute" without "switch &attribute" X-Git-Tag: release_3_0_24~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8257cb406470cb258cbcfd9c2baba63267bde8a;p=thirdparty%2Ffreeradius-server.git warn on "switch attribute" without "switch &attribute" --- diff --git a/src/main/modcall.c b/src/main/modcall.c index 839f5b09e7..aa6abf8fbf 100644 --- a/src/main/modcall.c +++ b/src/main/modcall.c @@ -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,