diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-11-16 08:18:28 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 08:18:28 -0800 |
commit | 4abf439e4bda8836cd68101d1f1cb09bc9105b17 (patch) | |
tree | 57c9884a23aedfc95ddb05fccc456d6b791b24e9 /cmd/podman/shared/funcs.go | |
parent | 43de95df34a88d2ded4b62ab0c1763a33acac07e (diff) | |
parent | 780b790415f94ea41ef70bd97828ecb92a4f06d1 (diff) | |
download | podman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.tar.gz podman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.tar.bz2 podman-4abf439e4bda8836cd68101d1f1cb09bc9105b17.zip |
Merge pull request #1822 from vrothberg/runlabel-shlexing
runlabel: use shlex for splitting commands
Diffstat (limited to 'cmd/podman/shared/funcs.go')
-rw-r--r-- | cmd/podman/shared/funcs.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/podman/shared/funcs.go b/cmd/podman/shared/funcs.go index a92e0d547..8520c0616 100644 --- a/cmd/podman/shared/funcs.go +++ b/cmd/podman/shared/funcs.go @@ -5,6 +5,8 @@ import ( "os" "path/filepath" "strings" + + "github.com/google/shlex" ) func substituteCommand(cmd string) (string, error) { @@ -42,7 +44,11 @@ func GenerateCommand(command, imageName, name string) ([]string, error) { if name == "" { name = imageName } - cmd := strings.Split(command, " ") + + cmd, err := shlex.Split(command) + if err != nil { + return nil, err + } prog, err := substituteCommand(cmd[0]) if err != nil { |