4.0 likes s and S protections

Guy Harris auspex!guy at uunet.uu.net
Fri Jan 13 10:29:33 AEST 1989


>If the setgid bit is set, the created file inherits the group ownership
>of the containing directory.  If it is not set, the file inherits the
>group ownership of the creating process.

Unless you've mounted the file system with the "grpid" option, which you
may want to do when mounting "old" file systems after upgrading to 4.0
(unless you really want to run a big "find" and change the modes of all
the directories).

>By the way, I understand that the default semantics (those used without
>the set group-id bit on) are SVID semantics.

They are; they're also the semantics of V6, V7, 4.1BSD, etc..

[[ Only because a process could only be in one group at a time (well, two
if you count real and effective separately).  --wnl ]]

>To remove a set-gid bit with chmod, one cannot merely "chmod 700".
>One must use "chmod g-s".

For files with mode, say, "rwsr-xr-x", you never could remove *just* the
set-GID bit with "chmod 700"; "chmod g-s" is the right way to remove just
the set-GID bit in every UNIX version since V7.  (The symbolic modes were
one of the nice improvements in V7; the only time I use numeric modes any
more are when I want to set the mode to 0.  The umask was another nice
improvement; most of the "chmod"s I do are to turn some specific bits on
or off, not to set the mode to some specific value.)



More information about the Comp.sys.sun mailing list