folders and files dont get created with permissions specified in smb extra config


Go to solution Solved by DaLeberkasPepi,

Recommended Posts

with the smb config like shown below i have following problem:
whenever i try to create a folder it creates 4 folders instantly and it doesn't let me delete them (which was obvious after looking into the permissions) 

image.thumb.png.004991b1b0108cf12cc508c3d24f6e89.png


I've tried everything i could, i also tried every combination of smb options but only the owner changes if i omit the force user/group section. The permissions for newly created folders/files always stays the same.

 

When i create a folder in the filebrowser in the webui everything is correct. 
 

The shares i am trying to share are both zfs pools and i already made sure there are no leftover acls (as far as i could tell)

image.thumb.png.60836d2791297e4df79a867626deedcb.png

root@HomeServer:~# ls -la /mnt/caches/domains/Test/
total 15
drwxrwxrwx 6 nobody users 7 Aug 27 22:54 ./
drwxrwxrwx 4 nobody users 5 Aug 27 22:24 ../
d---rwx--- 2 nobody users 2 Aug 27 22:48 Neuer\ Ordner/
d---rwx--- 2 nobody users 2 Aug 27 22:48 Neuer\ Ordner\ (2)/
d---rwx--- 2 nobody users 2 Aug 27 22:48 Neuer\ Ordner\ (3)/
d---rwx--- 2 nobody users 2 Aug 27 22:48 Neuer\ Ordner\ (4)/
----rwx--- 1 nobody users 0 Aug 27 22:54 testfile.txt*
root@HomeServer:~# getfacl /mnt/caches/domains/Test
getfacl: Removing leading '/' from absolute path names
# file: mnt/caches/domains/Test
# owner: nobody
# group: users
user::rwx
group::rwx
other::rwx
root@HomeServer:~# zfs get acltype caches/domains
NAME            PROPERTY  VALUE     SOURCE
caches/domains  acltype   posix     local


root@HomeServer:~# zfs get all caches/domains
NAME            PROPERTY              VALUE                  SOURCE
caches/domains  type                  filesystem             -
caches/domains  creation              Sun Aug 13 11:00 2023  -
caches/domains  used                  14.8G                  -
caches/domains  available             1.52T                  -
caches/domains  referenced            180K                   -
caches/domains  compressratio         3.61x                  -
caches/domains  mounted               yes                    -
caches/domains  quota                 none                   local
caches/domains  reservation           none                   local
caches/domains  recordsize            64K                    local
caches/domains  mountpoint            /mnt/caches/domains    inherited from caches
caches/domains  sharenfs              off                    inherited from caches
caches/domains  checksum              on                     inherited from caches
caches/domains  compression           zstd                   local
caches/domains  atime                 off                    local
caches/domains  devices               on                     default
caches/domains  exec                  on                     inherited from caches
caches/domains  setuid                on                     default
caches/domains  readonly              off                    local
caches/domains  zoned                 off                    default
caches/domains  snapdir               hidden                 local
caches/domains  aclmode               passthrough            local
caches/domains  aclinherit            passthrough            local
caches/domains  createtxg             2048                   -
caches/domains  canmount              on                     default
caches/domains  xattr                 sa                     local
caches/domains  copies                1                      local
caches/domains  version               5                      -
caches/domains  utf8only              on                     -
caches/domains  normalization         formD                  -
caches/domains  casesensitivity       sensitive              -
caches/domains  vscan                 off                    default
caches/domains  nbmand                off                    default
caches/domains  sharesmb              off                    inherited from caches
caches/domains  refquota              none                   local
caches/domains  refreservation        none                   local
caches/domains  guid                  11573844951444178803   -
caches/domains  primarycache          all                    default
caches/domains  secondarycache        all                    default
caches/domains  usedbysnapshots       144K                   -
caches/domains  usedbydataset         180K                   -
caches/domains  usedbychildren        14.8G                  -
caches/domains  usedbyrefreservation  0B                     -
caches/domains  logbias               latency                default
caches/domains  objsetid              66                     -
caches/domains  dedup                 off                    inherited from caches
caches/domains  mlslabel              none                   default
caches/domains  sync                  standard               local
caches/domains  dnodesize             auto                   inherited from caches
caches/domains  refcompressratio      1.19x                  -
caches/domains  written               104K                   -
caches/domains  logicalused           53.1G                  -
caches/domains  logicalreferenced     123K                   -
caches/domains  volmode               default                default
caches/domains  filesystem_limit      none                   default
caches/domains  snapshot_limit        none                   default
caches/domains  filesystem_count      none                   default
caches/domains  snapshot_count        none                   default
caches/domains  snapdev               hidden                 inherited from caches
caches/domains  acltype               posix                  local
caches/domains  context               none                   default
caches/domains  fscontext             none                   default
caches/domains  defcontext            none                   default
caches/domains  rootcontext           none                   default
caches/domains  relatime              off                    default
caches/domains  redundant_metadata    all                    default
caches/domains  overlay               on                     default
caches/domains  encryption            off                    default
caches/domains  keylocation           none                   default
caches/domains  keyformat             none                   default
caches/domains  pbkdf2iters           0                      default
caches/domains  special_small_blocks  0                      inherited from caches

 

