Skip to content

test(protocol): assert recv_secluded_args fully drains terminator NUL - #5610

Merged
oferchen merged 2 commits into
masterfrom
test/uts-1-d-secluded-args-drain-roundtrip
Jun 11, 2026
Merged

oferchen merged 2 commits into
masterfrom
test/uts-1-d-secluded-args-drain-roundtrip

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Lock 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 can leak into the subsequent @RSYNCD: protocol greeting stream.
  • Mirrors upstream io.c:1308-1367 read_args(), where read_line() returns 0 on the empty-arg terminator and leaves the input fd positioned past the consumed NUL.
  • Production code is unchanged; this is a regression test that pins behaviour after the UTS-1 secluded-args server-mode rejection fix (feat: skip SQPOLL when rootless container detected (SQP-LAND.4) #5559).

Test plan

  • Happy-path drain: 5-arg payload --server\0--sender\0-logDtpr\0.\0/path\0\0 parses to 5 args and cursor.position() == wire.len().
  • Empty arg list: lone \0 terminator parses to an empty vector and still consumes exactly 1 byte.
  • Premature EOF: payload missing the trailing \0\0 terminator returns io::ErrorKind::UnexpectedEof.

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
@github-actions github-actions Bot added the test label Jun 10, 2026
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
oferchen merged commit a31a405 into master Jun 11, 2026
8 of 9 checks passed
@oferchen
oferchen deleted the test/uts-1-d-secluded-args-drain-roundtrip branch June 11, 2026 03:10
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant