Bug 7884 - Workaround for ACL problem with ZFS under FreeBSD
Summary: Workaround for ACL problem with ZFS under FreeBSD
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.7
Hardware: x64 FreeBSD
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 04:56 UTC by trasz
Modified: 2011-02-22 10:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trasz 2010-12-23 04:56:30 UTC
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;
Comment 1 Wayne Davison 2011-02-22 10:53:57 UTC
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.