fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
prot.c
Go to the documentation of this file.
1#include <sys/types.h>
2#include <unistd.h>
3#include <grp.h>
4//#include "hasshsgr.h"
5#include "prot.h"
6
14/* XXX: there are more portability problems here waiting to leap out at me */
15
16int prot_gid(int gid)
17{
18//#ifdef HASSHORTSETGROUPS
19// short x[2];
20// x[0] = gid; x[1] = 73; /* catch errors */
21// if (setgroups(1,x) == -1) return -1;
22//#else
23 if (setgroups(1,(gid_t *)&gid) == -1) return -1;
24//#endif
25 return setgid(gid); /* _should_ be redundant, but on some systems it isn't */
26}
27
28int prot_uid(int uid)
29{
30 return setuid(uid);
31}
int prot_gid(int gid)
Definition: prot.c:16
int prot_uid(int uid)
Definition: prot.c:28