Repository navigation
fix(daemon): finish setup_protocol before multiplexing refuse-options error - #5734
Merged
Merged
Conversation
… error upstream rsync's daemon, after `@RSYNCD: OK`, completes `setup_protocol()` (compat-flags varint + checksum seed) before flipping its writer to multiplexed output and emitting any post-OK error. Refused-options diagnostics that surface from `parse_arguments()` follow the same discipline, riding `MSG_ERROR_XFER` + `MSG_ERROR_EXIT` frames. Our daemon skipped that prelude entirely on the refused-options abort path. The client then read the daemon's `MSG_ERROR_XFER` header as the compat-flags varint and the next four bytes as the checksum seed before flipping to multiplex input. The framing resynced partway into our `@ERROR: The server is configured to refuse --compress` payload, decoding the letter `A` (ASCII 65) as a fresh multiplex tag and aborting with `unexpected tag 72 [Receiver]` against upstream 3.4.3 and 3.4.4. Mirror the upstream prefix on the daemon side: write the compat-flags varint (deliberately omitting `CF_VARINT_FLIST_FLAGS` so the client never tries to read negotiated vstrings we have no peer for on the abort path) followed by the 4-byte checksum seed, then emit the existing multiplex frames. Add a wire-level regression test that pins the byte stream to the upstream shape and rejects the historical `tag 72` regression by name.
This was referenced Jun 12, 2026
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
… error (#5734) upstream rsync's daemon, after `@RSYNCD: OK`, completes `setup_protocol()` (compat-flags varint + checksum seed) before flipping its writer to multiplexed output and emitting any post-OK error. Refused-options diagnostics that surface from `parse_arguments()` follow the same discipline, riding `MSG_ERROR_XFER` + `MSG_ERROR_EXIT` frames. Our daemon skipped that prelude entirely on the refused-options abort path. The client then read the daemon's `MSG_ERROR_XFER` header as the compat-flags varint and the next four bytes as the checksum seed before flipping to multiplex input. The framing resynced partway into our `@ERROR: The server is configured to refuse --compress` payload, decoding the letter `A` (ASCII 65) as a fresh multiplex tag and aborting with `unexpected tag 72 [Receiver]` against upstream 3.4.3 and 3.4.4. Mirror the upstream prefix on the daemon side: write the compat-flags varint (deliberately omitting `CF_VARINT_FLIST_FLAGS` so the client never tries to read negotiated vstrings we have no peer for on the abort path) followed by the 4-byte checksum seed, then emit the existing multiplex frames. Add a wire-level regression test that pins the byte stream to the upstream shape and rejects the historical `tag 72` regression by name.
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
clientserver.c:1146-1186setup-protocol prelude on the daemon's post-@RSYNCD: OKrefused-options abort path so the client decodes the multiplexed error frames at the right wire offset.run_daemon_post_ok_refused_option_uses_multiplexed_error) that pins the byte stream byte-for-byte and rejects the historicalunexpected tag 72 [Receiver]failure mode by name.Why
Upstream's daemon, once it has emitted
@RSYNCD: OK, runssetup_protocol()(compat-flags varint + checksum seed) before flipping to multiplexed output and writing any error. Our daemon skipped that prelude entirely on the refused-options abort path. The client then read ourMSG_ERROR_XFERheader bytes as the compat-flags varint and the next four bytes as the checksum seed before flipping to multiplex input. Framing resynced partway into the@ERROR: The server is configured to refuse --compresspayload, decoding the letterA(ASCII 65) as a fresh multiplex tag and aborting withunexpected tag 72 [Receiver]against upstream rsync 3.4.3 and 3.4.4 — exactly the failure mode reported by the upstreamdaemon-refuse-compresstestsuite check (and any siblingdaemon-refusecases triggered by packed bundles like-vlogDtprez.iLsfxCIvu).The fix advertises a minimal compat-flag set without
CF_VARINT_FLIST_FLAGSso the client'sdo_negotiated_stringsstays clear and we do not have to write the bidirectional vstring exchange we have no peer for on the abort path.Test plan
cargo fmt --all -- --checkcargo nextest run -p daemon -E 'test(run_daemon_post_ok_refused_option_uses_multiplexed_error) or test(run_daemon_refuses_disallowed_module_options)'(both green; latter exercises the existing pre-@RSYNCD: OKrefuse path to confirm no regression)