diff options
author | Zhijiang Hu <hu.zhijiang@zte.com.cn> | 2018-01-05 06:29:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-05 06:29:13 +0000 |
commit | 431ed2baa96538fd48ebc1e7df8454b60b903de1 (patch) | |
tree | ea38d4d130fa8915802e790593a3407dc83ae242 /deploy | |
parent | 49205e7200afd0ce286d2f685093948cb1f7bf3d (diff) | |
parent | 2334b3c550c217308efbaf3f4f22718c3b3d0466 (diff) |
Merge "Fix security risks about shell=True"
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/utils.py | 5 |
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()) |