From 8644e0e5ce28b662a0b4e4b19351a38be5fa6681 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 6 Jan 2020 10:41:27 -0500 Subject: fsade: Don't treat EINVAL as an error acl_get_file() will return EINVAL on some platforms (e.g. FreeBSD, macOS) when the requested ACL type is not supported for that file. This fixes `bfs -acl` spewing "Invalid argument." for every file on FreeBSD with ZFS where ACLs are NFSv4 and thus the POSIX.1e ones are not supported. --- fsade.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'fsade.c') diff --git a/fsade.c b/fsade.c index 8f8f8b1..c7f9fed 100644 --- a/fsade.c +++ b/fsade.c @@ -104,6 +104,12 @@ static bool is_absence_error(int error) { } #endif + // On at least FreeBSD and macOS, EINVAL is returned when the requested + // ACL type is not supported for that file + if (error == EINVAL) { + return true; + } + #if __APPLE__ // On macOS, ENOENT can also signal that a file has no ACLs if (error == ENOENT) { -- cgit v1.2.3