From owner-freebsd-hackers@FreeBSD.ORG Mon Mar 23 03:00:54 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 55DC3106566B for ; Mon, 23 Mar 2009 03:00:54 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: from acm.poly.edu (acm.poly.edu [128.238.9.200]) by mx1.freebsd.org (Postfix) with ESMTP id E8CBE8FC14 for ; Mon, 23 Mar 2009 03:00:53 +0000 (UTC) (envelope-from spawk@acm.poly.edu) Received: (qmail 1173 invoked from network); 23 Mar 2009 02:34:11 -0000 Received: from unknown (HELO ?192.168.0.2?) (spawk@69.123.45.64) by acm.poly.edu with AES256-SHA encrypted SMTP; 23 Mar 2009 02:34:11 -0000 Message-ID: <49C6F4F4.5030609@acm.poly.edu> Date: Sun, 22 Mar 2009 22:33:24 -0400 From: Boris Kochergin User-Agent: Thunderbird 2.0.0.19 (X11/20090108) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: 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 03:00:54 -0000 Ahoy. I got bitten by this today--a system I administer for someone had users in more than 16 groups, so I had to bump the value, recompile the kernel, and reboot. It seems desirable to (at the very least) make this a read-only tunable that can be set using /boot/loader.conf, so as to avoid source modification and kernel recompilation. I had a look around, and noticed that NGROUPS_MAX is used to construct static arrays in a couple of locations ("ibcs2_gid_t iset[NGROUPS_MAX];"). It seems that malloc(9)/MALLOC(9) can be used to allocate memory for the array instead, and panic() (or something) can be called if the allocation fails, no? Is that about the gist of it? If I'm not overlooking something major, I'd like to take a stab at it. -Boris