From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 23 12:57:53 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 471861065673 for ; Mon, 23 Mar 2009 12:57:53 +0000 (UTC) (envelope-from fergus@cobbled.net) Received: from mail1.slb.deg.dub.stisp.net (mail1.slb.deg.dub.stisp.net [84.203.253.98]) by mx1.freebsd.org (Postfix) with SMTP id 92D1B8FC0C for ; Mon, 23 Mar 2009 12:57:52 +0000 (UTC) (envelope-from fergus@cobbled.net) Received: (qmail 26485 invoked from network); 23 Mar 2009 12:51:11 -0000 Received: from unknown (HELO holyman.cobbled.net) (84.203.180.117) by mail1.slb.deg.dub.stisp.net with SMTP; 23 Mar 2009 12:51:11 -0000 Received: by holyman.cobbled.net (Postfix, from userid 16385) id D11861031D; Mon, 23 Mar 2009 12:51:10 +0000 (UTC) Date: Mon, 23 Mar 2009 12:51:10 +0000 From: ttw+bsd@cobbled.net To: Boris Kochergin , freebsd-hackers@FreeBSD.ORG Message-ID: <20090323125110.GB8686@holyman.cobbled.net> Mail-Followup-To: Boris Kochergin , freebsd-hackers@FreeBSD.ORG References: <49C6F4F4.5030609@acm.poly.edu> <20090323043937.GA61818@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090323043937.GA61818@zim.MIT.EDU> Cc: Subject: Re: Doing away with NGROUPS_MAX in src/sys/sys/syslimits.h? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2009 12:57:53 -0000 On 23.03-00:39, David Schultz wrote: [ ... ] > There's already a kern.ngroups sysctl, but there are many places > where `ngroups' needs to be used in preference to NGROUPS in the > kernel. In userland, sysconf(_SC_NGROUPS_MAX) needs to be used in > preference to NGROUPS_MAX. you will also note that, as you look at this more, NGROUPS_MAX controls very little regarding the relevant buffers and, generally, without reviewing it again to be specific i'd suggest that you may expose a number of buffer overruns but will most certainally not get the 'correct' behaviour from the change. i.e. removing NGROUPS_MAX may remove an error message from setgroups but will not increase the buffer allocations or alter relevant code to check NGROUPS_MAX correctly.