From 2b30330cdcce4b3fd3648b480b0063ab167df054 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 28 Apr 2026 03:24:07 +0200 Subject: [PATCH] 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. --- src/vars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vars.c b/src/vars.c index c8a08b5d5..ea7822770 100644 --- a/src/vars.c +++ b/src/vars.c @@ -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. */