Skip to content

fix(archive): opens route through Root — the reported bypass and the hidden one - #345

Merged
David-Noble-at-work merged 1 commit into
developfrom
fix/archive-root-confinement
Aug 8, 2026
Merged

David-Noble-at-work merged 1 commit into
developfrom
fix/archive-root-confinement

Conversation

@David-Noble-at-work

Copy link
Copy Markdown
Contributor

Closes #225. openArchive bypassed fsroot.Root with os.Open — and the zip branch hid a second bypass, re-opening by path through zip.OpenReader. Opens now route through root.Open(root.NewPath(source)); newZipArchiveReader takes the open handle (Stat + zip.NewReader, handle owned by the reader), so zip reads the confined handle and the spool path drops a close-and-reopen. The broadened sweep of all provider os-level file I/O found four judgment groups — none a hole of this kind — ruled deliberate keeps, each site annotated with a one-line confinement reason (docs/plans/archive-root-confinement.md). Verified: suite green, board zero both GOOS, zero os.Open left in the archive provider.

…hidden one

Issue #225: openArchive used os.Open, bypassing fsroot.Root confinement
— and the zip branch hid a second bypass, closing the file to re-open
it by path via zip.OpenReader (its own unconfined os.Open). Opens now
route through root.Open(root.NewPath(source)) (the file provider's
idiom); newZipArchiveReader takes the already-open handle (Stat for
size, zip.NewReader, handle owned and closed by the reader), so the
zip branch hands the confined handle over and the spool path drops a
close-and-reopen. The sweep of all remaining os-level file I/O in
providers found four judgment groups (spool scratch, plan documents,
starlark sources, git subprocess trees) — ruled deliberate keeps, each
site now carrying a one-line confinement-reason comment. Plan:
docs/plans/archive-root-confinement.md.
@David-Noble-at-work David-Noble-at-work self-assigned this Aug 8, 2026
@David-Noble-at-work
David-Noble-at-work merged commit 9555e6e into develop Aug 8, 2026
2 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/archive-root-confinement branch August 8, 2026 01:23
David-Noble-at-work added a commit that referenced this pull request Aug 9, 2026
…Rs (#355)

A plan committed inside its own PR predates the merge by construction,
so no completed plan recorded where it landed. Each of the five now
ends with the PR it landed as and the squash date:
implicit-common-project and git-crypt-pinning (#354), writ-repo-remote
(#353), writ-repo-command (#352), archive-root-confinement (#345).

Co-authored-by: David Noble <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(provider/archive): archive provider bypasses Root, calls os.Open/os.OpenFile directly

1 participant