mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-01 19:20:59 +02:00
BUG/MINOR: vars: make parse_store() return error on var_set() failure
In 2.5, variables in the scope "proc" were pre-created with commit
df8eeb1619 ("MEDIUM: vars: pre-create parsed SCOPE_PROC variables as
permanent ones"). However one test on var_set() was copy-pasted from
vars_check_args() into parse_store(), and the former returns 0 on
error while for the latter it's a success. This means that some errors
on variables of scope "proc" (typically alloc failure) can be missed
at boot time, probably either making that variable invisible or causing
a crash during boot.
Let's return ACT_RET_PRS_ERR instead. This can be backported.
This commit is contained in:
parent
64e5489864
commit
2b30330cdc
@ -1271,7 +1271,7 @@ static enum act_parse_ret parse_store(const char **args, int *arg, struct proxy
|
||||
|
||||
if (rule->arg.vars.desc.scope == SCOPE_PROC &&
|
||||
!var_set(&rule->arg.vars.desc, &empty_smp, VF_CREATEONLY|VF_PERMANENT))
|
||||
return 0;
|
||||
return ACT_RET_PRS_ERR;
|
||||
|
||||
/* There is no fetch method when variable is unset. Just set the right
|
||||
* action and return. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user