summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/crypto/ssh/terminal
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-02-16 06:47:51 -0800
committerJoram Wilander <jwawilander@gmail.com>2018-02-16 09:47:51 -0500
commit6d8f122a5160f6d9e4c51579f2429dfaa62c7271 (patch)
tree6e0242cd6709260abd74060a7ec7dc1381efa36e /vendor/golang.org/x/crypto/ssh/terminal
parentb112747de76f9c11c4d8083207049fac6e435019 (diff)
downloadchat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.gz
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.tar.bz2
chat-6d8f122a5160f6d9e4c51579f2429dfaa62c7271.zip
Upgrading server dependancies (#8308)
Diffstat (limited to 'vendor/golang.org/x/crypto/ssh/terminal')
-rw-r--r--vendor/golang.org/x/crypto/ssh/terminal/util_windows.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
index 92944f3b4..4933ac361 100644
--- a/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
+++ b/vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
@@ -93,5 +93,13 @@ func ReadPassword(fd int) ([]byte, error) {
windows.SetConsoleMode(windows.Handle(fd), old)
}()
- return readPasswordLine(os.NewFile(uintptr(fd), "stdin"))
+ var h windows.Handle
+ p, _ := windows.GetCurrentProcess()
+ if err := windows.DuplicateHandle(p, windows.Handle(fd), p, &h, 0, false, windows.DUPLICATE_SAME_ACCESS); err != nil {
+ return nil, err
+ }
+
+ f := os.NewFile(uintptr(h), "stdin")
+ defer f.Close()
+ return readPasswordLine(f)
}