From 6704f23d5802e8cd7f72ca94c63ab5bbc1004a92 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 7 Feb 2018 23:19:43 -0500 Subject: [PATCH] set +x around sensitive code docker login code Call `set +x` as a guard just in case a script elsewhere is calling `set -x` which could cause the credentials to print to console. Change-Id: I6802887c7a3c9809d9d13d6b3cc90e3570f120fc Signed-off-by: Thanh Ha --- shell/docker-login.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/shell/docker-login.sh b/shell/docker-login.sh index 6613118e..92da7e0d 100644 --- a/shell/docker-login.sh +++ b/shell/docker-login.sh @@ -35,6 +35,7 @@ set -eu -o pipefail # Execute the credential lookup and login to the registry do_login() { + set +x # Ensure that no other scripts add `set -x` and print passwords echo "$1" CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \ -t -m "/x:settings/x:servers/x:server[starts-with(x:id, '${1}')]" \ -- 2.16.6