Re: Max group membership Kernel 2.2
- From
- Christian Weisgerber <naddy@...>
- Date
Mathias Waack <mathias@...> wrote: > On Friday 17 May 2002 14:20, Jan Weintz wrote: > > mich würde interessieren, ob es (immer noch) stimmt, daß unter Kernel > > 2.2 die Anzahl der Gruppen, denen ein user zugehören darf, auf 32 > > (irgendwo her flog mir auch 16 zu) begrenzt ist. Ist das so? War das so? > > Wird das so bleiben :-)? NFS hat eine Beschränkung auf maximal 16 Gruppen. > Kann ich mir kaum vorstellen. Also IMHO: es ist nicht so, war nie so und wird > nie so werden. Der Kernel weiss doch gar nicht, zu welchen Gruppen Du > gehoerst. Doch, das weiß er. Und wenn ich es wissen will, dann frage ich ihn mit getgroups(2). Seitdem das BSD-Modell der Supplementärgruppen in der Unix-Welt Einzug gehalten hat, muss er das auch wissen. > Deshalb kannst Du z.B. auch nicht einfach ein setgid(2) aufrufen. Dass darfst > Du nur als Root (genauer: wenn Du die capability CAP_SETGID hast). Da geht > der Kernel halt davon aus, dass Du weisst was Du tust. Daher ist newgrp(1) > auch set-uid root. Stevens beschreibt den Sachverhalt so schön, dass ich es hier einfach zitiere (Abschnitt 6.5, S. 150f.): "The use of groups in Unix has changed over time. With Version 7, each user belonged to a single group at any point in time. When we logged in we were assigned the real group ID corresponding to the numerical group ID in our password file entry. We could change this at any point by executing newgrp(1). If the newgrp command succeeded (refer to the manual page for the permission rules), our real group ID was changed to the new group's ID, and this was used for all subsequent file access permission checks. We could always go back to our original group by executing newgrp without any arguments. This form of group membership persisted until it was changed in 4.2BSD (circa 1983). With 4.2BSD the concept of supplementary group IDs was introduced. Not only did we belong to the group corresponding to the group ID in our password file entry, we could also belong to up to 16 additional groups. The file access permission checks were modified so that not only was the effective group ID compared to the file's group ID, but all the supplementary group IDs were also compared to the file's group ID. The advantage in using supplementary group IDs is that we no longer have to change groups explicitly. It is not uncommon to belong to multiple groups (i.e., participate in multiple projects) at the same time." -- Christian "naddy" Weisgerber naddy@...
Thread
In reply to: Re: Max group membership Kernel 2.2 Mathias Waack <mathias@...>