|
There is a difference between suid and the sticky bit. There are three bits in addition to rwx bits; sticky, suid & sgid. They have different meanings for files then for directories. The sticky bit used to retain a program in core memory, back when computers had small amounts of magnetic core memory. This use is obsolete but the alternate use for directories is still used. The name refers to the old usage to get programs to stick around in memory after being run. The sticky bit is used for directories to protect files from being deleted by non-owners. The suid bit isn't honored for scripts in Linux but is on some Unixes. The suid bit isn't honored for directories. On some Unix versions, a file created in an suid directory will inherit the directories owner. Linux does honor the sgid bit on directories. A file created in a sgid directory will inherit the group ownership of the directory.
An suid program will run as the owner of the program. An sgid program will run with the effective gid being that as the group owner of the program.
|