Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!diku!thorinn From: thorinn@diku.dk (Lars Henrik Mathiesen) Newsgroups: comp.unix.internals Subject: Re: What does SUID, SGID and Sticky bits do on inappropriate files? Message-ID: <1990Dec28.234940.24202@odin.diku.dk> Date: 28 Dec 90 23:49:40 GMT References: <1990Dec25.032451.25017@gpu.utcs.utoronto.ca> Sender: news@odin.diku.dk (Netnews System) Organization: Institute of Computer Science, U of Copenhagen Lines: 21 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@diku.dk