From b7ae5aa9839f6b4e7ea65354559154ab52aac209 Mon Sep 17 00:00:00 2001 From: Jacques Grove Date: Tue, 7 Apr 2020 18:32:53 -0700 Subject: [PATCH] Implement #6029 by chomping trailing newlines in -topo_zk_auth_file Potential breaking change if your passwords have trailing newlines. Signed-off-by: Jacques Grove --- go/vt/topo/zk2topo/zk_conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/topo/zk2topo/zk_conn.go b/go/vt/topo/zk2topo/zk_conn.go index f4dd9404f5b..7936c6f77c9 100644 --- a/go/vt/topo/zk2topo/zk_conn.go +++ b/go/vt/topo/zk2topo/zk_conn.go @@ -295,7 +295,7 @@ func (c *ZkConn) maybeAddAuth(ctx context.Context) { log.Errorf("failed to read topo_zk_auth_file: %v", err) return } - authInfo := string(authInfoBytes) + authInfo := strings.TrimRight(string(authInfoBytes), "\n") authInfoParts := strings.SplitN(authInfo, ":", 2) if len(authInfoParts) != 2 { log.Errorf("failed to parse topo_zk_auth_file contents, expected format : but saw: %s", authInfo)