BUG/MEDIUM: sample: Cumulate frontend and backend sample validity flags
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Oct 2021 15:22:17 +0000 (17:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Nov 2021 15:34:06 +0000 (16:34 +0100)
commit5793af79182af4bfefeb9918659374b469228d4e
treeb3c8754763f0661c396dabe27c0532bd156365f0
parentf2846f7377130573523e697a5ca0a557f73e4ef3
BUG/MEDIUM: sample: Cumulate frontend and backend sample validity flags

When the sample validity flags are computed to check if a sample is used in
a valid scope, the flags depending on the proxy capabilities must be
cumulated. Historically, for a sample on the request, only the frontend
capability was used to set the sample validity flags while for a sample on
the response only the backend was used. But it is a problem for listen or
defaults proxies. For those proxies, all frontend and backend samples should
be valid. However, at many place, only frontend ones are possible.

For instance, it is impossible to set the backend name (be_name) into a
variable from a listen proxy.

This bug exists on all stable versions. Thus this patch should probably be
backported. But with some caution because the code has probably changed
serveral times. Note that nobody has ever noticed this issue. So the need to
backport this patch must be evaluated for each branch.

(cherry picked from commit 7a06ffb854281a08dae8dc2c13669a3a43da1065)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 5f802b319f8b981d57af0e38a45a98bc23516bdc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cfgparse-listen.c
src/cfgparse.c
src/http_act.c
src/http_htx.c
src/http_rules.c
src/vars.c