2007-01-09 19:29:30 +00:00
|
|
|
--- coreutils-6.7/lib/getugroups.c.getgrouplist 2006-09-14 10:53:58.000000000 +0100
|
|
|
|
+++ coreutils-6.7/lib/getugroups.c 2007-01-09 17:33:09.000000000 +0000
|
|
|
|
@@ -21,6 +21,9 @@
|
|
|
|
|
|
|
|
#include <config.h>
|
2004-10-05 15:45:31 +00:00
|
|
|
|
|
|
|
+/* We do not need this code if getgrouplist(3) is available. */
|
|
|
|
+#ifndef HAVE_GETGROUPLIST
|
|
|
|
+
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdio.h> /* grp.h on alpha OSF1 V2.0 uses "FILE *". */
|
|
|
|
#include <grp.h>
|
2007-01-09 19:29:30 +00:00
|
|
|
@@ -102,3 +105,4 @@
|
2004-10-05 15:45:31 +00:00
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
+#endif /* have getgrouplist */
|
2007-01-09 19:29:30 +00:00
|
|
|
--- coreutils-6.7/src/id.c.getgrouplist 2006-10-22 17:54:15.000000000 +0100
|
|
|
|
+++ coreutils-6.7/src/id.c 2007-01-09 17:33:09.000000000 +0000
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
@@ -253,7 +253,14 @@
|
|
|
|
if (!username)
|
2004-10-05 15:45:31 +00:00
|
|
|
max_n_groups = getgroups (0, NULL);
|
|
|
|
else
|
|
|
|
- max_n_groups = getugroups (0, NULL, username, gid);
|
|
|
|
+ {
|
|
|
|
+#ifdef HAVE_GETGROUPLIST
|
|
|
|
+ max_n_groups = 0;
|
|
|
|
+ getgrouplist (username, gid, NULL, &max_n_groups);
|
|
|
|
+#else
|
|
|
|
+ max_n_groups = getugroups (0, NULL, username, gid);
|
|
|
|
+#endif
|
|
|
|
+ }
|
|
|
|
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
if (max_n_groups < 0)
|
|
|
|
ng = -1;
|
|
|
|
@@ -263,7 +270,22 @@
|
|
|
|
if (!username)
|
|
|
|
ng = getgroups (max_n_groups, g);
|
|
|
|
else
|
|
|
|
- ng = getugroups (max_n_groups, g, username, gid);
|
2004-10-05 15:45:31 +00:00
|
|
|
+ {
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
+#ifdef HAVE_GETGROUPLIST
|
|
|
|
+ int e;
|
|
|
|
+ ng = max_n_groups;
|
|
|
|
+ while ((e = getgrouplist (username, gid, g, &ng)) == -1
|
|
|
|
+ && ng > max_n_groups)
|
|
|
|
+ {
|
|
|
|
+ max_n_groups = ng;
|
|
|
|
+ g = xrealloc (g, max_n_groups * sizeof (GETGROUPS_T));
|
|
|
|
+ }
|
|
|
|
+ if (e == -1)
|
|
|
|
+ ng = -1;
|
2004-10-05 15:45:31 +00:00
|
|
|
+#else
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
+ ng = getugroups (max_n_groups, g, username, gid);
|
2004-10-05 15:45:31 +00:00
|
|
|
+#endif
|
- 5.92.
- No longer need afs, dircolors, utmp, gcc4, brokentest, dateseconds,
chown, rmaccess, copy, stale-utmp, no-sign-extend, fchown patches.
- Updated acl, dateman, pam, langinfo, i18n, getgrouplist, selinux patches.
- Dropped printf-ll, allow_old_options, jday, zh_CN patches.
- NOTE: i18n patch not ported for sort(1) yet.
2005-10-27 15:05:08 +00:00
|
|
|
+ }
|
|
|
|
}
|
2004-10-05 15:45:31 +00:00
|
|
|
|
|
|
|
if (ng < 0)
|
2007-01-09 19:29:30 +00:00
|
|
|
--- coreutils-6.7/m4/jm-macros.m4.getgrouplist 2006-12-06 11:04:22.000000000 +0000
|
|
|
|
+++ coreutils-6.7/m4/jm-macros.m4 2007-01-09 17:33:47.000000000 +0000
|
|
|
|
@@ -64,6 +64,7 @@
|
|
|
|
fchown \
|
|
|
|
fchmod \
|
|
|
|
ftruncate \
|
|
|
|
+ getgrouplist \
|
|
|
|
iswspace \
|
|
|
|
mkfifo \
|
|
|
|
mbrlen \
|