ReactOS  0.4.15-dev-499-g1f31905
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  }
#define error(str)
Definition: mkdosfs.c:1605
#define SOL_SOCKET
Definition: winsock.h:398
int socklen_t
Definition: tcp.c:35
GLdouble s
Definition: gl.h:2039
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

Referenced by __rpc_get_local_uid().