ports/153404: [PATCH] net/rsync: workaround for ACL problem with ZFS
Edward Tomasz Napierala
trasz at FreeBSD.org
Thu Dec 23 11:00:24 UTC 2010
>Number: 153404
>Category: ports
>Synopsis: [PATCH] net/rsync: workaround for ACL problem with ZFS
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Dec 23 11:00:21 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Edward Tomasz Napierala
>Release: FreeBSD 7.2-STABLE i386
>Organization:
>Environment:
System: FreeBSD pin.if.uz.zgora.pl 7.2-STABLE FreeBSD 7.2-STABLE #0: Wed Dec 2 07:49:34 CET
>Description:
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.
Attached patches make rsync properly recognize EINVAL as lack of support for the requested ACL type.
Added file(s):
- files/patch-acls.c
- files/patch-lib-sysacls.c
Port maintainer (ehaupt at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:
--- rsync-3.0.7_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/rsync/Makefile /home/trasz/rsync/Makefile
--- /usr/ports/net/rsync/Makefile 2010-10-13 20:57:09.000000000 +0200
+++ /home/trasz/rsync/Makefile 2010-12-23 11:37:14.000000000 +0100
@@ -7,6 +7,7 @@
PORTNAME= rsync
PORTVERSION= 3.0.7
+PORTREVISION= 1
CATEGORIES= net ipv6
MASTER_SITES= http://rsync.samba.org/ftp/%SUBDIR%/ \
ftp://ftp.samba.org/pub/%SUBDIR%/ \
diff -ruN --exclude=CVS /usr/ports/net/rsync/files/patch-acls.c /home/trasz/rsync/files/patch-acls.c
--- /usr/ports/net/rsync/files/patch-acls.c 1970-01-01 01:00:00.000000000 +0100
+++ /home/trasz/rsync/files/patch-acls.c 2010-12-23 11:37:14.000000000 +0100
@@ -0,0 +1,13 @@
+--- 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:
diff -ruN --exclude=CVS /usr/ports/net/rsync/files/patch-lib-sysacls.c /home/trasz/rsync/files/patch-lib-sysacls.c
--- /usr/ports/net/rsync/files/patch-lib-sysacls.c 1970-01-01 01:00:00.000000000 +0100
+++ /home/trasz/rsync/files/patch-lib-sysacls.c 2010-12-23 11:37:15.000000000 +0100
@@ -0,0 +1,16 @@
+--- 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;
--- rsync-3.0.7_1.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list