Skip to content

feat: wire --dparam values to daemon config override - #2375

Merged
oferchen merged 1 commit into
masterfrom
feature/wire-dparam-to-daemon
Feb 21, 2026
Merged

oferchen merged 1 commit into
masterfrom
feature/wire-dparam-to-daemon

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Wire the --dparam/-M CLI option through the full call chain so daemon parameter overrides are sent to the daemon and applied as module config overrides, matching upstream rsync behavior (clientserver.c)
  • On the client side, dparam values are sent as OPTION key=value lines during the daemon handshake protocol, between the version exchange and the module request
  • On the daemon side, received dparam options are applied to a session-local clone of the module definition after the refuse-options check, preventing mutation of shared state while honouring per-connection overrides
  • Security-sensitive directives (hosts allow/deny, auth users, secrets file, uid, gid) are blocked from dparam override to prevent privilege escalation

Test plan

  • Existing tests pass (21790 tests, all green)
  • New unit tests for apply_daemon_param_overrides(): boolean directives, timeout, security-sensitive rejection, missing =, unknown keys, empty params
  • New unit tests for daemon_params() builder setter and accessor defaults
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings passes clean
  • cargo check --workspace --all-features compiles without errors

Wire the --dparam/-M CLI option through the full call chain so that
daemon parameter overrides are actually sent to the daemon and applied
as module config overrides, matching upstream rsync behavior.

Client side:
- Capture dparam Vec<OsString> in run.rs instead of discarding with `_`
- Add daemon_params field to ConfigInputs, ClientConfigBuilder, and
  ClientConfig with builder setter and accessor
- Send dparam values as "OPTION key=value" lines during daemon handshake
  in daemon_transfer.rs (between version exchange and module request)

Daemon side:
- Add apply_daemon_param_overrides() to apply client-sent options as
  module config overrides on a session-local clone of the definition
- Security-sensitive directives (hosts allow/deny, auth users, secrets
  file, uid, gid) are blocked from dparam override
- Unknown directives are silently ignored, matching upstream behavior
@github-actions github-actions Bot added the enhancement New feature or request label Feb 21, 2026
@oferchen
oferchen merged commit 7ad80c9 into master Feb 21, 2026
15 of 16 checks passed
@oferchen
oferchen deleted the feature/wire-dparam-to-daemon branch February 21, 2026 15:17
oferchen added a commit that referenced this pull request May 1, 2026
Wire the --dparam/-M CLI option through the full call chain so that
daemon parameter overrides are actually sent to the daemon and applied
as module config overrides, matching upstream rsync behavior.

Client side:
- Capture dparam Vec<OsString> in run.rs instead of discarding with `_`
- Add daemon_params field to ConfigInputs, ClientConfigBuilder, and
  ClientConfig with builder setter and accessor
- Send dparam values as "OPTION key=value" lines during daemon handshake
  in daemon_transfer.rs (between version exchange and module request)

Daemon side:
- Add apply_daemon_param_overrides() to apply client-sent options as
  module config overrides on a session-local clone of the definition
- Security-sensitive directives (hosts allow/deny, auth users, secrets
  file, uid, gid) are blocked from dparam override
- Unknown directives are silently ignored, matching upstream behavior
oferchen added a commit that referenced this pull request May 5, 2026
Wire the --dparam/-M CLI option through the full call chain so that
daemon parameter overrides are actually sent to the daemon and applied
as module config overrides, matching upstream rsync behavior.

Client side:
- Capture dparam Vec<OsString> in run.rs instead of discarding with `_`
- Add daemon_params field to ConfigInputs, ClientConfigBuilder, and
  ClientConfig with builder setter and accessor
- Send dparam values as "OPTION key=value" lines during daemon handshake
  in daemon_transfer.rs (between version exchange and module request)

Daemon side:
- Add apply_daemon_param_overrides() to apply client-sent options as
  module config overrides on a session-local clone of the definition
- Security-sensitive directives (hosts allow/deny, auth users, secrets
  file, uid, gid) are blocked from dparam override
- Unknown directives are silently ignored, matching upstream behavior
oferchen added a commit that referenced this pull request May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
oferchen added a commit that referenced this pull request May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
oferchen added a commit that referenced this pull request May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
oferchen added a commit that referenced this pull request May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
oferchen added a commit that referenced this pull request May 18, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
oferchen added a commit that referenced this pull request Aug 24, 2026
SSE-6 from docs/design/socketpair-stderr-channel.md. Drives the SSE-3
`make_stderr_socketpair` primitive end-to-end by wiring the child end
into a real subprocess as fd 2 and asserting the parent end surfaces
the bytes verbatim. Each captured line additionally fires a
`tracing::warn!` event, mirroring the production drain shape staged
in SSE-4 (#4363) so this test continues to exercise the observable
contract once the async path lands.

Scenarios:
- single_error_line_propagates_through_socketpair: one echo writes
  `test error message\n`; parent buffer matches byte-for-byte and a
  single WARN event fires with the captured payload.
- multi_error_lines_propagate_and_fire_one_warn_each: three separate
  echo calls produce three ordered lines; all three are captured in
  order and one WARN event fires per line.
- drain_returns_after_child_exit_closes_child_end: confirms the drain
  observes EOF cleanly when the subprocess exits and the child end
  closes, guarding the failure mode the design doc calls out under
  "Tokio drain task survives past child reap".

Gated `cfg(all(unix, feature = "ssh-socketpair-stderr"))` so the file
no-ops on Windows and on default builds. Adds `tracing` and
`tracing-subscriber` as dev-dependencies of `rsync_io`; a custom
`Layer` records WARN events with thread-local dispatch propagated to
the spawned drain thread.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant