Charles-François Natali added the comment:
Closing.
Let's keep O_NOFOLLOW: it doesn't buy much, and might be useful for some arcane
reason on some weird platform...
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
STINNER Victor added the comment:
I'll wait a little before removing O_NOFOLLOW
I don't know this flag. What is its effect of the directory part of the path?
Does it change anything if the directory is a symbolic link?
--
___
Python tracker
Charles-François Natali added the comment:
I'll wait a little before removing O_NOFOLLOW
I don't know this flag. What is its effect of the directory part of the path?
Does it change anything if the directory is a symbolic link?
No, it only has an effect if the target file is a symlink.
STINNER Victor added the comment:
No, it only has an effect if the target file is a symlink.
Oh ok, so O_NOFOLLOW is useless when O_EXCL is used. It is safe to remove it,
but please only modify Python 3.4 (just in case...).
--
___
Python tracker
New submission from STINNER Victor:
os.O_CLOEXEC has been added to Python 3.3. This flag solves a race condition if
the process is forked between open() and a call to fcntl() to set the
FD_CLOEXEC flag.
The following patch written by neologix should fix this issue:
diff --git
STINNER Victor added the comment:
See also #16850 which proposes to expose O_CLOEXEC feature in the open()
builtin function.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16860
___
Charles-François Natali added the comment:
Here's the patch.
It also removes O_NOFOLLOW, which is basically useless (if the file is created
with O_CREAT|O_EXCL, then by definition it's not a symlink).
--
keywords: +needs review, patch
type: - behavior
Added file:
STINNER Victor added the comment:
Here's the patch.
_set_cloexec() is still called whereas it is useless if the OS supports
O_CLOEXEC... But the call must be kept because Linux 2.6.23 just ignores
O_CLOEXEC: we would have to check _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
_fcntl.FD_CLOEXEC to
Roundup Robot added the comment:
New changeset 64883c614c88 by Charles-François Natali in branch 'default':
Issue #16860: In tempfile, use O_CLOEXEC when available to set the
http://hg.python.org/cpython/rev/64883c614c88
--
nosy: +python-dev
___
Charles-François Natali added the comment:
I've committed it only to default, since it's not really a bug, but rather an
improvement (if we did consider this a security bug then it should also be
backported to 2.7, 3.1, etc).
I'll wait a little before removing O_NOFOLLOW: I'm 99% sure it's
10 matches
Mail list logo