Making rsync compile under Mac OS X 10.3.9 with extended attributes

Vitorio Machado v.machado at permanence-informatique.fr
Sat Feb 23 11:35:19 GMT 2008


v0.5 is out!

Changelog:
0.5 - Corrected path parser bug that would break if part of the path was
       an alias and not a folder.
       Corrected the fifos, block and character devices detection.

0.4 - Rewrited getxattr, setxattr to don't use getattrlist/setattrlist
       Corrected a bug on path2fsref where non-ASCII characters bugged
       Rewrited listxattr to better handle fifos, block and character 
devices
	  PS: This patch goes fine with rsync 3.0.0pre10

0.3 - Corrected a bug that makes files with resource fork invisible

0.2 - Corrected a pointer bug in sys_lgetxattr and sys_lsetxattr
       Corrected a bracket problem in sys_llistxattr

0.1 - First alpha compiling version

There is still a strange little bug:
Running
sudo ./rsync -aHXNvvvv --fileflags /Volumes/Src 
/Volumes/Dst/80-rsync-test
for the first time gives an error
rsync: failed to set times on 
"/Volumes/Dst/80-rsync-test/Src/60-bsd-flags/dir-with-flags": Operation 
not permitted (1)
The dir dir-with-flags it's created and appears to have the good times:
iLaG:~/Desktop/rsync-3.0.0pre10 patched lag$ 
/Developer/Tools/GetFileInfo 
/Volumes/Dst/80-rsync-test/Src/60-bsd-flags/dir-with-flags
directory: "/Volumes/Dst/80-rsync-test/Src/60-bsd-flags/dir-with-flags"
attributes: avbstcLinmed
created: 02/17/2008 21:58:36
modified: 02/17/2008 21:58:36
iLaG:~/Desktop/rsync-3.0.0pre10 patched lag$ 
/Developer/Tools/GetFileInfo /Volumes/Src/60-bsd-flags/dir-with-flags
directory: "/Volumes/Src/60-bsd-flags/dir-with-flags"
attributes: avbstcLinmed
created: 02/17/2008 21:58:36
modified: 02/17/2008 21:58:36

If I rerun the rsync it makes no error. If I run rsync for the first 
time without -X option it makes no error neither. What's strange is 
that the time setting have nothing to do with my mods.
What I've seen is that crtimes patch uses getattrlist/setattrlist that 
I'm avoiding because it doesn't have the same behaviour on 10.3 and 
10.4 (man getattrlist doesn't even exist on 10.3, the function was 
undocumented). But I don't know why it doesn't bug running without -X, 
as crtimes.diff is still active. There is maybe a bug mixing Carbon and 
getattrlist calls.

I'm attaching the verbose log of the operations before the error. And 
the patch, of course!

Vitorio

recv_files(Src/60-bsd-flags/file-with-flags)
got file_sum
sys_llistxattr(Src/60-bsd-flags/.file-with-flags.CqNyUX, 0x2800400, 
1024);
fsreffrompath(Src/60-bsd-flags/.file-with-flags.CqNyUX, 0xbfffcc00);
PWD=/Volumes/Dst/80-rsync-test
name=.file-with-flags.CqNyUX
list lenght=21, list content:
com.apple.FinderInfo
sys_lsetxattr(Src/60-bsd-flags/.file-with-flags.CqNyUX, 
com.apple.FinderInfo, 32);
value=
fsreffrompath(Src/60-bsd-flags/.file-with-flags.CqNyUX, 0xbfffca80);
PWD=/Volumes/Dst/80-rsync-test
name=.file-with-flags.CqNyUX
set modtime of Src/60-bsd-flags/.file-with-flags.CqNyUX to (1203281916) 
Sun Feb 17 21:58:36 2008
renaming Src/60-bsd-flags/.file-with-flags.CqNyUX to 
Src/60-bsd-flags/file-with-flags
touch_up_dirs: Src/60-bsd-flags (11)
set modtime of Src/60-bsd-flags to (1203281916) Sun Feb 17 21:58:36 2008
touch_up_dirs: Src/60-bsd-flags/dir-with-flags (22)
set modtime of Src/60-bsd-flags/dir-with-flags to (1203281916) Sun Feb 
17 21:58:36 2008
recv_files(Src/60-bsd-flags/dir-with-flags)
sys_llistxattr(Src/60-bsd-flags/dir-with-flags, 0x2800400, 1024);
fsreffrompath(Src/60-bsd-flags/dir-with-flags, 0xbfffcc60);
PWD=/Volumes/Dst/80-rsync-test
name=dir-with-flags
list lenght=21, list content:
com.apple.FinderInfo
sys_lsetxattr(Src/60-bsd-flags/dir-with-flags, com.apple.FinderInfo, 
32);
value=
fsreffrompath(Src/60-bsd-flags/dir-with-flags, 0xbfffcae0);
PWD=/Volumes/Dst/80-rsync-test
name=dir-with-flags
set modtime of Src/60-bsd-flags/dir-with-flags to (1203281916) Sun Feb 
17 21:58:36 2008
rsync: failed to set times on 
"/Volumes/Dst/80-rsync-test/Src/60-bsd-flags/dir-with-flags": Operation 
not permitted (1)
recv_files(Src/70-extended-attrs)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rsync10.3xattr_supportv0.5.diff
Type: application/octet-stream
Size: 18655 bytes
Desc: not available
Url : http://lists.samba.org/archive/rsync/attachments/20080223/32f1a829/rsync10.3xattr_supportv0.5.obj


More information about the rsync mailing list