From: Willy Tarreau Date: Fri, 25 Apr 2025 06:43:48 +0000 (+0200) Subject: Revert "BUG/MINOR: master/cli: properly trim the '@@' process name in error messages" X-Git-Tag: v3.2-dev12~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=931d932b3e8b762f69a9b779e858fe29a0712298;p=thirdparty%2Fhaproxy.git Revert "BUG/MINOR: master/cli: properly trim the '@@' process name in error messages" This reverts commit 0e94339eaf1c8423132debb6b1b485d8bb1bb7da. This patch was in fact fixing the symptom, not the cause. The root cause of the problem is that the parser was processing an incomplete line when looking for '@@'. When the LF is present, this problem does not exist as it's properly replaced with a zero. This can be verified using socat in raw mode: socat /tmp/master.sock STDIO,raw,echo=0 Then entering "@@1 show info" one character at a time will immediately fail on "@@" without going further. A subsequent patch will fix this. No backport is needed. --- diff --git a/src/cli.c b/src/cli.c index f9b65d66f..a64c2f448 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2937,7 +2937,7 @@ int pcli_find_bidir_prefix(struct stream *s, struct channel *req, char **str, co target_pid = pcli_prefix_to_pid(pid_str + 1); if (target_pid == -1) { - memprintf(errmsg, "Can't find the target PID matching the prefix '%.*s'\n", (int)(p - pid_str), pid_str); + memprintf(errmsg, "Can't find the target PID matching the prefix '%s'\n", pid_str); ret = -1; goto leave; }