summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-01-06 10:41:27 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-01-06 10:41:27 -0500
commit8644e0e5ce28b662a0b4e4b19351a38be5fa6681 (patch)
tree72a404989ddd645259f5c27c2eb9cb75e8dfb02d
parent5e1dd2cf253dd9f75164cbeff098c7eae36c4fd7 (diff)
downloadbfs-8644e0e5ce28b662a0b4e4b19351a38be5fa6681.tar.xz
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.
-rw-r--r--fsade.c6
1 files changed, 6 insertions, 0 deletions
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) {