docs(audits): confirm filter rules already match upstream iconv policy (#1914)#3550
Merged
Conversation
#1914) Audit the filter-evaluation entry points to confirm they operate on local-charset names, matching upstream rsync 3.4.1 exactly. Upstream rsync's exclude.c contains zero iconv references. Filter rules match raw bytes in the local charset on both sender and receiver. The hand-off happens at the flist boundary: sender filters before iconvbufs(ic_send,...), receiver filters after iconvbufs(ic_recv,...). Pattern strings are stored verbatim from CLI/merge-files in the local charset. oc-rsync follows the same model: - Sender FilterChain::allows() in generator/file_list/walk.rs sees raw Path bytes from the local filesystem before encoding conversion. - Receiver FilterChain::allows_deletion() in receiver/directory/deletion.rs sees post-ic_recv local-charset names from the file list and entry names from read_dir(). - Pattern strings flow through CLI -> filters crate without iconv hops. No code change required. Wiring a FilenameConverter into the filter chain would double-convert names and break pattern matches for non-ASCII patterns.
oferchen
added a commit
that referenced
this pull request
May 5, 2026
#1914) (#3550) Audit the filter-evaluation entry points to confirm they operate on local-charset names, matching upstream rsync 3.4.1 exactly. Upstream rsync's exclude.c contains zero iconv references. Filter rules match raw bytes in the local charset on both sender and receiver. The hand-off happens at the flist boundary: sender filters before iconvbufs(ic_send,...), receiver filters after iconvbufs(ic_recv,...). Pattern strings are stored verbatim from CLI/merge-files in the local charset. oc-rsync follows the same model: - Sender FilterChain::allows() in generator/file_list/walk.rs sees raw Path bytes from the local filesystem before encoding conversion. - Receiver FilterChain::allows_deletion() in receiver/directory/deletion.rs sees post-ic_recv local-charset names from the file list and entry names from read_dir(). - Pattern strings flow through CLI -> filters crate without iconv hops. No code change required. Wiring a FilenameConverter into the filter chain would double-convert names and break pattern matches for non-ASCII patterns.
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
--iconv. No code change is required.exclude.ccontains zero iconv references. Filter rules match local-charset bytes; iconv conversion happens at the flist boundary only (sender filters beforeiconvbufs(ic_send, ...); receiver filters aftericonvbufs(ic_recv, ...)).FilterChain::allows()in the sender walker sees raw filesystemPathbytes, andFilterChain::allows_deletion()on the receiver sees post-ic_recvlocal-charset names from the file list andread_direntries. Pattern strings flow CLI -> filters crate without an iconv hop.Audit finding
Wiring a
FilenameConverterinto the filter chain would be incorrect: it would double-convert names on the receiver and convert patterns away from the user's local charset, breaking pattern matches for any non-ASCII pattern.The new
docs/audits/iconv-filter-rules.mddocuments the exact upstream call sites, their oc-rsync counterparts, and the pattern-string handling, so the decision is reviewable and traceable.Test plan
cargo fmt --all -- --check(no Rust code changed; docs-only commit)docs/audits/iconv-pipeline.md)