]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: stats: revert the change on ST_CONVDONE
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 10:49:25 +0000 (11:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Feb 2021 15:23:45 +0000 (16:23 +0100)
commit5bbc676608f654ae76c7a4cc5852a443bfe8bd41
treea944ec824a838d7fc6d137bce8a0ff9313a39c87
parent937c3ead34becd6851572a8280831d760f612a09
BUG/MINOR: stats: revert the change on ST_CONVDONE

In 2.1, commit ee4f5f83d ("MINOR: stats: get rid of the ST_CONVDONE flag")
introduced a subtle bug. By testing curproxy against defproxy in
check_config_validity(), it tried to eliminate the need for a flag
to indicate that stats authentication rules were already compiled,
but by doing so it left the issue opened for the case where a new
defaults section appears after the two proxies sharing the first
one:

      defaults
          mode http
          stats auth foo:bar

      listen l1
          bind :8080

      listen l2
          bind :8181

      defaults
          # just to break above

This config results in:
  [ALERT] 042/113725 (3121) : proxy 'f2': stats 'auth'/'realm' and 'http-request' can't be used at the same time.
  [ALERT] 042/113725 (3121) : Fatal errors found in configuration.

Removing the last defaults remains OK. It turns out that the cleanups
that followed that patch render it useless, so the best fix is to revert
the change (with the up-to-date flags instead). The flag was marked as
belonging to the config. It's not exact but it's the closest to the
reality, as it's not there to configure the behavior but ti mention
that the config parser did its job.

This could be backported as far as 2.1, but in practice it looks like
nobody ever hit it.
include/haproxy/stats-t.h
src/cfgparse.c