ReactOS 0.4.16-dev-91-g764881a
getpeereid.c File Reference
#include <wintirpc.h>
#include <rpc/types.h>
#include <errno.h>
Include dependency graph for getpeereid.c:

Go to the source code of this file.

Functions

int getpeereid (int s, uid_t *euid, gid_t *egid)
 

Function Documentation

◆ getpeereid()

int getpeereid ( int  s,
uid_t euid,
gid_t egid 
)

Definition at line 46 of file getpeereid.c.

47{
48 struct ucred uc;
49 socklen_t uclen;
50 int error;
51
52 uclen = sizeof(uc);
53 error = getsockopt(s, SOL_SOCKET, SO_PEERCRED, &uc, &uclen); /* SCM_CREDENTIALS */
54 if (error != 0)
55 return (error);
56 // if (uc.cr_version != XUCRED_VERSION)
57 // return (EINVAL);
58 *euid = uc.uid;
59 *egid = uc.gid;
60 return (0);
61 }
GLdouble s
Definition: gl.h:2039
#define error(str)
Definition: mkdosfs.c:1605
int socklen_t
Definition: tcp.c:35
INT WSAAPI getsockopt(IN SOCKET s, IN INT level, IN INT optname, OUT CHAR FAR *optval, IN OUT INT FAR *optlen)
Definition: sockctrl.c:271
#define SOL_SOCKET
Definition: winsock.h:398

Referenced by __rpc_get_local_uid().