-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8368165: (fs) Path.toRealPath does not perform correctly for symbolic links in a mapped drive (win) #28032
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
base: master
Are you sure you want to change the base?
Conversation
… links in a mapped drive (win)
|
This change was tested successfully with links and files on a local mapped disk and on remote shares on macOS and Windows machines. It might be that falling back to the slow path should be limited to a certain subset of error codes encountered by |
|
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
toRealPath is specified to throw if it fails. The error |
|
I don't think the current behavior is incorrect, but it does not provide the sought for outcome. The fallback path using |
We can't fallback unconditionally when GetFinalPathNameByHandle fails. The only reason for this fallback path is for cases where there is a sym link to something that we know doesn't support links. So this is why it is limited to ERROR_INVALID_LEVEL, and even then it is dubious and maybe we need to explore the errors and interop issues further before seeing if anything should be done. |
Right, I was uncertain about this which is why I commented above that "It might be that falling back to the slow path should be limited to a certain subset of error codes". |
If
getFinalPaththrows an exception, or converts a drive path to a UNC path, then fall back to the slow path which usesresolveAllLinks.Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28032/head:pull/28032$ git checkout pull/28032Update a local copy of the PR:
$ git checkout pull/28032$ git pull https://git.openjdk.org/jdk.git pull/28032/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28032View PR using the GUI difftool:
$ git pr show -t 28032Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28032.diff
Using Webrev
Link to Webrev Comment