summaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
authorAlex Yang <yangyang1@zte.com.cn>2018-01-04 16:40:02 +0800
committerAlex Yang <yangyang1@zte.com.cn>2018-01-04 17:21:38 +0800
commit2334b3c550c217308efbaf3f4f22718c3b3d0466 (patch)
treef901417c8a976103d91749501b737b271f1d6533 /deploy
parent11f285bb542624446bfcf033532d6ca286cc2cb5 (diff)
Fix security risks about shell=True
Change-Id: I2db012e2b6a4325c42d5422901dea52a5ab7f664 Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
Diffstat (limited to 'deploy')
-rw-r--r--deploy/utils.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/deploy/utils.py b/deploy/utils.py
index 55fbc53a..d0e67359 100644
--- a/deploy/utils.py
+++ b/deploy/utils.py
@@ -124,10 +124,9 @@ def ipmi_reboot_node(host, user, passwd, boot_source=None):
def run_shell(cmd, check=False):
- process = subprocess.Popen(cmd,
+ process = subprocess.Popen(cmd.split(),
stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=True)
+ stderr=subprocess.PIPE)
while process.poll() is None:
LD(process.stdout.readline().strip())