Subject: Re: group perms
To: None <netbsd-users@NetBSD.org>
From: Eric Fox <eric@bsdsystems.com>
List: netbsd-users
Date: 05/17/2006 05:42:09
I had misunderstood this to be an ownership issue.  As far as I know, 
the only option you have is to make sure umask is set correctly in the 
global shell setup files (/etc/profile, /etc/csh.login, etc), but a user 
can still reset or change their umask in their personal rc files.  
Leaving you with running a chmod command via cron as the only way to be 
SURE that the files maintain the correct permissions.

  /\---/\  Eric J Fox
 /  o o  \ Small Business Computer Support
 \.\   /./ in the Phoenix Metropolitan Area
    \@/    http://www.bsdsystems.com/support/



Steven M. Bellovin wrote:

>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
>