Skip to content

docs(daemon): document filter precedence and exchange (#1888) - #3489

Merged
oferchen merged 1 commit into
masterfrom
docs/daemon-filter-precedence-1888
May 1, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/daemon-filter-precedence-1888

Conversation

@oferchen

@oferchen oferchen commented May 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds docs/daemon/filter-precedence.md documenting how filter rules from three sources combine: daemon module config (oc-rsyncd.conf), client CLI (--filter/--include/--exclude/--include-from/--exclude-from), and per-directory .rsync-filter merge files.
  • Documents the wire format (4-byte LE length prefix per rule, 4-byte zero terminator) and the receiver-side prepend that makes daemon rules mandatory.
  • Includes a worked example showing why a client --include='secrets/' cannot override a daemon-side exclude = secrets/.

Citations

  • crates/daemon/src/daemon/sections/module_access/helpers.rs:223 — build_daemon_filter_rules() in upstream-mandated order.
  • crates/transfer/src/receiver/transfer.rs:868-879 — daemon rules prepended to client wire rules.
  • crates/protocol/src/filters/wire.rs:181, 217 — read_filter_list() / write_filter_list() wire format.
  • Upstream: clientserver.c:874-893 (rsync_module()), exclude.c:1658 (send_filter_list()).

Closes #1888.

Test plan

  • Verified citations against current code (line numbers, function names, upstream references).
  • CI: fmt+clippy, nextest (stable), Windows, macOS, Linux musl.

Add docs/daemon/filter-precedence.md covering the three filter rule
sources (daemon module config, client CLI, per-directory .rsync-filter),
their evaluation order, the wire format, and a worked example showing
why a client --include cannot override a daemon-side exclude.

Cites build_daemon_filter_rules() in helpers.rs:223, the prepend logic
in transfer.rs:868-879, and the wire encoding in wire.rs, with
references to upstream clientserver.c:874-893 and exclude.c:1658.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 1, 2026
@oferchen
oferchen merged commit 7b1a009 into master May 1, 2026
12 checks passed
@oferchen
oferchen deleted the docs/daemon-filter-precedence-1888 branch May 1, 2026 21:08
oferchen added a commit that referenced this pull request May 5, 2026
Add docs/daemon/filter-precedence.md covering the three filter rule
sources (daemon module config, client CLI, per-directory .rsync-filter),
their evaluation order, the wire format, and a worked example showing
why a client --include cannot override a daemon-side exclude.

Cites build_daemon_filter_rules() in helpers.rs:223, the prepend logic
in transfer.rs:868-879, and the wire encoding in wire.rs, with
references to upstream clientserver.c:874-893 and exclude.c:1658.
oferchen added a commit that referenced this pull request Jun 3, 2026
…5394)

* test: add --iconv=utf8,latin1 filename round-trip integration test (#3489)

Add two integration tests verifying that filenames survive a complete
UTF-8 -> ISO-8859-1 -> UTF-8 round-trip through the local-copy iconv
path:

- iconv_utf8_latin1_round_trip_preserves_filenames: exercises five
  distinct Latin-1 accented characters (e-acute, n-tilde, u-diaeresis,
  o-diaeresis, a-grave) across flat files and nested directories.
  Verifies intermediate Latin-1 encoding and final UTF-8 recovery,
  plus payload integrity.

- iconv_round_trip_trailing_slash_copies_contents: same round-trip but
  with trailing-slash source operands (content-copy semantics) to cover
  both from_operands path behaviors.

Both tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
consistent with the existing iconv_local_copy test file.

* style: apply cargo fmt formatting
oferchen added a commit that referenced this pull request Aug 24, 2026
…5394)

* test: add --iconv=utf8,latin1 filename round-trip integration test (#3489)

Add two integration tests verifying that filenames survive a complete
UTF-8 -> ISO-8859-1 -> UTF-8 round-trip through the local-copy iconv
path:

- iconv_utf8_latin1_round_trip_preserves_filenames: exercises five
  distinct Latin-1 accented characters (e-acute, n-tilde, u-diaeresis,
  o-diaeresis, a-grave) across flat files and nested directories.
  Verifies intermediate Latin-1 encoding and final UTF-8 recovery,
  plus payload integrity.

- iconv_round_trip_trailing_slash_copies_contents: same round-trip but
  with trailing-slash source operands (content-copy semantics) to cover
  both from_operands path behaviors.

Both tests are gated on cfg(all(target_os = "linux", feature = "iconv"))
consistent with the existing iconv_local_copy test file.

* style: apply cargo fmt formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant