CIFS with read-only shares

Added by Geoff Nordli about 1 year ago

Hi Everyone.

I am trying to configure a system where there are two shares which point to the same directory. One of the shares is read-only and the other is read-write. I want the read-only to prevent file deletes, even if the user does have the required file level permissions to delete it.

There are several tutorials out there going through sharemgr to set this up, but for some reason I still can't get a share to act as read-only.

sharemgr show the state-ro share as being ro from everywhere/everyone, but I can still delete a file from that share. Maybe I don't understand how it is supposed to work.

root@llift-zfs1:/llift/state# sharemgr show -vp
default nfs=()
zfs
llift smb=()
          /llift/state
         state=/llift/state     smb=(guestok="true")
         state-ro=/llift/state  smb=(guestok="true" ro="*")

Any pointers?

thanks,

Geoff


Replies

RE: CIFS with read-only shares - Added by Geoff Nordli about 1 year ago

In case anyone is looking for the solution, there appears to be a problem with the share level ro property

The solution is to use chmod to set the ACL directly on the file which controls share access, which resides in the hidden .zfs directory, in the shares folder.

cd /path-to-dataset/.zfs/shares
chmod A=everyone@:read_set/execute:fd:allow read-only-share
chmod A=everyone@:full_set:fd:allow read-write-share

Have a great day!

Geoff