diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-08-18 11:28:46 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-08-20 12:21:49 -0400 |
commit | b5b782f2584e59534ae1d66551de0e04fc3c0038 (patch) | |
tree | 7b73bd343e8341c5ca4bfcaff7109e0b104e79df /pkg/systemd/generate/pods.go | |
parent | 402d002184fa33b8aa7bfe91a83b04ba80425e28 (diff) | |
download | podman-b5b782f2584e59534ae1d66551de0e04fc3c0038.tar.gz podman-b5b782f2584e59534ae1d66551de0e04fc3c0038.tar.bz2 podman-b5b782f2584e59534ae1d66551de0e04fc3c0038.zip |
generate systemd: quote arguments with whitespace
Make sure that arguments with whitespace are properly quoted so they are
interpreted as one (and not multiple ones) by systemd.
Now `-e tz="america/new york"` will be generated as `-e "tz=america/new york"`.
The quotes are moving but the argument is still correct.
Fixes: #7285
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/pods.go')
-rw-r--r-- | pkg/systemd/generate/pods.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go index 1c7ef7792..df807585a 100644 --- a/pkg/systemd/generate/pods.go +++ b/pkg/systemd/generate/pods.go @@ -292,6 +292,7 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions) } startCommand = append(startCommand, podCreateArgs...) + startCommand = quoteArguments(startCommand) info.ExecStartPre1 = "/bin/rm -f {{.PIDFile}} {{.PodIDFile}}" info.ExecStartPre2 = strings.Join(startCommand, " ") |