Date: Mon, 8 Jul 1996 11:00:39 -0400 From: Garrett Wollman <wollman@lcs.mit.edu> To: James Raynard <fqueries@jraynard.demon.co.uk> Cc: zach@blizzard.gaffaneys.com, freebsd-questions@freebsd.org Subject: Re: What's up with ownership? Message-ID: <9607081500.AA03598@halloran-eldar.lcs.mit.edu> In-Reply-To: <199607062246.WAA03437@jraynard.demon.co.uk> References: <87n31da1pa.fsf@freebsd.gaffaneys.com> <199607062246.WAA03437@jraynard.demon.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
<<On Sat, 6 Jul 1996 22:46:19 GMT, James Raynard <fqueries@jraynard.demon.co.uk> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9607081500.AA03598>