From 9f668d8be9abf086e6625cd04b131dd2c0248747 Mon Sep 17 00:00:00 2001 From: rpaulo Date: Mon, 5 Jun 2006 13:25:28 +0000 Subject: [PATCH] Call to kauth_cred_getgroups() should use kauth_cred_ngroups() result, not the size of the array. --- sys/miscfs/portal/portal_vnops.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/miscfs/portal/portal_vnops.c b/sys/miscfs/portal/portal_vnops.c index cf8434920f0c..3c304288220f 100644 --- a/sys/miscfs/portal/portal_vnops.c +++ b/sys/miscfs/portal/portal_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: portal_vnops.c,v 1.64 2006/05/14 21:31:53 elad Exp $ */ +/* $NetBSD: portal_vnops.c,v 1.65 2006/06/05 13:25:28 rpaulo Exp $ */ /* * Copyright (c) 1992, 1993 @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.64 2006/05/14 21:31:53 elad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: portal_vnops.c,v 1.65 2006/06/05 13:25:28 rpaulo Exp $"); #include #include @@ -397,8 +397,7 @@ portal_open(v) pcred.pcr_uid = kauth_cred_geteuid(ap->a_cred); pcred.pcr_gid = kauth_cred_getegid(ap->a_cred); pcred.pcr_ngroups = kauth_cred_ngroups(ap->a_cred); - kauth_cred_getgroups(ap->a_cred, pcred.pcr_groups, - sizeof(pcred.pcr_groups) / sizeof(pcred.pcr_groups[0])); + kauth_cred_getgroups(ap->a_cred, pcred.pcr_groups, pcred.pcr_ngroups); aiov[0].iov_base = &pcred; aiov[0].iov_len = sizeof(pcred); aiov[1].iov_base = pt->pt_arg;