-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
tempdir hardening fails when filesystem doesn't track ownership #13194
Comments
In this filesystem, you are able to write to a private directory which is reported as owned by another user? I'm surprised you are not having more issues. Can you explain how the workaround fixes the issue for you? |
The file system is used inside a containerized environment (but is not necessary to be containerized. I'm able to write anywhere there and there is no other processes running there.
When |
Maybe we can also skip the check if |
That sounds like a good solution. I'll look at it after lunch. |
After thinking about your suggestion, it is not a perfect fit for my use case. I'm using Bazel to run the tests and I can set hard coded environment variables in the From our user experience, it would be easier to just disable the check with an new environment variable or to allow |
#8516 verifies that tmpdir and tmp_path etc. are owned by the user. This fails on filesystems that do not track ownership.
In my use case, I am using Buildbarn's FUSE storage on Linux where ownership is always reported as 0. This has the benefit that actions reading the ownership, e.g.
tar
, will be deterministic.My workaround is to use the following in my test file:
Would it make sense to allow
rootdir_stat.st_uid == 0
in src/_pytest/tmpdir.py? An alternative is to disable the check with an environment variable.Related issues: #8414 and #10738.
The text was updated successfully, but these errors were encountered: