Repository navigation
fix: refuse --checksum with a none file checksum, exit 4 like 3.5.1 - #8262
Merged
Merged
Conversation
Upstream's file_checksum() has no CSUM_NONE arm. When --checksum asks it for a "none" file checksum, it falls to the default case, prints "Invalid checksum-choice for --checksum: none (0)" and exits RERR_UNSUPPORTED (checksum.c:548-551). The file checksum is the second comma component when one is given, so md5,none is refused and none,md5 is not. oc instead mapped none to MD4 and transferred with exit 0. Only the sender computes file checksums, so the refusal sits where oc is the sender. That is the client for a local copy or a push, and the --server sender for a pull. A pulling client leaves the refusal to the remote sender, like upstream. Every client/server pairing then exits with the code a 3.5.1 client gets from a 3.5.1 server. The new oracle test runs each cell against a real 3.5.1 when one is installed. Mutations that drop the client check, drop the server check, or apply the client check to pulls each fail it.
The first cut refused `-c --checksum-choice=none` before the walk, so a source with no regular file exited 4 where 3.5.1 exits 0. It also left an oc daemon sender accepting the combination. Upstream refuses inside file_checksum(). The sender's make_file() calls it for every regular file under --checksum (flist.c:1815-1816). It opens the file first: one that cannot be opened gets a zero sum (checksum.c:426-430). Only then does it reach the default case that refuses `none` (checksum.c:548-551). The refusal now sits at that point on each kind of oc sender: - Network senders, which cover the rsh server, the daemon and a push client. ServerConfig carries the whole-file checksum as file_checksum_choice. ChecksumAlgorithm::parse_file_choice reads it as the part after the first comma, or the whole spec when there is none. compute_flist_checksum refuses once the file has opened, and the walk ends the run on that error (Unsupported, exit 4) instead of skipping the entry. - The rsh server's spec is split the same way, so `md5,none` and `auto,md5` are no longer rejected as unknown names. - A local copy has no file-list pass. It scans the sources for a regular file that opens, with the same descent as the sender, and only when the configuration is the refused one. New oracle cells against 3.5.1: - a source without regular files is copied (exit 0); - a 3.5.1 client pulling from an oc daemon ends as it does from a 3.5.1 daemon; - a push refuses in the local sender with 3.5.1's exit and text; - the pull runs as `md5,none`, so only the file-sum refusal can stop it. An oc client must show the oc server's refusal. Each of these mutations fails a cell: - the generator refusal; - the walk's fatal arm; - the local scan, forced true or bypassed; - the daemon, server and push wiring. A 3.5.1 client pulling from an oc server still exits 4 where 3.5.1 exits 12. Upstream's sender never flushes the MSG_ERROR_EXIT it queues (cleanup.c:250-254, io.c:1073-1075). The oc server's message also does not reach that client's stderr. Both are left to the error-exit work.
Carries the session_fork.rs fix from #8253 so this branch's macOS jobs stop failing on the master test-harness race: on EPERM for our own child, SIGKILL the leader before a blocking WNOWAIT wait, and accept a setpgid refusal when the child already leads its own group. The content is identical to #8253, so the two merge without conflict.
# Conflicts: # crates/core/src/client/run/mod.rs
This was referenced Nov 3, 2026
oferchen
added a commit
that referenced
this pull request
Nov 4, 2026
Add the missing Unreleased lines for #8245 and #8262. Bring the release template to 3.5.1 and protocols 28-33, replace its SEC-1-era security table with a pointer to the CHANGELOG CVE index, add the Alpine .apk row and a QUIC section, and pin the CHANGELOG, SECURITY and compare links to the release tag. Remove RELEASE_NOTES_BETA.md, a v0.6.2-era draft that no workflow reads, and point the beta runbook at the release the tag push creates.
oferchen
added a commit
that referenced
this pull request
Nov 4, 2026
* docs: refresh the release template and changelog for 0.6.5 Add the missing Unreleased lines for #8245 and #8262. Bring the release template to 3.5.1 and protocols 28-33, replace its SEC-1-era security table with a pointer to the CHANGELOG CVE index, add the Alpine .apk row and a QUIC section, and pin the CHANGELOG, SECURITY and compare links to the release tag. Remove RELEASE_NOTES_BETA.md, a v0.6.2-era draft that no workflow reads, and point the beta runbook at the release the tag push creates. * ci: fill {{PREV_VERSION}} in release notes and fix the benchmark duplicate guard
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
-c --checksum-choice=nonenow fails the way 3.5.1 does: exit 4 withInvalid checksum-choice for --checksum: none (0). Upstream'sfile_checksum()has noCSUM_NONEarm, so it lands in the default case and exitsRERR_UNSUPPORTED(checksum.c:548-551). oc mappednoneto MD4, transferred, and exited 0.md5,noneandauto,noneare refused, whilenone,md5and--checksum-choice=nonewithout-cstill transfer.ServerConfig::file_checksum_choicefield carries the whole-file sum, parsed from the spec's second comma component.-cis combined with anonefile sum.--checksum-choicespec like upstream does, somd5,noneandauto,md5are accepted instead of rejected as unknown names.Measured against 3.5.1
-ac --cc=none-ac --cc=md5,none-ac --cc=none,md5-a --cc=none(no-c)Known differences, not changed here
rsync error: ... (code 4)trailer as two lines; oc prints one combined line, as its other option refusals do (task Add negotiation prologue display helpers #213).Test plan
tests/checksum_choice_none_refused.rs, with oracle cells against a real 3.5.1 that self-skip when it isn't installed:md5,noneso only the file-sum refusal can stop them;validate_file_checksumand the local source scan.cargo clippy --workspace --all-targets --all-features -D warnings, plus no-default clippy for core/transfer/protocol/daemon;cargo fmt --all -- --checkcargo nextest run -p core -p cli -p transfer -p daemon -p protocol -p bin --all-features: 19300 passed, 128 skippedConventional commit prefix
fix:Pre-merge checklist