Skip to content

Publish owner-readable input packs under restrictive umasks - #687

Draft
ConnorBaker wants to merge 1 commit into
numtide:mainfrom
ConnorBaker:fix/readable-input-pack-publication
Draft

ConnorBaker wants to merge 1 commit into
numtide:mainfrom
ConnorBaker:fix/readable-input-pack-publication

Conversation

@ConnorBaker

Copy link
Copy Markdown
Collaborator

On 0bf30820d, two hash-pinned tarballs shared a nonempty file. The older input also had a larger unshared file. After the old index reached its TTL, running (umask 0400; iets cache gc --ttl 30) compacted the pack. Its replacement had mode 0200. The next ordinary warm hashFile returned the prior digest while a fresh process failed with “Permission denied”. The old pack was already gone.

Set mode 0600 on the private temporary pack's open file descriptor before syncing and renaming it. This applies at the publication point shared by initial pack writes, merges and GC rewrites. It enforces the owner-only file mode documented in docs/explanation/caching.md. An error establishing permissions aborts publication before the earlier generation is removed. Windows retains its native ACL behavior.

The pack round-trip regression gives the temporary the mode produced by umask 0400 while it is still open to the writer. It checks the published mode and reads its contents through a new reader. A separate CLI reproduction runs real GC under the restrictive process umask and compares ordinary warm evaluation with a fresh native read. Existing unreadable files continue to report their I/O errors.

AI assistance: OpenAI Codex.

On the fix, the same GC replaced mode 0600 with 0600 and fresh native and warm evaluation both returned the expected nonempty digest. All 26 input-store and pack unit tests passed.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant