Ensure selfcheck file inherits directory permissions#13528
Merged
Conversation
1db6780 to
2e4aaa2
Compare
Member
|
Hi @amol- thanks for your PR to pip. Please be aware it take the maintainers some time to review as we are all doing this on a volunteer basis. |
ichard26
requested changes
Aug 13, 2025
ichard26
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR! This is on the right track. I have some small suggestions, but otherwise, this should be ready to merged very soon!
Co-authored-by: Richard Si <sichard26@gmail.com>
Signed-off-by: Alessandro Molina <alessandro@molina.fyi>
Member
|
pre-commit.ci autofix |
ichard26
approved these changes
Aug 14, 2025
Contributor
Author
|
@ichard26 is there anything else I can help with to have this one merged? Happy to do what I can |
Member
|
@amol- Nope, we just needed someone to press the shiny green merge button. Given that no one seems interested in reviewing this, I'll merge this now. Thank you for the reminder! Sorry about the delay. I've been busy with non-OSS commitments. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
When writing files to cache pip does copy the permissions from the cache directory, this is an expected behaviour to ensure that any user that has access to the cache has also access to its content.
Copying the permissions explicitly is necessary due to the use of
adjacent_tmp_filewhich by virtue oftempfile.mkstemp(indirectly viaNamedTemporaryFile) causes all files to be created with600permissions.This is not happening for
selfcheck/XXXXXby the way, which makes the selfcheck unaccessible by users different from the one that created the cache.This PullRequest creates an helper method
copy_directory_permissionswhich allows both the cache and the selfcheck file to share the same logic in copying directory permissions and thus ensure consistency in cache files permissions.