Skip to content

fix: refuse an untrusted destination symlink with the upstream diagnostic - #8071

Merged
oferchen merged 3 commits into
masterfrom
fix/untrusted-dest-symlink-diagnostic
Oct 2, 2026
Merged

oferchen merged 3 commits into
masterfrom
fix/untrusted-dest-symlink-diagnostic

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

Part 2 of 3 of the 3.5.1 confinement remainder, stacked on the search-only traversal PR.

rsync 3.5.1 resolves an existing destination directory through the ownership walk (change_dir()) before the receiver writes anything. When the walk refuses a symlink owned by neither root nor the euid, it prints the actionable "refusing to follow a symlink owned by an untrusted user; use --insecure-links ..." line.

oc followed the destination by path and failed later with "cannot replace non-directory destination with directory" (exit 23).

oc now resolves an existing destination directory the same way:

  • it exits 3 (RERR_FILESELECT);
  • it prints the upstream diagnostic from the walk on the error channel;
  • --insecure-links keeps the plain follow.

@oferchen
oferchen force-pushed the fix/search-only-traversal branch from de929d3 to c5608c3 Compare September 30, 2026 14:01
@oferchen
oferchen force-pushed the fix/untrusted-dest-symlink-diagnostic branch from 0405cdf to c73ef32 Compare September 30, 2026 14:02
@github-actions github-actions Bot added the bug Something isn't working label Sep 30, 2026
@oferchen
oferchen deleted the branch master September 30, 2026 14:44
@oferchen oferchen closed this Sep 30, 2026
@oferchen oferchen reopened this Sep 30, 2026
@oferchen
oferchen changed the base branch from fix/search-only-traversal to master September 30, 2026 14:45
@oferchen
oferchen force-pushed the fix/untrusted-dest-symlink-diagnostic branch 2 times, most recently from 0795cb6 to 3c8919e Compare October 1, 2026 04:26
…stic

rsync 3.5.1 resolves an existing destination directory through the
ownership walk before the receiver writes anything (change_dir()), and
the walk prints the actionable "refusing to follow a symlink owned by an
untrusted user; use --insecure-links ..." line whenever it refuses a
symlink owned by neither root nor the euid.

oc followed the destination by path and failed later with "cannot
replace non-directory destination with directory" (exit 23). Resolve
an existing destination directory the same way (exit 3,
RERR_FILESELECT) and emit the upstream diagnostic from the walk on the
error channel. --insecure-links keeps the plain follow.
The destination walk opens the root O_PATH on Linux and O_RDONLY
elsewhere, exactly like upstream directory_traverse_flags(). A 0333
destination therefore transfers on Linux but fails file selection with
exit 3 on macOS - measured identical against upstream 3.5.1 on macOS
(change_dir#1 ... Permission denied, code 3). Gate the transfer cell to
Linux and pin the non-Linux exit 3 in a companion.
@oferchen
oferchen force-pushed the fix/untrusted-dest-symlink-diagnostic branch 2 times, most recently from 90b913d to b2549a0 Compare October 1, 2026 17:50
@oferchen
oferchen merged commit 9d91bad into master Oct 2, 2026
79 checks passed
@oferchen
oferchen deleted the fix/untrusted-dest-symlink-diagnostic branch October 2, 2026 03:02
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.

1 participant