summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/net.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-28 13:11:50 +0000
committerCorinna Vinschen <corinna@vinschen.de>2005-02-28 13:11:50 +0000
commit496337c9a58d7b107ab2a6dfdd25347479cfaa37 (patch)
treebc27563b72a99bfcbe1ae73621c08c220a58ee00 /winsup/cygwin/net.cc
parent882a0c85075ac08baff8d04bad904a88388a02f0 (diff)
downloadcygnal-496337c9a58d7b107ab2a6dfdd25347479cfaa37.tar.gz
cygnal-496337c9a58d7b107ab2a6dfdd25347479cfaa37.tar.bz2
cygnal-496337c9a58d7b107ab2a6dfdd25347479cfaa37.zip
* 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.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 98e121c5a..472e97c3e 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -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;