From owner-freebsd-questions Mon Dec 4 0:56:18 2000 From owner-freebsd-questions@FreeBSD.ORG Mon Dec 4 00:56:17 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id ADD9C37B400 for ; Mon, 4 Dec 2000 00:56:16 -0800 (PST) Received: (qmail 19248 invoked by uid 100); 4 Dec 2000 08:56:16 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14891.23600.60352.296277@guru.mired.org> Date: Mon, 4 Dec 2000 02:56:16 -0600 (CST) To: Dmitry Karasik Cc: questions@freebsd.org Subject: Re: NGROUPS_MAX in sys/syslimits.h In-Reply-To: <121570471@toto.iv> X-Mailer: VM 6.75 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ X-Message: You should get a better mailer. Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dmitry Karasik types: > I recently found myself in "too many groups", as LIBC complains; > I found that somehow that if I present in more than in 16 groups ( what > is exactly that value of NGROUPS_MAX in sys/syslimits.h), I run into > problems. Well, first thing that popped out was to recompile LIBC, and maybe > I'll do that (later), but I'm just curious - how come that 16 is a limit? > Didn't anyone before run into this "implementation flaw"? Or, maybe, there > exists some better solution? Yup, I ran into it the first time I wanted to use a BSD that supported multiple group memberships in a commercial environment. We wanted ~100s of groups per user. Contemplating the effect that changing NGROUPS_MAX to that would have on kernel memory usage made me go look for a better solution (and I found one). It exists for the same reason hard limits exist in so many other places - because Unix was written when machines were much smaller and slower (I was once at a site that ran into a bug with Unix if you put more than 256K or so in a machine), and it was faster and more space efficient just to set up a hard limit than to implement a linked list for this case. It's still there because nobody who has the time, inclination and talent to fix it has ever been hit by the limit in such a way as to make fixing it a reasonable solution. Which begs the question - why do you need so many groups? There may be a better solution to the problem that's causing that than kernel groups. http://www.mired.org/home/mwm/ Independent WWW/Unix/FreeBSD consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message