Unraid Version: Version: 6.12.4-rc19

 

smb.extra:

[global]
    veto files = /._*/.DS_Store/*.PlexCleaner/

[tank]
    path = /mnt/tank
    browseable = no
    valid users = schlichtner
    writeable = yes
    force create mode = 0666
    force directory mode = 0777
    force user = nobody
    force group = users

[caches]
    path = /mnt/caches
    browseable = no
    valid users = schlichtner
    writeable = yes
    force create mode = 0666
    force directory mode = 0777
    force user = nobody
    force group = users

 

/etc/samba/smb.conf:

root@HomeServer:~# cat /etc/samba/smb.conf
[global]
        # configurable identification
        include = /etc/samba/smb-names.conf

        # log stuff only to syslog
        logging = syslog@0

        # we don't do printers
        show add printer wizard = No
        disable spoolss = Yes
        load printers = No
        printing = bsd
        printcap name = /dev/null

        # disable aio by default
        aio read size = 0
        aio write size = 0

        # misc.
        invalid users = root
        unix extensions = No
        wide links = Yes
        use sendfile = Yes
        host msdfs = No

        # ease upgrades from Samba 3.6
        acl allow execute always = Yes
        # permit NTLMv1 authentication
        ntlm auth = Yes

        # default global fruit settings:
        #fruit:aapl = Yes
        #fruit:nfs_aces = Yes
        fruit:nfs_aces = No
        #fruit:copyfile = No
        #fruit:model = MacSamba

        # hook for user-defined samba config
        include = /boot/config/smb-extra.conf

[global]
        # hook for unassigned devices shares
        include = /etc/samba/smb-unassigned.conf

        # auto-configured shares
        include = /etc/samba/smb-shares.conf

 

/etc/samba/smb-names.conf

root@HomeServer:~# cat /etc/samba/smb-names.conf 
# Generated names
netbios name = HomeServer
server string = Inter-Tech 4U 4424
hide dot files = no
server multi channel support = no
max open files = 40960
multicast dns register = No
disable netbios = yes
server min protocol = SMB2
security = USER
workgroup = WORKGROUP
map to guest = Bad User
passdb backend = smbpasswd
null passwords = Yes
idmap config * : backend = tdb
idmap config * : range = 3000-7999
create mask = 0777
directory mask = 0777
bind interfaces only = yes
interfaces = 192.168.1.7/24 127.0.0.1

 

homeserver-diagnostics-20230827-2254.zip

Link to comment

Update:

The same seems to happen to dockers so it is mostly nothing directly with smb.

 

The Docker settings seem correct and all was working a few days erlier, before i transferd my zfs pool to truenas scale because unraid 6.12.3 kept on crashing on my while replacing a disk. And in Truenas Scale i changed the permissions to posixacl but i changed them back when i switched back to unraid but maybe i missed something somwhere.
image.thumb.png.94b7cd36d40b2f8f99e8efb4259951db.png

 

image.thumb.png.c83c0f88d00777959a6af3d93d093248.png

 

Edit: it only happens for directories created from withing dockers. The files created from a running docker seem to have the proper rw settings:

image.thumb.png.fd1ec3d295486241152231b5ac3ad0b7.png

Edited by DaLeberkasPepi
Link to comment
  • Solution

Update: it seems i found the missing bit after all.....

As a last resort i tried creating a new dataset and testing with that one. And that worked for some reason.

After comparing the settings between the newly created dataset and one of the old ones i noticed that the settings for aclmode and aclinherit where different:
image.thumb.png.14c2a96374848b941ae2c02fd35b2d8c.png

 

And after changing that setting on one of my existing datasets, the permissions also worked correctly on that share....

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.