Skip to contentSkip to conversation

fix NGROUPS hard limit (resend)

PATCH In review Timothy Hockin 12 participants 21 messages Oct 22, 2002 – Oct 25, 2002 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 fix NGROUPS hard limit (resend)

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas:
# ChangeSet 1.808 -> 1.809
# include/linux/kernel.h 1.24 -> 1.25

#	        lib/Makefile	1.14    -> 1.15   
#	               (new)	        -> 1.1     lib/bsearch.c  
#	               (new)	        -> 1.1     lib/qsort.c    

#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/10/21 [email protected] 1.809
# Add generic qsort() and bsearch(): qsort() from BSD, bsearch() from glibc # --------------------------------------------
#

include/linux/kernel.h +5 -0
diff -Nru a/include/linux/kernel.h b/include/linux/kernel.h
@@ -215,4 +215,9 @@
 #define __FUNCTION__ (__func__)
 #endif
 
+void qsort(void *base, size_t nmemb, size_t size,
+	int (*compar)(const void *, const void *));
+void *bsearch(const void *key, const void *base, size_t nmemb, size_t size,
+	int (*compar)(const void *, const void *));
+
 #endif
lib/Makefile +3 -2
diff -Nru a/lib/Makefile b/lib/Makefile
@@ -9,10 +9,11 @@
 L_TARGET := lib.a
 
 export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o \
-	       crc32.o rbtree.o radix-tree.o
+	       crc32.o rbtree.o radix-tree.o qsort.o bsearch.o
 
 obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o \
-	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o
+	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
+	 qsort.o bsearch.o
 
 obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
lib/bsearch.c new file +49 -0

49 lines not on this page · raw message

lib/qsort.c new file +180 -0

180 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Timothy Hockin

+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.

Ahem.

Since the copyright holder appears to be the Regents of the University of California, you have permission to remove this (ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change). Also, you must remove this clause for the code to be suitable for inclusion in Linux. Not only is the advertising clause incompatible with the GPL, but imagine what a pain it would be to include this acknowedgement in any sort of advertisement. If you think I'm overreacting, check out this lovely cruft from NetBSD's INSTALL document:

