overflow: linkname_len

Wayne Davison wayned at samba.org
Fri Mar 28 02:15:47 GMT 2008


On Thu, Mar 27, 2008 at 12:21:58PM -0700, Brian McGrew wrote:
> Looking at /usr/include/sys/syslimits.h on the Mac, PATH_MAX is defined at
> 1024 and then MAXPATHLEN is defined as PATH_MAX.

I'd suggest trying to create a really long symlink to see what the OS
maximum value is.  If the OS allows a larger value, you can define a
larger MAXPATHLEN and see if that works for you (e.g. in config.h or
rsync.h, ad an #undef MAXPATHLEN followed by a #define MAXPATHLEN 4096
or whatever value the OS will support).  If it's really 1024, then rsync
cannot currently help you copy the symlinks.

If you end up not being able to create the long symlinks on your Mac
filesystem, turn off the -l option in the rsync command, copy everything
else, and then do something like this on the sending system:

find . -type l -ls >symlinks.txt

That will make a record of what the symlinks point to.  Then, create a
script that is able to read the text file and recreate the links;  e.g.
see the support/file-attr-restore for a perl script that is able to read
find -ls output which could be adapted to recreate symlinks rather than
skipping them.

..wayne..


More information about the rsync mailing list