From 3decfef4083189743e1d8aba6dc7c1970d5170a3 Mon Sep 17 00:00:00 2001 From: Bruno Clermont Date: Wed, 8 Feb 2017 18:32:49 +0800 Subject: [PATCH] fix password read on windows, `0` isn't Stdin on windows --- src/cypherpunks.ru/govpn/verifier.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cypherpunks.ru/govpn/verifier.go b/src/cypherpunks.ru/govpn/verifier.go index 168342f..d5976ec 100644 --- a/src/cypherpunks.ru/govpn/verifier.go +++ b/src/cypherpunks.ru/govpn/verifier.go @@ -28,6 +28,7 @@ import ( "log" "os" "strings" + "syscall" "cypherpunks.ru/balloon" "github.com/agl/ed25519" @@ -138,7 +139,7 @@ func KeyRead(path string) (string, error) { var pass string if path == "" { os.Stderr.Write([]byte("Passphrase:")) - p, err = terminal.ReadPassword(0) + p, err = terminal.ReadPassword(int(uintptr(syscall.Stdin))) os.Stderr.Write([]byte("\n")) pass = string(p) } else { -- 2.44.0