This product includes software developed by the University of California, Berkeley and its contributors.
This product includes software developed by The NetBSD Foundation, Inc. This product includes software developed by the NetBSD Foundation, Inc. and its contributors.
This product includes software developed by the Computer Systems Engi- neering Group at Lawrence Berkeley Laboratory.
This product includes software developed by Adam Glass and Charles Han- num.
This product includes software developed by Adam Glass and Charles M. Hannum.
This product includes software developed by Adam Glass.
This product includes software developed by Alistair G. Crooks. This product includes software developed by Amancio Hasty and Roger Hardiman.
This product includes software developed by Berkeley Software Design, Inc.
This product includes software developed by Bill Paul.
This product includes software developed by Charles D. Cranor and Wash- ington University.
This product includes software developed by Charles D. Cranor. This product includes software developed by Charles Hannum, by the Uni- versity of Vermont and State Agricultural College and Garrett A. Wollman, by William F. Jolitz, and by the University of California, Berkeley, Lawrence Berkeley Laboratory, and its contributors.
This product includes software developed by Charles Hannum. This product includes software developed by Charles M. Hannum. This product includes software developed by Chris Provenzano. This product includes software developed by Christian E. Hopps. This product includes software developed by Christopher G. Demetriou for the NetBSD Project.
This product includes software developed by Christopher G. Demetriou. This product includes software developed by Christos Zoulas. This product includes software developed by David Jones and Gordon Ross. This product includes software developed by Dean Huxley. This product includes software developed by Eric S. Hvozda. This product includes software developed by Ezra Story.
This product includes software developed by Gardner Buchanan. This product includes software developed by Gordon Ross. This product includes software developed by Gordon W. Ross and Leo Wep- pelman.
This product includes software developed by Gordon W. Ross. This product includes software developed by Hauke Fath.
This product includes software developed by HAYAKAWA Koichi. This product includes software developed by Hellmuth Michaelis and Joerg Wunsch.
This product includes software developed by Herb Peyerl. This product includes software developed by Holger Veit and Brian Moore for use with "386BSD" and similar operating systems.
This product includes software developed by Hubert Feyrer for the NetBSD Project.
This product includes software developed by Iain Hibbert. This product includes software developed by Ian W. Dall. This product includes software developed by Ignatios Souvatzis for the NetBSD Project.
This product includes software developed by Jason R. Thorpe for And Com- munications, http://www.and.com/.
This product includes software developed by Joachim Koenig-Baltes. This product includes software developed by Jochen Pohl for The NetBSD Project.
This product includes software developed by John Polstra. This product includes software developed by Jonathan Stone and Jason R. Thorpe for the NetBSD Project.
This product includes software developed by Jonathan Stone for the NetBSD Project.
This product includes software developed by Jonathan Stone. This product includes software developed by Julian Highfield. This product includes software developed by Kenneth Stailey. This product includes software developed by Leo Weppelman. This product includes software developed by Lloyd Parkes. This product includes software developed by Manuel Bouyer. This product includes software developed by Marc Horowitz. This product includes software developed by Mark Brinicombe for the NetB- SD Project.
This product includes software developed by Mark Brinicombe. This product includes software developed by Mark Tinguely and Jim Lowe. This product includes software developed by Markus Wild. This product includes software developed by Martin Husemann and Wolfgang Solfrank.
This product includes software developed by Mats O Jansson and Charles D. Cranor.
This product includes software developed by Mats O Jansson. This product includes software developed by Matthias Pfaller. This product includes software developed by Michael L. Hitch. This product includes software developed by Niels Provos. This product includes software developed by Paul Kranenburg. This product includes software developed by Paul Mackerras. This product includes software developed by Peter Galbavy. This product includes software developed by Philip A. Nelson. This product includes software developed by Rodney W. Grimes. This product includes software developed by Roland C. Dowdeswell. This product includes software developed by Rolf Grossmann. This product includes software developed by Scott Bartram. This product includes software developed by SigmaSoft, Th. Lockert. This product includes software developed by Tatoku Ogaito for the NetBSD Project.
This product includes software developed by Terrence R. Lambert. This product includes software developed by Theo de Raadt and John Brezak.
This product includes software developed by Theo de Raadt. This product includes software developed by Tohru Nishimura for the NetB- SD Project.
This product includes software developed by TooLs GmbH.
This product includes software designed by William Allen Simpson. This product includes software developed by Winning Strategies, Inc. This product includes software developed by Zembu Labs, Inc. This product includes software developed by the Center for Software Sci- ence at the University of Utah.
This product includes software developed by the Computer Systems Labora- tory at the University of Utah.
This product includes software developed by the University of Calgary De- partment of Computer Science and its contributors.
This product includes software developed by the University of Vermont and State Agricultural College and Garrett A. Wollman.
This product includes software developed for the FreeBSD project. This product includes software developed for the Internet Software Con- sortium by Ted Lemon.
This product includes software developed for the NetBSD Project by Frank van der Linden.
This product includes software developed for the NetBSD Project by Jason R. Thorpe.
This product includes software developed for the NetBSD Project by John M. Vinopal.
This product includes software developed for the NetBSD Project by Matthias Drochner.
This product includes software developed for the NetBSD Project by Matthieu Herrb.
This product includes software developed for the NetBSD Project by Perry E. Metzger.
This product includes software developed for the NetBSD Project by Pier- mont Information Systems Inc.
This product includes software developed for the NetBSD Project by Ted Lemon.
This product includes software developed for the NetBSD Project by Wasabi Systems, Inc.
This product includes software developed by LAN Media Corporation and its contributors.
This product includes software developed by Michael Graff for the NetBSD Project.
This product includes software developed by Niklas Hallqvist, C Stone and Job de Haas.
This product includes software developed by Eric Young (eay@min- com.oz.au).
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/).
This product includes software developed by the University of Oregon. This product includes software developed by the University of Southern California and/or Information Sciences Institute.
This product includes software developed by Internet Initiative Japan Inc.
This product includes software developed by Reinoud Zandijk. This product includes software developed at the Information Technology Division, US Naval Research Laboratory.

