зеркало из https://github.com/golang/term.git
ssh/terminal: account for win32 api changes
The API changed for this function, since the call always succeeds. Update this user of it accordingly. Fixes: golang/go#34461 Change-Id: I9d19b70767fc6b1b9292ad8732dd8e54bb6a8ae0 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/196897 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Родитель
c5b4c79d1f
Коммит
cf60e62b0d
|
@ -94,8 +94,7 @@ func ReadPassword(fd int) ([]byte, error) {
|
||||||
defer windows.SetConsoleMode(windows.Handle(fd), old)
|
defer windows.SetConsoleMode(windows.Handle(fd), old)
|
||||||
|
|
||||||
var h windows.Handle
|
var h windows.Handle
|
||||||
p, _ := windows.GetCurrentProcess()
|
if err := windows.DuplicateHandle(windows.GetCurrentProcess(), windows.Handle(fd), windows.GetCurrentProcess(), &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
|
||||||
if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче