When running on ZFS or UFS with NFSv4 ACL support enabled, "rsync -A" fails due to acl_get_file(3) returning EINVAL. EINVAL is caused by improper use of this routine - rsync doesn't bother to check if POSIX.1e ACLs are supported, and blindly requests ACL_TYPE_ACCESS, which is invalid for files with NFSv4 ACLs. Patch below makes rsync properly recognize EINVAL as lack of support for the requested ACL type. --- acls.c.orig 2010-12-23 10:45:21.344757361 +0100 +++ acls.c 2010-12-23 10:44:33.000000000 +0100 @@ -1082,6 +1082,10 @@ int default_perms_for_dir(const char *di case ENOTSUP: #endif case ENOSYS: +#ifdef __FreeBSD__ + /* Workaround for improper NFSv4 ACL handling in rsync. */ + case EINVAL: +#endif /* No ACLs are available. */ break; case ENOENT: --- lib/sysacls.c.orig 2010-12-23 10:47:02.945461082 +0100 +++ lib/sysacls.c 2010-12-23 10:44:52.000000000 +0100 @@ -2771,6 +2771,13 @@ int no_acl_syscall_error(int err) if (err == ENOENT) return 1; /* Weird problem with directory ACLs. */ #endif +#ifdef __FreeBSD__ + if (err == EINVAL) + /* + * Workaround for improper NFSv4 ACL handling in rsync. + */ + return 1; +#endif #if defined(ENOSYS) if (err == ENOSYS) { return 1;
Interesting. So, non-posix ACLs are supported (thus, no ENOTSUP), but the arg is invalid because ACL_TYPE_ACCESS isn't allowed. I've checked in a fix for this.