Repository navigation
fix: accept -s secluded-args in oc-rsync --server flag string - #5516
Merged
Merged
Conversation
When the upstream rsync client uses --secluded-args / -s, it splits its argv: the server-options head (--server, --sender, packed flag string, value-bearing long flags) travels on the command line, while the trailing positional args (the dot separator and path arguments) stream over stdin as NUL-delimited bytes. The previous server-mode handler replaced its effective argument slice with the stdin payload alone, discarding the flag string entirely. That triggered 'invalid server arguments: missing rsync server flag string' on every upstream invocation that sets -s -- including 00-hello's test4/test5 (-ais round-trips through lsh.sh). Match upstream's read_args() contract: keep the command-line argv tail, skip the synthetic 'rsync' arg0 the wire prepends, and append the rest of the stdin payload as positional arguments. Adds two round-trip regression tests using captured upstream wire bytes: one for the packed -slogDtpre.iLsfxCIvu form and one for the standalone -s spelling. upstream: rsync.c:283 send_protected_args(), io.c:1295 read_args()
oferchen
force-pushed
the
fix/uts-1-secluded-args-server-mode
branch
from
June 10, 2026 02:58
e3ac386 to
803a114
Compare
2 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
4 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
UTS-1.e (`docs/audits/uts-1-e-test6-actual-command.md`): document the upstream `testsuite/00-hello.test` test6 command that lsh.sh forwards to oc-rsync (`--server --sender -logDtpre.iLsfxCIvu --old-args . 'one two'`), capture the verbatim failure from `target/interop/upstream-testsuite/00-hello.log:139-141`, and trace the receiver-side `zero-length filename` error to a missing server- side `--old-args` re-split (upstream `options.c:1640-1648`). Includes two follow-up items. UTS-1.f (`docs/audits/uts-1-f-tcpdump-wire-parity.md`): walk the `-ais` wire-byte layout for push and pull through lsh.sh. The symmetric oc-rsync<->oc-rsync legs (test4/test5) show PARITY, with the drain layer matching upstream `io.c:1308-1367` byte-for-byte and locked by PR #5610's regression test. The asymmetric upstream-client -> oc-rsync-server legs are a GAP_FOUND because PR #5541's rebase diff silently reverted PR #5516's cmdline+stdin merge in `crates/cli/src/frontend/server/run.rs`. The drain test from #5610 remains valid; the merge fix needs to be reapplied. Includes three follow-up items. Both docs cross-reference PR #5516, PR #5610, PR #5541, the upstream 3.4.4 source at `target/interop/upstream-src/rsync-3.4.4/`, and the captured fixture log at `target/interop/upstream-testsuite/00-hello.log`. No production code changes. No oc-rsync-specific feature impact. No branding touched.
2 of 3 tasks
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
* fix: accept -s secluded-args in server flag string When the upstream rsync client uses --secluded-args / -s, it splits its argv: the server-options head (--server, --sender, packed flag string, value-bearing long flags) travels on the command line, while the trailing positional args (the dot separator and path arguments) stream over stdin as NUL-delimited bytes. The previous server-mode handler replaced its effective argument slice with the stdin payload alone, discarding the flag string entirely. That triggered 'invalid server arguments: missing rsync server flag string' on every upstream invocation that sets -s -- including 00-hello's test4/test5 (-ais round-trips through lsh.sh). Match upstream's read_args() contract: keep the command-line argv tail, skip the synthetic 'rsync' arg0 the wire prepends, and append the rest of the stdin payload as positional arguments. Adds two round-trip regression tests using captured upstream wire bytes: one for the packed -slogDtpre.iLsfxCIvu form and one for the standalone -s spelling. upstream: rsync.c:283 send_protected_args(), io.c:1295 read_args() * style: cargo fmt fix for assert_eq! collapsing
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
UTS-1.e (`docs/audits/uts-1-e-test6-actual-command.md`): document the upstream `testsuite/00-hello.test` test6 command that lsh.sh forwards to oc-rsync (`--server --sender -logDtpre.iLsfxCIvu --old-args . 'one two'`), capture the verbatim failure from `target/interop/upstream-testsuite/00-hello.log:139-141`, and trace the receiver-side `zero-length filename` error to a missing server- side `--old-args` re-split (upstream `options.c:1640-1648`). Includes two follow-up items. UTS-1.f (`docs/audits/uts-1-f-tcpdump-wire-parity.md`): walk the `-ais` wire-byte layout for push and pull through lsh.sh. The symmetric oc-rsync<->oc-rsync legs (test4/test5) show PARITY, with the drain layer matching upstream `io.c:1308-1367` byte-for-byte and locked by PR #5610's regression test. The asymmetric upstream-client -> oc-rsync-server legs are a GAP_FOUND because PR #5541's rebase diff silently reverted PR #5516's cmdline+stdin merge in `crates/cli/src/frontend/server/run.rs`. The drain test from #5610 remains valid; the merge fix needs to be reapplied. Includes three follow-up items. Both docs cross-reference PR #5516, PR #5610, PR #5541, the upstream 3.4.4 source at `target/interop/upstream-src/rsync-3.4.4/`, and the captured fixture log at `target/interop/upstream-testsuite/00-hello.log`. No production code changes. No oc-rsync-specific feature impact. No branding touched.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
When the upstream rsync client uses --secluded-args / -s, it splits its argv: the server-options head (--server, --sender, packed flag string, value-bearing long flags) travels on the command line, while the trailing positional args (the dot separator and path arguments) stream over stdin as NUL-delimited bytes. PR #5516 wired the merge into run_server_mode so both sources combine into the effective argv before flag parsing. PR #5541 (URV-6.b NDX_DEL_STATS wiring) inadvertently reverted that merge along with the regression tests, restoring the prior behaviour of replacing effective_args with the stdin payload alone. The regression discards the cmdline tail. Against an upstream client that sets -s, the server loses the packed flag string entirely and aborts with "invalid server arguments: missing rsync server flag string". The 00-hello suite kept passing because test4/test5 run oc-rsync on both ends and the symmetric client buries the full arg list inside the stdin payload. Restore the merge contract from PR #5516: skip the synthetic "rsync" arg0 the wire prepends and prepend args[1..] (the command-line tail) before the remaining stdin args. Re-add the two PR #5516 regression tests covering both the packed -slogDtpre.iLsfxCIvu form and the standalone -s spelling. upstream: main.c::read_args() merges cmdline args with stdin args under --protect-args / secluded-args (main.c:1852 callsite, io.c:1308 read_args(), rsync.c:283 send_protected_args(), options.c:2745 NULL split). Documented in the UTS-1.e+.f audit (#5631).
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
When upstream rsync invokes
--serverwith--secluded-args/-s, theclient splits its argv: the server-options head (
--server,--sender,the packed transfer-flag string such as
-slogDtpre.iLsfxCIvu, and thevalue-bearing long flags) travels on the command line, while the trailing
positional args (the
.separator and path arguments) stream over stdinas NUL-delimited bytes terminated by an empty string.
The server-mode handler previously replaced its effective argument slice
with the stdin payload alone, discarding the flag string entirely. That
triggered
invalid server arguments: missing rsync server flag stringonevery upstream invocation with
-s-- including the-aisround-trips intestsuite/00-hello_test.py(test4, test5) underlsh.sh.This change matches upstream's
read_args()contract (io.c:1295) andthe
send_protected_args()wire layout (rsync.c:283): we keep thecommand-line argv tail, skip the synthetic
rsyncarg0 that the wireprepends, and append the rest of the stdin payload as positional args.
Wire evidence (captured under lsh.sh -ais)
Captured via a tee wrapper around
oc-rsync --serverwhile runningrsync -ais --rsync-path=oc-rsync lh:reproA/from/ /tmp/reproA/:--server --sender -slogDtpre.iLsfxCIvursync\0.\0/home/ofer/reproA/from/\0\0The flag string travels on the command line. Before this fix the server
discarded it; after this fix it is preserved and merged with the
stdin-provided positional path tail.
Test results on the Linux interop host
Before this PR:
After this PR (00-hello, tests 1-5):
Other suites that previously reported the same
missing rsync server flag stringerror no longer surface that error:exclude-lsh,files-from,alt-dest,batch-mode,hardlinksThose suites still fail on independent issues (filter semantics,
symlink-mtime drift,
--old-argsre-splitting) that are tracked asseparate follow-ups.
Test plan
testsuite/00-hello_test.pytests 4 & 5 pass underlsh.sh -aiswith
oc-rsync --server(previously hard-failed with arg parsererror)
--serverpath is unchanged (verified by runningrsync -ai --rsync-path=oc-rsync lh:src/ dest/end-to-end)crates/cli/src/frontend/server/tests.rsusing captured upstreamwire bytes -- one for the packed
-slogDtpre.iLsfxCIvuform andone for the standalone
-sformmusl
upstream:
rsync.c:283send_protected_args(),io.c:1295read_args(),options.c:2604server_options()(sets thesflag-string char and theNULL split between command-line and stdin tails)