can't save files created by others in samba shares

Hi,
My system is FreeBSD 13.2, samba 4.16.
I've set up some samba shares and added users and groups to access these shares. Now the users can navigate the shares, can create and delete files and folders. The problem I have is user A can't save files created by other user B when he's done modifications, even user A and user B are in the same group. However, user A can delete files and folders created by others. What am I doing wrong? Here is /usr/local/etc/smb4.conf:
Code:
# Global parameters
[global]
        netbios name = JFSVR
        passdb backend = tdbsam
        realm = WKGRP.IO
        workgroup = WKGRP
        max connections = 30
        vfs objects = dfs_samba4 zfsacl
        server role = standalone server
        security = user
        ntlm auth = yes
        local master = yes
        log level = 3
        max log size = 5000
        log file = /var/log/samba4/%m
        os level = 255
        hosts allow = 127.0.0.1 192.168.0.0/16
        dns forwarder = no
        dns proxy = no
        interfaces = bce0
        bind interfaces only = yes
        socket options = TCP_NODELAY

[store1]
        path = /jails/samba/store1        # jail is not configured, "jails" is just the name, samba is not running inside jail.
        valid users = @mgmt, @eng, @mfg, @sales, @qual, @purch, @hr, @fina, @oper
        write list = @eng, @mfg, @sales, @qual, @purch
        browseable = yes
        writeable  = yes
        guest ok = no
        public = no
        create mask = 0777
        directory mask = 0777
        inherit acls = no
        inherit owner = no
        inherit permissions = no
 
Made these changes to [store1] section in /usr/local/etc/smb4.conf, but still can't save files created by others.
Code:
create mask = 0777
force create mode = 0777
directory mask = 0777
force directory mode = 0777
inherit permissions = yes

For example,
Code:
# ll
drwxrwxrwx   2 user_a  eng        3B Jun 12 14:11 test/

# cd test;ll
-rwxrwxrwx  1 user_a eng   171B Jun 12 14:40 test.txt*

# setfacl -m u:user_b:rwxp::allow,g:eng:rwxp::allow test.txt
# getfacl test.txt
# file: test.txt
# owner: user_a
# group: eng
       user:user_b:rwxp----------:-------:allow
         group:eng:rwxp----------:-------:allow
            owner@:rwxp--aARWcCos:-------:allow
            group@:rwxp--a-R-c--s:-------:allow
         everyone@:rwxp--a-R-c--s:-------:allow

Now user_b can open file test.txt, but can't make changes then save it.
 
I should add that the saving-file problem is seen on Windows, Win10 specifically. I don't have Win7 or Win11 to try.
user_b can login to FBSD system, and make changes to test.txt and save it just fine.

Helps are highly appreciated.
 
Create a group, put the users that need write permission in that group. Set the directory and file permissions so the group can write. Change the group ownership of the main directory to this group.
 
This samba permission thing is so confusing, I'm pulling my hair out.

Set the directory and file permissions so the group can write.
In my case, setting this in FBSD doesn't take effect. I managed to set the group write permission from Win10. After that, a user can modify and save files created by others.
 
Back
Top