BSD file system

Barry Margolin barmar at kulla
Sat Oct 21 07:10:28 AEST 1989


In article <38688 at wlbr.IMSD.CONTEL.COM> sms at WLV.IMSD.CONTEL.COM.UUCP (Steven M. Schultz) writes:
>In article <20258 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>>Given that `the process' may be in up to 8 (4.2BSD) or 16 (4.3BSD)
>>groups simultaneously, there is no single correct choice based on
>>the process alone, hence the parent directory rule.
>	  It makes sense to me to use the primary
>	group for purposes of file ownership.   Directories such as /tmp
>	typically are owned by groups of which users are not members, this
>	has led to surprises at least once for me.

This is presumably why SunOS (and other BSD systems?) supports BOTH types
of default group ownership.  There's a bit in the directory mode that
specifies whether file groups should come from the directory or from the
process.  /tmp is a good example of a directory whose files should inherit
the group from the process (although in most cases /tmp files should
probably have null group and world access anyway).  But a directory shared
by a group of users might want the files to be owned by the group, even
though that isn't their primary group.  For example, at our site, all
regular employees are in primary group "staff", but there are directories
whose files should only be writable by users in particular groups.

At least the way we use the system, /tmp-style group ownership seems to be
in the minority.  Spool directories are the only other cases I can think of
offhand.  There are few other places where users create files in
directories owned by groups to which they don't belong (directories tend
not to be world-writable -- in fact, were there no other bit available, the
world-write bit could have been used as a kludgey way to implement the
aforementioned flag).
Barry Margolin, Thinking Machines Corp.

barmar at think.com
{uunet,harvard}!think!barmar



More information about the Comp.unix.wizards mailing list