From: Willy Tarreau Date: Thu, 6 May 2021 06:48:09 +0000 (+0200) Subject: BUG/MINOR: config: add a missing "ELIF_TAKE" test for ".elif" condition evaluator X-Git-Tag: v2.4-dev19~121 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f67ff020720dc403fcf65b0b2807b27a215c42cf;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: add a missing "ELIF_TAKE" test for ".elif" condition evaluator This missing state was causing a second elif condition to be evaluated after a first one succeeded after a .if failed. For example in the test below the else would be executed: .if 0 .elif 1 .elif 0 .else .endif No backport is needed, this is 2.4-only. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 13362214c0..b6145fc8a5 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -1891,6 +1891,7 @@ next_line: if (nested_conds[nested_cond_lvl] == NESTED_COND_IF_TAKE || nested_conds[nested_cond_lvl] == NESTED_COND_IF_SKIP || + nested_conds[nested_cond_lvl] == NESTED_COND_ELIF_TAKE || nested_conds[nested_cond_lvl] == NESTED_COND_ELIF_SKIP) { nested_conds[nested_cond_lvl] = NESTED_COND_ELIF_SKIP; } else if (!*args[1] || *args[1] == '0') {