Re: [rteval PATCH] rteval: stressng.py: Fix argument passing to Popen
From: John Kacur <jkacur@redhat.com>
Date: 2021-07-28 21:38:10
On Wed, 28 Jul 2021, Atsushi Nemoto wrote:
quoted hunk ↗ jump to hunk
The self.args is a list of strings which may contains spaces. Use shell style and pass self.args as a joined string. Signed-off-by: Atsushi Nemoto <redacted> --- rteval/modules/loads/stressng.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py index 926de38..927bee5 100644 --- a/rteval/modules/loads/stressng.py +++ b/rteval/modules/loads/stressng.py@@ -84,7 +84,7 @@ class Stressng(CommandLineLoad): self._log(Log.DEBUG, "starting with %s" % " ".join(self.args)) try: - self.process = subprocess.Popen(self.args, + self.process = subprocess.Popen(" ".join(self.args), shell=True, stdout=self.__out, stderr=self.__err, stdin=self.__in)-- 2.11.0
I don't see the need to do this here and in fact there are some security implications to using shell=True. Is there a reason you want to do this? John