BUG/MINOR: cli: cli_snd_buf: preserve \r\n for payload lines
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Thu, 12 Dec 2024 18:38:38 +0000 (19:38 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 6 Jan 2025 10:19:06 +0000 (11:19 +0100)
commit09ac38f57bb773a05cb4947e85d9adb93856d8b2
tree33a48e437aff887b96ddd13e13e86c7a03bdf54c
parent1856ca71819a254e6cab8f6fa59ab3d515b5ea43
BUG/MINOR: cli: cli_snd_buf: preserve \r\n for payload lines

cli_snd_buf() analyzez input line by line. Before this patch it has always
scanned a given line for the presence of '\r' followed by '\n'.

This is only needed for strings, that contain the commands itself like
"show ssl cert\n", "set ssl cert test.pem <<\n".

In case of strings, which contain the command's payload, like
"-----BEGIN CERTIFICATE-----\r\n", '\r\n' should be preserved
as is.

This patch fixes the GitHub issue #2818.

This patch should be backported in v3.1 and in v3.0.

(cherry picked from commit d60c893991699af1103bcdcd33c915885c056559)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cli.c