From 11ef149e721974503a36872d7b2bea0b975f4d98 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 6 Apr 2020 07:49:19 +0200 Subject: [PATCH] BUG/MINOR: checks: Forbid tcp-check lines in default section as documented --- src/cfgparse-listen.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; -- 2.47.3