Skip to content

Split protocol negotiation into focused modules - #22

Merged
oferchen merged 1 commit into
masterfrom
codex/implement-pure-rust-rsync-with-protocol-32
Oct 15, 2025
Merged

oferchen merged 1 commit into
masterfrom
codex/implement-pure-rust-rsync-with-protocol-32

Conversation

@oferchen

@oferchen oferchen commented Oct 15, 2025 •

Copy link
Copy Markdown
Owner

Summary

  • split the monolithic crates/protocol/src/lib.rs into dedicated error, legacy, negotiation, and version modules to satisfy the workspace file size guidelines
  • re-export the existing public API from the new module layout so downstream code remains unchanged
  • keep the existing negotiation, legacy daemon parsing, and selection tests alongside their corresponding modules for clarity

Testing

  • cargo test

@oferchen
oferchen merged commit fa14dbd into master Oct 15, 2025
@oferchen
oferchen deleted the codex/implement-pure-rust-rsync-with-protocol-32 branch October 15, 2025 12:34
oferchen added a commit that referenced this pull request May 22, 2026
…EC-1.q)

Extend DeleteFs with unix-only `*_at` siblings (unlink_file_at, rmdir_at,
unlink_symlink_at, unlink_device_at, unlink_special_at, remove_dir_all_at)
that take a parent dirfd + single-component leaf and route through
fast_io::unlinkat / fast_io::recursive_unlinkat (SEC-1.s). Path-based
methods stay as the no-sandbox / Windows fallback so existing callers
keep working unchanged.

Closes the six GAP sites in crates/engine/src/delete/emitter/fs.rs from
PR #4710 audit section 4 (#22-#27) by giving RealDeleteFs a dirfd-
anchored dispatch shape. Adds DeleteEmitter::with_sandbox carrier slot
that opens a per-plan dirfd via DirSandbox::root_dirfd just before
dispatch so a mid-syscall symlink swap on the parent walk cannot
redirect the call. Plan-directory open failure transparently falls back
to the path-based methods so the drain stays compatible.

RecordingDeleteFs and ScriptedDeleteFs implement `*_at` by discarding
parent_fd and recording the leaf name so every emitter unit test keeps
working without sandbox plumbing. New sandbox.rs test module exercises
each `*_at` variant against a live tempdir, the recursive peel's
symlink-swap resistance, and the sandbox-off / missing-plan-directory
fallback paths.

Promotes recursive_unlinkat(parent_dirfd, leaf) from a SEC-1.s internal
helper to a pub entry point so engine can use it directly without
synthesising absolute-path arguments. Receiver-deletion integration in
crates/transfer/ deferred to a follow-up per design doc; the receiver
loop does not yet route through DeleteEmitter.
oferchen added a commit that referenced this pull request May 22, 2026
…EC-1.q) (#4728)

Extend DeleteFs with unix-only `*_at` siblings (unlink_file_at, rmdir_at,
unlink_symlink_at, unlink_device_at, unlink_special_at, remove_dir_all_at)
that take a parent dirfd + single-component leaf and route through
fast_io::unlinkat / fast_io::recursive_unlinkat (SEC-1.s). Path-based
methods stay as the no-sandbox / Windows fallback so existing callers
keep working unchanged.

Closes the six GAP sites in crates/engine/src/delete/emitter/fs.rs from
PR #4710 audit section 4 (#22-#27) by giving RealDeleteFs a dirfd-
anchored dispatch shape. Adds DeleteEmitter::with_sandbox carrier slot
that opens a per-plan dirfd via DirSandbox::root_dirfd just before
dispatch so a mid-syscall symlink swap on the parent walk cannot
redirect the call. Plan-directory open failure transparently falls back
to the path-based methods so the drain stays compatible.

RecordingDeleteFs and ScriptedDeleteFs implement `*_at` by discarding
parent_fd and recording the leaf name so every emitter unit test keeps
working without sandbox plumbing. New sandbox.rs test module exercises
each `*_at` variant against a live tempdir, the recursive peel's
symlink-swap resistance, and the sandbox-off / missing-plan-directory
fallback paths.

Promotes recursive_unlinkat(parent_dirfd, leaf) from a SEC-1.s internal
helper to a pub entry point so engine can use it directly without
synthesising absolute-path arguments. Receiver-deletion integration in
crates/transfer/ deferred to a follow-up per design doc; the receiver
loop does not yet route through DeleteEmitter.
oferchen added a commit that referenced this pull request Aug 24, 2026
…EC-1.q) (#4728)

Extend DeleteFs with unix-only `*_at` siblings (unlink_file_at, rmdir_at,
unlink_symlink_at, unlink_device_at, unlink_special_at, remove_dir_all_at)
that take a parent dirfd + single-component leaf and route through
fast_io::unlinkat / fast_io::recursive_unlinkat (SEC-1.s). Path-based
methods stay as the no-sandbox / Windows fallback so existing callers
keep working unchanged.

Closes the six GAP sites in crates/engine/src/delete/emitter/fs.rs from
PR #4710 audit section 4 (#22-#27) by giving RealDeleteFs a dirfd-
anchored dispatch shape. Adds DeleteEmitter::with_sandbox carrier slot
that opens a per-plan dirfd via DirSandbox::root_dirfd just before
dispatch so a mid-syscall symlink swap on the parent walk cannot
redirect the call. Plan-directory open failure transparently falls back
to the path-based methods so the drain stays compatible.

RecordingDeleteFs and ScriptedDeleteFs implement `*_at` by discarding
parent_fd and recording the leaf name so every emitter unit test keeps
working without sandbox plumbing. New sandbox.rs test module exercises
each `*_at` variant against a live tempdir, the recursive peel's
symlink-swap resistance, and the sandbox-off / missing-plan-directory
fallback paths.

Promotes recursive_unlinkat(parent_dirfd, leaf) from a SEC-1.s internal
helper to a pub entry point so engine can use it directly without
synthesising absolute-path arguments. Receiver-deletion integration in
crates/transfer/ deferred to a follow-up per design doc; the receiver
loop does not yet route through DeleteEmitter.
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