-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make network cache file permissions inherit from cache directory #13070
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not that familiar with how the HTTP cache functions, but it's probably worth clearing the executable bit. There are likely easier ways to abuse pip to compromise a multi-user set up, but even if it's simply to mitigate future "this seems unsecure" bug reports, I'd clear the bit.
Thanks for the PR by the way! |
Both reasonable suggestions. Done 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Resolves #11012.
The Problem
In a multi-user environment, it would be nice to be able to share a single cache. The NamedTemporaryFile class that is used to create the files is hardcoded to use file mode 600 (owner read/write only). This makes it impossible to share a cache with other users as they would need read/write permissions set for group or others.
The Solution
This PR resolves the problem by changing the file permissions after the file has been written to have the same read/write permissions as those from the cache's directory. One exception is that the owner read/write permissions will always be set (just as it was prior to this change).