mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Force command action to not be executed by the shell unless specifically enabled
This commit is contained in:
committed by
James Cammarata
parent
9730157525
commit
ba0fec4f42
@@ -207,7 +207,9 @@ class Service(object):
|
||||
os._exit(0)
|
||||
|
||||
# Start the command
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=lambda: os.close(pipe[1]))
|
||||
if isinstance(cmd, basestring):
|
||||
cmd = shlex.split(cmd)
|
||||
p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE, preexec_fn=lambda: os.close(pipe[1]))
|
||||
stdout = ""
|
||||
stderr = ""
|
||||
fds = [p.stdout, p.stderr]
|
||||
|
||||
Reference in New Issue
Block a user