Fix shell quoting for cmd.run

In my tests this fixed issue saltstack#26114 , maybe somebody needs to test for regressions? re-submitted against 2015.8 branch as requested by @twangboy
This commit is contained in:
TheBigBear 2015-08-17 17:47:04 +01:00
parent ef4dbd8b16
commit 6221e69c14

View File

@ -29,6 +29,7 @@ try:
except ImportError:
import msgpack_pure as msgpack
# pylint: enable=import-error
import shlex
# Import salt libs
from salt.exceptions import SaltRenderError
@ -566,7 +567,7 @@ def install(name=None, refresh=False, pkgs=None, saltenv='base', **kwargs):
if msiexec:
cmd.extend(['msiexec', '/i'])
cmd.append(cached_pkg)
cmd.extend(install_flags.split())
cmd.extend(shlex.split(install_flags))
if msiexec and allusers:
cmd.append('ALLUSERS="1"')
@ -672,7 +673,7 @@ def remove(name=None, pkgs=None, version=None, extra_uninstall_flags=None, **kwa
if pkginfo[version].get('msiexec'):
cmd.extend(['msiexec', '/x'])
cmd.append(expanded_cached_pkg)
cmd.extend(uninstall_flags.split())
cmd.extend(shlex.split(uninstall_flags))
if extra_uninstall_flags:
cmd.extend(str(extra_uninstall_flags).split())