-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Handle special cases for File.createTempFile
#133530
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
Handle special cases for File.createTempFile
#133530
Conversation
Pinging @elastic/es-core-infra (Team:Core/Infra) |
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.
IIRC I didn't do this because we implicitly allow access to the temp directory for all code, so I only overrode the methods that took in a base dir to create a temp file. This should work though, it just means additional checks (we already grant the tmp dir access automatically in module policies, do we also do that for eg the unnamed module that apm agent uses?)
It's a good point; at first, I just added a
case to the existing What I did not like about it is that we now have the "we implicitly allow access to the temp directory for all code" policy in yet another place, so I change it this way. I'm fine either way really, even just adding the |
Yep, all paths (including APM_MODULE and UNKNOWN) all use a FileAccessTree. They might have a |
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.
LGTM
We were missing a couple of cases where File.createTempFile (from java.io) are defaulting to the default temp directory. This PR addresses that. Fixes elastic#130086
We were missing a couple of cases where File.createTempFile (from java.io) are defaulting to the default temp directory. This PR addresses that. Fixes elastic#130086
…c#133647) We were missing a couple of cases where File.createTempFile (from java.io) are defaulting to the default temp directory. This PR addresses that. Fixes elastic#130086
…c#133647) We were missing a couple of cases where File.createTempFile (from java.io) are defaulting to the default temp directory. This PR addresses that. Fixes elastic#130086
We were missing a couple of cases where
File.createTempFile
(fromjava.io
) are defaulting to the default temp directory.This PR addresses that.
Fixes #130086