From 41b562c01f9cbac89a8bce9421973f5d596d35e4 Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Tue, 28 May 2019 15:03:32 +0800 Subject: [PATCH] Use double-quoted string for writing proxy.sh Presence of special characters (i.e. &) in proxy environment values causes generation of an invalid /etc/profile.d/proxy.sh file. This is a problem due to the common inclusion of special characters in passwords and proxy strings of the format htt[p|s]://user:pass@url:port. --- cmd/control/console_init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/control/console_init.go b/cmd/control/console_init.go index e070d785..5cbf5b33 100644 --- a/cmd/control/console_init.go +++ b/cmd/control/console_init.go @@ -182,7 +182,7 @@ func consoleInitFunc() error { proxyLines := []string{} for _, k := range []string{"http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY", "no_proxy", "NO_PROXY"} { if v, ok := cfg.Rancher.Environment[k]; ok { - proxyLines = append(proxyLines, fmt.Sprintf("export %s=%s", k, v)) + proxyLines = append(proxyLines, fmt.Sprintf("export %s=%q", k, v)) } }