Extended attributes in MacOS X

Wesley W. Terpstra wesley at terpstra.ca
Thu Oct 26 11:03:38 GMT 2006


On Oct 26, 2006, at 4:01 AM, Wayne Davison wrote:
> Great!  I've taken your code, tweaked it a little, and then did some
> bug-fixing of the xattr code in general (I found some buffer problems
> quickly using valgrind).  The end result is now in CVS and in the most
> recent "nightly" tar file (see the download page of the website).

I've built CVS, but had to make this change:
flist.c:983:
   static struct file_struct *send_file_name(int f, struct file_list  
*flist,
                                             char *fname, STRUCT_STAT  
*stp,
                                             unsigned short flags)
   {
           struct file_struct *file;
- #ifdef SUPPORT_ACLS
+ #if defined SUPPORT_ACLS || defined SUPPORT_XATTRS
           statx sx;
   #endif

Also, these warnings remain:
gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c log.c -o log.o
log.c: In function 'rwrite':
log.c:310: warning: passing argument 2 of 'libiconv' from  
incompatible pointer type
xattr.c: In function 'rsync_xal_get':
xattr.c:164: warning: format '%d' expects type 'int', but argument 5  
has type 'ssize_t'
xattr.c:164: warning: format '%d' expects type 'int', but argument 6  
has type 'ssize_t'
popt/poptconfig.c: In function 'configLine':
popt/poptconfig.c:27: warning: pointer targets in passing argument 1  
of 'strncmp' differ in signedness
popt/poptconfig.c:34: warning: pointer targets in assignment differ  
in signedness
popt/poptconfig.c:40: warning: pointer targets in assignment differ  
in signedness
gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c popt/ 
popthelp.c -o popt/popthelp.o
popt/popthelp.c: In function 'singleOptionHelp':
popt/popthelp.c:194: warning: pointer targets in initialization  
differ in signedness
popt/popthelp.c:213: warning: pointer targets in passing argument 1  
of 'sprintf' differ in signedness
popt/popthelp.c:215: warning: pointer targets in passing argument 1  
of 'sprintf' differ in signedness
popt/popthelp.c:219: warning: pointer targets in passing argument 1  
of 'sprintf' differ in signedness
popt/popthelp.c:222: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness
popt/popthelp.c:222: warning: pointer targets in initialization  
differ in signedness
popt/popthelp.c:230: warning: pointer targets in assignment differ in  
signedness
popt/popthelp.c:232: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness
popt/popthelp.c:233: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness
popt/popthelp.c:238: warning: pointer targets in passing argument 2  
of 'strcpy' differ in signedness
popt/popthelp.c:241: warning: pointer targets in passing argument 2  
of 'strcpy' differ in signedness
popt/popthelp.c:244: warning: pointer targets in assignment differ in  
signedness
popt/popthelp.c:315: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness
popt/popthelp.c:332: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness
gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c popt/ 
poptparse.c -o popt/poptparse.o
popt/poptparse.c: In function 'poptParseArgvString':
popt/poptparse.c:61: warning: pointer targets in passing argument 1  
of 'strlen' differ in signedness

It does seem to work:
I've successfully copied from mac->mac, mac->linux->mac, and linux- 
 >mac->linux
...with the caveat that any 'system.*' EAs on the mac fail to copy to  
linux (which is ok since there shouldn't be any!):
kiwiw:~ terpstra$ ./rsync/cvs/rsync -aX regnotes root at pumpkin:/media/ 
bleh
.bleh.uGozF5: rsync_xal_set: lsetxattr system.test failed: Operation  
not supported
rsync error: some files could not be transferred (code 23) at main.c 
(977) [sender=2.6.9pre2]

Your fast patching has motivated me to investigate ACLs. :-) The  
problem I anticipate is that MacOSX has a lot more permissions beyond  
read,write,execute. The osx permissions are a superset of the windows  
ACLs, linux, and a bit more. Where should I put things that don't map  
to POSIX? 


More information about the rsync mailing list