From c2bd15fc74dd426805ae2c8777d1d6c9f28b8b2e Mon Sep 17 00:00:00 2001 From: Rafael Fonseca Date: Fri, 26 Apr 2024 10:00:31 +0200 Subject: [PATCH] OCPBUGS-33024: agent: escape '%' in proxy settings The 'DefaultEnvironment' config from systemd accepts some % specifiers for expansion [1]. Because of that, proxy configurations that make use of that character need to be escaped with another '%'. [1] https://man7.org/linux/man-pages/man5/systemd-system.conf.5.html --- .../etc/systemd/system.conf.d/10-default-env.conf.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/data/agent/files/etc/systemd/system.conf.d/10-default-env.conf.template b/data/data/agent/files/etc/systemd/system.conf.d/10-default-env.conf.template index ca543da071a..3ef52c1241e 100644 --- a/data/data/agent/files/etc/systemd/system.conf.d/10-default-env.conf.template +++ b/data/data/agent/files/etc/systemd/system.conf.d/10-default-env.conf.template @@ -1,12 +1,12 @@ {{if .Proxy -}} [Manager] {{if .Proxy.HTTPProxy -}} -DefaultEnvironment=HTTP_PROXY="{{.Proxy.HTTPProxy}}" +DefaultEnvironment=HTTP_PROXY="{{replace .Proxy.HTTPProxy "%" "%%"}}" {{end -}} {{if .Proxy.HTTPSProxy -}} -DefaultEnvironment=HTTPS_PROXY="{{.Proxy.HTTPSProxy}}" +DefaultEnvironment=HTTPS_PROXY="{{replace .Proxy.HTTPSProxy "%" "%%"}}" {{end -}} {{if .Proxy.NoProxy -}} DefaultEnvironment=NO_PROXY="{{.Proxy.NoProxy}}" {{end -}} -{{end -}} \ No newline at end of file +{{end -}}