1 --- coreutils-6.7/lib/getugroups.c.getgrouplist 2006-09-14 10:53:58.000000000 +0100
2 +++ coreutils-6.7/lib/getugroups.c 2007-01-09 17:33:09.000000000 +0000
7 +/* We do not need this code if getgrouplist(3) is available. */
8 +#ifndef HAVE_GETGROUPLIST
10 #include <sys/types.h>
11 #include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
17 +#endif /* have getgrouplist */
18 --- coreutils-6.7/src/id.c.getgrouplist 2006-10-22 17:54:15.000000000 +0100
19 +++ coreutils-6.7/src/id.c 2007-01-09 17:33:09.000000000 +0000
22 max_n_groups = getgroups (0, NULL);
24 - max_n_groups = getugroups (0, NULL, username, gid);
26 +#ifdef HAVE_GETGROUPLIST
28 + getgrouplist (username, gid, NULL, &max_n_groups);
30 + max_n_groups = getugroups (0, NULL, username, gid);
38 ng = getgroups (max_n_groups, g);
40 - ng = getugroups (max_n_groups, g, username, gid);
42 +#ifdef HAVE_GETGROUPLIST
45 + while ((e = getgrouplist (username, gid, g, &ng)) == -1
46 + && ng > max_n_groups)
49 + g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
54 + ng = getugroups (max_n_groups, g, username, gid);
60 --- coreutils-6.7/m4/jm-macros.m4.getgrouplist 2006-12-06 11:04:22.000000000 +0000
61 +++ coreutils-6.7/m4/jm-macros.m4 2007-01-09 17:33:47.000000000 +0000