]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: cfgparse-listen: don't lose the errors reported while creating a proxy
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2026 14:37:58 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:22:33 +0000 (09:22 +0200)
commit37e580199be819d966d172c051505fdc14fc36ca
tree61edb81338cb0bebd43cc15e1a671776f88aa373
parent405848889ab758eea46ff19f890e7b4ad7234a84
BUG/MINOR: cfgparse-listen: don't lose the errors reported while creating a proxy

When a proxy inherits from its defaults section, the return value of
proxy_ref_defaults() was assigned to err_code instead of being ORed
into it, wiping all the errors collected earlier for that line. As a
result an invalid character in a proxy's name was reported but the
process started anyway:

  $ cat inv.cfg
  defaults
      mode http
  frontend inv@lid
      bind :8080
  $ ./haproxy -c -f inv.cfg
  [ALERT] : parsing [inv.cfg:3] : character '@' is not permitted in
    'frontend' name 'inv@lid'.
  $ echo 0
  0

The same applies to the duplicate name and ambiguous defaults reference
diagnostics emitted before the proxy is created.

Configurations which were mistakenly accepted until will now be rejected,
though they were already emitting an alert. The issue was only introduced
in 3.4 with commit 87ea407cce ("MINOR: proxy: refactor proxy inheritance
of a defaults section"), so it's fairly unlikely that a bogus configuration
was introduced only there, thus a backport would be preferable, or maybe
only the err_code should be turned to ERR_WARN to remain tolerant for
existing versions.
src/cfgparse-listen.c