summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/idvec-impgids.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-06-26 13:36:03 +0000
committerMark Kettenis <kettenis@gnu.org>2001-06-26 13:36:03 +0000
commit160a808ee59628d5928fab0e57fcf559889cca72 (patch)
tree50ee092b8caa0f51c209909e09648c93047791df /libshouldbeinlibc/idvec-impgids.c
parentb4b68736670315fcb8750cca938be4c91a3aafcf (diff)
* idvec-impgids.c (_merge_implied_gids) [HAVE_GETGROUPLIST]:
Conditionally enable code that calls getgrouplist. Use `int' instead of `size_t' for number of groups. [!HAVE_GETGROUPLIST]: Add #warning about missing getgrouplist.
Diffstat (limited to 'libshouldbeinlibc/idvec-impgids.c')
-rw-r--r--libshouldbeinlibc/idvec-impgids.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libshouldbeinlibc/idvec-impgids.c b/libshouldbeinlibc/idvec-impgids.c
index 62417e12..21e6af1d 100644
--- a/libshouldbeinlibc/idvec-impgids.c
+++ b/libshouldbeinlibc/idvec-impgids.c
@@ -1,6 +1,6 @@
/* Add gids implied by a user
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2001 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -56,11 +56,10 @@ _merge_implied_gids (struct idvec *implied_gids, uid_t uid)
else
{
struct idvec *cache = make_idvec ();
-#if 0 /* Glibc doesn't have getgrouplist yet. */
+#ifdef HAVE_GETGROUPLIST
gid_t _gids[NUM_STATIC_GIDS], *gids = _gids;
- size_t maxgids = NUM_STATIC_GIDS;
- size_t ngids =
- getgrouplist (pw->pw_name, pw->pw_gid, gids, &maxgids);
+ int maxgids = NUM_STATIC_GIDS;
+ int ngids = getgrouplist (pw->pw_name, pw->pw_gid, gids, &maxgids);
if (ngids == -1)
{
@@ -81,6 +80,7 @@ _merge_implied_gids (struct idvec *implied_gids, uid_t uid)
free (gids);
}
#else
+#warning "getgrouplist() not available; supplementary group IDs unsupported."
if (! cache)
err = ENOMEM;
else