Module Name:    src
Committed By:   bouyer
Date:           Sat Nov 28 16:01:03 UTC 2009

Modified Files:
        src/lib/libpuffs [netbsd-5]: creds.c

Log Message:
Pull up following revision(s) (requested by pooka in ticket #1155):
        lib/libpuffs/creds.c: revision 1.15
In getgroups(), copy only up to the number of supplementary groups
that actually exist.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.12.1 src/lib/libpuffs/creds.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libpuffs/creds.c
diff -u src/lib/libpuffs/creds.c:1.14 src/lib/libpuffs/creds.c:1.14.12.1
--- src/lib/libpuffs/creds.c:1.14	Sat Dec  8 19:57:02 2007
+++ src/lib/libpuffs/creds.c	Sat Nov 28 16:01:03 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: creds.c,v 1.14 2007/12/08 19:57:02 pooka Exp $	*/
+/*	$NetBSD: creds.c,v 1.14.12.1 2009/11/28 16:01:03 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: creds.c,v 1.14 2007/12/08 19:57:02 pooka Exp $");
+__RCSID("$NetBSD: creds.c,v 1.14.12.1 2009/11/28 16:01:03 bouyer Exp $");
 #endif /* !lint */
 
 /*
@@ -85,10 +85,11 @@
 
 	if (!UUCCRED(pkcr)) {
 		errno = EOPNOTSUPP;
+		*ngids = 0;
 		return -1;
 	}
 
-	ncopy = MIN(*ngids, NGROUPS);
+	ncopy = MIN(*ngids, pkcr->pkcr_uuc.cr_ngroups);
 	(void)memcpy(rgids, pkcr->pkcr_uuc.cr_groups, sizeof(gid_t) * ncopy);
 	*ngids = (short)ncopy;
 

Reply via email to