BUG/MEDIUM: config: reject anything but "if" or "unless" after a use-backend rule
authorWilly Tarreau <w@1wt.eu>
Tue, 28 Feb 2017 08:34:39 +0000 (09:34 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 28 Feb 2017 08:34:39 +0000 (09:34 +0100)
commit4f86264bae1e8bec4bf0f0596975597f6fec48ef
treea439269f84bc1ff28d4d20790cb665e38a1cf996
parent7d388635526cffa79f4a62906f17afa5990f6092
BUG/MEDIUM: config: reject anything but "if" or "unless" after a use-backend rule

Adrian Fitzpatrick reported that since commit f51658d ("MEDIUM: config:
relax use_backend check to make the condition optional"), typos like "of"
instead of "if" on use_backend rules are not properly detected. The reason
is that the parser only checks for "if" or "unless" otherwise it considers
there's no keyword, making the rule inconditional.

This patch fixes it. It may reveal some rare config bugs for some people,
but will not affect valid configurations.

This fix must be backported to 1.7, 1.6 and 1.5.
src/cfgparse.c