From owner-freebsd-questions Mon Jul 8 08:01:29 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id IAA09893 for questions-outgoing; Mon, 8 Jul 1996 08:01:29 -0700 (PDT) Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id IAA09880 for ; Mon, 8 Jul 1996 08:01:25 -0700 (PDT) Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA03598; Mon, 8 Jul 1996 11:00:39 -0400 Date: Mon, 8 Jul 1996 11:00:39 -0400 From: Garrett Wollman Message-Id: <9607081500.AA03598@halloran-eldar.lcs.mit.edu> To: James Raynard Cc: zach@blizzard.gaffaneys.com, freebsd-questions@freebsd.org Subject: Re: What's up with ownership? In-Reply-To: <199607062246.WAA03437@jraynard.demon.co.uk> References: <87n31da1pa.fsf@freebsd.gaffaneys.com> <199607062246.WAA03437@jraynard.demon.co.uk> Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk < said: >> Are files created in a directory >> supposed to have the same gid as the directory (when the directory >> doesn't have the setgid bit on), or does FreeBSD have a bug? > No bugs, this is how it's meant to work! :-) It's worth explaining why this is the Right Thing. Say John and Jane are working on a project together. To make file-sharing easier, they create a group, `jjproj', and a directory, `/home/jjproj', mode ug=rwx,o=rx, owner `root', group `jjproj', and agree to use a umask of 002. Now consider what happens with the SysV behavior when John creates a file. His primary group is not `jjproj', it's something more general like `users' or `devel' or `staff'. Under System V, when he creates a file in this directory, it still gets assigned a group of `users'. Oh dear! Now all of the people in group `users'---all the users in the system, most likely---have write access to this file. To get the correct group, he has to manually change it, which leaves lots of room for errors and race conditions. Consider by contrast the BSD model. John creates `/home/jjproj/foo', and it automatically belongs to the same group as is able to write to the `/home/jjproj' directory in the first place, which is exactly the right thing. Rather than introduce warts to selectively enable this behavior depending on some random selection of circumstances, BSD simply applies this model consistently throughout the filesystem, even in places where it is not obviously useful. -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant