1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Create temporary file in a secure manner. (#2887)

This commit is contained in:
sgujic 2016-09-09 20:47:49 +02:00 committed by Matt Clay
parent acadc2ac9c
commit d34f3b4c05

View file

@ -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')