Skip to content

syscall: follow trusted sender ancestor links - #1088

Open
steadytao wants to merge 7 commits into
masterfrom
sender-ancestor-links
Open

steadytao wants to merge 7 commits into
masterfrom
sender-ancestor-links

Conversation

@steadytao

@steadytao steadytao commented Sep 14, 2026

Copy link
Copy Markdown
Member

Fixes #1087

Summary

Explicit sender command-line arguments now establish transfer roots and may pass through ancestor symlinks regardless of ownership. This covers absolute and relative directory sources as well as direct file sources used with --relative, while keeping recursive traversal confined beneath the selected source root.

--files-from entries follow only trusted-owned ancestor symlinks because the source base is operator-selected but individual list entries are not. File-leaf symlinks remain refused unless an existing symlink-following option is enabled.

Daemon confinement remains unchanged.

@steadytao

Copy link
Copy Markdown
Member Author

@peabee Could you test this with your backup application using the original /mnt/home/My_Documents path? Please check that the backup completes and the expected files are copied.

@steadytao steadytao added the bug Something isn't working label Sep 14, 2026
@peabee

peabee commented Sep 14, 2026

Copy link
Copy Markdown

Hi happy to test but unsure what "this" is or how to obtain it......
A binary would be ideal......
But if you want me to download source and compile I don't know how to download source with a pull request included - sorry!

@steadytao

Copy link
Copy Markdown
Member Author

This is built against TrixiePup64, so it may not run on your Slackware-based Puppy - rsync.tar.gz

Make sure to keep your existing rsync; if this binary reports a library error, send me that error and your exact Puppy version/environment so I can provide a matching build.

@steadytao

Copy link
Copy Markdown
Member Author

Ah and you can use git clone --single-branch --branch sender-ancestor-links https://github.com/RsyncProject/rsync.git to clone the PR if that is easier.

Comment thread syscall.c Outdated
@seks99x

seks99x commented Sep 15, 2026

Copy link
Copy Markdown
Member

Great job! there is still another case not covered. File transfers using the -R (--relative) flag are still broken across the board if a symlink is included in the path (full/relative paths). Directories or recursive transfers works well with full/relative paths.

┌──(root㉿192)-[~/rsync-latest-news]
└─# rsync/rsync -R rsync/lnk/test/a /home/omar/dest/ -> rel/full path case
rsync: [sender] send_files failed to open "/root/rsync-latest-news/rsync/lnk/test/a": Too many levels of symbolic links (40)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1404) [sender=3.5.0-gd0a5ab7f]

Expected Behavior (rsync 3.4.1)
seks@omars-Mac-mini rsync-3.4.1 % ./rsync -R lnk/sub/a dest/ 
seks@omars-Mac-mini rsync-3.4.1 % ls dest/
lnk

@peabee

peabee commented Sep 16, 2026

Copy link
Copy Markdown

This is built against TrixiePup64, so it may not run on your Slackware-based Puppy - rsync.tar.gz

Make sure to keep your existing rsync; if this binary reports a library error, send me that error and your exact Puppy version/environment so I can provide a matching build.

Sorry for the delay in responding....
Many thanks for the binary - appreciated - all dependencies were satisfied.
I can confirm that with this version, the backup to /mnt/home/My_Documents where /mnt/home is a symlink works successfully - no errors.
Looking forward to the new version appearing.
Thanks.

@steadytao

Copy link
Copy Markdown
Member Author

Much appreciated. The new version should be released on the 21st for as long we catch no more edge/corner cases.

@steadytao
steadytao requested a review from seks99x September 16, 2026 10:03
@seks99x

seks99x commented Sep 16, 2026

Copy link
Copy Markdown
Member

files-from uses relative by default and still broken. They should be following only trusted symlinks because we are inside the operators-tree.

┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# ./rsync -av --files-from=/root/rsync-latest-news/rsync/files.txt /root/rsync-latest-news/seks99x/batch/rsync/  /home/omar/dest/
building file list ... done
rsync: [sender] send_files failed to open "/root/rsync-latest-news/seks99x/batch/rsync/lnk/test/a": Too many levels of symbolic links (40)

sent 185 bytes  received 31 bytes  432.00 bytes/sec
total size is 1,057  speedup is 4.89
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1404) [sender=3.5.0-gc9f8e21f]
                                                                                                                                                                            
┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# ls -al lnk                                                                                                                     
lrwxrwxrwx 1 root root 10 Sep 15 18:34 lnk -> /etc/omar/
                                                                                                                                                                            
┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# cat files.txt            
lnk/test/a. -> contains symlink

Expected Behavior (rsync 3.4.1)
seks@omars-Mac-mini rsync-3.4.1 % ./rsync -av --files-from=files.txt . dest/
building file list ... done
lnk/
lnk/sub/
lnk/sub/a

sent 161 bytes  received 41 bytes  404.00 bytes/sec
total size is 3  speedup is 0.01

seks@omars-Mac-mini rsync-3.4.1 % cat files.txt 
lnk/sub/a -> contains symlink
                                                                                                                                                                            

@steadytao

Copy link
Copy Markdown
Member Author

Ahhhh true. Thank you.

@seks99x

seks99x commented Sep 16, 2026

Copy link
Copy Markdown
Member

If a directory listed in --files-from contains or leads through a trusted symlink, traversing it fails . Trusted symlinks in the path should be followed correctly here.
Files are working right, if I changed the path to lnk/test/a it will work as expected.

┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# ./rsync -av --files-from=/root/rsync-latest-news/rsync/fi . /home/omar/dest/
building file list ... 
rsync: [sender] opendir "/root/rsync-latest-news/rsync/lnk/test" failed: Too many levels of symbolic links (40)
done
lnk/
lnk/test/

sent 84 bytes  received 22 bytes  212.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1404) [sender=3.5.0-ge7a40140]
                                                                                                                                                                            
┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# cat fi                
lnk/test/
                                                                                                                                                                            
┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# ll lnk
lrwxrwxrwx 1 root root 10 Sep 15 18:34 lnk -> /etc/omar/
                                                                                                                                                                            
┌──(root㉿192)-[~/rsync-latest-news/rsync]
└─# 

Comment thread flist.c Outdated
@steadytao

Copy link
Copy Markdown
Member Author

Oof ye. Okay give me more time on this. Good to get a rough shape and it semi-working but it needs a lot more for proper coverage.

@steadytao steadytao self-assigned this Sep 16, 2026
@seks99x

seks99x commented Sep 16, 2026

Copy link
Copy Markdown
Member

Take your time, mate! Symlinks are an absolute mess in this codebase😂

@steadytao

Copy link
Copy Markdown
Member Author

Symlinks are an absolute mess everywhere. I need to start a revolt!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sender-side ELOOP after upgrading to 3.5.0

3 participants