OS X xattr troubles (was Re: --exclude patterns)

Mike Bombich mike at bombich.com
Thu Jan 31 12:54:44 GMT 2008

On Jan 30, 2008, at 11:03 PM, Anthony Morton wrote:

>>> I have a similar problem.  I'm trying to specify a custom per- 
>>> directory filter using
>>> 	--filter='dir-merge .rsync-filter-m'
>>> but because the whole thing is double-quoted the filter rule  
>>> arrives in single quotes.  I can't simply leave out the quotes  
>>> here because the --filter option only gets the first token as its  
>>> argument.....
>> You can use an underscore instead of a space after the "dir-merge".
> Thanks, that's solved it.
> Now there's a new problem I'd appreciate any help with.  I've just  
> started out with 3.0.0pre8 on OS X Leopard 10.5.1, patched according  
> to Mike Bombich's recipe on this list at
> <http://lists.samba.org/archive/rsync/2008-January/019618.html>
> I have also run the backup-bouncer test as suggested (using -aHAX  
> and --fileflags) and obtained results identical to Rob DuToit's.   
> (Devices and fifos did not copy with their xattrs but all else was  
> OK - this may be related to the bug Wayne opened.)

I think the errors that rsync complains about on devices and fifos  
should be ignored.  I applied this patch and the errors go away and  
the backup-bouncer test succeeds (e.g. the fifos and devices are  
recreated without error):

diff -Naur rsync-3.0.0pre8/xattrs.c rsync-3.0.0pre8_mod/xattrs.c
--- rsync-3.0.0pre8/xattrs.c	2008-01-12 11:14:56.000000000 -0600
+++ rsync-3.0.0pre8_mod/xattrs.c	2008-01-28 22:31:11.000000000 -0600
@@ -128,7 +128,7 @@
  	if (list_len >= 0)
  		return list_len;
-	if (errno == ENOTSUP)
+	if (errno == ENOTSUP || errno == EPERM)
  		return 0;
  	if (errno == ERANGE) {
  		list_len = sys_llistxattr(fname, NULL, 0);
@@ -766,6 +766,8 @@

  		if (sys_lsetxattr(fname, name, rxas[i].datum, rxas[i].datum_len) <  
0) {
+			if (errno == EPERM)
+				return 0;
  			rsyserr(FERROR_XFER, errno,
  				"rsync_xal_set: lsetxattr(\"%s\",\"%s\") failed",
  				fname, name);

I plan to submit that, I just haven't had a spare moment.

> However, trying a local rsync on my own home directory with -X and  
> the destination set to a directory on a local HFS+-formatted  
> FireWire disk (actually an iPod) immediately errors out with
> [sender] could not find xattr #2 for .
> rsync error: error in rsync protocol data stream (code 12) at  
> xattrs.c(561) [sender=3.0.0pre8]
> Things seem to be OK if I omit -X to leave the xattrs out.
> Is this a bug or is there something up with my filesystem?  (My  
> installation's only a month old.)

I'm getting the same error with pre8 and the nightly from the 27th.  I  
haven't boiled it down to a reproducible case yet, though.  I tried to  
do that last night but ran out of time...


> Tony M.
> -- 
> To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
> Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

More information about the rsync mailing list