]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: log: keep the ref in dup_logger()
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 13 Nov 2023 09:19:12 +0000 (10:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 13 Nov 2023 10:06:05 +0000 (11:06 +0100)
commit76acde91076760d760c6384fb2df7a061055e9e6
treed12ea86361ef1de25148bc94b1b737dcd67b0743
parent33a1fc883ae5e99f60f79331adf0f741a37c0295
BUG/MINOR: log: keep the ref in dup_logger()

This bug was introduced with 969e212 ("MINOR: log: add dup_logsrv() helper
function")

When duplicating an existing log entry, we must take care to inherit from
its original ->ref if it is set, because not doing so would make 28ac0999
("MINOR: log: Keep the ref when a log server is copied to avoid duplicate entries")
ineffective given that global log directives will lose their original
reference when duplicated resursively (at least twice), which is what
happens when global log directives are first inherited to defaults which
are then inherited to a regular proxy at the end of the chain.

This can be easily reproduced using the following configuration:

   |global
   |  log stdout format raw local0
   |
   |defaults
   |  log global
   |
   |frontend test
   |  log global
   |  ...

Logs from "test" proxy will be duplicated because test incorrectly
inherited from global "log" directives twice, which 28ac0999 would
normally detect and prevent.

No backport needed unless 969e212 gets backported.
src/log.c