HI,
I have a wierd permission problem with with samba.
this is the configuration:
[global]
workgroup = GRUPPO
passdb backend = tdbsam
domain logons = no
domain master = no
security = user
wins support = No
wins server = xxxx.xxx
interfaces = eth0
bind interfaces only = yes
netbios aliases = testsmb
[testshare]
path = /data/testshare
valid users = @smbRW,@smbRO,@smbTT
write list = @smbRW,@smbTT
read list = @smbRO
create mask = 770
directory mask = 2770
force create mode = 770
force directory mode= 2770
Those are acl and permission for testshare folder on the filesystem (ext4)
testshare permission (please note the sguid)
drwxrws---+ 17 mmm smbRW
testshare acl
# file: .
# owner: mmm
# group: smbRW
# flags: -s-
user::rwx
group::rwx
group:smbRW:rwx
group:smbRO:r-x
group:smbTT:rwx
mask::rwx
other::---
default:user::rwx
default:group::rwx
default:group:smbRW:rwx
default:group:smbRO:r-x
default:group:smbTT:rwx
default:mask::rwx
default:other::---
I used two test accounts:
- test is member of users and smbRW groups
- test2 is member of users and smbTT groups
My goal is to permit users belonging to smbRW or smbTT groups to create file and folder inside testshare and those file and folder (and subfolder) should have smbRW group and should inherit al the ACL. I also want this to work the same way
for both local (ie from a terminal) and remote (through samba) access
Local access work as expected:
test@linux-c55h:/data/testshare> mkdir local.test.dir
test@linux-c55h:/data/testshare> ls -la
drwxrws---+ 2 test smbRW 4096 May 3 13:27 local.test.dir
test2@linux-c55h:/data/testshare> mkdir local.test2.dir
drwxrws---+ 2 test2 smbRW 4096 May 3 13:30 local.test2.dir
remote access through samba instead:
smbclient -U test //XXXXXX/testshare
Enter GRUPPO est's password:
Domain=[LINUX-C55H] OS=[Windows 6.1] Server=[Samba 4.6.16-git.154.2998451b91227.1-SUSE-SLE_12-x86_64]
smb: \> mkdir test.remote.dir
smb: \> exit
# smbclient -U test2 //XXXXXXXXXX/testshare
Enter GRUPPO est2's password:
Domain=[LINUX-C55H] OS=[Windows 6.1] Server=[Samba 4.6.16-git.154.2998451b91227.1-SUSE-SLE_12-x86_64]
smb: \> mkdir test2.remote.dir
smb: \> exit
...on the server:
drwxrws---+ 2 test smbRW 4096 May 3 13:32 test.remote.dir
drwxrwx---+ 2 test2 smbRW 4096 May 3 13:32 test2.remote.dir <<<<<<<<<<<NOTE THE MISSING SGID
getfacl test.remote.dir/
# file: test.remote.dir/
# owner: test
# group: smbRW
# flags: -s-
user::rwx
group::rwx
group:smbRW:rwx
group:smbRO:r-x
group:smbTT:rwx
mask::rwx
other::---
default:user::rwx
default:group::rwx
default:group:smbRW:rwx
default:group:smbRO:r-x
default:group:smbTT:rwx
default:mask::rwx
default:other::---
getfacl test2.remote.dir/
# file: test2.remote.dir/
# owner: test2
# group: smbRW
user::rwx
group::rwx
group:smbRW:rwx
group:smbRO:r-x
group:smbTT:rwx
mask::rwx
other::---
default:user::rwx
default:group::rwx
default:group:smbRW:rwx
default:group:smbRO:r-x
default:group:smbTT:rwx
default:mask::rwx
default:other::---
As you can see with the user test which belongs to smbRW, the owner group of the parent folder, everything is as expected, while with the user test2 which belongs to smbTT, a group allowed through acl, the sgid attribute is lost.
I cannot understand why this is happening. Any help would be greatly appreciated
Thank you all.