In the following statement, "This software" refers to the Mitsumi CD-ROM driver:
This software was developed by Holger Veit and Brian Moore for use with "386BSD" and similar operating systems. "Similar operating systems" includes mainly non-profit oriented systems for research and education, including but not restricted to "NetBSD" , "FreeBSD" , "Mach" (by CMU).
In the following statement, "This software" refers to the parallel port driver:
This software is a component of "386BSD" developed by William F. Jolitz, TeleMuse.

#2 lore raw
Quoted 8 lines · Aaron Lehmann
Quoted 4 lines · Timothy Hockin

+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.

Quoted 5 lines

Ahem.

Since the copyright holder appears to be the Regents of the University of California, you have permission to remove this (ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change).

Done, in BK at the same URL. Thanks for the reference.

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]
#4 lore raw
Quoted 2 lines · Alan Cox

Ok sanity check time. Why do you need qsort and bsearch for this kind of thing. Just how many groups do you plan to support ?

Unlimited - we've tested with tens of thousands.

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]
#5 lore raw
Quoted 5 lines · Tim Hockin
Quoted 2 lines · Alan Cox

Ok sanity check time. Why do you need qsort and bsearch for this kind of thing. Just how many groups do you plan to support ?

Unlimited - we've tested with tens of thousands.

Now how about the real world requirements ?

#6 lore raw
Quoted 11 lines · Alan Cox
Quoted 6 lines · Tim Hockin
Quoted 2 lines · Alan Cox

Ok sanity check time. Why do you need qsort and bsearch for this kind of thing. Just how many groups do you plan to support ?

Unlimited - we've tested with tens of thousands.

Now how about the real world requirements ?

Those were real world requirements - we got the number 10,000 from our product management, which (presumably) spoke with customers. On the hosting systems, it is really possible to have thousands of virtual sites.

Now, I don't much care if you want it to be a linear search, and I'll revert it, if needed, but qsort() is already in in XFS specific code, and bsearch is small. It doesn't negatively impact any fast path, and provides better behavior for the crazies that really want 10,000 groups.

Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]
#7 lore raw
Quoted 14 lines · Tim Hockin
Quoted 8 lines · Alan Cox
Quoted 5 lines · Tim Hockin
Quoted 2 lines · Alan Cox

Ok sanity check time. Why do you need qsort and bsearch for this kind of thing. Just how many groups do you plan to support ?

Unlimited - we've tested with tens of thousands.

Now how about the real world requirements ?

Those were real world requirements - we got the number 10,000 from our product management, which (presumably) spoke with customers. On the hosting systems, it is really possible to have thousands of virtual sites.

Quoted 6 lines

Now, I don't much care if you want it to be a linear search, and I'll revert it, if needed, but qsort() is already in in XFS specific code, and bsearch is small. It doesn't negatively impact any fast path, and provides better behavior for the crazies that really want 10,000 groups.

Tim

Does it actually work with NFS???? or any networked file system? Most of them limit ngroups to 16 to 32, and cannot send any data if there is an overflow, since that overflow would replace all of the data you try to send/recieve...

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Signature · 5 lines
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.
#8 lore raw
Quoted 4 lines · Jesse Pollard

Does it actually work with NFS???? or any networked file system? Most of them limit ngroups to 16 to 32, and cannot send any data if there is an overflow, since that overflow would replace all of the data you try to send/recieve...

NFS has a smaller limit, that is correct. An unfortunate limitation.

Quoted 5 lines

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

I'm glad it doesn't affect you. If it was a more common problem, it would have been solved a long time ago. It does affect some people, though. Maybe they can redesign their group structures, but why not remove this arbitrary limit, since we can?

Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]
#9 lore raw
Quoted 8 lines · Tim Hockin
Quoted 5 lines · Jesse Pollard

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Quoted 4 lines

