From: Claudio-Daniel Freire Date: Wed, 7 Sep 2011 21:52:11 +0000 (+0200) Subject: Do not use shell=True with Popen, some distros use dash, we need bash. X-Git-Tag: nepi-3.0.0~241 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0fb21a270f8844da6ed43caaf21a2c0b8ec89161;hp=c3cf1fb6775ef6bba65883206e292254f2a72286;p=nepi.git Do not use shell=True with Popen, some distros use dash, we need bash. --- diff --git a/src/nepi/util/server.py b/src/nepi/util/server.py index ffed2c7b..704984c2 100644 --- a/src/nepi/util/server.py +++ b/src/nepi/util/server.py @@ -846,7 +846,6 @@ def popen_python(python_code, sudo = False, environment_setup = ""): - shell = False cmd = "" if python_path: python_path.replace("'", r"'\''") @@ -891,12 +890,11 @@ def popen_python(python_code, server_key, host, port, args) args.append(cmd) else: - args = cmd - shell = True + args = [ "/bin/bash", "-c", cmd ] # connects to the remote host and starts a remote proc = subprocess.Popen(args, - shell = shell, + shell = False, stdout = subprocess.PIPE, stdin = subprocess.PIPE, stderr = subprocess.PIPE)