summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-01-08 14:30:28 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-01-08 14:30:28 -0500
commit82dd2eb052aea282de099c2a26fd36f94649a5ae (patch)
tree52ab25813778192084984f6bb9b641b68fadbc38
parentd7df42567c998b271f598dbdeb996d94b0a6fb4e (diff)
downloadbfs-82dd2eb052aea282de099c2a26fd36f94649a5ae.tar.xz
tests: Fix setting ACLs on Linux
-rwxr-xr-xtests.sh29
1 files changed, 15 insertions, 14 deletions
diff --git a/tests.sh b/tests.sh
index 1c59fe2..9d18f83 100755
--- a/tests.sh
+++ b/tests.sh
@@ -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() {