What does SUID, SGID and Sticky bits do on inappropriate files?

Lars Henrik Mathiesen thorinn at diku.dk
Sat Dec 29 10:49:40 AEST 1990


For plain files, that is, regular files with no execute bits set, I
know of the following uses for these bits:

The sticky bit is used to mark swap files of diskless clients under
NFS. Updated blocks of such a file are written at once, like all NFS
writes, but they are then immediately flushed from the server's block
cache, on the theory that the server has better things to use its
cache for. Also, the inode times may not be updated on such a write.
(In principle, the foregoing holds for all writes, but the
implementation I've seen only tests the bit on writes from the NFS
server code --- and it always sets the inode time.)

Under System V, and now SunOS 4, if a file has the setgid bit set but
not the group execute bit, file locking on that file is mandatory: An
exclusive lock on a segment of the file prevents all other processes
from reading or writing it, while a shared lock only prevents writing.
It only works for the fcntl and lockf styles of locking.

--
Lars Mathiesen, DIKU, U of Copenhagen, Denmark      [uunet!]mcsun!diku!thorinn
Institute of Datalogy -- we're scientists, not engineers.      thorinn at diku.dk



More information about the Comp.unix.internals mailing list