[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
getgrouplist
From: |
Mark Kettenis |
Subject: |
getgrouplist |
Date: |
Sun, 24 Jun 2001 15:09:19 +0200 |
OK, now that getgrouplist has been added to libc, we can think of
enabling the code that deals with supplementary group IDs in
libshouldbelibc/idvec-impgids.c. To avoid forcing people to upgrade
their libc we should add an autoconf check for getgrouplist.
Here's a patch. Seems to work fine for me. OK to check this in?
Mark
Index: libshouldbeinlibc/ChangeLog
from Mark Kettenis <address@hidden>
* idvec-impgids.c [HAVE+GETGROUPLIST] (_merge_implied_gids):
Conditionally enable code that calls getgrouplist. Use `int'
instead of `size_t' for number of groups.
Index: libshouldbeinlibc/idvec-impgids.c
===================================================================
RCS file: /cvsroot/hurd/hurd/libshouldbeinlibc/idvec-impgids.c,v
retrieving revision 1.2
diff -u -p -r1.2 idvec-impgids.c
--- libshouldbeinlibc/idvec-impgids.c 1997/08/07 02:57:46 1.2
+++ libshouldbeinlibc/idvec-impgids.c 2001/06/24 13:08:02
@@ -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 <address@hidden>
@@ -56,11 +56,10 @@ _merge_implied_gids (struct idvec *impli
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)
{
Index: ChangeLog
from Mark Kettenis <address@hidden>
* configure.in: Add check for getgrouplist.
Index: configure.in
===================================================================
RCS file: /cvsroot/hurd/hurd/configure.in,v
retrieving revision 1.19
diff -u -p -r1.19 configure.in
--- configure.in 2000/05/25 20:23:28 1.19
+++ configure.in 2001/06/24 13:07:24
@@ -104,6 +104,9 @@ AC_CACHE_CHECK([for libio],
hurd_cv_libio=yes,
hurd_cv_libio=no))
+# Check if libc contains getgrouplist().
+AC_CHECK_FUNCS(getgrouplist)
+
# The versions of the symbols in libthreads have to match those in
# libc.so. Since the symbols in a libc that includes libio will be
# versioned differently from the ones in a libc that uses stdio, this
- getgrouplist,
Mark Kettenis <=