I'm glad it doesn't affect you. If it was a more common problem, it would have been solved a long time ago. It does affect some people, though. Maybe they can redesign their group structures, but why not remove this arbitrary limit, since we can?

For anoncvs this is a common problem.

Each project has its own group and the anoncvs user needs access to all (write access in order to make lock files).

regards,

Rik

Signature · 4 lines
A: No.
Q: Should I include quotations after my reply?

http://www.surriel.com/		http://distro.conectiva.com/
#10 lore raw
In reply to Tim Hockin
Quoted 14 lines · Tim Hockin
Quoted 4 lines · Jesse Pollard

Does it actually work with NFS???? or any networked file system? Most of them limit ngroups to 16 to 32, and cannot send any data if there is an overflow, since that overflow would replace all of the data you try to send/recieve...

NFS has a smaller limit, that is correct. An unfortunate limitation.

Quoted 5 lines

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Quoted 4 lines

I'm glad it doesn't affect you. If it was a more common problem, it would have been solved a long time ago. It does affect some people, though. Maybe they can redesign their group structures, but why not remove this arbitrary limit, since we can?

Think about a while - if a file write (say 1K in length) must include 10000 groups (at 16 bits/group? 32bits?) then the resulting transaction becomes 1K + 2*10K -> 21K (or 1K+4*10K -> 41K). This is over 20 times the overhead.

No I don't expect the structures to be changed that much.

I am in favor of being able to change the limits, but lets be reasonable. I can see a use for 64 groups, but not much over. Even that introduces a practical security problem (leakage of data from one authorized group to unauthorized groups).

By the time you get one or more people with that many groups you may as well put everybody in one group and be done with it.

ACLs would be much more usefull, and controllable than 10000 groups anyway. At least the owner of the file would be able to specify exactly what access is being granted, and to whom.

BTW, a bsearch algorithm is slow compaired to a radix search in sparse trees...

Signature · 5 lines
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.
#11 lore raw
Quoted 2 lines · Jesse Pollard

I am in favor of being able to change the limits, but lets be reasonable. I can see a use for 64 groups, but not much over.

Anoncvs.

Rik

Signature · 4 lines
A: No.
Q: Should I include quotations after my reply?

http://www.surriel.com/		http://distro.conectiva.com/
#12 lore raw
In reply to Tim Hockin
Quoted 15 lines · Tim Hockin
Quoted 4 lines · Jesse Pollard

Does it actually work with NFS???? or any networked file system? Most of them limit ngroups to 16 to 32, and cannot send any data if there is an overflow, since that overflow would replace all of the data you try to send/recieve...

NFS has a smaller limit, that is correct. An unfortunate limitation.

Quoted 5 lines

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Quoted 4 lines

I'm glad it doesn't affect you. If it was a more common problem, it would have been solved a long time ago. It does affect some people, though. Maybe they can redesign their group structures, but why not remove this arbitrary limit, since we can?

This is a real, if not terribly common problem here too. Thanks for addressing the issue...

Signature · 1 line
	- Panu -
#13 lore raw
Quoted 9 lines · Panu Matilainen
Quoted 7 lines · Tim Hockin
Quoted 4 lines · Jesse Pollard

Does it actually work with NFS???? or any networked file system? Most of them limit ngroups to 16 to 32, and cannot send any data if there is an overflow, since that overflow would replace all of the data you try to send/recieve...

Quoted 4 lines
Quoted 1 line

NFS has a smaller limit, that is correct. An unfortunate limitation.

This is a real, if not terribly common problem here too. Thanks for addressing the issue...

Now i'll poke my stick into the hornets nest...

What i think would be much more usefull and could be supported by NFS et al would be to allow groups to be members of other groups.

Method 1 -- explicitly:

