Skip to content
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

syscall: Readlink is incorrect for windows #16861

Closed
gooid opened this issue Aug 24, 2016 · 3 comments
Closed

syscall: Readlink is incorrect for windows #16861

gooid opened this issue Aug 24, 2016 · 3 comments

Comments

@gooid
Copy link

@gooid gooid commented Aug 24, 2016

`

------------------------ src/syscall/syscall_windows.go ------------------------
index 703bb53..eb9a7e1 100644
@@ -1028,11 +1028,11 @@ func Readlink(path string, buf []byte) (n int, err error) {
case IO_REPARSE_TAG_SYMLINK:
data := (symbolicLinkReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))
p := (
[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))

  •   s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2])
    
  •   s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength+data.PrintNameOffset)/2])
    
    case _IO_REPARSE_TAG_MOUNT_POINT:
    data := (mountPointReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))
    p := (
    [0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))
  •   s = UTF16ToString(p[data.PrintNameOffset/2 : (data.PrintNameLength-data.PrintNameOffset)/2])
    
  •   s = UTF16ToString(p[data.SubstituteNameOffset/2 + 4 : (data.SubstituteNameLength+data.SubstituteNameOffset)/2])
    
    default:
    // the path is not a symlink or junction but another type of reparse
    // point

`

705d06f0-69df-4601-aa5c-5a879f60b4f7

@bradfitz bradfitz added the OS-Windows label Aug 24, 2016
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Aug 24, 2016

@hirochachacha
Copy link
Contributor

@hirochachacha hirochachacha commented Aug 25, 2016

Dup of #15978.

@alexbrainman
Copy link
Member

@alexbrainman alexbrainman commented Aug 25, 2016

Yes, looks like related to issue #15978.

Alex

@bradfitz bradfitz closed this Aug 25, 2016
@golang golang locked and limited conversation to collaborators Aug 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.