Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/libhack emulate getgrouplist() directly, no ne...



details:   https://anonhg.NetBSD.org/src/rev/8e99882d0b1a
branches:  trunk
changeset: 584372:8e99882d0b1a
user:      drochner <drochner%NetBSD.org@localhost>
date:      Wed Sep 14 15:54:53 2005 +0000

description:
emulate getgrouplist() directly, no need to pull in
the wrapper from libc

diffstat:

 distrib/utils/libhack/getgrent.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r f8e4c112205b -r 8e99882d0b1a distrib/utils/libhack/getgrent.c
--- a/distrib/utils/libhack/getgrent.c  Wed Sep 14 15:35:26 2005 +0000
+++ b/distrib/utils/libhack/getgrent.c  Wed Sep 14 15:54:53 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getgrent.c,v 1.11 2005/09/14 15:31:18 he Exp $ */
+/*     $NetBSD: getgrent.c,v 1.12 2005/09/14 15:54:53 drochner Exp $   */
 
 /*
  * Copyright (c) 1989, 1991, 1993
@@ -70,7 +70,7 @@
 #define getgrnam_r             _getgrnam_r
 #define setgrent               _setgrent
 #define setgroupent            _setgroupent
-#define getgroupmembership     _getgroupmembership
+#define getgrouplist           _getgrouplist
 
 __weak_alias(endgrent,_endgrent)
 __weak_alias(getgrent,_getgrent)
@@ -79,7 +79,7 @@
 __weak_alias(getgrnam_r,_getgrnam_r)
 __weak_alias(setgrent,_setgrent)
 __weak_alias(setgroupent,_setgroupent)
-__weak_alias(getgroupmembership,_getgroupmembership)
+__weak_alias(getgrouplist,_getgrouplist)
 #endif
 
 #include <sys/param.h>
@@ -208,12 +208,13 @@
 }
 
 int
-getgroupmembership(const char *uname, gid_t agroup,
-    gid_t *groups, int maxgroups, int *grpcnt)
+getgrouplist(const char *uname, gid_t agroup,
+    gid_t *groups, int *grpcnt)
 {
        struct group *grp;
-       int i, ngroups, ret;
+       int maxgroups, i, ngroups, ret;
 
+       maxgroups = *grpcnt;
        ret = 0;
        ngroups = 0;
 



Home | Main Index | Thread Index | Old Index