mirror of
https://github.com/rancher/os.git
synced 2025-06-24 14:01:34 +00:00
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.
This commit is contained in:
parent
8d7f7199c9
commit
41b562c01f
@ -182,7 +182,7 @@ func consoleInitFunc() error {
|
|||||||
proxyLines := []string{}
|
proxyLines := []string{}
|
||||||
for _, k := range []string{"http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY", "no_proxy", "NO_PROXY"} {
|
for _, k := range []string{"http_proxy", "HTTP_PROXY", "https_proxy", "HTTPS_PROXY", "no_proxy", "NO_PROXY"} {
|
||||||
if v, ok := cfg.Rancher.Environment[k]; ok {
|
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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user