|Lesson 8|| Additional access permission bits|
|Objective|| Describe the Use of the save text and SUID/SGID access permission Bits.|
Describe Use of save text and SUID
In addition to the rwx bits we discussed in detail above, UNIX supports four other types of access:
- Save text (t)
- SGID and
- File locking (l)
Save text permission
Setting the save text bit (indicated by t) on an executable file is supposed to tell the kernel to leave a program in memory after it terminates.
This use is now largely obsolete. The save text permission on a directory means something slightly different. When this permission bit is set on a directory, a user may delete a file only if he or she has write permission (w) for that file,
even if he or she has write permission on the directory. This is a strengthening of the normal UNIX rules discussed in a previous lesson. To set this bit, use the command
chmod u+t directory
To unset this bit, use the command
chmod u–t directory
When used on a file, these bits are extremely important, but are also relevant to running processes. Therefore, we will discuss them in further detail a bit later in this course when we discuss processes.
The SGID bit has a special meaning when set on a directory. It forces new files created in that directory to be owned by the same group that owns the directory (instead of the group of the file's creator). This feature can be convenient if you want to force all files created in a certain directory (regardless of who creates them) to have the same group ownership. To set this bit on a directory, you would use
chmod g+s directory
The file locking permission is used in special circumstances outside the scope of this course.