mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix Insecure temporary file
This commit is contained in:
parent
a6aa74f520
commit
6e76c46c4c
|
@ -55,7 +55,7 @@ class Dmgtools(Dmg):
|
||||||
def create(self, dmg, volume_name, directory, symlinks):
|
def create(self, dmg, volume_name, directory, symlinks):
|
||||||
input_size = sum(os.stat(os.path.join(path, f)).st_size for path, dirs, files in os.walk(directory) for f in files)
|
input_size = sum(os.stat(os.path.join(path, f)).st_size for path, dirs, files in os.walk(directory) for f in files)
|
||||||
output_size = max(input_size * 2, 1024**2)
|
output_size = max(input_size * 2, 1024**2)
|
||||||
hfs = tempfile.mktemp(prefix=dmg + '.', suffix='.hfs')
|
hfs = tempfile.mkstemp(prefix=dmg + '.', suffix='.hfs')
|
||||||
self._create_hfs(hfs, volume_name, output_size)
|
self._create_hfs(hfs, volume_name, output_size)
|
||||||
self._add(hfs, directory)
|
self._add(hfs, directory)
|
||||||
for target, link_name in symlinks:
|
for target, link_name in symlinks:
|
||||||
|
|
Loading…
Reference in a new issue