From d34f3b4c050aad0e49a8ab0920bf41455a3fe1c2 Mon Sep 17 00:00:00 2001 From: sgujic Date: Fri, 9 Sep 2016 20:47:49 +0200 Subject: [PATCH] Create temporary file in a secure manner. (#2887) --- .../modules/extras/web_infrastructure/jenkins_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/web_infrastructure/jenkins_plugin.py b/lib/ansible/modules/extras/web_infrastructure/jenkins_plugin.py index 4dc2c345a6..266d7f49c7 100644 --- a/lib/ansible/modules/extras/web_infrastructure/jenkins_plugin.py +++ b/lib/ansible/modules/extras/web_infrastructure/jenkins_plugin.py @@ -564,7 +564,7 @@ class JenkinsPlugin(object): msg_exception="Updates download failed.") # Write the updates file - updates_file = tempfile.mktemp() + updates_file = tempfile.mkstemp() try: fd = open(updates_file, 'wb') @@ -641,7 +641,7 @@ class JenkinsPlugin(object): def _write_file(self, f, data): # Store the plugin into a temp file and then move it - tmp_f = tempfile.mktemp() + tmp_f = tempfile.mkstemp() try: fd = open(tmp_f, 'wb')