From: Alan T. DeKok Date: Fri, 5 Aug 2022 13:04:38 +0000 (-0400) Subject: better errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b38e7b4e7254912d6b0da753dddd9417694cafc4;p=thirdparty%2Ffreeradius-server.git better errors foo.bar = baz results in the config file parser creating foo { bar = baz } We should likely forbid that in the parser. But for now, a better error here is useful --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index ec5156c5bd9..bfc116dd5c6 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -798,6 +798,11 @@ do_children: subcs = cf_item_to_section(ci); token = cf_section_name2_quote(subcs); + if (token == T_INVALID) { + cf_log_err(ci, "Section '%s { ... }' is missing the '=' operator", cf_section_name1(subcs)); + goto error; + } + if (!fr_assignment_op[token]) { cf_log_err(ci, "Invalid operator '%s'", fr_tokens[token]); goto error;