Showing the ACL for files on the server itself

ACLs have always been a horrible swamp of confusion (of extremely dubious value), but it seems like they’re much worse than usual on TrueNAS SCALE.

I’m not even talking about what’s visible over shares; I’m just talking about trying to find out how a file is protected using command-line tools in the server itself.

Other Unixes have ls -l indicate the presence of an ACL by appending ‘+’ to the permission output; then you’d use the ‘getfacl’ command.

ls doesn’t show me that on TN25. And while the getfacl command is present, reading around seems to say that I should be using the nfs4xdr_getfacl command (which does exist, and shows me a tad more information). Does which of these is right depend on configuration of the dataset, by chance? Why doesn’t using the wrong one tell you you’re using the wrong one?

But, the bottom line – given a file path on the TN25 server, how do I go about getting all the permissions information about that file via the CLI? (And – why is this hard? This should be one of the very simplest things to do!)

yeah on SCALE the tool depends on the dataset acltype.

for NFSv4 ACL datasets (pretty common on SMB shares) the one that actually dumps the full picture for me is:

nfs4xdr_getfacl /mnt/pool/dataset/path/to/file

getfacl is the POSIX ACL path. on an nfsv4 dataset it can look empty or weird even when there is a real ACL, and it usually wont yell at you for being the wrong tool.

quick check which world you are in:

zfs get acltype,aclmode,aclinherit pool/dataset

if acltype is nfsv4, stick with nfs4xdr_getfacl. if it is posix, getfacl is the right one.

ls -l not showing the + marker on TN25 is annoying. i just jump straight to the zfs get + the matching getfacl flavor and ignore ls for this.

Yep, NFSv4 ACL. Thanks. I’ll try to remember to ask ZFS for the type, that’s useful, but just remembering to think of ACLs at all is the problem; hence the importance of ls reporting their presence!!!

And I fixed my weird protection problem in one case (not mentioned above, I’ve kept poking at things here) by deleting the ACL from the dataset.

(I had 2 “similar” cases one of which chmod worked right in, the other where it didn’t, and one difference was whether nfs4xdr_getfacl reported a “non-trivial” ACL; the case with the non-trivial ACL behaved badly, didn’t look like the ACL demanded that behavior, but I deleted it, and the behavior went away. Not sure this will work for other datasets yet, but it’s hopeful.)