From 3fad5bcb9348ccb276db940c0c56e58790545ac4 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 21 Jan 2016 12:20:13 +0300 Subject: [PATCH] Use stderr for passphrase prompt, to prevent newclient.sh from catching it Signed-off-by: Sergey Matveev --- VERSION | 2 +- doc/news.texi | 8 ++++++++ src/cypherpunks.ru/govpn/verifier.go | 5 +++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index ef425ca..d346e2a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.2 +5.3 diff --git a/doc/news.texi b/doc/news.texi index 608613a..2846bc6 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -5,6 +5,14 @@ @table @strong +@item Release 5.3 +@cindex Release 5.3 +@itemize +@item Fixed minor bug with @code{newclient.sh} that caught +"Passphrase:" prompt and inserted it into example YAML output. +Just replaced stdout output to stderr for that prompt. +@end itemize + @item Release 5.2 @cindex Release 5.2 @itemize diff --git a/src/cypherpunks.ru/govpn/verifier.go b/src/cypherpunks.ru/govpn/verifier.go index 0dc9388..a452a50 100644 --- a/src/cypherpunks.ru/govpn/verifier.go +++ b/src/cypherpunks.ru/govpn/verifier.go @@ -25,6 +25,7 @@ import ( "fmt" "io/ioutil" "log" + "os" "strings" "github.com/agl/ed25519" @@ -125,9 +126,9 @@ func KeyRead(path string) (string, error) { var err error var pass string if path == "" { - fmt.Print("Passphrase:") + os.Stderr.Write([]byte("Passphrase:")) p, err = terminal.ReadPassword(0) - fmt.Print("\n") + os.Stderr.Write([]byte("\n")) pass = string(p) } else { p, err = ioutil.ReadFile(path) -- 2.44.0