Subject: Re: Group IDs of directories (was Re: Sticky bit?)
To: Curt Sampson <cjs@portal.ca>
From: Todd Vierling <tv@pobox.com>
List: netbsd-users
Date: 09/10/1997 15:19:36
On Wed, 10 Sep 1997, Curt Sampson wrote:

: > This is a weirdness that's partly 4.4BSD's fault.  New files in directories
: > are created with the group-id of that directory, which is IMHO a bad idea.
: 
: To tell you the truth, I find this terribly convenient. It makes
: it a lot easier to share files with varying groups of people without
: checking and changing ownership all the time.

Well, in some cases I will admit its convenience.  That's why I propose
utilising the following method of determining the group ID of a new file
(this is a detailed description of what I proposed in the previous message).
This would afford the security of owner's group IDs, while allowing shared
group IDs in two ways.  In your circumstance, Curt, there should be no
changes on your part since everyone *should* be part of the shared group,
right?  :)

Given PDGID = the group ID of the parent directory of the file, and FGID =
the new file's group ID,

If effective user ID == 0, FGID = PDGID.*
Else, if parent directory is set-gid, FGID = PDGID.
Else, if the PDGID is one of the creator's current groups, FGID = PDGID.
Else, PDGID = effective group ID (primary group ID) of creator.

* In addition to a sysctl to revert to "old" group ID semantics, this
step should have a sysctl that bypasses it (i.e. root has no special
handling).

Feeping creaturism, isn't it wonderful?  But you never know.  Comments
please!  Particularly from anyone that knows what POSIX dictates in ffs. 

=====
== Todd Vierling (Personal tv@pobox.com; Business tv@lucent.com)
== I know you like the Internet, Bobby.  Now go eat your Frosted Flakes.