Repository navigation
Conversation
steadytao
requested changes
Oct 21, 2026
steadytao
left a comment
Member
There was a problem hiding this comment.
Small test nitpick but other then that, looks quite good; thank you.
| parent.symlink_to(outside, target_is_directory=True) | ||
|
|
||
|
|
||
| if gated_transfer('raced-parent/untouched', replace_parent) != 0: |
Member
There was a problem hiding this comment.
This requires held-directory traversal to keep working after a rename. Accept either a successful write to saved-parent or a failed transfer with the outside marker unchanged.
Passing an existing destination as the leaf's /proc/self/fd/N makes rsync lstat the procfs link and try to replace it, failing with EPERM. Use the held parent fd plus the leaf name, as for a missing destination. Keep directory arguments pinned directly and verify the parent's leaf still matches the already validated inode before releasing its fd. Reuse pin_dir() for the parent checks and execute-only directory support. Add end-to-end coverage for overwrite, creation, directories, pulls, rejected paths, an in-place leaf replacement and a parent rename. Based on the parent-pin approach described by JeanFrancoisGagne in RsyncProject#1107. Fixes RsyncProject#1107. Assisted-by: OpenAI Codex Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
sairex53
force-pushed
the
fix-1107-rrsync-existing-file
branch
from
October 21, 2026 11:40
442a4ed to
e62b5ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1107.
An upload to an existing file fails because rsync sees the destination's
/proc/self/fd/Nas a symlink and tries to replace it. Pass the filename beneath a pinned parent directory instead, matching the handling of new files. Existing directory arguments keep their current handling.This follows the parent-pin approach suggested by @JeanFrancoisGagne in the issue. It reuses
pin_dir()and checks that the leaf under the held parent still matches the validated inode.Added an end-to-end regression test covering existing-file overwrite and new-file creation (normal and
--inplace), directories, pulls, rejected..and symlink paths, a leaf replaced with a symlink during--inplace, and a renamed parent. All test fixtures stay in the test scratch directory.Testing
On Fedora 44 aarch64:
unlink(3) failed: Operation not permittedand passes after it.rrsync-*tests pass.git diff --checkpass.AI assistance: OpenAI Codex.