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.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'winsup/cygwin/fhandler.h') diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index ca95bc03f..57a55e524 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -221,6 +221,14 @@ public: int get_close_on_exec () { return FHISSETF (CLOEXEC); } int set_close_on_exec_flag (int b) { return FHCONDSETF (b, CLOEXEC); } + LPSECURITY_ATTRIBUTES get_inheritance (bool all = 0) + { + if (all) + return get_close_on_exec () ? &sec_all_nih : &sec_all; + else + return get_close_on_exec () ? &sec_none_nih : &sec_none; + } + void set_check_win95_lseek_bug (int b = 1) { FHCONDSETF (b, W95LSBUG); } int get_check_win95_lseek_bug () { return FHISSETF (W95LSBUG); } -- cgit v1.2.3