-
Notifications
You must be signed in to change notification settings - Fork 18k
path/filepath: allow EvalSymlinks to work on UNC share roots on Windows #42096
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
Conversation
Fixes golang#42079 Previously, EvalSymlinks returned an error when called with the root of a UNC share (e.g. \\server\share). This was due to Windows's FindFirstFile function not supporting a share root path. To resolve this, now return early from toNorm in the case where the path after the volume name is empty. Skipping the later path component resolution shouldn't have any negative impact in this case, as if the path is empty, there aren't any path components to resolve anyways. The test case uses the localhost admin share (c$), as it should be present in most situations. This allows testing without setting up an external file share. However, this fix applies to all UNC share root paths.
This PR (HEAD: bd3db2c) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/263917 to see it. Tip: You can toggle comments from me using the |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be During May-July and Nov-Jan the Go project is in a code freeze, during which Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Alex Brainman: Patch Set 1: Run-TryBot+1 Trust+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Go Bot: Patch Set 1: TryBots beginning. Status page: https://farmer.golang.org/try?commit=9a1eb90b Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Go Bot: Patch Set 1: Build is still in progress... Other builds still in progress; subsequent failure notices suppressed until final report. Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Go Bot: Patch Set 1: TryBot-Result-1 1 of 20 TryBots failed: Consult https://build.golang.org/ to see whether they are new failures. Keep in mind that TryBots currently test exactly your git commit, without rebasing. If your commit's git parent is old, the failure might've already been fixed. Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Alex Brainman: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Message from Alex Brainman: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/263917. |
Fixes #42079 Previously, EvalSymlinks returned an error when called with the root of a UNC share (e.g. \\server\share). This was due to Windows's FindFirstFile function not supporting a share root path. To resolve this, now return early from toNorm in the case where the path after the volume name is empty. Skipping the later path component resolution shouldn't have any negative impact in this case, as if the path is empty, there aren't any path components to resolve anyways. The test case uses the localhost admin share (c$), as it should be present in most situations. This allows testing without setting up an external file share. However, this fix applies to all UNC share root paths. Change-Id: I05035bd86be93662d7bea34fab4b75fc8e918206 GitHub-Last-Rev: bd3db2c GitHub-Pull-Request: #42096 Reviewed-on: https://go-review.googlesource.com/c/go/+/263917 Trust: Alex Brainman <[email protected]> Trust: Giovanni Bajo <[email protected]> Run-TryBot: Alex Brainman <[email protected]> Reviewed-by: Alex Brainman <[email protected]>
This PR is being closed because golang.org/cl/263917 has been merged. |
Fixes #42079
Previously, EvalSymlinks returned an error when called with the root of
a UNC share (e.g. \server\share). This was due to Windows's
FindFirstFile function not supporting a share root path.
To resolve this, now return early from toNorm in the case where the path
after the volume name is empty. Skipping the later path component
resolution shouldn't have any negative impact in this case, as if the
path is empty, there aren't any path components to resolve anyways.
The test case uses the localhost admin share (c$), as it should be
present in most situations. This allows testing without setting up an
external file share. However, this fix applies to all UNC share root
paths.