summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/containers.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-08-18 11:28:46 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-08-19 08:32:51 +0200
commitb1ffa2324eaf3e3d847ce4e0f738d6bf9e46a54b (patch)
tree8ad2adc65d5ab854b10e29c67f1a14643cddbe05 /pkg/systemd/generate/containers.go
parent9d096c1c4ea5308c94f779444b61015eeef2972a (diff)
downloadpodman-b1ffa2324eaf3e3d847ce4e0f738d6bf9e46a54b.tar.gz
podman-b1ffa2324eaf3e3d847ce4e0f738d6bf9e46a54b.tar.bz2
podman-b1ffa2324eaf3e3d847ce4e0f738d6bf9e46a54b.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/containers.go')
-rw-r--r--pkg/systemd/generate/containers.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go
index 3d266a7a1..5f6376977 100644
--- a/pkg/systemd/generate/containers.go
+++ b/pkg/systemd/generate/containers.go
@@ -241,6 +241,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
startCommand = append(startCommand, "--replace")
}
startCommand = append(startCommand, info.CreateCommand[index:]...)
+ startCommand = quoteArguments(startCommand)
info.ExecStartPre = "/bin/rm -f {{.PIDFile}} {{.ContainerIDFile}}"
info.ExecStart = strings.Join(startCommand, " ")