fix: match upstream letter order in server flag string#6857
Merged
Conversation
build_server_flag_string packed the compact single-letter server flag bundle (-logDtpr...) in an order that diverged from upstream server_options() (options.c:2619-2723). A real rsync server parses each byte independently so this never broke interop, but wire fidelity means the client's own argv should be byte-for-byte indistinguishable from upstream's. Reorder the pushes to follow upstream's exact sequence (v, q, b, u, n, l, d, W, H, o, g, D, t, U, N, p, A, X, r, c, C, I, R, x, S, z) and add a golden test pinning the full letter order.
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
build_server_flag_stringpacked the compact single-letter server flagbundle (e.g.
-logDtpr) in an order that diverged from upstreamserver_options()(options.c:2619-2723): flags likez,H,N, and theA/Xblock were emitted far out of upstream's sequence relative tob/u/n/d/W.broke interop, but wire fidelity means our client's own
--serverargvshould be byte-for-byte indistinguishable from upstream's own client.
v, q, b, u, n, l, d, W, H, o, g, D, t, U, N, p, A, X, r, c, C, I, R, x, S, z.server_flag_string_matches_upstream_letter_order)pinning the full letter order across one flag from each upstream grouping.
Test plan
cargo fmt -p core -- --checkcargo clippy -p core --all-targets --all-features --no-deps -- -D warningscargo nextest run -p core --all-features -E 'test(server_flag_string) or test(server_option) or test(server_arg)'(45 passed)