example group file extract:
webroot:x:103:www,jim,joy custadm:x:140:%webroot,bob,carol,ted,alice webcusts:x:1000:%webcust1,%webcust2,%webcust3 webcust1:x:1001:%custadm,%custwebs,Matt,Christoph webcust2:x:1002:%custadm,%custwebs,Suparna,Aaron,Tim webcust3:x:1003:%custadm,%custwebs,Randal,Jesse

I'm using the % prefix here to specify the group namespace.

It would require permissions checking to aquire a list of groups that are group members.

Now, changing it at this level would require that the libs be updated (but so would infinite groups) and a way to inform the kernel of the nested group memberships.

For informing the kernel i lean toward a sysfs interface fed by a user-space utility that would build or update a pinned table. The in-kernel group lists would be unrolled (per the example webroot=custadm,webcust1,webcust2,webcust3)

There would be problems with existing utilities due to the new logic but that is a fairly small set and it might not be unreasonable to provide an infinite NGROUPS emulation. Also multiple inheritance and loops would have to be caught.

It also provides a way to have 400 (out of 16000) users in a group without infinite line length in /etc/group.

Method 2 -- implicitly:

Have the sysfs interface fed by a utility that would use a separate config file. The group file would be constructed as though NGROUPS were infinite.

When setgroups is called with size > NGROUPS it would have to search for any entries that matched the list (yuck). Match failure would error with EINVAL

The only change to libs and utilities would be to lift NGROUPS_MAX. The need for explicity group numbers would be so it would work over networks.

This method has far too much magic for my taste and the potential for admin error in maintaining separate files is frightening.

The implicit method could be restricted to an extension to NFS but then you would need to have the match cached in task_struct (reset by setgroups).

The important thing either way would be that you would save on memory for group lists and it would work over NFS without a protocol change.

I've actually wanted the nested group memberships for a long time.

The only other idea I've had for accommodating NFS and other remote FS for processes having excessive NGROUPS is to have the client fetch the ownership and ACLs and execute the access specifying the applicable subset of groups. This would not be good for performance but might possibly be done with the existing protocols and might be better performance-wise than sending kilobytes of GIDs with every RPC call.

Signature · 5 lines
________________________________________________________________
	J.W. Schultz            Pegasystems Technologies
	email address:		[email protected]

		Remember Cernan and Schmitt
#14 lore raw
Quoted 7 lines
	example group file extract:
		webroot:x:103:www,jim,joy
		custadm:x:140:%webroot,bob,carol,ted,alice
		webcusts:x:1000:%webcust1,%webcust2,%webcust3
		webcust1:x:1001:%custadm,%custwebs,Matt,Christoph
		webcust2:x:1002:%custadm,%custwebs,Suparna,Aaron,Tim
		webcust3:x:1003:%custadm,%custwebs,Randal,Jesse

I've always wanted something like this. It really is not too difficult to do, but it is entirely a library problem.

Quoted 4 lines

Now, changing it at this level would require that the libs be updated (but so would infinite groups) and a way to inform the kernel of the nested group memberships.

unlimited groups requires a TRIVIAL change to libc.

Quoted 5 lines

For informing the kernel i lean toward a sysfs interface fed by a user-space utility that would build or update a pinned table. The in-kernel group lists would be unrolled (per the example webroot=custadm,webcust1,webcust2,webcust3)

gahh..Why does the kernel need to know about a group and members? At login time (or rather, setgroups() time, likely login, but could be other) getgrent() or whatnot does a full expansion on the nested group file (handling recursion properly!). You call setgroups() with the full list of GIDs for your user. The kernel should not know about a group beyond a GID, unless we're talking about vastly different semantics than traditional users and groups.

Quoted 1 line

There would be problems with existing utilities due

problems with things that parse /etc/group. Not problems with things that use the getgr*() functions.

Quoted 3 lines

It also provides a way to have 400 (out of 16000) users in a group without infinite line length in /etc/group.

Line length is/was an real issue. Last I tried to do something like having 5000 users in a group, libc would not parse it. Can't say I've tried lately. That, however, is another purely library problem.

