Skip to content

fix: accept path = / in rsyncd.conf module definitions - #5522

Merged
oferchen merged 1 commit into
masterfrom
fix/uts-12-daemon-path-root
Jun 10, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/uts-12-daemon-path-root

Conversation

@oferchen

@oferchen oferchen commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Locks in the behaviour that the daemon-config parser accepts a bare path = /
    under both use chroot = no and use chroot = yes, mirroring upstream
    semantics for the daemon-path-root-read interop scenario (UTS-12).
  • Adds regression coverage at two layers so the existing is_absolute() gate
    cannot be tightened into a /-rejecter without failing tests.

Upstream reference

  • loadparm.c (P_PATH, rsync 3.4.2 line 443-450): trailing-slash strip only
    fires when len > 1, so the single character / is preserved verbatim and
    reachable as lp_path(module_id).
  • clientserver.c (line 823-865, rsync 3.4.2): when use chroot = no the
    module path is normalized and served as-is; when use chroot = yes the
    daemon chroot()s into the path, with chroot("/") succeeding as a no-op.

Changes

  • crates/daemon/src/daemon/sections/module_definition/finish.rs: documents
    the validator's intent to accept / and cites the upstream behaviour so
    future maintenance does not regress it.
  • crates/daemon/src/daemon/sections/module_parsing.rs: same clarifying
    comment on the sibling --module name=/ inline path validator.
  • crates/daemon/src/daemon/sections/module_definition/tests.rs: two unit
    tests covering finish() with path = / plus use_chroot = true and
    use_chroot = false respectively.
  • crates/daemon/src/daemon/sections/config_parsing/tests.rs: two end-to-end
    parser tests for [root]\npath = /\nuse chroot = {no,yes}\n.

No changes to wire protocol, branding, or any oc-rsync-specific path
(parallel-receive-delta, io_uring, IOCP, flat-flist, daemon-tls, DirSandbox,
SEND_ZC, flat arena flist). Daemon-config scope only.

Test plan

  • CI fmt+clippy passes.
  • CI nextest (stable) passes the four new tests:
    parse_module_path_root_without_chroot,
    parse_module_path_root_with_chroot,
    finish_allows_root_path_with_chroot,
    finish_allows_root_path_without_chroot.
  • CI Windows / macOS / Linux musl matrices stay green (new tests are
    #[cfg(unix)] so Windows is unaffected).

Document that the daemon-config validator accepts a bare `/` module path
under both `use chroot = no` and `use chroot = yes`, matching upstream
loadparm.c P_PATH (which preserves a single-slash path verbatim) and
clientserver.c (which serves from `/` directly with chroot off and
chroots into it as a no-op with chroot on).

Locks the behaviour in with regression tests at both the rsyncd.conf
parser layer (config_parsing) and the ModuleDefinitionBuilder::finish
validator layer (module_definition), so future tightening of the
`is_absolute()` gate cannot silently regress the daemon-path-root-read
interop scenario.
@github-actions github-actions Bot added the bug Something isn't working label Jun 9, 2026
@oferchen
oferchen merged commit db4a386 into master Jun 10, 2026
69 checks passed
@oferchen
oferchen deleted the fix/uts-12-daemon-path-root branch June 10, 2026 05:07
oferchen added a commit that referenced this pull request Jun 10, 2026
…5532)

Locks in the runtime-path side of UTS-12 (`daemon-path-root-read`):
PR #5522 added validator-level regression coverage, but no test
exercised an actual daemon thread serving a module whose `path = /`
without chroot. This adds an end-to-end `#list` round-trip so a
future regression that lets the validator accept the config but
breaks inside the connection handler (e.g. an inappropriate `chdir`
of `/` or a bare-slash module name advertisement bug) fails fast.

Upstream reference: `loadparm.c` (P_PATH) preserves a single `/`
verbatim; `clientserver.c` serves it as-is when `use chroot = no`.
oferchen added a commit that referenced this pull request Aug 24, 2026
Document that the daemon-config validator accepts a bare `/` module path
under both `use chroot = no` and `use chroot = yes`, matching upstream
loadparm.c P_PATH (which preserves a single-slash path verbatim) and
clientserver.c (which serves from `/` directly with chroot off and
chroots into it as a no-op with chroot on).

Locks the behaviour in with regression tests at both the rsyncd.conf
parser layer (config_parsing) and the ModuleDefinitionBuilder::finish
validator layer (module_definition), so future tightening of the
`is_absolute()` gate cannot silently regress the daemon-path-root-read
interop scenario.
oferchen added a commit that referenced this pull request Aug 24, 2026
…5532)

Locks in the runtime-path side of UTS-12 (`daemon-path-root-read`):
PR #5522 added validator-level regression coverage, but no test
exercised an actual daemon thread serving a module whose `path = /`
without chroot. This adds an end-to-end `#list` round-trip so a
future regression that lets the validator accept the config but
breaks inside the connection handler (e.g. an inappropriate `chdir`
of `/` or a bare-slash module name advertisement bug) fails fast.

Upstream reference: `loadparm.c` (P_PATH) preserves a single `/`
verbatim; `clientserver.c` serves it as-is when `use chroot = no`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant