]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: config: use a copy of the file name in proxy configurations
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 06:01:43 +0000 (08:01 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Oct 2012 06:13:32 +0000 (08:13 +0200)
commit8113a5d78f2d2abe942f88a3a4df9f8bb5e535ba
tree75c1e1d2fd2756cf8b5718ee6bc3d1c52bf88eb9
parentd1a33e35fb33b990217ae0652cbc6b322e49d31b
BUG/MINOR: config: use a copy of the file name in proxy configurations

Each proxy contains a reference to the original config file and line
number where it was declared. The pointer used is just a reference to
the one passed to the function instead of being duplicated. The effect
is that it is not valid anymore at the end of the parsing and that all
proxies will be enumerated as coming from the same file on some late
configuration errors. This may happen for exmaple when reporting SSL
certificate issues.

By copying using strdup(), we avoid this issue.

1.4 has the same issue, though no report of the proxy file name is done
out of the config section. Anyway a backport is recommended to ease
post-mortem analysis.
include/types/proxy.h
src/cfgparse.c
src/haproxy.c