On 10/5/2018 6:00 PM, Chase Whitener via RT wrote:
Show quoted text>
>
> This conversation seems to have again deviated from the original problem of how to detect when ACLs are present on the current file system that would prevent us from testing this portion of the functionality of the module.
>
----
If at first you don't succeed...
look for binaries 'chacl, getfacl setfacl' if on linux. I don't know
of an OS independent way to check for acls, but solaris, cygwin linux
are likely
to have get/set facl.
And see if they can be set or listed?
For linux, another place to look for OS support would be /proc/config.gz:
Show quoted text> zgrep ACL /proc/config.gz
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_XFS_POSIX_ACL=y
CONFIG_BTRFS_FS_POSIX_ACL=y
CONFIG_FS_POSIX_ACL=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_CIFS_ACL=y
---
it shows the running kernel's ACL support
Are those the type of things you are looking for to see if ACL's
may be present?...unfortunately, linux specific.
or something like this (practical test):
a directory (named 'file') with an acl:
Show quoted text> chacl -l file
[u::rwx,g::rwx,g:Trusted\040Local\040Net\040Users:r-x,m::rwx,o::r-x/u::rwx,u:Media:rwx,g::r-x,g:Media:rwx,g:Trusted\040Local\040Net\040Users:r-x,m::rwx,o::r-x]
file
Show quoted text> cd file
> umask 777
> touch 77 (should be 000, no?)
> umask 000
> touch 00 (should be rw+rw+rw, no?)
> mkdir dir
> chacl -l dir
[u::rwx,u:Media:rwx,g::r-x,g:Media:rwx,g:Trusted\040Local\040Net\040Users:r-x,m::rwx,o::r-x/u::rwx,u:Media:rwx,g::r-x,g:Media:rwx,g:Trusted\040Local\040Net\040Users:r-x,m::rwx,o::r-x]
dir
Show quoted text> llg -a
total 16
drwxrwsr-x 2 Media Media 36 Oct 5 21:24 ./
drwxrwxr-x 13 Media Media 4096 Oct 5 21:25 ../
-rw-rw-r-- 1 law Media 0 Oct 5 21:23 00
-rw-rw-r-- 1 law Media 0 Oct 5 21:24 77
drwxrwsr-x 2 law Media 10 Oct 5 21:32 dir/
file 00 doesn't have 'write' for other (o::r-x)
and file 77 still has access for user 'law' and group Media
Another gotcha -- if parent has set groupid set, that will propagate to
child dirs on xfs by default, though there are ways to change that behavior:
Show quoted text> ll /proc/sys/fs/xfs
...
-rw-r--r-- 1 0 Oct 5 21:35 inherit_noatime
-rw-r--r-- 1 0 Oct 5 21:35 inherit_nodefrag
-rw-r--r-- 1 0 Oct 5 21:35 inherit_nodump
-rw-r--r-- 1 0 Oct 5 21:35 inherit_nosymlinks
-rw-r--r-- 1 0 Oct 5 21:35 inherit_sync
-rw-r--r-- 1 0 Oct 5 21:35 irix_sgid_inherit
-rw-r--r-- 1 0 Oct 5 21:35 irix_symlink_mode
...
(specifically irix_sgid_inherit)
As you can see, there are ways to change other behaviors to
inherit parent settings or not.
I think acls are on by default on most file systems
EXCEPT with ext[34] they are a mount option.
But I don't know of any OS-independent nor FS independent
way to detect them.
Some versions of 'cp' copy them, as well as some versions of tar
and rsync.
Show quoted text> I'll leave this open for now until our next release when we'll move this particular test to the author test suite, mitigating any possible issues from leaving it in the mix.
>
> Thanks,
> Chase
>
>