Repository navigation
fix(transfer): keep --files-from entries relative under SSH push - #5907
Merged
Merged
Conversation
1 of 3 tasks
oferchen
force-pushed
the
fix/uts-files-from-ssh-push-relative
branch
2 times, most recently
from
June 18, 2026 03:02
27d8fd3 to
bbea958
Compare
The SSH-push path's `build_server_config_for_generator` left `files_from_path` empty on the local sender's ServerConfig. The generator then fell through to `build_file_list(paths)` and walked the absolute source operand recursively. With `--files-from` active the remote receiver applies implied `--relative`, so the wire-side absolute names were mirrored on the destination - the upstream testsuite's `files-from.test` invocation 2 produced `./home/runner/work/rsync/rsync/target/interop/upstream-testsuite/...` instead of the listed `./dir`, `./empty`, `./emptydir`, etc. Wire the local sender's generator to the local `--files-from` source (Stdin, LocalFile, or forwarded-from-wire for RemoteFile), mirroring upstream's `options.c:2473,2501` and `main.c:1322-1328`. The generator now reads filenames from the list, applies the `/./ ` anchor split, and emits wire-side relative names. Also fix the remote-arg builder to match upstream's `options.c:2962` gate `if (files_from && (!am_sender || filesfrom_host))`: PUSH with a local list must NOT forward `--files-from=-` to the remote receiver. SSH pull's `--files-from=- --from0` forwarding is wired symmetrically by reading the local list and forwarding its bytes via `server_config.connection.files_from_data`, matching daemon pull. The same wiring is applied to the embedded-ssh transport. The shared helper for serializing a local files-from source into the wire format is moved to `client::remote::files_from_forwarding` and re-exported from `daemon_transfer::orchestration::transfer` to keep the existing daemon test surface intact. Tests: - Unit tests in `crates/core/src/client/remote/ssh_transfer.rs::tests` pin `files_from_path` propagation for each `FilesFromSource` variant. - Unit tests in `crates/core/src/client/remote/invocation/tests.rs` pin the remote `--files-from` arg for each PUSH/PULL x local/remote combination. - New integration test in `crates/transfer/tests/uts_files_from_ssh_push_relative.rs` drives the generator's `resolve_files_from_paths` + `build_file_list_with_base` pipeline against the upstream files-from.test source layout and asserts the wire-side file list never embeds the absolute source path. Refs upstream `flist.c:2275-2298 send_file_list`, `options.c:2962-2974`, `main.c:1191-1198,1322-1328,1372-1375`.
oferchen
force-pushed
the
fix/uts-files-from-ssh-push-relative
branch
from
June 18, 2026 04:14
38a9d00 to
8e0dcf2
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
* fix(transfer): keep --files-from entries relative under SSH push The SSH-push path's `build_server_config_for_generator` left `files_from_path` empty on the local sender's ServerConfig. The generator then fell through to `build_file_list(paths)` and walked the absolute source operand recursively. With `--files-from` active the remote receiver applies implied `--relative`, so the wire-side absolute names were mirrored on the destination - the upstream testsuite's `files-from.test` invocation 2 produced `./home/runner/work/rsync/rsync/target/interop/upstream-testsuite/...` instead of the listed `./dir`, `./empty`, `./emptydir`, etc. Wire the local sender's generator to the local `--files-from` source (Stdin, LocalFile, or forwarded-from-wire for RemoteFile), mirroring upstream's `options.c:2473,2501` and `main.c:1322-1328`. The generator now reads filenames from the list, applies the `/./ ` anchor split, and emits wire-side relative names. Also fix the remote-arg builder to match upstream's `options.c:2962` gate `if (files_from && (!am_sender || filesfrom_host))`: PUSH with a local list must NOT forward `--files-from=-` to the remote receiver. SSH pull's `--files-from=- --from0` forwarding is wired symmetrically by reading the local list and forwarding its bytes via `server_config.connection.files_from_data`, matching daemon pull. The same wiring is applied to the embedded-ssh transport. The shared helper for serializing a local files-from source into the wire format is moved to `client::remote::files_from_forwarding` and re-exported from `daemon_transfer::orchestration::transfer` to keep the existing daemon test surface intact. Tests: - Unit tests in `crates/core/src/client/remote/ssh_transfer.rs::tests` pin `files_from_path` propagation for each `FilesFromSource` variant. - Unit tests in `crates/core/src/client/remote/invocation/tests.rs` pin the remote `--files-from` arg for each PUSH/PULL x local/remote combination. - New integration test in `crates/transfer/tests/uts_files_from_ssh_push_relative.rs` drives the generator's `resolve_files_from_paths` + `build_file_list_with_base` pipeline against the upstream files-from.test source layout and asserts the wire-side file list never embeds the absolute source path. Refs upstream `flist.c:2275-2298 send_file_list`, `options.c:2962-2974`, `main.c:1191-1198,1322-1328,1372-1375`. * fix(clippy): unused mut in test; gate test-only re-export * fix(clippy): update import for Path after ptr_arg fix
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.
Summary
build_server_config_for_generatorno longer leavesfiles_from_pathempty on the local sender. With--files-fromactive, the generator now reads filenames from the local list (or the forwarded wire stream for remote files-from) instead of recursing the absolute source operand and mirroring its absolute path on the destination under implied--relative.RemoteInvocationBuildernow matches upstream'soptions.c:2962gate: PUSH with a local list omits--files-fromto the remote receiver; PULL still forwards--files-from=- --from0and the local list bytes over the wire (parity with the daemon path).Root cause
The CI upstream-testsuite run https://github.com/oferchen/rsync/actions/runs/27711564454 (
files-from.log) showed invocation 2 oftestsuite/files-from.test:producing destination paths like
instead of the listed
./dir,./empty,./emptydir, ... The local mode invocation 1 passed because the CLI workflow's local-only branch already prefixes file_list_operands with/./markers. The SSH-push branch dropped those operands and never propagated--files-fromto the local sender'sServerConfig, so the generator walked the absolute$scratchdirand emitted absolute-prefixed wire names. Upstream's behaviour is documented atflist.c:2275-2298 send_file_list,options.c:2962-2974, andmain.c:1191-1198,1322-1328,1372-1375.Test plan
crates/core/src/client/remote/ssh_transfer.rs::tests- new unit tests pinfiles_from_pathpropagation forLocalFile,Stdin,RemoteFile, and the disabled case.crates/core/src/client/remote/invocation/tests.rs- new unit tests pin the remote--files-fromarg across PUSH/PULL x local/remote.crates/transfer/tests/uts_files_from_ssh_push_relative.rs- new integration test drives the generator'sresolve_files_from_paths+build_file_list_with_basepipeline against the upstreamfiles-from.testsource layout and asserts the wire-side file list never embeds the absolute source path.Upstream Testsuitejob runsfiles-from.testto completion.