010-150 · Question #42
Given the following directory permissions: drwxrwxrwt 14 root root 36864 2012-03-02 11:17 /tmp What does the letter t at the end of drwxrwxrwt indicate?
The correct answer is B. It means that even though the directory is globally writable only the owner can delete their own. The 't' character at the end of a permission string on a directory represents the sticky bit, which restricts file deletion to the file's owner even when the directory is world-writable.
Question
Given the following directory permissions:
drwxrwxrwt 14 root root 36864 2012-03-02 11:17 /tmp What does the letter t at the end of drwxrwxrwt indicate?
Options
- AIt is the sticky bit that causes all commands in this directory to be launched as root.
- BIt means that even though the directory is globally writable only the owner can delete their own
- CIt makes the directory accessible for everybody.
- DIt indicates that this directory contains only temporary files that may be deleted.
- EIt is a temporary bit that prevents launching commands in this directory.
How the community answered
(63 responses)- A6% (4)
- B81% (51)
- C8% (5)
- D2% (1)
- E3% (2)
Why each option
The 't' character at the end of a permission string on a directory represents the sticky bit, which restricts file deletion to the file's owner even when the directory is world-writable.
Executing files as root is the behavior of the setuid bit on an executable, not the sticky bit on a directory.
The sticky bit on a directory prevents users from deleting or renaming files they do not own, even if they have write permission on the directory itself. This is the classic use case on /tmp, where all users can create files but cannot delete files belonging to others. Only the file owner, the directory owner, or root can remove files in a sticky-bit directory.
World accessibility is already granted by the 'rwx' bits for 'others'; the sticky bit adds a deletion restriction, not an access grant.
The sticky bit has no bearing on file content type or lifecycle; it is purely an access-control mechanism on deletion.
The sticky bit does not restrict command execution in the directory; it only restricts which users may delete or rename files within it.
Concept tested: Linux sticky bit on world-writable directories
Source: https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html
Topics
Community Discussion
No community discussion yet for this question.