nerdexam
LPI

010-100 · Question #33

Given a directory with the following information: drwxrwxrwxt 12 tu tg 36864 2012-03-15 /home/directory/ Which of the following statements are true? (Choose TWO answers)

The correct answer is A. Everybody can create files in the directory. D. Everybody can delete only his own files. The directory has world-writable permissions with the sticky bit set, allowing all users to create files but restricting file deletion to each file's owner.

Security and File Permissions

Question

Given a directory with the following information:

drwxrwxrwxt 12 tu tg 36864 2012-03-15 /home/directory/ Which of the following statements are true? (Choose TWO answers)

Options

  • AEverybody can create files in the directory.
  • BFiles in the directory are created with read, write and execute permissions for everyone.
  • CThe directory is broken.
  • DEverybody can delete only his own files.
  • EThe directory is a security risk.

How the community answered

(47 responses)
  • A
    77% (36)
  • B
    13% (6)
  • C
    6% (3)
  • E
    4% (2)

Why each option

The directory has world-writable permissions with the sticky bit set, allowing all users to create files but restricting file deletion to each file's owner.

AEverybody can create files in the directory.Correct

The permission bits 'rwxrwxrwx' grant write and execute access to all users (owner, group, and others), so any user on the system can create new files in this directory.

BFiles in the directory are created with read, write and execute permissions for everyone.

The parent directory's permission bits do not determine the permissions assigned to newly created files inside it - new file permissions are governed by each creating process's umask value, not the directory mode.

CThe directory is broken.

The permission string 'drwxrwxrwxt' is entirely valid; the trailing 't' is the standard representation of the sticky bit combined with execute permission for others, not an error or corruption indicator.

DEverybody can delete only his own files.Correct

The lowercase 't' in the permission string indicates the sticky bit is set; on a directory, the sticky bit restricts file deletion so that each user can only delete files they personally own, regardless of having write permission on the directory itself.

EThe directory is a security risk.

The directory is not a notable security risk because the sticky bit specifically mitigates the main danger of world-writable directories by preventing users from deleting or renaming each other's files, which is the same safe configuration used for /tmp.

Concept tested: Linux sticky bit behavior on shared directories

Source: https://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html

Topics

#sticky bit#directory permissions#file ownership#special permissions

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice