Repository navigation
fix(review): the index copy goes into a fresh private dir, not a guessable temp path - #160
Merged
Merged
Conversation
…sable temp path TempIndex copied the git index with fs::copy to temp_dir()/plannotator-tui-index-<pid>-<n>. On a shared /tmp another user could plant a symlink there, so the copy overwrote any file the reviewer can write, or plant a file they control and swap the index git then reads. The copy now goes into a directory created exclusively, mode 0700 on Unix, which drop removes with git's lock file. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its one test reads mode bits, so on Windows the module's import went unused and failed clippy. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
The failing 🤖 Co-created with Claude Opus 5.5 |
Contributor
Author
|
The flake fix is #161: the index copy got a fresh mtime, which defeats git's racy-clean check. Once it's in, rerunning 🤖 Co-created with Claude Opus 5.5 |
Merged
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.
TempIndexcopied the git index withfs::copytotemp_dir()/plannotator-tui-index-<pid>-<n>, a guessable path in a shared directory. On a shared/tmp, another local user could plant a symlink there, so the copy overwrote any file the reviewer can write. They could also plant a file they control and swap the index that git then reads. This is the same flaw class as #143.The copy now goes into a directory created exclusively, mode 0700 on Unix, at
<dir>/index; drop removes the directory, git'sindex.lockincluded. Linux's defaultfs.protected_symlinks/fs.protected_regularalready blunt this on many systems, and macOS and Windows use a per-user temp dir.🤖 Co-created with Claude Opus 5.5