mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 14:50:59 +01:00
BUG/MINOR: vars: fix set-var/unset-var exclusivity in the keyword parser
The parser checks first for "set-var" then "unset-var" from the updated
offset instead of testing it only when the other one fails, so it
validates this rule as "unset-var":
http-request set-varunset-var(proc.a)
This should be backported everywhere relevant, though it's mostly harmless
as it's unlikely that some users are purposely writing this in their conf!
This commit is contained in:
parent
30ee2965b6
commit
2819210a83
@ -736,11 +736,11 @@ static enum act_parse_ret parse_store(const char **args, int *arg, struct proxy
|
|||||||
const char *kw_name;
|
const char *kw_name;
|
||||||
int flags, set_var = 0;
|
int flags, set_var = 0;
|
||||||
|
|
||||||
if (!strncmp(var_name, "set-var", 7)) {
|
if (strncmp(var_name, "set-var", 7) == 0) {
|
||||||
var_name += 7;
|
var_name += 7;
|
||||||
set_var = 1;
|
set_var = 1;
|
||||||
}
|
}
|
||||||
if (!strncmp(var_name, "unset-var", 9)) {
|
else if (strncmp(var_name, "unset-var", 9) == 0) {
|
||||||
var_name += 9;
|
var_name += 9;
|
||||||
set_var = 0;
|
set_var = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user