Skip to content

Handle device copies as zero-length files - #2052

Merged
oferchen merged 1 commit into
masterfrom
fix-test-failure-for-local_copy-tests-execute_copies_devic
Nov 7, 2025
Merged

oferchen merged 1 commit into
masterfrom
fix-test-failure-for-local_copy-tests-execute_copies_devic

Conversation

@oferchen

@oferchen oferchen commented Nov 7, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • add a dedicated helper so device entries copied "as files" create empty files and avoid streaming data from character devices
  • ensure the helper applies metadata, records summary information, and integrates with deferred updates just like the regular file path

Testing

  • not run (vendored OpenSSL build repeatedly stalled while attempting cargo check/cargo test in the container)

[Codex Task](

@oferchen
oferchen merged commit 304cad8 into master Nov 7, 2025

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +450 to +456
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))?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@oferchen
oferchen deleted the fix-test-failure-for-local_copy-tests-execute_copies_devic branch November 8, 2025 08:18
oferchen added a commit that referenced this pull request May 1, 2026
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.
oferchen added a commit that referenced this pull request May 1, 2026
…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.
oferchen added a commit that referenced this pull request May 5, 2026
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.
oferchen added a commit that referenced this pull request May 5, 2026
…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.
oferchen added a commit that referenced this pull request May 5, 2026
)

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).
oferchen added a commit that referenced this pull request May 18, 2026
)

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).
oferchen added a commit that referenced this pull request Aug 24, 2026
)

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant