[comp.unix.aix] Directories Setting GID...

somsky@brl.mil (William R. Somsky) (05/14/91)

Anyone want to tell me why directories
are created with the set-gid bit turned on?  

web@farpoint.austin.ibm.com (Bill Baker) (05/14/91)

>From: somsky@brl.mil (William R. Somsky)
>Anyone want to tell me why directories
>are created with the set-gid bit turned on?  

The set-gid bit determines how the group id of new files is set.  If the
set-gid bit is on, the file inherits the group id from the directory.  If
not, the file inherits the group id from the effective group id of the
process.

This is a compromise between BSD and SysV.  I believe this functionality
is emerging as a standard; it is now part of the third edition SVID.

Enjoy,
web
-- 
Bill Baker             Internet: web@glasnost.austin.ibm.com
IBM PSP                AWD net: web@farpoint.austin.ibm.com
11400 Burnet Rd.       VNET: WEBAKER AT AUSVMQ
Austin, TX; 78758-2502

karish@pangea.Stanford.EDU (Chuck Karish) (05/15/91)

In article <7559@awdprime.UUCP> web@farpoint.austin.ibm.com (Bill Baker) writes:
>The set-gid bit determines how the group id of new files is set.  If the
>set-gid bit is on, the file inherits the group id from the directory.  If
>not, the file inherits the group id from the effective group id of the
>process.
>
>This is a compromise between BSD and SysV.  I believe this functionality
>is emerging as a standard; it is now part of the third edition SVID.

It's there because FIPS 151-1 requires the BSD behavior, which is
incompatible with the default SysV behavior.

It meets the letter of the FIPS, but does not provide a stable
environment for group sharing of files, as a real BSD system would.
The problem is that any user can inadvertantly turn off the set-gid bit
with a simple chmod and break the inheritance properties of the changed
directory and any directories later created in it.

Some vendors have recognized this problem and made provision for
enforcing the BSD behavior.  SunOS, for example, allows the
administrator to turn on the BSD behavior for an entire filesystem with
the 'grpid' option to mount(8).
--

	Chuck Karish		karish@mindcraft.com
	(415) 323-9000		karish@forel.stanford.edu