Skip to content

docs(design): SEC-1.s recursive_unlinkat sandbox helper to unblock SEC-1.q - #4724

Merged
oferchen merged 1 commit into
masterfrom
docs/sec-1-s-recursive-unlinkat-design
May 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/sec-1-s-recursive-unlinkat-design

Conversation

@oferchen

@oferchen oferchen commented May 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Opens SEC-1.s to track `recursive_unlinkat_via_sandbox_or_fallback` in `crates/fast_io/src/dir_sandbox/at_syscalls.rs`, the missing helper called out by `docs/design/sec-1-q-delete-emitter-sandbox-2026-05-22.md` step 2 as the prerequisite for `DeleteFs::remove_dir_all_at` and by `docs/audits/sec-1-path-syscall-audit-2026-05-22.md` row Add coverage for legacy AUTHREQD parser edge cases #27 (the only Carrier-class GAP not covered by an existing helper).
  • Specifies the signature mirroring the SEC-1.f/.g/.h/.i/.j `*_via_sandbox_or_fallback` family (sandbox option + `dest_dir` + `relative_path` + already-joined absolute path), the openat + fdopendir + readdir + fstatat-classify + unlinkat peel algorithm with cycle detection on `(dev, ino)` and file-vs-dir TOCTOU race retry, fallback semantics, upstream-equivalent error mapping from `delete.c:48-176`, the cross-platform plan, an 8-case test plan, and an ~480 LoC effort estimate (~250 helper + ~150 unit tests + ~80 integration).
  • Docs-only: no Rust changes. Helper implementation ships in a follow-up PR; SEC-1.q trait refactor lands after that.

Test plan

  • `git diff master --stat` shows only the new design doc.
  • Cross-references resolve: SEC-1.q closure doc, SEC-1.r closure doc, SEC-1.b carrier doc, audit, and upstream `delete.c` are all present in-tree at the cited paths.
  • Signature mirrors existing helpers in `at_syscalls.rs` (`unlink_via_sandbox_or_fallback`, `openat_via_sandbox_or_fallback`).

…C-1.q

Opens SEC-1.s to track the recursive_unlinkat_via_sandbox_or_fallback
helper called out by SEC-1.q (PR #4711) as the prerequisite for
DeleteFs::remove_dir_all_at and by PR #4710's GAP row #27 as the
missing Carrier piece for the --delete recursive fallback.

Documents the proposed signature mirroring the existing
*_via_sandbox_or_fallback family, the openat/fdopendir/readdir +
fstatat-classify + unlinkat peel algorithm, cycle detection via
(dev, ino) tracking, TOCTOU race handling for file-vs-dir swaps,
fallback to std::fs::remove_dir_all when the sandbox is absent,
upstream-equivalent error semantics from delete.c:48-176, the
cross-platform plan, an 8-case test plan, an ~480 LoC effort
estimate, and a three-step dispatch sequence keeping each PR
self-contained.

Docs-only: no implementation in this PR.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 22, 2026
@oferchen
oferchen merged commit a711652 into master May 22, 2026
10 checks passed
@oferchen
oferchen deleted the docs/sec-1-s-recursive-unlinkat-design branch May 22, 2026 14:33
oferchen added a commit that referenced this pull request Aug 24, 2026
…C-1.q (#4724)

Opens SEC-1.s to track the recursive_unlinkat_via_sandbox_or_fallback
helper called out by SEC-1.q (PR #4711) as the prerequisite for
DeleteFs::remove_dir_all_at and by PR #4710's GAP row #27 as the
missing Carrier piece for the --delete recursive fallback.

Documents the proposed signature mirroring the existing
*_via_sandbox_or_fallback family, the openat/fdopendir/readdir +
fstatat-classify + unlinkat peel algorithm, cycle detection via
(dev, ino) tracking, TOCTOU race handling for file-vs-dir swaps,
fallback to std::fs::remove_dir_all when the sandbox is absent,
upstream-equivalent error semantics from delete.c:48-176, the
cross-platform plan, an 8-case test plan, an ~480 LoC effort
estimate, and a three-step dispatch sequence keeping each PR
self-contained.

Docs-only: no implementation in this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant