A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2019-March/156772.html below:

[Python-Dev] Remove tempfile.mktemp()

[Python-Dev] Remove tempfile.mktemp() [Python-Dev] Remove tempfile.mktemp()Sebastian Rittau srittau at rittau.biz
Wed Mar 20 04:57:38 EDT 2019
Am 20.03.19 um 09:47 schrieb Anders Munch:
> Greg Ewing:
>> So use NamedTemporaryFile(delete = False) and close it before passing it to the other program.
> That's effectively the same as calling tempfile.mktemp.   While it does waste time opening and closing an unused file, that doesn't help with security.  If anything, it might worsen security.

That is not actually true. The important difference is that with 
NamedTemporaryFile the file exists with appropriate access right (0600). 
This denies access of that file to other users. With mktemp() no file is 
created, so another user can "hijack" that name and cause programs to 
write potentially privileged data into or read manipulated data from 
that file.

  - Sebastian


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4