-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8355342: File.getCanonicalPath on Java 24 resolves paths on network drives to UNC format #27324
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
…rives to UNC format
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
Webrevs
|
Would it be possible to provide a summary as to why we don't run into this with toRealPath? |
In |
I assume you've checked the flags that can be provided to GetFinalPathNameByHandleW and that there isn't a solution there. In that case, I think it would be better to check the attributes in the WIN32_FIND_DATA to see if it's a reparse point. That would mean deeper changes but should mean you avoid the post-processing the result from getFinalPath, which I think is a bit too hacky to have in this code. |
Yes, I checked all combinations before pursuing this change. There's no help there.
Will check it out.
I think it's correct but I agree about its "hackiness." |
In this scenario
where
|
File.getCanonicalPath
invokesGetFinalPathNameByHandle
on the result ofcanonicalize0
which causes the drive letter of a mapped drive to be converted to a UNC prefix. If such a substitution is detected, this request proposes to revert the conversion of drive letter to UNC prefix before returning the canonical path.Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27324/head:pull/27324
$ git checkout pull/27324
Update a local copy of the PR:
$ git checkout pull/27324
$ git pull https://git.openjdk.org/jdk.git pull/27324/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27324
View PR using the GUI difftool:
$ git pr show -t 27324
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27324.diff
Using Webrev
Link to Webrev Comment