Sticky bit?

Art Neilson art at pilikia.pegasus.com
Tue Mar 26 17:02:53 AEST 1991


In article <1991Mar24.223426.10401 at cs.umu.se> dvldbg at cs.umu.se (Daniel Brahneborg) writes:
>In <6704 at navy28.UUCP> seda at motcid.UUCP (Joseph W. Seda) writes:
>>What does the stick bit do? I could look through all the man pages and probably
>>still not find all the details.  Can someone help?
>
>The sticky bit is used for changing the user-id of the process that
>runs the program, such as 'su', and lots of others.
>The id is set to the user of the file, which in this case
>almost always is root. You can also have the group id changed.
>Check the manual pages for chmod, they should tell you the details.

I think you are confusing the setuid bit with the sticky bit.  The sticky
bit means different things depending if it's set on a binary or a directory.
The sticky bit when set on a binary file means save the text section (i.e.
code) in memory or swap upon termination.  When the program is next invoked,
the program text is already resident which results in much faster load times.
Frequently executed programs such as ls can benefit greatly from this.  Some
UNIX releases such as BSD and newer versions of SYS5 have support for the
sticky bit set on directories.  In this case, if a directory is writable 
and has the sticky bit set, files within that directory can only be removed
if one or more of the following is true:

	the user owns the file
	the user owns the directory
	the file is writable by the user
	the user is root
-- 
Arthur W. Neilson III		| INET: art at pilikia.pegasus.com
Bank of Hawaii Tech Support	| UUCP: uunet!ucsd!nosc!pilikia!art



More information about the Comp.unix.misc mailing list