Repository navigation
fix: accept path = / in rsyncd.conf module definitions - #5522
Merged
Merged
Conversation
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.
3 tasks
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`.
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
path = /under both
use chroot = noanduse chroot = yes, mirroring upstreamsemantics for the
daemon-path-root-readinterop scenario (UTS-12).is_absolute()gatecannot be tightened into a
/-rejecter without failing tests.Upstream reference
loadparm.c(P_PATH, rsync 3.4.2 line 443-450): trailing-slash strip onlyfires when
len > 1, so the single character/is preserved verbatim andreachable as
lp_path(module_id).clientserver.c(line 823-865, rsync 3.4.2): whenuse chroot = nothemodule path is normalized and served as-is; when
use chroot = yesthedaemon
chroot()s into the path, withchroot("/")succeeding as a no-op.Changes
crates/daemon/src/daemon/sections/module_definition/finish.rs: documentsthe validator's intent to accept
/and cites the upstream behaviour sofuture maintenance does not regress it.
crates/daemon/src/daemon/sections/module_parsing.rs: same clarifyingcomment on the sibling
--module name=/inline path validator.crates/daemon/src/daemon/sections/module_definition/tests.rs: two unittests covering
finish()withpath = /plususe_chroot = trueanduse_chroot = falserespectively.crates/daemon/src/daemon/sections/config_parsing/tests.rs: two end-to-endparser 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
fmt+clippypasses.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.#[cfg(unix)]so Windows is unaffected).