What are the risks of --insecure-links?

Chris Green cl at isbd.net
Fri Oct 2 12:15:58 UTC 2026


rsync.project via rsync <rsync at lists.samba.org> wrote:
> 
> Hi Chris,
> 
> This error happens because the symlink you are operating with is an
> untrusted symlink. Untrusted symlink is a symlink which is not owned by
> root or the user running the process if the process is local, otherwise if
> the process is daemon it should not follow any link outside the daemon
> tree. —insecure-links will follow non-trusted symlinks normally. By
> applying —insecure-links any user have permissions to the syncing tree (src
> or dest) can redirect the transfer if he planted symlink inside the
> operating tree (rsync -a src/ dest/). If you don’t have any untrusted users
> on the system it’s ok to use —insecure-links , but it’s better to lchown
> the symlink with a trusted UID to avoid any issues.
> 
Yes, I understand (I think) the reasons for the message about not
following links outside the tree.

What I was asking is how to **find** the links that are causing the
issue. I am running a command as follows:-

    rsync -a -X -A -F --link-dest=/bak/snapshot/cur  /etc /home /bak/snapshot/new/

This produces the "refusing to follow a symlink owned by an untrusted
user" just eight times while there are thousands of files in the above
hierarchies, there are over 1000 symbolic links.

How can I find the six symbolic links which are causing the error? 

I have tried using 'find' but I can't see a way of detecting symbolic
links that point outside the hierarchy.

I have been trying rsync's --verbose and --info options to see if I can get
it to tell me where the errors are happening but with little success.

Some help (or pointers to help) would be much appreciated.

-- 
Chris Green
·




More information about the rsync mailing list