Subject: Re: group perms
To: Eric Fox <eric@bsdsystems.com>
From: Steven M. Bellovin <smb@cs.columbia.edu>
List: netbsd-users
Date: 05/16/2006 22:26:01
On Tue, 16 May 2006 19:17:38 -0700, Eric Fox <eric@bsdsystems.com> wrote:

> What you want to do is set the SGID bit either 'chmod g+s dirname' or, 
> numerically, add 2000 to your numeric permissions, i.e.: for directory 
> permissions of 775, use chmod to set the permissions to 2775 so the SGID 
> bit is set, which should cause all new files and subdirectories to 
> inherit the group ownership.
> 

The issue is what is the group id of files -- and directories -- created
in a directory.  The convention in early Solaris -- a decision made after
the System V/Solaris merge -- which I think that NetBSD follows, is that
the SETGID bit controls that.  If it's off, it's the effective gid of the
creating process; if it's on, it's the GID of the directory.  Neither
value affects the umask.  You thus need to have both SETGID set on the
directory *and* have users have a umask of, say, 002 or 007.


		--Steven M. Bellovin, http://www.cs.columbia.edu/~smb