300-300 · Question #72
What is true about the option create mask in smb.conf?
The correct answer is C. Each permission bit that is cleared (0) in create mask is always cleared on a file created by. create mask works as a bitwise AND filter applied to file permissions when Samba creates files. Because of this AND operation, any bit that is 0 in the mask will force the corresponding permission bit to 0 in the resulting file - unconditionally - making C correct. Why the distra
Question
Options
- AEach permission bit that is set (1) in create mask cannot be set on a file created by Samba even if
- BEach permission bit that is cleared (0) in create mask is only set on a file created by Samba if the
- CEach permission bit that is cleared (0) in create mask is always cleared on a file created by
- DEach permission bit that is set (1) in create mask is always set on a file created by Samba
- EWhen both create mask and create mode are specific for a share, create mask is ignored.
How the community answered
(29 responses)- A10% (3)
- B3% (1)
- C79% (23)
- D7% (2)
Explanation
create mask works as a bitwise AND filter applied to file permissions when Samba creates files. Because of this AND operation, any bit that is 0 in the mask will force the corresponding permission bit to 0 in the resulting file - unconditionally - making C correct.
Why the distractors are wrong:
- A reverses the logic: bits set to 1 in
create maskare permitted (they pass through the AND), not blocked. - B is wrong because 0 bits are not "conditionally" cleared - they are always cleared; there is no circumstance under which a masked-out bit gets set.
- D confuses "allowed" with "guaranteed": a 1 in
create maskmeans the bit can be set, but only if the underlying permission also requests it - it is not forced on. - E is false:
create mask(AND mask, removes bits) andforce create mode(OR mask, adds bits) are both applied together; neither is ignored when both are present.
Memory tip: Think of create mask as a net with holes. Wherever the net has a 0 (solid patch), no permission can pass through - ever. Wherever it has a 1 (hole), the permission might pass through, depending on what was requested.
Topics
Community Discussion
No community discussion yet for this question.