* fhandler.h (class fhandler_socket): Declare new method

set_socketpair_eids.
	* fhandler_socket.cc (fhandler_socket::set_socketpair_eids): New method.
	(fhandler_socket::dup): Duplicate sec_pipe if necessary.
	(fhandler_socket::listen): Only create sec_pipe if named pipes are
	available. Initialized sec_peer_pid to 0 as on Linux.
	(fhandler_socket::connect): Only run eid credential transaction if
	named pipes are available.  Fake otherwise. Initialized sec_peer_pid
	to 0 as on Linux.
	(fhandler_socket::accept): Ditto.
	(fhandler_socket::close): Move closing sec_pipe handle from here...
	(fhandler_socket::~fhandler_socket): ... to here.
	* net.cc (socketpair): Set eid credentials by calling
	fhandler_socket::set_socketpair_eids() on both socket ends.
	* wincap.h (wincaps::has_named_pipes): New element.
	* wincap.cc: Implement above element throughout.
This commit is contained in:
Corinna Vinschen
2005-02-28 13:11:50 +00:00
parent 882a0c8507
commit 496337c9a5
6 changed files with 132 additions and 36 deletions

View File

@@ -2198,6 +2198,8 @@ socketpair (int family, int type, int protocol, int *sb)
((fhandler_socket *) sb0)->set_addr_family (family);
((fhandler_socket *) sb0)->set_socket_type (type);
((fhandler_socket *) sb0)->connect_state (connected);
if (family == AF_LOCAL && type == SOCK_STREAM)
((fhandler_socket *) sb0)->set_socketpair_eids ();
cygheap_fdnew sb1 (sb0, false);
@@ -2207,6 +2209,8 @@ socketpair (int family, int type, int protocol, int *sb)
((fhandler_socket *) sb1)->set_addr_family (family);
((fhandler_socket *) sb1)->set_socket_type (type);
((fhandler_socket *) sb1)->connect_state (connected);
if (family == AF_LOCAL && type == SOCK_STREAM)
((fhandler_socket *) sb1)->set_socketpair_eids ();
sb[0] = sb0;
sb[1] = sb1;