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

Brandon S. Allbery KB8JRR allbery at NCoast.ORG
Wed Dec 26 12:10:25 AEST 1990


As quoted from <1990Dec25.155758.8227 at mp.cs.niu.edu> by rickert at mp.cs.niu.edu (Neil Rickert):
+---------------
| In article <1990Dec25.032451.25017 at gpu.utcs.utoronto.ca> jmason at gpu.utcs.utoronto.ca (Jamie Mason) writes:
| >	Also what are the effects of the Set-User-ID and Set-Group-ID
| >bits on files which cannot be properly said to be *EXECUTED*?  (Though the X
| >permissions are set)   For instance Directories, but also the other types
| >of special files named above?
| >
|  Recent versions of 'sendmail' use the suid/sgid bits when mailing to a
+---------------

This is also done by System V at/cron to make sure that crontabs and at job
files aren't "usurped" by someone else, since chown clears setuid/setgid.
This of course is an aspect of System V's permissive chown rules, about which
see threads elsewhere (I decline to comment).

Some SCO Xenix, SCO "UNIX", and possibly SVR3.2 use setgid on non-executables
to indicate that normally cooperative file locking should actually be
mandatory.  The SCO "UNIX" systems at work do not use g+s on files, however;
the command used is "chown +l".

SunOS and maybe other Unixes use g+s on a directory to produce sticky gid's:
files created in the directory inherit the directory's gid instead of the
creating process's egid.

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery at NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY



More information about the Comp.unix.internals mailing list