問題文
A default file creation mask of 022 is in effect. A program creates a regular file requesting mode 666. What permissions does the resulting file have, and why?
選択肢
- Mode 666, because the mask applies only to directories, and a regular file keeps every bit the program requested.
- Mode 644, because the bits present in the mask are turned off from the requested mode.
- Mode 022, because the mask replaces the requested mode entirely whenever the requesting program does not have administrative privileges, which is why unprivileged programs cannot create files with permissive modes.
- Mode 755, because the execute bit is added for the owner on every new file, and the mask is applied afterward only to the group and other bits.