Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ucla-cs!ames!ucbcad!ucbvax!jade!eris!mwm From: mwm@eris.BERKELEY.EDU (Mike (No one lives forever.) Meyer) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Groups in 4BSD (Was: System V letting random users chown) Message-ID: <2837@jade.BERKELEY.EDU> Date: Tue, 17-Mar-87 20:14:23 EST Article-I.D.: jade.2837 Posted: Tue Mar 17 20:14:23 1987 Date-Received: Thu, 19-Mar-87 07:23:05 EST References: <713@aw.sei.cmu.edu.sei.cmu.edu> <15054@sun.uucp> <2454@mtgzy.UUCP> <15136@sun.uucp> Sender: usenet@jade.BERKELEY.EDU Reply-To: mwm@eris.BERKELEY.EDU (Mike (No one lives forever.) Meyer) Organization: Missionaria Phonibalonica Lines: 35 Xref: mnetor comp.unix.questions:1492 comp.unix.wizards:1499 In article <15136@sun.uucp> guy%gorodish@Sun.COM (Guy Harris) writes: >How it works: > When you log in, your effective group ID is set to the number > in the group field of your "/etc/passwd" entry. Your group > set is initialized from { group ID in "/etc/passwd" } (union) > (although Not quite, Guy. I think it's just confusing terminolgy, though. Your effective group id is set from the group field in /etc/passwd. Your group set is the set of groups your in /etc/group, EXCEPT for the group that is your group id. The operation is set difference, not union. In addition, if you use the setregid system call to set your real group id to a group that's in your group set, it will be taken from your group set. A second setregid back to the original group id will not put things back, so that the group will have vanished from your group set. The semantics of the gid/group set aren't very clean. If you're going to be writing code that dynamically deals with either one, be carefull, or you'll surprise yourself. Finally, notice that Guy's limit of 16 users is 4.3BSD. It was 8 in 4.2.