diff options
author | Mark Kettenis <kettenis@gnu.org> | 2001-06-26 13:36:03 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2001-06-26 13:36:03 +0000 |
commit | 160a808ee59628d5928fab0e57fcf559889cca72 (patch) | |
tree | 50ee092b8caa0f51c209909e09648c93047791df | |
parent | b4b68736670315fcb8750cca938be4c91a3aafcf (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.
-rw-r--r-- | libshouldbeinlibc/ChangeLog | 7 | ||||
-rw-r--r-- | libshouldbeinlibc/idvec-impgids.c | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/libshouldbeinlibc/ChangeLog b/libshouldbeinlibc/ChangeLog index be744ee2..e6d8e961 100644 --- a/libshouldbeinlibc/ChangeLog +++ b/libshouldbeinlibc/ChangeLog @@ -1,3 +1,10 @@ +2001-06-24 Mark Kettenis <kettenis@gnu.org> + + * 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. + 2001-03-31 Roland McGrath <roland@frob.com> * ugids.h: Fix obsolescent #endif syntax. 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 |