Bug 3839 - The '/' in the Softlink is missing on the remote Rsyncd server !
The '/' in the Softlink is missing on the remote Rsyncd server !
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
2.5.7
x86 Windows 98
: P3 normal
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-15 11:51 UTC by Louie Chan
Modified: 2006-10-15 13:26 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Louie Chan 2006-06-15 11:51:46 UTC
Dear all,

When I use rsync with "-l" to backup some softlinks to the remote Rsyncd server, the '/' in all softlink files on the remote server has been removed. For example: The softlink "test2.txt -> /home/louie/test.txt" will become to "test2.txt -> home/louie/test.txt" on the remote server. Therefore, the OS cannot locate the right location due to missing '/' when I recover this softlink from the remote server to the local machine.

Do you know if there is any method to fix this problem ?

Thanks !

Best Regards. Louie
Comment 1 Wayne Davison 2006-06-15 12:22:33 UTC
This has been fixed in the CVS version for a while now, which you can try out via the "nightly" tar files.  This sanitizing of symlinks as they get expanded is still pretty new, so it would help if folks beat on the code to see if there are any places where a symlink could escape the top of the module's hierarchy that aren't handled yet.

You can also avoid the problem with any rsync by turning chroot on in the config file.
Comment 2 Louie Chan 2006-06-16 01:29:36 UTC
(In reply to comment #1)
> This has been fixed in the CVS version for a while now, which you can try out
> via the "nightly" tar files.  This sanitizing of symlinks as they get expanded
> is still pretty new, so it would help if folks beat on the code to see if there
> are any places where a symlink could escape the top of the module's hierarchy
> that aren't handled yet.
>

Dear Wayne,

Thanks for your kind reply !

Can you tell me which version of rsync has fixed this problem ?
'cos I can find that the man page for rsync v2.6.4-3 is still telling us that it will still remove the leading slashes in all symbollinks. See below:
       man rsyncd.conf
       use chroot
              If "use chroot" is true, the rsync server  will  chroot  to  the
              "path"  before starting the file transfer with the client.  This
              has the advantage of extra protection against possible implemen-
              tation security holes, but it has the disadvantages of requiring
              super-user privileges, of not  being  able  to  follow  symbolic
              links  that are either absolute or outside of the new root path,
              and of complicating the preservation  of  usernames  and  groups
              (see  below).  When "use chroot" is false, for security reasons,
              symlinks may only be relative  paths  pointing  to  other  files
              within  the root path, and leading slashes are removed from most
              absolute paths (options such  as  --backup-dir,  --compare-dest,
              etc. interpret an absolute path as rooted in the module’s "path"
              dir, just as if chroot was specified).   The  default  for  "use
              chroot" is true.

> You can also avoid the problem with any rsync by turning chroot on in the
> config file.
>
  It works for my current version after I have turned chroot on.

  Thanks !

Best Regards. Louie

Comment 3 Matt McCutchen 2006-06-17 09:15:11 UTC
(In reply to comment #2)
> Can you tell me which version of rsync has fixed this problem ?

The problem was fixed in the CVS after the release of 2.6.8, which means that the only way you can get a fixed rsync is to compile it yourself from the source code in CVS.  To get the source, you can either check out the source code from CVS or download and unpack the nightly tar file, as Wayne mentioned:
    http://rsync.samba.org/ftp/rsync/nightly/rsync-nightly.tar.gz
Then ./configure, make, su -c 'make install'.