Inspect a character device whose ls -l type indicator is c.
Do not allow ordinary users to read or write through the device.
Which statement about permissions is correct?
Device nodes have owners, groups, and mode bits. Their read/write bits control access when a process opens the device.
Detailed explanation
Incorrect. Device type does not make ordinary mode bits irrelevant.
Incorrect. Device type does not make ordinary mode bits irrelevant.
Incorrect. Device nodes have ownership and permissions like other filesystem objects.
Incorrect. Device nodes have ownership and permissions like other filesystem objects.
Correct. Owner, group, and other r/w bits control device-node access.
Correct. Owner, group, and other r/w bits control device-node access.
Incorrect. x is not the bit that grants device read/write access.
Incorrect. x is not the bit that grants device read/write access.
Try it yourself
An example you can run in a temporary verification environment.
ls -l /dev/null 2>/dev/null || trueExpected result
先頭cと所有者・グループ・rwx形式のモード。状態は変更しないKey points
- c means character device
- Device nodes have owner and group
- r/w control access
Notes
- Environment: Linux / /dev/nullの属性読み取りのみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.