mirror of
https://github.com/containers/podman.git
synced 2025-10-18 11:42:55 +08:00
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>
This commit is contained in:
@ -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, " ")
|
||||
|
Reference in New Issue
Block a user