Repository navigation
Conversation
…rives to UNC format
|
👋 Welcome back bpb! A progress list of the required criteria for merging this PR into |
|
@bplb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 153 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
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 |
Are you able to check how it behaves when mapped to a location on different host? |
This hack does not work when Z: is mapped to a drive on another machine, at least on my laptop because there is no key HKEY_CURRENT_USER\Network\Z\RemotePath in the registry in this case. |
|
This issue is going to require stepping back and re-visiting the question as to what is the canonical path when a file is located with a UNC path. We wrestled with this in JDK 7 and I thought got to the best answer with toRealPath but it seems we may have to re-visit this now. |
From issue JDK-8368165: Path.of("Z:\link").toRealPath() throws an exception on the Windows host where Z: is mapped to a remote drive on a Mac host via Samba: | Exception java.nio.file.FileSystemException: Z:\link: The name of the file cannot be resolved by the system |
I assume "link" is a sym link. I haven't configured SAMBA in a while but isn't there a config setting in smb.conf that controls this? |
Yes.
I don't know but will check. |
"This option is enabled (i.e. smbd will follow symbolic links) by default." |
|
Commit ebe88f7 changes |
Would it be possible to paste in the outcome from the latest change with files that exist, and do not exist, on the UNC share. I think it would be useful to have both the toRealPath and File.getCanonicalPath outcome. This is a tricky issue as the current implementation isn't wrong, it's just surprising (and in the case of the bug report, awkward when attempting to use the real path as a working directory for a subprocess). |
AlanBateman
left a comment
There was a problem hiding this comment.
It took a lot of iterations but I think the latest is good. I assume you'll run tier1+tier2 at least before integrating.
Certainly. There is still a weird test failure that I am investigating to determine whether it is related to the change. Otherwise tiers 1-3 are clear. |
|
Without commit 0918c3a, which was apparently due to |
File::getCanonicalFile is specified to return a result when the file doesn't exist to I think this is okay. Were you able to establish if this was a just a broken link or something else? |
Not definitively, but I think if could be. The Windows system error code was |
Okay, in that case it should be okay to treat it as a broken link. |
|
/integrate |
|
Going to push as commit 1f08a3e.
Your commit was automatically rebased without conflicts. |
File.getCanonicalPathinvokesGetFinalPathNameByHandleon the result ofcanonicalize0which 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
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27324/head:pull/27324$ git checkout pull/27324Update a local copy of the PR:
$ git checkout pull/27324$ git pull https://git.openjdk.org/jdk.git pull/27324/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27324View PR using the GUI difftool:
$ git pr show -t 27324Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27324.diff
Using Webrev
Link to Webrev Comment