on at least freebsd, symlinks have settable times/perms as well as u/g/flags. true, use of a symlink is time/perm/u/g/flag agnostic however, unsynchronized time/perm do cause problems elsewhere on systems that have the above syscalls. ie: 1 - find <path> -newer <stampfile> -ls print if any/all types, rather than a single, are newer 2 - find <path> -perm +7022 -ls print if any/all types, rather than a single, are not isolated rsync created slinks earn the time of the symlink(2) call by rsync. further, an lutimes(2) run elsewhere against the slink is not picked up by later rsync runs. both break ex1. similarly, rsync ignores both umask and src perms when creatings slinks. neither are updated in later runs. breaking ex2. rm -r ./dstdir srcdir: lrwxrwx--- 1 u g 1 Jul 24 03:29:58 2005 a -> b -rw-r----- 1 u g 0 Jul 24 03:29:58 2005 b prw-rw---- 1 u g 0 Jul 24 03:29:58 2005 fifo srwxrwx--- 1 u g 0 Jul 24 03:29:58 2005 sockfile umask 0022 [root] rsync -axv --delete ./srcdir/ ./dstdir/ dstdir: lrwxrwxrwx 1 u g 1 Jul 24 03:30:36 2005 a -> b -rw-r----- 1 u g 0 Jul 24 03:29:58 2005 b prw-rw---- 1 u g 0 Jul 24 03:29:58 2005 fifo srwxrwx--- 1 u g 0 Jul 24 03:29:58 2005 sockfile last time i looked this required passing the source stat structure through to the affected rsync functions and extending the fn to use it with the above syscalls, perhaps ifdef'd if not present. reply only to bugzilla/rsync list, thx.
Created attachment 1336 [details] Use lchmod and lutimes, if present Please test this patch and see if it works for you. You will need to run "autoconf; autoheader; make proto" (or "make gen" if you already have a Makefile) and then re-run configure (e.g. "./config.status --recheck; ./config.status" if you already ran configure in that dir) before running "make".
the patch applies clean to: cvs co -D '2005-07-07 22:53:59-0000' which refers to the latest src rev in the patch [not knowing which tag or date to apply to]. ./configures ok, but make tanks with... gcc -I. -I. -g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt -c rsync.c -o rsync.o rsync.c: In function `set_perms': rsync.c:75: too many arguments to function `set_modtime' *** Error code 1 Stop in /tmp/rsync. so skipping ahead and using this instead... cvs co -D '2005-07-31 00:00:00-0000' ...slinks work great. the following changes to the source slinks are now transferred to the destination correctly... create/delete/user/group/perm/mtime ran against a couple million mixed inodes. all but a device and/or hardlink issue check out so far. checking... HUGE THANKS TO THE RSYNC DEVEL[S] FOR THIS SLINK WORK!!!
I checked this fix in to CVS a few days ago, so this appears to be fixed now. Thanks for your help testing this.