From c14d85b7bb17b5ef10043211bc5be4009d1be29f Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 18 Oct 2014 11:27:43 +0000 Subject: [PATCH] In bind_port(), check if the socket is valid before marking it CLOSEEXEC --- jbsockets.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/jbsockets.c b/jbsockets.c index 13a6a0c2..dec4204d 100644 --- a/jbsockets.c +++ b/jbsockets.c @@ -1,4 +1,4 @@ -const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.127 2014/06/03 10:27:56 fabiankeil Exp $"; +const char jbsockets_rcs[] = "$Id: jbsockets.c,v 1.128 2014/10/18 11:24:53 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/jbsockets.c,v $ @@ -909,10 +909,6 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) fd = socket(AF_INET, SOCK_STREAM, 0); #endif /* def HAVE_RFC2553 */ -#ifdef FEATURE_EXTERNAL_FILTERS - mark_socket_for_close_on_execute(fd); -#endif - #ifdef _WIN32 if (fd == JB_INVALID_SOCKET) #else @@ -926,6 +922,10 @@ int bind_port(const char *hostnam, int portnum, jb_socket *pfd) #endif } +#ifdef FEATURE_EXTERNAL_FILTERS + mark_socket_for_close_on_execute(fd); +#endif + #ifndef _WIN32 /* * This is not needed for Win32 - in fact, it stops -- 2.39.2