From: Alan T. DeKok Date: Thu, 21 Nov 2024 18:54:55 +0000 (-0500) Subject: better error messages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa7b671dee2cc662c4a7a51d1b1e37840d9093c5;p=thirdparty%2Ffreeradius-server.git better error messages If I run into a problem because of a typo, and the error message isn't clear enough to me, then it should be clarified for others, too --- diff --git a/src/lib/server/cf_file.c b/src/lib/server/cf_file.c index bb97a55113b..06385100d4a 100644 --- a/src/lib/server/cf_file.c +++ b/src/lib/server/cf_file.c @@ -2559,7 +2559,15 @@ check_for_eol: */ parse_name2: if (!(isalpha((uint8_t) *ptr) || isdigit((uint8_t) *ptr) || (*(uint8_t const *) ptr >= 0x80))) { - return parse_error(stack, ptr, "Invalid second name for configuration section"); + /* + * Maybe they missed a closing brace somewhere? + */ + name2_token = gettoken(&ptr, buff[2], stack->bufsize, false); /* can't be EOL */ + if (fr_assignment_op[name2_token]) { + return parse_error(stack, ptr2, "Unexpected operator, was expecting a configuration section. Is there a missing '}' somewhere?"); + } + + return parse_error(stack, ptr2, "Invalid second name for configuration section"); } name2_token = gettoken(&ptr, buff[2], stack->bufsize, false); /* can't be EOL */