]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: trace: stop rewriting argv with -dt
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 29 Oct 2024 09:50:27 +0000 (10:50 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 29 Oct 2024 10:01:47 +0000 (11:01 +0100)
commit596db3ef86844617565a0b4b4ce8358fe6537d87
tree50914935b1efe2a542dca677f8c66d391c75f39d
parente240be549509c3f68e6963862ed4e035c26ad536
BUG/MINOR: trace: stop rewriting argv with -dt

When using trace with -dt, the trace_parse_cmd() function is doing a
strtok which write \0 into the argv string.

When using the mworker mode, and reloading, argv was modified and the
trace won't work anymore because the first : is replaced by a '\0'.

This patch fixes the issue by allocating a temporary string so we don't
modify the source string directly. It also replace strtok by its
reentrant version strtok_r.

Must be backported as far as 2.9.
include/haproxy/trace.h
src/trace.c