Repository navigation
test: cover daemon runtime serving path = / without chroot - #5532
Merged
Merged
Conversation
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`.
3 tasks
2 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
PR #5532 added run_daemon_serves_module_with_root_path_no_chroot which only exercises #list against a `path = /` module. The upstream rsync 3.4.4 #897 scenario was specifically about reading a file from such a module. This test pulls a deterministic file via rsync://127.0.0.1:port/root<absolute_tempdir>/source.txt against a `[root] path = / use chroot = no read only = yes` module and asserts the destination matches the source byte-for-byte. The upstream bug class does not reproduce in oc-rsync because the per-file `secure_relative_open` check is replaced with module-rooted ServerConfig plus canonical-prefix validation, but the end-to-end file-pull path was previously uncovered by an integration test.
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`.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
PR #5532 added run_daemon_serves_module_with_root_path_no_chroot which only exercises #list against a `path = /` module. The upstream rsync 3.4.4 #897 scenario was specifically about reading a file from such a module. This test pulls a deterministic file via rsync://127.0.0.1:port/root<absolute_tempdir>/source.txt against a `[root] path = / use chroot = no read only = yes` module and asserts the destination matches the source byte-for-byte. The upstream bug class does not reproduce in oc-rsync because the per-file `secure_relative_open` check is replaced with module-rooted ServerConfig plus canonical-prefix validation, but the end-to-end file-pull path was previously uncovered by an integration test.
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
daemon-path-root-readscenario: a module configured withpath = /,use chroot = no,read only = yesmust accept a#listrequest and advertise the module without the connectionhandler tripping over the bare-slash path.
future regression that passes parsing but breaks inside the
runtime path (e.g. a chdir/chroot mishap or a stray
is_absolute()-style guard sneaking in) fails fast.Upstream reference
loadparm.c(P_PATH, rsync 3.4.2): single/survives thetrailing-slash strip (
len > 1guard) and is reachable vialp_path(module_id).clientserver.c(rsync 3.4.2, line ~823-865): whenuse chroot = nothe daemon serves the module path as-is; whenuse chroot = yeschroot("/")succeeds as a no-op.Changes
crates/daemon/src/tests/chunks/run_daemon_serves_module_with_root_path_no_chroot.rs:new
#[cfg(unix)]integration test that starts the daemon withan inline rsyncd.conf containing
[root] path = / use chroot = no read only = yes, connects, issues#list, and asserts themodule is advertised followed by
@RSYNCD: EXIT.crates/daemon/src/tests.rs: wires the new chunk into thedaemon test module.
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). Test-only.
Test plan
fmt+clippypasses.nextest (stable)passes the newrun_daemon_serves_module_with_root_path_no_chroottest.#[cfg(unix)]).