From 6a31fd8d732afd232d6a99708192170e13129374 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 12 Nov 2009 11:59:09 -0700 Subject: build: update gnulib, for getgroups improvements A replacement getgroups is now guaranteed to exist, but it may fail with ENOSYS. mgetgroups is moved to gnulib, and now takes gid_t instead of GETGROUPS_T (but setgroups still needs GETGROUPS_T). * gnulib: Update to latest. * gl/modules/mgetgroups: Delete, moved to gnulib. * gl/m4/mgetgroups.m4: Likewise. * gl/lib/mgetgroups.h: Likewise. * gl/lib/mgetgroups.c: Likewise. * src/group-list.c (print_group_list): Adjust callers. * src/id.c (print_full_info): Likewise. --- src/group-list.c | 6 ++---- src/id.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/group-list.c b/src/group-list.c index 4c5391ddb..1fadd0c57 100644 --- a/src/group-list.c +++ b/src/group-list.c @@ -54,14 +54,13 @@ print_group_list (const char *username, ok = false; } -#if HAVE_GETGROUPS { - GETGROUPS_T *groups; + gid_t *groups; int i; int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), &groups); - if (n_groups < 0) + if (n_groups < 0 && errno != ENOSYS) { if (username) { @@ -84,7 +83,6 @@ print_group_list (const char *username, } free (groups); } -#endif /* HAVE_GETGROUPS */ return ok; } diff --git a/src/id.c b/src/id.c index 601e77077..9a00f5ce4 100644 --- a/src/id.c +++ b/src/id.c @@ -292,14 +292,13 @@ print_full_info (const char *username) printf ("(%s)", grp->gr_name); } -#if HAVE_GETGROUPS { - GETGROUPS_T *groups; + gid_t *groups; int i; int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), &groups); - if (n_groups < 0) + if (n_groups < 0 && errno != ENOSYS) { if (username) { @@ -327,7 +326,6 @@ print_full_info (const char *username) } free (groups); } -#endif /* HAVE_GETGROUPS */ /* POSIX mandates the precise output format, and that it not include any context=... part, so skip that if POSIXLY_CORRECT is set. */ -- cgit v1.2.3-70-g09d2