summaryrefslogtreecommitdiff
path: root/src/group-list.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-11-12 11:59:09 -0700
committerEric Blake <ebb9@byu.net>2009-11-13 07:50:20 -0700
commit6a31fd8d732afd232d6a99708192170e13129374 (patch)
treea02c4dc471e03a5b54820a03776097ffc1a5e08f /src/group-list.c
parent719a95aa9dca00c83c6da57fbdd5c2ae7acaa1f8 (diff)
downloadcoreutils-6a31fd8d732afd232d6a99708192170e13129374.tar.xz
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.
Diffstat (limited to 'src/group-list.c')
-rw-r--r--src/group-list.c6
1 files changed, 2 insertions, 4 deletions
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;
}