Quoted 3 lines

The important thing either way would be that you would save on memory for group lists and it would work over NFS without a protocol change.

No, it wouldn't work on NFS except to another system which understands this scheme. The patch I proposed uses CoW grouplists. This is good enough for the vast majority of cases - not too many apps call setgroups() themselves, being a restricted syscall, and all that.

Quoted 2 lines

I've actually wanted the nested group memberships for a long time.

So have I, but it is a different problem...Patches should be sent to glibc developers.

#15 lore raw
In reply to Jesse Pollard
Quoted 6 lines · Jesse Pollard

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Large CVS hosting operations like GNU Savannah have historically used patches to increase NGROUPS. Using one group per project in CVS is the sanest way to manage a big repository with complex permissions.

miket

#16 lore raw
Quoted 10 lines · Mike Touloumtzis
Quoted 5 lines · Jesse Pollard

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

Large CVS hosting operations like GNU Savannah have historically used patches to increase NGROUPS. Using one group per project in CVS is the sanest way to manage a big repository with complex permissions.

OK, I'll bite..

Why is this?

I saw the post about having to have access to a lock directory by a cvsuser, but how is that different than having that directory with an ACL entry that includes the cvsuser? Or an ACL that includes the group that the cvsuser is a member of?

Granted, each project repository would have such a directory for locks belonging to the project, but that seems to already be the case. Setting up the ACL would just be one additional step in setting up a project.

Signature · 5 lines
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.
#17 lore raw
Quoted 9 lines · Jesse Pollard
Quoted 4 lines · Mike Touloumtzis

Large CVS hosting operations like GNU Savannah have historically used patches to increase NGROUPS. Using one group per project in CVS is the sanest way to manage a big repository with complex permissions.

OK, I'll bite..

Why is this?

I only learned about this by reading the docs on Savannah; the admins can provide better information. But my understanding is simply that they have M users and N projects, and they want the system to support any number of permission pairs from M x N, i.e. they want each user to be able to commit to an arbitrary number of projects. And CVS relies on OS permissions.

Quoted 4 lines

I saw the post about having to have access to a lock directory by a cvsuser, but how is that different than having that directory with an ACL entry that includes the cvsuser? Or an ACL that includes the group that the cvsuser is a member of?

I guess they prefer to use traditional Unix permissions rather than ACLs. I have the same preference. Unix groups are well supported by tools and the kind of permission setup I described above is nicely transparent to administer. Granting a user write access to a project is simply 'adduser username projectname', and a project can easily support a large number of writers without big ACLs.

