Issue 16946: subprocess: _close_open_fd_range_safe() does not set close-on-exec flag on Linux < 2.6.23 if O_CLOEXEC is defined - Python tracker
Python Home About News Documentation Downloads Community Foundation Developer's Guide Issue Tracker Issues Search Random Issue Summaries Issues with patch Easy issues Stats User Administration User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue16946 ➜ This issue tracker has been migrated to GitHub , and is currently read-only . For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on 2013-01-12 14:54 by vstinner , last changed 2022-04-11 14:57 by admin . This issue is now closed . Messages (3) msg179803 - (view) Author: STINNER Victor (vstinner) * Date: 2013-01-12 14:54 The following extract of _close_open_fd_range_safe() is not correct: #ifdef O_CLOEXEC fd_dir_fd = open(FD_DIR, O_RDONLY | O_CLOEXEC, 0); #else fd_dir_fd = open(FD_DIR, O_RDONLY, 0); #ifdef FD_CLOEXEC { int old = fcntl(fd_dir_fd, F_GETFD); if (old != -1) fcntl(fd_dir_fd, F_SETFD, old | FD_CLOEXEC); } #endif #endif On Linux older than 2.6.23, O_CLOEXEC may be defined by the glibc whereas the kernel does not support it.
In this case, the flag is simply ignored and close-on-exec flag is not set on the file descriptor. msg180910 - (view) Author: STINNER Victor (vstinner) * Date: 2013-01-29 15:17 This issue is fixed in my implementation of the PEP 433 : see #17036 . msg196332 - (view) Author: STINNER Victor (vstinner) * Date: 2013-08-27 23:25 This issue has been fixed in the implementation of the PEP 446 (issue #18571 ). History Date User Action Args 2022-04-11 14:57:40 admin set github: 61150 2013-08-27 23:25:04 vstinner set status: open -> closed resolution: fixed messages: + msg196332 2013-01-29 15:17:03 vstinner set messages: + msg180910 2013-01-13 07:07:07 gregory.p.smith set assignee: gregory.p.smith nosy: + gregory.p.smith , - gps 2013-01-12 15:10:33 r.david.murray set nosy: + gps 2013-01-12 14:54:13 vstinner create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements