From: Christopher Faulet Date: Mon, 6 Apr 2020 05:49:19 +0000 (+0200) Subject: BUG/MINOR: checks: Forbid tcp-check lines in default section as documented X-Git-Tag: v2.2-dev7~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11ef149e721974503a36872d7b2bea0b975f4d98;p=thirdparty%2Fhaproxy.git BUG/MINOR: checks: Forbid tcp-check lines in default section as documented --- diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index fbefdd5aa2..4117ea9b68 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -3019,6 +3019,13 @@ stats_error_parsing: if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL)) err_code |= ERR_WARN; + if (curproxy == &defproxy) { + ha_alert("parsing [%s:%d]: '%s' not allowed in 'defaults' section.\n", + file, linenum, args[0]); + err_code |= ERR_ALERT | ERR_FATAL; + goto out; + } + if (strcmp(args[1], "comment") == 0) { int cur_arg; struct tcpcheck_rule *tcpcheck;