mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-27 05:18:00 +00:00
[BUG] config: tcp-request content only accepts "if" or "unless"
As reported by Maik Broemme, if something different from "if" or "unless" was specified after "tcp-request content accept", the condition would silently remain void. The parser must obviously complain since this typically corresponds to a forgotten "if".
This commit is contained in:
parent
7154365cc6
commit
606ad73e73
@ -591,10 +591,18 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
|
|||||||
pol = ACL_COND_NONE;
|
pol = ACL_COND_NONE;
|
||||||
cond = NULL;
|
cond = NULL;
|
||||||
|
|
||||||
if (!strcmp(args[3], "if"))
|
if (!*args[3])
|
||||||
|
pol = ACL_COND_NONE;
|
||||||
|
else if (!strcmp(args[3], "if"))
|
||||||
pol = ACL_COND_IF;
|
pol = ACL_COND_IF;
|
||||||
else if (!strcmp(args[3], "unless"))
|
else if (!strcmp(args[3], "unless"))
|
||||||
pol = ACL_COND_UNLESS;
|
pol = ACL_COND_UNLESS;
|
||||||
|
else {
|
||||||
|
retlen = snprintf(err, errlen,
|
||||||
|
"'%s %s %s' only accepts 'if' or 'unless', in %s '%s' (was '%s')",
|
||||||
|
args[0], args[1], args[2], proxy_type_str(curpx), curpx->id, args[3]);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/* Note: we consider "if TRUE" when there is no condition */
|
/* Note: we consider "if TRUE" when there is no condition */
|
||||||
if (pol != ACL_COND_NONE &&
|
if (pol != ACL_COND_NONE &&
|
||||||
|
Loading…
Reference in New Issue
Block a user