Repository navigation
fix: parse daemon module filter directives with the shared parser - #8353
Merged
Merged
Conversation
oferchen
added a commit
that referenced
this pull request
Nov 10, 2026
oferchen
added a commit
that referenced
this pull request
Nov 10, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 10, 2026 20:36
94ba255 to
53bb2ed
Compare
oferchen
added a commit
that referenced
this pull request
Nov 11, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 06:39
53bb2ed to
79f40ee
Compare
oferchen
added a commit
that referenced
this pull request
Nov 11, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 08:51
79f40ee to
5516e5e
Compare
oferchen
added a commit
that referenced
this pull request
Nov 11, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 09:49
5516e5e to
c61375b
Compare
oferchen
added a commit
that referenced
this pull request
Nov 11, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 10:31
c61375b to
4f50916
Compare
oferchen
added a commit
that referenced
this pull request
Nov 11, 2026
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 10:49
4f50916 to
1301bc8
Compare
A `!` read from a merge file or an --exclude-from/--include-from file empties the whole list the file is parsed into, argv rules included, as 3.5.1 does (exclude.c:1542-1551). oc cleared only the file's own rules, so an earlier --exclude kept applying. Every filter string now parses through one parse_filter_str with upstream's xflags, and add_rule applies XFLG_ABS_IF_SLASH and XFLG_DIR2WILD3 as rules are added, ready for the daemon's module directives. A dir-merge `e` modifier adds the basename exclude ahead of the rule, as parse_filter_str does.
The daemon module filter, include, exclude, include from and exclude from directives now go through the core parse_filter_str with 3.5.1 xflags (clientserver.c:933-952), and the daemon helpers parser is deleted. A refused directive ends the session before @rsyncd: OK with the cause in the daemon log only, and -from records are reported by file and line.
oferchen
force-pushed
the
fix/argv-filter-shared-parser
branch
from
November 11, 2026 10:59
1301bc8 to
cefca29
Compare
oferchen
added a commit
that referenced
this pull request
Nov 18, 2026
#8434) Two documentation changes for the 0.6.5 release. **Changelog.** Every PR merged since v0.6.4 was checked against `[Unreleased]`. - Seven lines cited five PRs that were closed without merging; they now cite the PRs that carried the work (#8295, #8304, #8314, #8353, #8383). - Three lines added by #8363 were no longer in the file and are restored. - Eighteen merged PRs with user-visible changes had no entry and now have one. - One entry moved from Added to Fixed. **Differences from rsync 3.5.2.** New `docs/differences-from-rsync-3.5.2.md`, linked from the README and the environment reference. It lists behaviour kept on purpose, upstream fixes adopted early (none yet, three pending), oc-rsync extensions (options, transports, daemon parameters, debug words, sandboxing, environment variables, the opt-in consecutive-match extension) and links to the platform documents. Every row is backed by code or a test. No code changes. Closes #8564 Closes #8565
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
Collapses the daemon's module filter parser into the one core filter parser, so module directives, client options and server argv options all go through a port of 3.5.1's
parse_filter_str(exclude.c:1516-1598) andadd_rule(exclude.c:279-314). Stacked on #8343.crates/core/src/client/filter_args/filter_str.rscarries the rule template and xflags (OLD_PREFIXES,ABS_IF_SLASH,DIR2WILD3).add_ruledoes the side drop, the slash anchoring (a trailing slash does not count, leading**stays unanchored) and the/***suffix on Exclude and Protect rules only.--include,--excludeand--filteruse it, and so do the module directives.clientserver.c:933-952):filteris word-split with the full grammar;include/excludeare word-split withOLD_PREFIXES;include from/exclude fromread withOLD_PREFIXESandFATAL_ERRORS. About 1,700 lines of the daemon's own parser inmodule_access/helpers.rsare deleted. The old parser ignored!and anchored/, so a module served files that 3.5.1 hides.pop_filter_list(listp); listp->head = NULL(exclude.c:1540-1546) drops every rule ahead of the clear, argv rules included. oc used to clear only the file's own rules. This was MEASURED on 3.5.1: with-f '- b' -f '. rules'and!inrules, both a and b transfer.@RSYNCD: OK, and the cause goes to the daemon log only, as 3.5.1 does. oc used to send an@ERRORline it made up itself.check_filter(&daemon_filter_list)while the list is being built (exclude.c:1639-1664). An absolute name skipsmodule_dirlenby length alone. A name with no slash opens from cwd (parse_merge_name, exclude.c:704-715).<rule from FILE line N>.<rule from FILE>(exclude.c:71-136, MEASURED).-fromrecords now carry their line number.:pdir-merge rule now sendspon the wire (get_rule_prefix, exclude.c:1872).:rdir-merge rule keeps its side.directory_only,anchoredandnegate.pop_filter_listcomment in merge.rs, which described the clear wrongly.Tests
tests/daemon_module_filters.rs: 7 cells against live 3.5.1.a_clear_inside_a_file_empties_the_rules_ahead_of_itincrates/cli/tests/upstream_compat_filter_rule_parse.rs.crates/core/src/client/filter_args/tests/filter_str.rs: theadd_rulecells, plus the 17 split cells moved from the daemon.Dropped or replaced daemon tests
The parser these tests exercised is deleted:
strip_matched_keyword_*(7): the helper is gone. The keyword walk is covered by the coresplit_*cells.build_pattern_rule_{exclude,include,anchored,doublestar_prefix_stays_unanchored,directory_only_exclude_dir2wild3,directory_only_include_preserved},pattern_{leading_slash_is_anchored,no_slash_is_not_anchored,embedded_slash_is_anchored,deep_path_is_anchored},directory_exclude_gets_wild3,directory_include_keeps_directory_flag,include_with_embedded_slash_is_anchored(13): duplicates of the coreadd_rulecells (a_pattern_without_a_slash_is_added_as_written,a_slash_anywhere_in_the_pattern_anchors_it,a_leading_double_star_stays_unanchored,a_trailing_slash_marks_a_directory_rule_and_is_not_counted).an_inexpressible_modifier_drops_the_rule_rather_than_refusing_it: replaced bythe_negate_and_xattr_modifiers_are_carried_on_the_rule. The rule is now carried, not dropped.read_patterns_from_file_reads_a_plain_file_unchanged: a duplicate ofexclude_from_reads_one_pattern_per_line.read_patterns_from_file_*andsplit_filter_tokens_*tests were renamed toexclude_from_*and moved to coresplit_*, unchanged.build_daemon_filter_rules_line_final_clear_*now expects an empty list.*_non_merge_cvs_*now expects the-Cdefaults expanded.*_clears_*.Residuals
:w .wson rsh, on daemon-Mand on a module directive. All three are the sender-side per-dir merge error report: 3.5.1's client prints the parse error first and exits 1. The 4 Push cells inupstream_compat_filter_rule_parse(c_modifier_inside_a_per_directory_merge_file,merge_file_rules_end_where_upstream_ends_them,naming_both_sides_still_names_a_side,sided_merge_file_refuses_a_sided_rule) fail for the same reason. They also fail on master's binary underOC_RSYNC_UPSTREAM_COMPAT=1and SKIP in CI. Task 547 fixes them in a PR stacked on this one.failed to read filter file '...'andfailed to read filter patterns from standard inputare not 3.5.1's. This PR moved them unchanged from cli to core, and they are left for the task 632 and 626 sweep.Gates
cargo fmt --checkandcheck_rustfmt_all.py-D warningswith_dir_merge_options) removed