The issue is not just lock directories, but the right to change any file in a project, i.e. full CVS commit access to the project rather than anonymous access. So they would need an ACL on each file in the repository, and they would need new files to inherit ACLs from their parent directories (I've never used ACLs on Linux but I assume this kind of thing is supported).

miket

#18 lore raw
Quoted 8 lines · Mike Touloumtzis
Quoted 7 lines · Jesse Pollard
Quoted 3 lines · Mike Touloumtzis

Large CVS hosting operations like GNU Savannah have historically used patches to increase NGROUPS. Using one group per project in CVS is the sanest way to manage a big repository with complex permissions.

OK, I'll bite..

Quoted 7 lines
Quoted 1 line

Why is this?

I only learned about this by reading the docs on Savannah; the admins can provide better information. But my understanding is simply that they have M users and N projects, and they want the system to support any number of permission pairs from M x N, i.e. they want each user to be able to commit to an arbitrary number of projects. And CVS relies on OS permissions.

Thats what I thought. Essentially, all projects are world rw if all users have access to all projects.

Quoted 12 lines
Quoted 4 lines

I saw the post about having to have access to a lock directory by a cvsuser, but how is that different than having that directory with an ACL entry that includes the cvsuser? Or an ACL that includes the group that the cvsuser is a member of?

I guess they prefer to use traditional Unix permissions rather than ACLs. I have the same preference. Unix groups are well supported by tools and the kind of permission setup I described above is nicely transparent to administer. Granting a user write access to a project is simply 'adduser username projectname', and a project can easily support a large number of writers without big ACLs.

Quoted 3 lines

The issue is not just lock directories, but the right to change any file in a project, i.e. full CVS commit access to the project rather than anonymous access.

As soon as everyone is in every group you get anonymous access. You would also have the same result by putting all of the CVS files in one group.

Or by just making the directories/files world rwx/rw.

Quoted 4 lines

So they would need an ACL on each file in the
repository, and they would need new files to inherit ACLs from their parent directories (I've never used ACLs on Linux but I assume this kind of thing is supported).

Actually it depends on the implementation. I believe some of the ACL specs on a directory can be specified to be inherited (I'll have to check the POSIX ACL definitions, but I remember a number of capabilities available on directories that didn't exist for files-- yup - It's called a "default ACL" and can be used to set UGO access, protection masking and user acess controls).

In the scenario above, I would most likey specify an ACL to include specific groups of users. That way it wouldn't necessarily be equivalent to a world rw access.

Signature · 5 lines
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: [email protected]

Any opinions expressed are solely my own.
#19 lore raw
In reply to Jesse Pollard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Jesse" == Jesse Pollard <[email protected]> writes:

Quoted 14 lines · Tim Hockin
Quoted 14 lines
Quoted 8 lines · Alan Cox
Quoted 5 lines · Tim Hockin
Quoted 2 lines · Alan Cox

Ok sanity check time. Why do you need qsort and bsearch for this kind of thing. Just how many groups do you plan to support ?

Unlimited - we've tested with tens of thousands.

Now how about the real world requirements ?

Those were real world requirements - we got the number 10,000 from our product management, which (presumably) spoke with customers. On the hosting systems, it is really possible to have thousands of virtual sites.

Quoted 6 lines
Quoted 6 lines

Now, I don't much care if you want it to be a linear search, and I'll revert it, if needed, but qsort() is already in in XFS specific code, and bsearch is small. It doesn't negatively impact any fast path, and provides better behavior for the crazies that really want 10,000 groups.

Tim

Jesse> Does it actually work with NFS???? or any networked file Jesse> system? Most of them limit ngroups to 16 to 32, and cannot Jesse> send any data if there is an overflow, since that overflow Jesse> would replace all of the data you try to send/recieve...

Jesse> And I really doubt that anybody has 10000 unique groups (or Jesse> even close to that) running under any system. The center I'm at Jesse> has some of the largest UNIX systems ever made, and there are Jesse> only about 600 unique groups over the entire center. The Jesse> largest number of groups a user can be in is 32. And nobody Jesse> even comes close.

  $ ypcat group | wc -l
  9527
  $ ypcat passwd | wc -l
  62076

Yes, we're insane :-)

OTOH, we use AFS and PTS groups, because Unix groups don't scale. And we would not use the ngroups mechanism in Linux even if it did, because we need to inter-operate with Solaris.

Cheers, Hildo

#20 lore raw
In reply to Jesse Pollard
Quoted 5 lines · Jesse Pollard

And I really doubt that anybody has 10000 unique groups (or even close to that) running under any system. The center I'm at has some of the largest UNIX systems ever made, and there are only about 600 unique groups over the entire center. The largest number of groups a user can be in is 32. And nobody even comes close.

It happens. We have a bunch of webservers with the web user in thousands of groups, and we ran into the per-process limit a long, long time ago. My solution was a bit simpler, however:

static int supplemental_group_member(gid_t grp)

 {
        int i = current->ngroups;

+ if (current->uid == 80)
+ if (grp >= 1000)
+ return 1;

O:)

This allows us to have a group-per-user policy where the web server has access to each user's files without allowing any user to have access to files belonging to any other user, which is quite useful.

Simon-

[        Simon Kirby        ][        Network Operations        ]
[     [email protected]     ][     NetNation Communications     ]

[ Opinions expressed are not necessarily those of my employer. ]