From cfe4a05232de70c9f6dd2faa2c680796d550dbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Torres?= Date: Thu, 14 Jul 2022 11:05:02 -0500 Subject: [PATCH] redirect passpharse output to Standard error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrés Torres --- cmd/tuf/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/tuf/main.go b/cmd/tuf/main.go index 137420f1..83885ced 100644 --- a/cmd/tuf/main.go +++ b/cmd/tuf/main.go @@ -145,9 +145,9 @@ func getPassphrase(role string, confirm bool, change bool) ([]byte, error) { // No environment variable set, so proceed prompting for new passphrase role = fmt.Sprintf("new %s", role) } - fmt.Printf("Enter %s keys passphrase: ", role) + fmt.Fprintf(os.Stderr, "Enter %s keys passphrase: ", role) passphrase, err := term.ReadPassword(int(syscall.Stdin)) - fmt.Println() + fmt.Fprintln(os.Stderr) if err != nil { return nil, err } @@ -156,9 +156,9 @@ func getPassphrase(role string, confirm bool, change bool) ([]byte, error) { return passphrase, nil } - fmt.Printf("Repeat %s keys passphrase: ", role) + fmt.Fprintf(os.Stderr, "Repeat %s keys passphrase: ", role) confirmation, err := term.ReadPassword(int(syscall.Stdin)) - fmt.Println() + fmt.Fprintln(os.Stderr) if err != nil { return nil, err }