Samba – How to stop Samba from writing extended ACLs

access-control-listsamba

Is there any configuration option to stop Samba from writing extended ACLs for newly created files? I only found nt acl support but this seems to disable support for permissions completely. I want Samba to behave as if my filesystem didn't support ACLs.

Best Answer

This answer does not really solve the problem, but as nobody else answered anything for years, I'll share my experience hoping it might help someone. Please correct me if I am wrong.

There doesn't seem to be an easy way to do that. With "easy", I mean, not with a standard configuration option. It probably requires recompiling samba with the option --with-acl-support=no, and even recompiling the kernel.

I am saying this after testing by explicitly disabling every single acl and xattr option in the samba configuration.

The easiest solution would probably be to disable ACLs on the server and the file system of the share. But that is also not easy.

I did manage to disable ACLs on XFS, by formatting the partition as mkfs.xfs -m crc=0 /dev/mydev1, and mounting it with mount -t xfs -o noattr2 /dev/mydev1 /mnt/mymount. But surprisingly the ACLs can still be stored!

The reason behind this, seems to be that kernels newer than 2.6 come already with the ACL support pre-compiled. Try running grep -i acl /boot/config-$(uname -r) and you'll see plenty of entries, including "CONFIG_CIFS_ACL" with values "=y", which means that they are hard-coded into the kernel, and cannot be disabled.

So, either recompile samba and/or the kernel, or as we did, learn to live with it and eventually adopt the ACL policy.