From b8257cb406470cb258cbcfd9c2baba63267bde8a Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 27 Aug 2021 18:07:33 -0400 Subject: [PATCH] warn on "switch attribute" without "switch &attribute" --- src/main/modcall.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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, -- 2.47.2