From: Tim Duesterhus Date: Tue, 18 Aug 2020 20:00:04 +0000 (+0200) Subject: MEDIUM: cfgparse: Emit hard error on truncated lines X-Git-Tag: v2.3-dev4~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f92afb732b50b5390d2a3307e7e3b7cfba1bf819;p=thirdparty%2Fhaproxy.git MEDIUM: cfgparse: Emit hard error on truncated lines As announced within the emitted log message this is going to become a hard error in 2.3. It's 2.3 time now, let's do this. see 2fd5bdb439da29f15381aeb57c51327ba57674fc --- diff --git a/src/cfgparse.c b/src/cfgparse.c index de82a9fd3e..17db1fcae3 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1876,11 +1876,11 @@ next_line: char *line = thisline; if (missing_lf != -1) { - ha_warning("parsing [%s:%d]: Stray NUL character at position %d. " - "This will become a hard error in HAProxy 2.3.\n", - file, linenum, (missing_lf + 1)); - err_code |= ERR_WARN; + ha_alert("parsing [%s:%d]: Stray NUL character at position %d.\n", + file, linenum, (missing_lf + 1)); + err_code |= ERR_ALERT | ERR_FATAL; missing_lf = -1; + break; } linenum++; @@ -2086,10 +2086,9 @@ next_line: } if (missing_lf != -1) { - ha_warning("parsing [%s:%d]: Missing LF on last line, file might have been truncated at position %d. " - "This will become a hard error in HAProxy 2.3.\n", - file, linenum, (missing_lf + 1)); - err_code |= ERR_WARN; + ha_alert("parsing [%s:%d]: Missing LF on last line, file might have been truncated at position %d.\n", + file, linenum, (missing_lf + 1)); + err_code |= ERR_ALERT | ERR_FATAL; } if (cs && cs->post_section_parser)