diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-12-08 14:35:12 +0100 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-12-08 15:51:23 +0100 |
commit | 2d517b687b0832a6240a165e8aacef2876b9228a (patch) | |
tree | 3c33b88b10ea7b92a1dec0faed9c41a1224b567c /pkg/systemd/generate/common.go | |
parent | 31be3a9f24597a282a51764c15603311e59e4d44 (diff) | |
download | podman-2d517b687b0832a6240a165e8aacef2876b9228a.tar.gz podman-2d517b687b0832a6240a165e8aacef2876b9228a.tar.bz2 podman-2d517b687b0832a6240a165e8aacef2876b9228a.zip |
generate systemd: support entrypoint JSON strings
Make sure to preserve the quoting of entrypoint JSON strings.
Fixes: #12477
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/common.go')
-rw-r--r-- | pkg/systemd/generate/common.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go index 24c85a27e..8689e084c 100644 --- a/pkg/systemd/generate/common.go +++ b/pkg/systemd/generate/common.go @@ -101,7 +101,7 @@ func escapeSystemdArguments(command []string) []string { func escapeSystemdArg(arg string) string { arg = strings.ReplaceAll(arg, "$", "$$") arg = strings.ReplaceAll(arg, "%", "%%") - if strings.ContainsAny(arg, " \t") { + if strings.ContainsAny(arg, " \t\"") { arg = strconv.Quote(arg) } else if strings.Contains(arg, `\`) { // strconv.Quote also escapes backslashes so |