Repository navigation
Handle device copies as zero-length files - #2052
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if inplace_enabled { | ||
| let mut file = fs::OpenOptions::new() | ||
| .create(true) | ||
| .write(true) | ||
| .truncate(true) | ||
| .open(destination) | ||
| .map_err(|error| LocalCopyError::io("copy file", destination.to_path_buf(), error))?; |
There was a problem hiding this comment.
Respect --copy-devices when --inplace is set
The new copy_special_as_regular_file helper respects context.inplace_enabled() by opening the destination path in place (OpenOptions::new().create(true).write(true).truncate(true)). When the destination already exists as a device node and the user also supplies --inplace, this code never replaces that device with an empty regular file; it simply opens the device (which may even fail to truncate) and later applies metadata using the original device file_type. The copy therefore finishes with the device still present instead of the zero‑length regular file the commit is supposed to create. Device copies should bypass the in‑place path and always use the guarded temporary file workflow so an existing special file is replaced with a regular file.
Useful? React with 👍 / 👎.
Document how to put TLS in front of oc-rsyncd using stunnel, an SSH local-forward, or a TCP-mode reverse proxy (HAProxy/nginx). Covers threat model, matching `oc-rsyncd.conf` snippets, client-side options including `--connect-program` and `--port`, mTLS, and DNS-SAN cert hygiene. Cross-links the daemon filter-precedence page.
…3518) SECURITY.md referenced TLS-in-front deployment but did not provide a runnable recipe. Add `docs/deployment/daemon-tls.md` with concrete configurations for the three supported terminators (stunnel, `ssh -L`, HAProxy TCP mode), hardened systemd unit excerpts for each scenario, and nftables/iptables/container-bridge rules that deny external access to the daemon's loopback-bound 873/tcp port. Cross-link from the SECURITY.md "Daemon TLS" hardening note and from the README "Known Limitations / Architectural Trade-offs" section so operators land on the recipe directly.
Document how to put TLS in front of oc-rsyncd using stunnel, an SSH local-forward, or a TCP-mode reverse proxy (HAProxy/nginx). Covers threat model, matching `oc-rsyncd.conf` snippets, client-side options including `--connect-program` and `--port`, mTLS, and DNS-SAN cert hygiene. Cross-links the daemon filter-precedence page.
…3518) SECURITY.md referenced TLS-in-front deployment but did not provide a runnable recipe. Add `docs/deployment/daemon-tls.md` with concrete configurations for the three supported terminators (stunnel, `ssh -L`, HAProxy TCP mode), hardened systemd unit excerpts for each scenario, and nftables/iptables/container-bridge rules that deny external access to the daemon's loopback-bound 873/tcp port. Cross-link from the SECURITY.md "Daemon TLS" hardening note and from the README "Known Limitations / Architectural Trade-offs" section so operators land on the recipe directly.
) Specifies a hybrid model where a tokio async accept loop hands off accepted connections to a fixed-size pool of synchronous worker threads via a bounded channel. Transfer state machine and wire format are unchanged; the design only replaces the accept-and-dispatch layer. Tracking #1674. References #1591 (async-channel abstraction), #1934/#1935 (async-daemon feature gate), #2052 (TLS termination).
) Specifies a hybrid model where a tokio async accept loop hands off accepted connections to a fixed-size pool of synchronous worker threads via a bounded channel. Transfer state machine and wire format are unchanged; the design only replaces the accept-and-dispatch layer. Tracking #1674. References #1591 (async-channel abstraction), #1934/#1935 (async-daemon feature gate), #2052 (TLS termination).
) Specifies a hybrid model where a tokio async accept loop hands off accepted connections to a fixed-size pool of synchronous worker threads via a bounded channel. Transfer state machine and wire format are unchanged; the design only replaces the accept-and-dispatch layer. Tracking #1674. References #1591 (async-channel abstraction), #1934/#1935 (async-daemon feature gate), #2052 (TLS termination).
Summary
Testing
cargo check/cargo testin the container)[Codex Task](