BUG/MINOR: cli: don't show sockpairs in HAPROXY_CLI and HAPROXY_MASTER_CLI
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 12 Nov 2024 21:43:49 +0000 (22:43 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Nov 2024 09:59:22 +0000 (10:59 +0100)
commite771877f826f8020d6f5cc96dd33cae2a0534879
tree3b6bb5fbcc64e89f8daf0dcaf26e5425f454c9fc
parent51a13e690513cfdeb5372e50ee62f3b1d61ecc6f
BUG/MINOR: cli: don't show sockpairs in HAPROXY_CLI and HAPROXY_MASTER_CLI

Before this fix, HAPROXY_CLI and HAPROXY_MASTER_CLI have contained along with
CLI sockets addresses internal sockpairs, which are used only for master CLI
(reload sockpair and sockpair shared with a worker process). These internal
sockpairs are always need to be hidden.

At the moment there is no any client, who uses sockpair addresses for the
stats listener or in order to connect to master CLI. So, let's simply not copy
these internal sockpair addresses of MASTER and GLOBAL proxy listeners.

As listeners with sockpairs are skipped and they can be presented in the
listeners list in any order, let's add semicolon separator between addresses
only in the case, when there are already some string saved in the trash and we
are sure, that we are adding a new address to it. Otherwise, we could have such
weird output:

HAPROXY_MASTER_CLI=unix@/tmp/mcli.sock;;

This fix is need to be backported in all stable versions.

(cherry picked from commit 113745e6f0c0ef8fe89e89fdfdcc6ed994889d4a)
[cf: ctx adjt]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cli.c