diff options
author | Casper H.S. Dik <Casper.Dik@Sun.COM> | 2009-11-20 20:58:43 +0100 |
---|---|---|
committer | Casper H.S. Dik <Casper.Dik@Sun.COM> | 2009-11-20 20:58:43 +0100 |
commit | 67dbe2be0c0f1e2eb428b89088bb5667e8f0b9f6 (patch) | |
tree | ae276da3565da2f00f984253f7b5da205d4384c5 /usr/src/lib/libsocket/inet | |
parent | f73ae3db72a91f9f8759931a1c643c7dad785881 (diff) | |
download | illumos-joyent-67dbe2be0c0f1e2eb428b89088bb5667e8f0b9f6.tar.gz |
PSARC 2009/542 Increase the maximum value of NGROUPS_MAX to 1024
4088757 Customer would like to increase ngroups_max more than 32
6853435 Many files incorrectly include the private <sys/cred_impl.h>
Diffstat (limited to 'usr/src/lib/libsocket/inet')
-rw-r--r-- | usr/src/lib/libsocket/inet/rcmd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr/src/lib/libsocket/inet/rcmd.c b/usr/src/lib/libsocket/inet/rcmd.c index 6a0edcac5b..d1fdcd2418 100644 --- a/usr/src/lib/libsocket/inet/rcmd.c +++ b/usr/src/lib/libsocket/inet/rcmd.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -37,8 +37,6 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <limits.h> #include <stdio.h> #include <ctype.h> @@ -62,6 +60,7 @@ #include <string.h> #include <stdlib.h> #include <grp.h> +#include <alloca.h> #include <arpa/inet.h> #include <priv_utils.h> @@ -565,7 +564,8 @@ ruserok(const char *rhost, int superuser, const char *ruser, const char *luser) char pbuf[MAXPATHLEN]; uid_t uid = (uid_t)-1; gid_t gid = (gid_t)-1; - gid_t grouplist[NGROUPS_MAX]; + int maxgrp = getgroups(0, NULL); + gid_t *grouplist = alloca(maxgrp * sizeof (gid_t)); int ngroups; sp = rhost; @@ -605,7 +605,7 @@ ruserok(const char *rhost, int superuser, const char *ruser, const char *luser) */ gid = getegid(); uid = geteuid(); - if ((ngroups = getgroups(NGROUPS_MAX, grouplist)) == -1) + if ((ngroups = getgroups(maxgrp, grouplist)) == -1) return (-1); (void) setegid(pwd->pw_gid); |