I am just looking into zfs because i am setting up a freenas server so this may be a stupid question but i have been unable to find an explanation of how a snapshot is read only when the permissions seem to show the opposite. let me explain:
my freenas is running 12.2-RELEASE-p2
I have a zfs pool with a .zfs/snapshot folder in it with a single snapshot.
This is a snapshot of an smb share in which the user and group are "reader". That is user reader and group reader have full access to all files in the share.
Going into the .zfs/snapshot folder I can see the manual snapshot folder is owned by root:wheel as I would expect to enforce read only ( at least from user "reader" perspective )
But looking at a folder inside the snapshot it appears owner group are now reader:reader and it has full rights
I understand that ZFS is a COW so its going to copy the permissions of the files/folders but I don't see what keeps user reader from going into this snapshot and deleting files, which i think would really mess up the entire pool. at the same time my understanding is all snapshots are read only. So if a snapshot is read only how is that enforced or is it not. any explanation of this or a link explaining it would be really helpful.
Thanks for your time!
my freenas is running 12.2-RELEASE-p2
I have a zfs pool with a .zfs/snapshot folder in it with a single snapshot.
Code:
root@hal[~]# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
diskpool/nasdataset@manual-2021-01-24_12-38 0B - 61.1M -
This is a snapshot of an smb share in which the user and group are "reader". That is user reader and group reader have full access to all files in the share.
Going into the .zfs/snapshot folder I can see the manual snapshot folder is owned by root:wheel as I would expect to enforce read only ( at least from user "reader" perspective )
Code:
root@hal[/mnt/diskpool/nasdataset/.zfs/snapshot]# ls -lt
total 12
drwxrwx---+ 3 root wheel 3 Jan 22 17:41 manual-2021-01-24_12-38
root@hal[/mnt/diskpool/nasdataset/.zfs/snapshot]# getfacl manual-2021-01-24_12-38
# file: manual-2021-01-24_12-38
# owner: root
# group: wheel
owner@:rwxpDdaARWcCos:fd-----:allow
group@:rwxpDdaARWcCos:fd-----:allow
user:reader:r-x---a-R-c---:fd-----:allow
everyone@:--------------:fd-----:allow
Code:
root@hal[....zfs/snapshot/manual-2021-01-24_12-38]# getfacl test
# file: test
# owner: reader
# group: reader
owner@:rwxpDdaARWcCos:fd-----:allow
group@:rwxpDdaARWcCos:fd-----:allow
everyone@:--------------:fd-----:allow
root@hal[....zfs/snapshot/manual-2021-01-24_12-38]#
root@hal[....zfs/snapshot/manual-2021-01-24_12-38]#
root@hal[....zfs/snapshot/manual-2021-01-24_12-38]#
Thanks for your time!