1

I'm using ACLs to enable rw access to both local and samba users, and noticed that group permissions is always set to rwx.

This is the ACL set on the test directory:

ubuntu@server:/test$ getfacl .
# file: .
# owner: samba
# group: samba
user::rwx
user:samba:rwx
user:ubuntu:rwx
group::rwx
mask::rwx
other::r-x
default:user::rwx
default:user:samba:rwx
default:user:ubuntu:rwx
default:group::rwx
default:mask::rwx
default:other::r-x


Files created via Samba will result in -rw-rwxr--+:

ubuntu@server:/test$ ls -l
total 0
-rw-rwxr--+ 1 samba samba 0 Feb 19 03:40 file1


To isolate the issue, I've set create mask = 0000 on smb.conf:

/etc/samba/smb.conf:

[Share]
path = /test
browseable = yes
guest ok = yes
read only = no
map archive = no
create mask = 0000

ubuntu@server:/test$ sudo systemctl restart smbd.service

*Create file2 via Samba*

ubuntu@server:/test$ ls -l
total 0
-rw-rwxr--+ 1 samba samba 0 Feb 19 03:40 file1
----rwx---+ 1 samba samba 0 Feb 19 03:41 file2


We can find out that it's not ACL misbehaving by creating a file under the samba user:

ubuntu@server:/test$ sudo -u samba touch file3
ubuntu@server:/test$ ls -l
total 0
-rw-rwxr--+ 1 samba samba 0 Feb 19 03:40 file1
----rwx---+ 1 samba samba 0 Feb 19 03:41 file2
-rw-rw-r--+ 1 samba samba 0 Feb 19 03:42 file3

So we can see here, it's samba that's setting g+rwx.


The problem goes away after disabling ACL:

ubuntu@server:/test$ sudo setfacl -b /test
ubuntu@server:/test$ sudo getfacl .
# file: .
# owner: samba
# group: samba
user::rwx
group::rwx
other::r-x

*Create file4 via Samba*

ubuntu@server:/test$ ls -l
total 0
-rw-rwxr--+ 1 samba samba 0 Feb 19 03:40 file1
----rwx---+ 1 samba samba 0 Feb 19 03:41 file2
-rw-rw-r--+ 1 samba samba 0 Feb 19 03:42 file3
---------- 1 samba samba 0 Feb 19 03:43 file4


So is it correct to conclude that with ACL activated, samba will set g+rwx? Is it a bug, or did I miss something out?

I've scoured through the samba docs and tried all the options relevant to permissions: create mask, force create mode, inherit permissions, map archive,hidden,readonly,system, and am at a loss what else could be causing this.

migrated from askubuntu.com Feb 19 '17 at 11:56

This question came from our site for Ubuntu users and developers.

  • I have exactly the same problem, and it's really annoying me. Did you find any solution? – Doub Oct 20 '18 at 20:33
  • @Doub nope, it isn't a crippling problem for me hence I just lived with it. Haven't got around to filing a bug report in the samba bugzilla. – loongyh Oct 27 '18 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.