diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-01-08 14:30:28 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-01-08 14:30:28 -0500 |
commit | 82dd2eb052aea282de099c2a26fd36f94649a5ae (patch) | |
tree | 52ab25813778192084984f6bb9b641b68fadbc38 /tests.sh | |
parent | d7df42567c998b271f598dbdeb996d94b0a6fb4e (diff) | |
download | bfs-82dd2eb052aea282de099c2a26fd36f94649a5ae.tar.xz |
tests: Fix setting ACLs on Linux
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -84,6 +84,7 @@ function _realpath() { BFS="$(_realpath ./bfs)" TESTS="$(_realpath ./tests)" +UNAME="$(uname)" DEFAULT=yes POSIX= @@ -2392,21 +2393,21 @@ function test_xtype_bind_mount() { } function set_acl() { - uname="$(uname)" - - if [ "$uname" = "Darwin" ]; then - chmod +a "$(id -un) allow read,write" "$1" - elif [ "$uname" = "FreeBSD" ]; then - if [ "$(getconf ACL_EXTENDED "$1")" -gt 0 ]; then + case "$UNAME" in + Darwin) + chmod +a "$(id -un) allow read,write" "$1" + ;; + FreeBSD) + if [ "$(getconf ACL_NFS4 "$1")" -gt 0 ]; then + setfacl -m "u:$(id -un):rw::allow" "$1" + else + setfacl -m "u:$(id -un):rw" "$1" + fi + ;; + *) setfacl -m "u:$(id -un):rw" "$1" - elif [ "$(getconf ACL_NFS4 "$1")" -gt 0 ]; then - setfacl -m "u:$(id -un):rw::allow" "$1" - else - return 1 - fi - else - return 1 - fi + ;; + esac } function test_acl() { |