Skip to content
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

Use safe method for handling Files#createDirectories #7997

Merged
merged 2 commits into from
Jun 25, 2022

Conversation

Owen1212055
Copy link
Member

@Owen1212055 Owen1212055 commented Jun 16, 2022

Fixes #7969

Symbolic links seem to not be handled nicely in Files#createDirectories.
There will most likely be a future patch that targets correctly handling symlinks for this method when used in other places in the source code. But I wanted to get this out so that it can specifically target to fix this issue.

There was a bug report on this, but it was marked as NAI: https://bugs.openjdk.org/browse/JDK-8130464

@electronicboy
Copy link
Member

(Validated the behavior here using jshell, seems to work as expected here)

Copy link
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually no, this doesn't work. It throws an exception if the config directory doesn't exist at all. toRealPath requires it to exist

@Owen1212055 Owen1212055 force-pushed the fixy-symbolic-config branch from 82e0258 to cfb2659 Compare June 25, 2022 18:30
@Owen1212055 Owen1212055 changed the title Use .toRealPath in createDirectories (paper config) Use safe method for handling Files#createDirectories Jun 25, 2022
@Owen1212055
Copy link
Member Author

Updated and fixed, see paper contributing. If anyone knows a better place for this type of util method would be appreciated, but it probably is just fine there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlinked world directory not working
4 participants