summaryrefslogtreecommitdiff
path: root/sys/kern/init_sysctl.c
diff options
context:
space:
mode:
authordsl <dsl@NetBSD.org>2007-06-30 13:32:14 +0000
committerdsl <dsl@NetBSD.org>2007-06-30 13:32:14 +0000
commit04c196a6420d4f0e19aaab4e331e429b4fd8fa19 (patch)
tree0cd82f4366664779583eda36a352e49dd0fa173a /sys/kern/init_sysctl.c
parent5092d427158952b0293c49a6f537f5358eb87b6c (diff)
Add a flags parameter to kauth_cred_get/setgroups() so that sys_set/setgroups
can copy directly to/from userspace. Avoids exposing the implementation of the group list as an array to code outside kern_auth.c. compat code and man page need updating.
Diffstat (limited to 'sys/kern/init_sysctl.c')
-rw-r--r--sys/kern/init_sysctl.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/init_sysctl.c b/sys/kern/init_sysctl.c
index ae8cd487d08..1510f3a2b2a 100644
--- a/sys/kern/init_sysctl.c
+++ b/sys/kern/init_sysctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init_sysctl.c,v 1.101 2007/05/17 14:51:38 yamt Exp $ */
+/* $NetBSD: init_sysctl.c,v 1.102 2007/06/30 13:32:14 dsl Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.101 2007/05/17 14:51:38 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_sysctl.c,v 1.102 2007/06/30 13:32:14 dsl Exp $");
#include "opt_sysv.h"
#include "opt_multiprocessor.h"
@@ -2732,7 +2732,8 @@ fill_kproc2(struct proc *p, struct kinfo_proc2 *ki)
ki->p_ngroups = kauth_cred_ngroups(p->p_cred);
kauth_cred_getgroups(p->p_cred, ki->p_groups,
- min(ki->p_ngroups, sizeof(ki->p_groups) / sizeof(ki->p_groups[0])));
+ min(ki->p_ngroups, sizeof(ki->p_groups) / sizeof(ki->p_groups[0])),
+ UIO_SYSSPACE);
ki->p_jobc = p->p_pgrp->pg_jobc;
if ((p->p_lflag & PL_CONTROLT) && (tp = p->p_session->s_ttyp)) {