]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: Add an anonymization on a missed element in 'show server state'
authorErwan Le Goas <elegoas@haproxy.com>
Thu, 29 Sep 2022 08:28:44 +0000 (10:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 29 Sep 2022 08:53:14 +0000 (10:53 +0200)
Add HA_ANON_CLI to the srv->hostname when using 'show servers state'.
It can contain sensitive information like 'www....com'

No backport needed, except if anonymization mechanism is backported.

src/proxy.c

index 6d59c838d41386ed673f63b34b11291475984a31..12125dd7f853d25865f0ce7fb554cab034885ed8 100644 (file)
@@ -2796,7 +2796,8 @@ static int dump_servers_state(struct stconn *sc)
                                     (long int)srv_time_since_last_change,
                                     srv->check.status, srv->check.result, srv->check.health,
                                     srv->check.state, srv->agent.state,
-                                    bk_f_forced_id, srv_f_forced_id, srv->hostname ? srv->hostname : "-", srv->svc_port,
+                                    bk_f_forced_id, srv_f_forced_id,
+                                    srv->hostname ? HA_ANON_CLI(srv->hostname) : "-", srv->svc_port,
                                     srvrecord ? srvrecord : "-", srv->use_ssl, srv->check.port,
                                     srv_check_addr, srv_agent_addr, srv->agent.port);
                } else {