Repository navigation
Publish owner-readable input packs under restrictive umasks - #687
Draft
ConnorBaker wants to merge 1 commit into
Draft
ConnorBaker wants to merge 1 commit into
ConnorBaker wants to merge 1 commit into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 warmhashFilereturned 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.