Skip to content

fix: escape control bytes in local-copy, server and daemon stderr - #8911

Merged
oferchen merged 2 commits into
masterfrom
fix/client-stderr-escape
Nov 28, 2026
Merged

oferchen merged 2 commits into
masterfrom
fix/client-stderr-escape

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • A control byte in a file name is now escaped as \#ooo in every stderr diagnostic, the way rsync 3.5.2's log.c filtered_fwrite() does. Follow-up to Client stderr diagnostics print control bytes raw; rsync 3.5.2 escapes them #8884, which covered the client's own lines.
  • Local copy: the engine's direct stderr writes (unreadable or vanished sources, dangling symlinks, ACL and xattr read failures, create and delete failures, verification retries) go through the shared terminal-line helper instead of raw eprintln!.
  • Remote-shell server: its own stderr writes are escaped.
  • Daemon: the stderr copy of an argv-filter refusal is escaped.
  • logging::escape gains the helper the three call sites share, so there is one escaping rule.

Names made only of printable bytes print exactly as before.

Verification

Run on Linux x86_64 at this tree (the commit message was reworded afterwards; the tree is unchanged):

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features --no-deps -- -D warnings
  • cargo check and cargo clippy -D warnings for x86_64-pc-windows-gnu
  • xtask no-placeholders, xtask citations, citation_drift_audit.py --ratchet
  • cargo nextest run --all-features for logging (444 passed), engine (4994 passed, 21 skipped), cli (3781 passed, 2 skipped), daemon (2210 passed, 20 skipped)

New test file client_stderr_control_byte_escaping.rs drives the binary with control bytes in names on the local-copy, server and daemon paths.

Not run locally: macOS and Windows test suites, interop.

@oferchen oferchen added this to the 0.6.5 milestone Nov 28, 2026
@github-actions github-actions Bot added the bug Something isn't working label Nov 28, 2026
@oferchen
oferchen merged commit 8241c02 into master Nov 28, 2026
89 checks passed
@oferchen
oferchen deleted the fix/client-stderr-escape branch November 28, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant