blob: de0f02d91f2e2a82217d78784e36f520bdaf3f82 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include <stddef.h>
#include <grp.h>
extern int _getpw(int *, char **, char **);
extern char **_grpmems(char *);
static struct group holdgroup;
struct group *
getgrgid(gid_t gid)
{
int num;
char *nam, *mem;
num = gid;
nam = 0;
mem = 0;
if(_getpw(&num, &nam, &mem)){
holdgroup.gr_name = nam;
holdgroup.gr_passwd = "";
holdgroup.gr_gid = num;
holdgroup.gr_mem = _grpmems(mem);
return &holdgroup;
}
return NULL;
}
|