Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jun 2009 18:52:02 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r194552 - head/sys/i386/ibcs2
Message-ID:  <200906201852.n5KIq2dL084126@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Sat Jun 20 18:52:02 2009
New Revision: 194552
URL: http://svn.freebsd.org/changeset/base/194552

Log:
  Use NGROUPS instead of NGROUPS_MAX as the limits on setgroups and
  getgroups for ibcs emulation.  It seems vanishingly likely any
  programs will actually be affected since they probably assume a much
  lower value and use a static array size.

Modified:
  head/sys/i386/ibcs2/ibcs2_misc.c

Modified: head/sys/i386/ibcs2/ibcs2_misc.c
==============================================================================
--- head/sys/i386/ibcs2/ibcs2_misc.c	Sat Jun 20 18:39:18 2009	(r194551)
+++ head/sys/i386/ibcs2/ibcs2_misc.c	Sat Jun 20 18:52:02 2009	(r194552)
@@ -664,7 +664,7 @@ ibcs2_getgroups(td, uap)
 
 	if (uap->gidsetsize < 0)
 		return (EINVAL);
-	ngrp = MIN(uap->gidsetsize, NGROUPS_MAX);
+	ngrp = MIN(uap->gidsetsize, NGROUPS);
 	gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK);
 	error = kern_getgroups(td, &ngrp, gp);
 	if (error)
@@ -692,7 +692,7 @@ ibcs2_setgroups(td, uap)
 	gid_t *gp;
 	int error, i;
 
-	if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS_MAX)
+	if (uap->gidsetsize < 0 || uap->gidsetsize > NGROUPS)
 		return (EINVAL);
 	if (uap->gidsetsize && uap->gidset == NULL)
 		return (EINVAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906201852.n5KIq2dL084126>