svn commit: r194552 - head/sys/i386/ibcs2

Brooks Davis brooks at FreeBSD.org
Sat Jun 20 18:52:02 UTC 2009


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);


More information about the svn-src-head mailing list