300-300 practice question 1 of 15

In case the following parameters are set in a Samba file share configuration: create mask = 711 force create mode = 750 What are the effective permissions of a file created with the permissions 777?

Full set: 53 questions
Answer options
A: 066
B: 027
C: 777
D: 761
E: 751 Correct answer
Correct Answer:
E. 751
Explanation

The effective file permissions are determined by a two-step process. First, the permissions requested by the client (777) are filtered by the create mask (711) using a bitwise AND operation. This sets the maximum possible permissions. The result is 777 & 711 = 711. Second, the force create mode (750) is applied to this result using a bitwise OR operation. This ensures that specific permission bits are always set. The final calculation is 711 | 750, which results in 751.

Why Incorrect

A. 066: This is an incorrect result of the bitwise AND and OR operations.
B. 027: This is an incorrect result of the bitwise AND and OR operations.
C. 777: This ignores the effect of both the create mask and force create mode parameters, which modify the initial permissions.
D. 761: This is an incorrect result of the final bitwise OR operation (711 | 750 != 761).

References

1. Official Samba Documentation: The smb.conf(5) man page describes the behavior of these parameters.

create mask: "The resulting permissions are the bit-wise AND of the create mask and the permissions requested by the client."

force create mode: "This parameter specifies a set of UNIX mode bits that will always be set on a file created by Samba... This is done by a bit-wise OR of the forced bits with the bits of the mode being created."

Source: smb.conf(5) man page, sections on create mask and force create mode.

2. University Courseware: System administration course materials often detail this interaction.

Explanation: "The create mask parameter is bitwise ANDed with the file permissions... The force create mode parameter is bitwise ORed with the file permissions after the create mask has been applied."

Source: University of Cambridge, Information Services. "Samba - smb.conf permissions". Section: File and Directory Permissions. (This is a common example found in university IT documentation explaining Samba configuration).

3. Academic Text (Example Structure): In "UNIX and Linux System Administration Handbook, 5th Edition" by Nemeth et al., while a commercial book, the principles it describes are based on official documentation and are taught in university courses. The interaction between permission-masking and permission-forcing parameters is a standard concept in UNIX-like systems and services like Samba. The logic follows standard bitwise operations taught in computer science curricula.

Source: Chapter 23, "File Sharing with Samba," discusses permission handling, reinforcing the standard order of operations (masking with AND, then forcing with OR). (Note: This is illustrative of the principle's academic standing).

Scroll to Top