Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-02-23 20:39:46 +0300
committerCorinna Vinschen <corinna@vinschen.de>2005-02-23 20:39:46 +0300
commitc8b404bf5c8c5268ef9a288d8c59b7e3ea935e8b (patch)
tree619b38b52fa65a469b1d8ca788b9a834a15768c9 /winsup/cygwin/fhandler.h
parent81d0376064d861df4d70f1263ec627af96486443 (diff)
* cygwin.din (getpeereid): Export.
* fhandler.h (class fhandler_socket): Add pipe and id members to exchange eid credentials for AF_LOCAL sockets. (eid_pipe_name): Declare new method. (getpeereid): Ditto. * fhandler_socket.cc (fhandler_socket::eid_pipe_name): New method. (fhandler_socket::fhandler_socket): Initialize sec_pipe. (fhandler_socket::connect): Exchange eid credentials with accepting socket process. (fhandler_socket::listen): Prepare eid credential transaction. (fhandler_socket::accept): Exchange eid credentials with connecting socket process. (fhandler_socket::close): Close eid credentials pipe if open. (fhandler_socket::getpeereid): New method. * net.cc (cygwin_getsockopt): Add SO_PEERCRED handling. (getpeereid): New function. * include/asm/socket.h (SO_PEERCRED): Define. * include/cygwin/socket.h (struct ucred): Define new type. * include/cygwin/version.h: Bump API minor version.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r--winsup/cygwin/fhandler.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h
index 3199351ce..d3250d1b2 100644
--- a/winsup/cygwin/fhandler.h
+++ b/winsup/cygwin/fhandler.h
@@ -355,6 +355,16 @@ class fhandler_socket: public fhandler_base
int type;
int connect_secret [4];
HANDLE secret_event;
+
+ HANDLE sec_pipe;
+ pid_t sec_pid;
+ __uid32_t sec_uid;
+ __gid32_t sec_gid;
+ pid_t sec_peer_pid;
+ __uid32_t sec_peer_uid;
+ __gid32_t sec_peer_gid;
+ char *eid_pipe_name (char *buf);
+
struct _WSAPROTOCOL_INFOA *prot_info_ptr;
char *sun_path;
struct status_flags
@@ -395,6 +405,7 @@ class fhandler_socket: public fhandler_base
int accept (struct sockaddr *peer, int *len);
int getsockname (struct sockaddr *name, int *namelen);
int getpeername (struct sockaddr *name, int *namelen);
+ int getpeereid (pid_t *pid, __uid32_t *euid, __gid32_t *egid);
int open (int flags, mode_t mode = 0);
ssize_t readv (const struct iovec *, int iovcnt, ssize_t tot = -1);