Skip to content

Commit

Permalink
Fix SMB create and directory mask defaults (#14655)
Browse files Browse the repository at this point in the history
This is a regression that slipped into large refactor effort to
remove clustering vestiges in Electric Eel. The values for
default create mask and directory mask became more restrictive than
in previous TrueNAS versions. This commit resets them to old defaults
for the directory mask (775) but a slightly more restrictive default for
files (664) since execute is generally not desired for newly created
files. Tests validating new defaults is also added.

Generally, these values are not used when SMB shares are created with
our recommended default configuration (using NFSv4 ACLs with a
restricted aclmode) and so impact on userbase during BETA / RC
cycles was minimal.
  • Loading branch information
anodos325 authored Oct 11, 2024
1 parent a44f619 commit 897cf08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/plugins/smb_/util_smbconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def generate_smb_conf_dict(
'netbios aliases': ' '.join(smb_service_config['netbiosalias']),
'guest account': smb_service_config['guest'] if smb_service_config['guest'] else 'nobody',
'obey pam restrictions': any(home_share),
'create mask': smb_service_config['filemask'] or '0744',
'directory mask': smb_service_config['dirmask'] or '0755',
'create mask': smb_service_config['filemask'] or '0664',
'directory mask': smb_service_config['dirmask'] or '0775',
'ntlm auth': smb_service_config['ntlmv1_auth'],
'server multichannel support': smb_service_config['multichannel'],
'unix charset': smb_service_config['unixcharset'],
Expand Down
2 changes: 2 additions & 0 deletions src/middlewared/middlewared/pytest/unit/plugins/test_smb.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def test__base_smb():
assert conf['idmap config * : backend'] == 'tdb'
assert conf['idmap config * : range'] == '90000001 - 100000000'
assert conf['server smb encrypt'] == 'default'
assert conf['directory mask'] == '0775'
assert conf['create mask'] == '0664'


def test__syslog():
Expand Down

0 comments on commit 897cf08

Please sign in to comment.