diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2011-12-13 11:04:22 +0100 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2012-02-21 15:53:41 +0100 |
commit | 3cedd1dd9877a0bae3e69d27c3d1a2fcd98787c0 (patch) | |
tree | a1af6e31567b9a7a992bc90d6106a7cfb0c67b37 /debian/patches/close_socket_before_scripts.patch | |
parent | 349cfa7acb95abe865209a28e417ec74b56f9bba (diff) |
Imported Debian patch 2.2.1-1debian/2.2.1-1
Diffstat (limited to 'debian/patches/close_socket_before_scripts.patch')
-rw-r--r-- | debian/patches/close_socket_before_scripts.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/patches/close_socket_before_scripts.patch b/debian/patches/close_socket_before_scripts.patch new file mode 100644 index 0000000..011a8e7 --- /dev/null +++ b/debian/patches/close_socket_before_scripts.patch @@ -0,0 +1,32 @@ +Description: Set socket's FD_CLOEXEC flag before calling up script + Moving the set_cloexec() call from link_socket_init_phase2() to + link_socket_init_phase1(). +Author: Julien Cristau <jcristau@debian.org> +Bug-Debian: http://bugs.debian.org/367716 + +Index: openvpn-2.2.0/socket.c +=================================================================== +--- openvpn-2.2.0.orig/socket.c 2011-04-21 21:13:34.000000000 +0200 ++++ openvpn-2.2.0/socket.c 2011-05-10 16:18:35.300018716 +0200 +@@ -1327,6 +1327,10 @@ + resolve_bind_local (sock); + resolve_remote (sock, 1, NULL, NULL); + } ++ ++ /* set socket file descriptor to not pass across execs, so that ++ scripts don't have access to it */ ++ set_cloexec (sock->sd); + } + + /* finalize socket initialization */ +@@ -1532,10 +1536,6 @@ + /* set socket to non-blocking mode */ + set_nonblock (sock->sd); + +- /* set socket file descriptor to not pass across execs, so that +- scripts don't have access to it */ +- set_cloexec (sock->sd); +- + #ifdef ENABLE_SOCKS + if (socket_defined (sock->ctrl_sd)) + set_cloexec (sock->ctrl_sd); |