Date: Tue, 9 Jun 2009 04:58:16 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r193806 - projects/ngroups/sys/sys Message-ID: <200906090458.n594wGZk056204@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Tue Jun 9 04:58:15 2009 New Revision: 193806 URL: http://svn.freebsd.org/changeset/base/193806 Log: Set NGROUPS_MAX to be 1023 since it should be the number of _supplemental_ groups and thus getgroups() should return up to NGROUPS_MAX+1 results on FreeBSD (ignoring for the moment the fact that NGROUPS_MAX isn't actually a maximum value under POSIX). This limits waste in naive applications to a single page. Set NGROUPS to NGROUPS_MAX+1 to properly reflect the in-kernel space requirements. Modified: projects/ngroups/sys/sys/param.h projects/ngroups/sys/sys/syslimits.h Modified: projects/ngroups/sys/sys/param.h ============================================================================== --- projects/ngroups/sys/sys/param.h Tue Jun 9 04:39:47 2009 (r193805) +++ projects/ngroups/sys/sys/param.h Tue Jun 9 04:58:15 2009 (r193806) @@ -77,7 +77,7 @@ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ -#define NGROUPS NGROUPS_MAX /* max number groups */ +#define NGROUPS NGROUPS_MAX+1 /* max number groups */ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ Modified: projects/ngroups/sys/sys/syslimits.h ============================================================================== --- projects/ngroups/sys/sys/syslimits.h Tue Jun 9 04:39:47 2009 (r193805) +++ projects/ngroups/sys/sys/syslimits.h Tue Jun 9 04:58:15 2009 (r193806) @@ -54,7 +54,9 @@ #define MAX_CANON 255 /* max bytes in term canon input line */ #define MAX_INPUT 255 /* max bytes in terminal input */ #define NAME_MAX 255 /* max bytes in a file name */ -#define NGROUPS_MAX 32767 /* max supplemental group id's */ +#ifndef NGROUPS_MAX +#define NGROUPS_MAX 1023 /* max supplemental group id's */ +#endif #ifndef OPEN_MAX #define OPEN_MAX 64 /* max open files per process */ #endif
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906090458.n594wGZk056204>