From d1a0ea38818cd08797906ab562a77bbd4c834c31 Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Tue, 31 Aug 2021 09:24:28 -0400 Subject: [PATCH] Reintroduce conversion required for Windows (#1868) --- ee/fleetctl/updates.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ee/fleetctl/updates.go b/ee/fleetctl/updates.go index 43249336dc..7262642a66 100644 --- a/ee/fleetctl/updates.go +++ b/ee/fleetctl/updates.go @@ -443,7 +443,8 @@ func (p *passphraseHandler) readPassphrase(role string, confirm bool) ([]byte, e } fmt.Printf("Enter %s key passphrase: ", role) - passphrase, err := terminal.ReadPassword(syscall.Stdin) + // the int(...) conversion is required as on Windows syscall.Stdin is of type Handle. + passphrase, err := terminal.ReadPassword(int(syscall.Stdin)) //nolint:unconvert fmt.Println() if err != nil { return nil, errors.Wrap(err, "read password") @@ -454,7 +455,8 @@ func (p *passphraseHandler) readPassphrase(role string, confirm bool) ([]byte, e } fmt.Printf("Repeat %s key passphrase: ", role) - confirmation, err := terminal.ReadPassword(syscall.Stdin) + // the int(...) conversion is required as on Windows syscall.Stdin is of type Handle. + confirmation, err := terminal.ReadPassword(int(syscall.Stdin)) //nolint:unconvert fmt.Println() if err != nil { return nil, errors.Wrap(err, "read password confirmation")