LFCS · Question #666
What do the permissions -rwSr-xr-x mean for a binary file when it is executed as a command?
The correct answer is C. The execute flag is not set for the owner. Therefore the SetUID flag is ignored. The permissions -rwSr-xr-x on a binary file indicate that the SetUID bit is present but ineffective because the owner's execute permission is missing.
Question
Options
- AThe command is SetUID and it will be executed with the effective rights of the owner.
- BThe command will be executed with the effective rights of the group instead of the owner.
- CThe execute flag is not set for the owner. Therefore the SetUID flag is ignored.
- DThe command will be executed with the effective rights of the owner and group.
How the community answered
(35 responses)- A11% (4)
- B3% (1)
- C83% (29)
- D3% (1)
Why each option
The permissions `-rwSr-xr-x` on a binary file indicate that the SetUID bit is present but ineffective because the owner's execute permission is missing.
While the SetUID bit is technically present, the uppercase 'S' indicates the owner's execute permission is missing, which means the command will not be executed with the effective rights of the owner.
The 'S' is in the owner's permission field, not the group's, meaning it pertains to SetUID, not SetGID; thus, it does not relate to executing with the effective rights of the group.
The uppercase 'S' in the owner's execute position signifies that the SetUID bit is set, but the owner lacks execute permission. For the SetUID bit to be effective, the owner's execute permission (lowercase 'x') must also be set, rendering the 'S' ignored for execution with elevated privileges.
This permission set does not enable execution with the effective rights of both owner and group simultaneously, and specifically, the SetUID bit is ineffective due to the missing owner execute permission.
Concept tested: Linux SetUID permissions and their effectiveness
Source: https://linux.die.net/man/1/chmod
Topics
Community Discussion
No community discussion yet for this question.