ucspi-ssl  0.99e
TLS encryption for IPv6 communication
prot.c
Go to the documentation of this file.
1 /* Public domain. */
2 
3 #define _BSD_SOURCE
4 
5 #include <grp.h>
6 #include <sys/types.h>
7 #include <sys/param.h>
8 #include <unistd.h>
9 #include "prot.h"
10 
11 int prot_gid(int gid)
12 {
13  gid_t x[2];
14  x[0] = gid; x[1] = 73; /* catch errors */
15  if (setgroups(1,x) == -1) return -1;
16  return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
17 }
18 
19 int prot_uid(int uid)
20 {
21  return setuid(uid);
22 }
int prot_gid(int gid)
Definition: prot.c:11
int prot_uid(int uid)
Definition: prot.c:19
unsigned long gid
Definition: sslhandle.c:506
unsigned long uid
Definition: sslhandle.c:505