From: Gregory P. Smith Date: Sat, 21 Jan 2012 22:39:29 +0000 (-0800) Subject: Fixes issue #8052: The posix subprocess module's close_fds behavior was X-Git-Tag: v3.3.0a1~323 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d635af5a61897e6246bfb1ddf7e4d496bfd1121d;p=thirdparty%2FPython%2Fcpython.git Fixes issue #8052: The posix subprocess module's close_fds behavior was suboptimal by closing all possible file descriptors rather than just the open ones in the child process before exec(). It now closes only the open fds when it is possible to safely determine what those are. --- d635af5a61897e6246bfb1ddf7e4d496bfd1121d diff --cc configure index d6bd2bf6dee2,b95e0a3f0f1c..10ee46ca570b --- a/configure +++ b/configure @@@ -6140,16 -6159,15 +6140,16 @@@ f for ac_header in asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ -ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ -shadow.h signal.h stdint.h stropts.h termios.h thread.h \ +ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \ +sched.h shadow.h signal.h stdint.h stropts.h termios.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \ +poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ +sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/loadavg.h \ sys/lock.h sys/mkdev.h sys/modem.h \ -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ -sys/syscall.h sys/termio.h sys/time.h \ -sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ -sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ - sys/stat.h sys/termio.h sys/time.h \ ++sys/stat.h sys/syscall.h sys/termio.h sys/time.h \ +sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ +libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h spawn.h util.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` diff --cc configure.in index fd70d251977d,71e0a8f2de39..0aa094a80f3f --- a/configure.in +++ b/configure.in @@@ -1330,16 -1335,15 +1330,16 @@@ dnl AC_MSG_RESULT($cpp_type AC_HEADER_STDC AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ fcntl.h grp.h \ -ieeefp.h io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ -shadow.h signal.h stdint.h stropts.h termios.h thread.h \ +ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \ +sched.h shadow.h signal.h stdint.h stropts.h termios.h \ unistd.h utime.h \ -sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \ +poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ +sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/loadavg.h \ sys/lock.h sys/mkdev.h sys/modem.h \ -sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ -sys/syscall.h sys/termio.h sys/time.h \ -sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ -sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ +sys/param.h sys/select.h sys/sendfile.h sys/socket.h sys/statvfs.h \ - sys/stat.h sys/termio.h sys/time.h \ ++sys/stat.h sys/syscall.h sys/termio.h sys/time.h \ +sys/times.h sys/types.h sys/uio.h sys/un.h sys/utsname.h sys/wait.h pty.h \ +libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h spawn.h util.h) AC_HEADER_DIRENT AC_HEADER_MAJOR