[Bug 13827] despite --copy-unsafe-links, rsync does not copy the referent of symlinks that point one level outside the copied tree

samba-bugs at samba.org samba-bugs at samba.org
Sat Mar 16 17:57:26 UTC 2019


https://bugzilla.samba.org/show_bug.cgi?id=13827

Wayne Davison <wayne at opencoder.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #1 from Wayne Davison <wayne at opencoder.net> ---
In the command:

rsync --archive --copy-unsafe-symlinks home ../rootdir2

The top dir in the tree is "." with "home" being something that you want to
transfer in that tree.  Thus, anything in that tree is fair game in rsync's
algorithm.  You should instead run this (which was your second test):

rsync --archive --copy-unsafe-symlinks home/ ../rootdir2/home/

Which makes sure that nothing exits the home dir's tree.

The reason for this is that someone might have specified more dirs to copy in
the past (such as "home bin") and then do a partial copy within that tree with
just "home" and they don't want the symlinks mangled in that case.  Rsync makes
the rule that the cut-off point is the top of the tree for the transfer, not an
item within the tree.  You can always tell what the top of the tree is by
seeing what part of the path rsync isn't mentioning.  If the name is mentioned
(as "home" is in the first case) it isn't the top of the transfer.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.



More information about the rsync mailing list