From 6b91b8d53be5b2333c3a8909d48a7a603aae4177 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 26 Jul 2001 19:22:24 +0000 Subject: Throughout, reorganize header file inclusion to put security.h prior to fhandler.h. * fhandler.h (fhandler_base::get_inheritance): New method. * fhandler_socket.cc (fhandler_socket::create_secret_event): Use proper close-on-exec inheritance when creating. (fhandler_socket::check_peer_secret_event): Create handle as non-inheritable. --- winsup/cygwin/fhandler_socket.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/fhandler_socket.cc') diff --git a/winsup/cygwin/fhandler_socket.cc b/winsup/cygwin/fhandler_socket.cc index 974f2de..13cbe9f 100644 --- a/winsup/cygwin/fhandler_socket.cc +++ b/winsup/cygwin/fhandler_socket.cc @@ -23,6 +23,7 @@ #define USE_SYS_TYPES_FD_SET #include #include "cygerrno.h" +#include "security.h" #include "fhandler.h" #include "dtable.h" #include "cygheap.h" @@ -98,7 +99,7 @@ fhandler_socket::create_secret_event (int* secret) __small_sprintf (buf, SECRET_EVENT_NAME, sin.sin_port, secret_ptr [0], secret_ptr [1], secret_ptr [2], secret_ptr [3]); - secret_event = CreateEvent ( NULL, FALSE, FALSE, buf); + secret_event = CreateEvent (get_inheritance (), FALSE, FALSE, buf); if (!secret_event && GetLastError () == ERROR_ALREADY_EXISTS) secret_event = OpenEvent (EVENT_ALL_ACCESS, FALSE, buf); @@ -133,7 +134,7 @@ fhandler_socket::check_peer_secret_event (struct sockaddr_in* peer, int* secret) __small_sprintf (buf, SECRET_EVENT_NAME, peer->sin_port, secret_ptr [0], secret_ptr [1], secret_ptr [2], secret_ptr [3]); - ev = CreateEvent (NULL, FALSE, FALSE, buf); + ev = CreateEvent (&sec_none_nih, FALSE, FALSE, buf); if (!ev && GetLastError () == ERROR_ALREADY_EXISTS) { debug_printf ("%s event already exist"); -- cgit v1.1