-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
os: Readlink returns garbage when symlink target is like \\?\Volume{XXXXX}\ #30463
Comments
Change https://golang.org/cl/164201 mentions this issue: |
@jhowardmsft FYI, please, see https://golang.org/cl/164201 - hopefully it will be part of go1.13. Alex |
@alexbrainman Thanks for pinging me on this. @jiria FYI |
This reverts the part of commit 8100e75 (PR containerd#113) that added the fork of Readlink() for Windows. At that time the fork was done to work around the bug in golang's implementation of os.Readlink() for Windows. The above bug was never reported upstream, but fortunately it was independently found, reported [1], and fixed [2]. The fix made its way into go-1.13 (there is no mention of that in release notes, so I checked it in git history). [1] golang/go#30463 [2] https://go-review.googlesource.com/c/go/+/164201 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This reverts the part of commit 8100e75 (PR containerd#113) that added the fork of Readlink() for Windows. At that time the fork was done to work around the bug in golang's implementation of os.Readlink() for Windows. The above bug was never reported upstream, but fortunately it was independently found, reported [1], and fixed [2]. The fix made its way into go-1.13 (there is no mention of that in release notes, so I checked it in git history). [1] golang/go#30463 [2] https://go-review.googlesource.com/c/go/+/164201 Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
containerd/continuity@8100e75 referred to this issue, but I believe its use of |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I run
go test
command against this main_test.go fileWhat did you expect to see?
I expected test to pass.
What did you see instead?
Test fails with this error:
The problem here is that os.Readlink does not handle links where target looks like this
\\?\Volume{XXXXX}\
.Volume{ea961e77-0000-0000-0000-501f00000000}\\
that os.Readlink returns is not useful for anything.We have to handle symlinks, like that, because, for example, windows-arm TMP directory is such link (see #29746 (comment) for details). So it will be quite common at least on windows-arm.
Alex
The text was updated successfully, but these errors were encountered: