Repository navigation
test(protocol): assert recv_secluded_args fully drains terminator NUL - #5610
Merged
Merged
Conversation
Locks the UTS-1.d invariant that recv_secluded_args consumes every byte of the wire payload up to and including the terminating NUL, so no residual bytes leak into the subsequent protocol greeting stream. Three regression cases mirroring upstream io.c:1308-1367 read_args(): - happy path with 5 args asserts cursor.position() == wire.len() - empty arg list still drains the lone terminator NUL - premature EOF before the terminator returns ErrorKind::UnexpectedEof
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.
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
…in-roundtrip test(protocol): assert recv_secluded_args fully drains terminator NUL
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
recv_secluded_argsconsumes every byte of the wire payload up to and including the terminating NUL, so no residual bytes can leak into the subsequent@RSYNCD:protocol greeting stream.io.c:1308-1367read_args(), whereread_line()returns 0 on the empty-arg terminator and leaves the input fd positioned past the consumed NUL.Test plan
--server\0--sender\0-logDtpr\0.\0/path\0\0parses to 5 args andcursor.position() == wire.len().\0terminator parses to an empty vector and still consumes exactly 1 byte.\0\0terminator returnsio::ErrorKind::UnexpectedEof.