backend/satellite_tools/disk_dumper/iss_runcommand.py | 2 +-
backend/spacewalk/common/fileutils.py | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 5c6b7971e8ba28af9b69a5992bee514511b43d36
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Jan 25 16:41:42 2010 +0100
execute command through shell only if we get string, if it is sequence then call it
directly
diff --git a/backend/satellite_tools/disk_dumper/iss_runcommand.py
b/backend/satellite_tools/disk_dumper/iss_runcommand.py
index 4becf1d..91ffc17 100644
--- a/backend/satellite_tools/disk_dumper/iss_runcommand.py
+++ b/backend/satellite_tools/disk_dumper/iss_runcommand.py
@@ -36,7 +36,7 @@ def make_fd_nonblocking(file_desc):
def run_command(command):
command_process = subprocess.Popen(command, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- close_fds=True, shell=True)
+ close_fds=True, shell=(not (type(cmd) in (types.ListType,
types.TupleType))) )
outstring = StringIO.StringIO()
errstring = StringIO.StringIO()
diff --git a/backend/spacewalk/common/fileutils.py
b/backend/spacewalk/common/fileutils.py
index eeadfab..b2b89a3 100644
--- a/backend/spacewalk/common/fileutils.py
+++ b/backend/spacewalk/common/fileutils.py
@@ -206,11 +206,12 @@ def rhn_popen(cmd, progressCallback=None, bufferSize=16384,
outputLog=None):
subprocess._cleanup()
- if type(cmd) in (types.ListType, types.TupleType):
+ cmd_is_list = type(cmd) in (types.ListType, types.TupleType)
+ if cmd_is_list:
cmd = map(str, cmd)
c = subprocess.Popen(cmd, bufsize=0, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
- close_fds=True, shell=True)
+ close_fds=True, shell=(not cmd_is_list))
# We don't write to the child process
c.stdin.close()
Show replies by date