mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 20:54:24 -07:00
Create temporary file in a secure manner. (#2887)
This commit is contained in:
parent
acadc2ac9c
commit
d34f3b4c05
1 changed files with 2 additions and 2 deletions
|
@ -564,7 +564,7 @@ class JenkinsPlugin(object):
|
||||||
msg_exception="Updates download failed.")
|
msg_exception="Updates download failed.")
|
||||||
|
|
||||||
# Write the updates file
|
# Write the updates file
|
||||||
updates_file = tempfile.mktemp()
|
updates_file = tempfile.mkstemp()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fd = open(updates_file, 'wb')
|
fd = open(updates_file, 'wb')
|
||||||
|
@ -641,7 +641,7 @@ class JenkinsPlugin(object):
|
||||||
|
|
||||||
def _write_file(self, f, data):
|
def _write_file(self, f, data):
|
||||||
# Store the plugin into a temp file and then move it
|
# Store the plugin into a temp file and then move it
|
||||||
tmp_f = tempfile.mktemp()
|
tmp_f = tempfile.mkstemp()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fd = open(tmp_f, 'wb')
|
fd = open(tmp_f, 'wb')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue