Repository navigation
fix(daemon): exit 4 on a refused option, not 1 - #7587
Merged
Merged
Conversation
A daemon that refuses a client option sent the peer MSG_ERROR_EXIT with RERR_SYNTAX (1). Upstream ends that path in exit_cleanup(RERR_UNSUPPORTED) at clientserver.c:1267, so a client scripting on `rsync -z` (or the default-refused --write-devices / --copy-devices) being rejected saw 1 where upstream reports 4. Measured against the pinned upstream 3.5.0 daemon, same client, push direction: --write-devices upstream 4, oc 1 -> 4 refuse options=compress, -z upstream 4, oc 1 -> 4 refuse options=delete, -r --delete upstream 4, oc 1 -> 4 Upstream has one post-@rsyncd:OK fatal branch (clientserver.c:1254-1268, `if (!ret || err_msg)`), which covers both a refused option and a failed pre-xfer exec and ends in RERR_UNSUPPORTED. The sibling on that branch, handle_client_arg_rejection_post_handshake, already sent 4; the refused- option arm was the straggler, so this makes the branch uniform. The read-only push and write-only pull rejections are a different decision - made later in do_server_recv()/do_server_sender() - and keep RERR_SYNTAX; their tests stay green unchanged. The `@ERROR: ` payload prefix on the refusal text is untouched: the exit code is a separate argument to send_multiplexed_error_and_exit, and the prefix divergence is owned elsewhere.
oferchen
added a commit
that referenced
this pull request
Sep 2, 2026
`## [Unreleased]` last covered the #7304-#7522 era. Measured against the 60 most recently merged pull requests, 44 were absent; of the most recent 45, 43 were absent. Nothing from #7574 onward was recorded at all. Each entry is derived from what the pull request actually landed - the merge commit and the body - not from its title. Three cases where those differ: * #7616 ships far more than the doc-alias correction its body describes: the `upstream_version` pin moves to 3.5.0 and `--version` starts naming `quic`, `sd-notify`, `vmsplice` and `send_zc`. * #7618 also adds the pull-request rustdoc-link job its body says was filed separately, which is what closes the master-only-gate recurrence. * #7602's squash carries the closed #7597 as its first commit, so the directory-obstacle half is recorded under #7602. #7587 is deliberately not recorded. Its merge commit is empty: the change had already landed as #7563, which the section already names. Entries extend the existing Keep a Changelog groups and the bold sub-groupings. Clusters that are one story carry one entry with several references: the FERROR_XFER routing and its two-phase drain (#7576, #7581), the connection-FSM close edge and the accept loop that outlives a session error (#7579, #7590), the three detaching daemon suites (#7578, #7588, #7592), the io_uring and SEND_ZC work (#7593, #7600, #7610), the citation retargets (#7601, #7603, #7604), and the accept-loop pin flake (#7615, #7620). Only `## [Unreleased]` is touched; every released section, including the 3.4.4 statements that were correct when written, is byte-identical.
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.
A daemon that refuses a client option after sending
@RSYNCD: OKexits1where upstream exits
4(RERR_UNSUPPORTED).Upstream
clientserver.c:1254-1268is a single post-OK fatal branch:It covers both a refused option and a failed
pre-xfer exec, and it ends inexit_cleanup(RERR_UNSUPPORTED)at:1267. That is the code the peerobserves in the
MSG_ERROR_EXITpayload.The discriminator
Not every daemon refusal maps to
4. The sibling read-only / write-onlyrejection is a different decision, made later in
do_server_recv()/do_server_sender(), and it keepsRERR_SYNTAX. This change moves only thepost-OK option-refusal branch; the read-only rejection is deliberately
untouched.
Scope
FEATURE_UNAVAILABLE_EXIT_CODE->RERR_UNSUPPORTED_EXIT_CODEat thepost-OK refusal site, with the two existing daemon integration tests updated
to assert the code the peer actually receives.
Deliberately out of scope
The
@ERROR:payload-prefix divergence on the same path belongs to theIOBUF work, which also owns the missing exit linger. Fixing the prefix at
one site while the other stays divergent would create two behaviours where
there is currently one consistent bug.