-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for Windows OpenSSH agent forwarding #2127
Conversation
return source{}, errors.New("only single socket allowed") | ||
} | ||
|
||
if parsed := parsePlatformSocketPath(p); parsed != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getWindowsPipeDialer(p)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL linter errors in CI
Looking at the code, it might make sense (now we're going from 2 to 3) to split out the 'tryAsWindowsNamedPipe', 'tryAsUnixDomainSocket' and 'tryAsPrivateKeyFile' logic into three functions. That would simplify the |
Will fix. |
So we'd have something like this? if parsed := tryWindowsPipePath(); parsed != nil {
socket = parsed
continue
}
if parsed, err := tryUnixSocketPath(p); err != nil {
return source{}, errors.WithStack(err)
} else if parsed != nil {
socket = parsed
continue
}
// open file
// read contents
// try parse private key
// (on failure check contains "socket") ? I'm not convinced that the The only Windows socket-y files that I can think of that have this kind of content are cygwin and/or msys sockets (ref). While I haven't explicitly tested this, I'm doubtful that Go even supports connecting to these "sockets" using Thoughts?
Sounds reasonable.
Wow, that just consumed most of my evening. TIL that AF_UNIX has been implemented on Windows. These sockets are represented on the filesystem by reparse points. However, due to a bug (ref) in Windows 1903+, these files are not reported as reparse points. So, |
Yeah, that was pretty-much what I was thinking. As far as the I guess the use-case here is people running a cygwin-based ssh-agent build. Side-band, I find myself wondering now if cygwin supports |
I have updated my branch with the requested changes. I also have a working implementation of native UNIX socket support on Windows. Would you prefer I make that part of this PR, or split it out into a separate one? Also, any verdict on whether to remove the |
…ed pipes. Signed-off-by: Siebe Schaap <[email protected]>
…ndows rather than syscall. Signed-off-by: Siebe Schaap <[email protected]>
…ndowsPipeDialer(). Signed-off-by: Siebe Schaap <[email protected]>
…th; allowed backslashes in host. Signed-off-by: Siebe Schaap <[email protected]>
9ea037b
to
c9a5f88
Compare
For reference, So I'd keep it as part of the Windows flow for now, and separately investigate it more carefully, if warranted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
PTAL @TBBle
Use Windows OpenSSH agent named pipe as fallback SSH agent socket path when available.
Recognize named pipe paths when on Windows and use winio.DialPipe() to connect.
Existing functionality is not affected. Tested on both Windows and Ubuntu.
See issue #2124 for further details.