I setup Samba with ACL support on an Ubuntu 18.04 LTS server and I'm facing the following situation.
Here's the smb.conf
content:
[global]
# naming
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
# networking
disable netbios = yes
local master = no
domain master = no
preferred master = no
# domain accounts
security = ADS
realm = EXAMPLE.COM
encrypt passwords = yes
invalid users = root
idmap config *:backend = tdb
idmap config *:range = 70001-80000
template shell = /bin/bash
winbind nss info = rfc2307
winbind use default domain = yes
winbind rpc only = yes
winbind cache time = 10
vfs objects = acl_xattr
map acl inherit = yes
acl group control = yes
store dos attributes = no
# logging
log file = /var/log/samba/log.%m
max log size = 1000
# permissions
create mode = 0644
directory mode = 0755
inherit acls = yes
map archive = no
# printers
load printers = no
# veto files
veto files = /._*/.DS_Store/
[All Users]
comment = All Home Directories
path = /home/EXAMPLE
browseable = yes
read only = no
valid users = @dl_acc_ro @dl_acc_rw
From macOS Sierra, I connect to a samba share with smb://myserver.com/test
. Then I open a terminal and $ cd /Volumes/test
and I finally create a file with $ touch xxx
.
Here's the output of $ ls -l
on my Mac:
$ ls -l
-rwx------ 1 gregory staff 0 Sep 26 20:00 xxx
And now on the server itself:
$ ls -l
-rwxrwxr-x+ 1 gregory utilisa. du domaine 0 Sep 26 18:00 xxx
And ACLs:
$ getfacl /home/EXAMPLE/gregory
getfacl: Removing leading '/' from absolute path names
# file: home/EXAMPLE/gregory
# owner: gregory
# group: utilisa.\040du\040domaine
user::rwx
group::r-x
other::r-x
$ getfacl /home/EXAMPLE/gregory/xxx
getfacl: Removing leading '/' from absolute path names
# file: home/EXAMPLE/gregory/xxx
# owner: gregory
# group: utilisa.\040du\040domaine
user::rwx
user:gregory:rwx
group::r-x
group:utilisa.\040du\040domaine:r-x
mask::rwx
other::r-x
As you can see, the regular file created by touch
has the executable bit set. Is there a way I can avoid this behavior? I would like regular files created through Samba to have 0644
permissions.
For the record, I tested from a Linux workstation and it exhibits the same behavior, which makes me believe it's all happening on the Samba server side.