Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
path/filepath: allow EvalSymlinks to work on UNC share roots on Windows
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 <alex.brainman@gmail.com> Trust: Giovanni Bajo <rasky@develer.com> Run-TryBot: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
- Loading branch information