From 614fc9d3c54e607af1d10d02efa0f58be2cea71f Mon Sep 17 00:00:00 2001 From: Zachary Wasserman Date: Mon, 16 Jul 2018 10:03:50 -0700 Subject: [PATCH] Confirm password on setup (#1866) --- cmd/fleetctl/setup.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/fleetctl/setup.go b/cmd/fleetctl/setup.go index 403e833699..5bd38c7ace 100644 --- a/cmd/fleetctl/setup.go +++ b/cmd/fleetctl/setup.go @@ -62,6 +62,17 @@ func setupCommand() cli.Command { } fmt.Println() flPassword = string(passBytes) + + fmt.Print("Confirm Password: ") + passBytes, err = terminal.ReadPassword(int(os.Stdin.Fd())) + if err != nil { + return errors.Wrap(err, "error reading password confirmation") + } + fmt.Println() + if flPassword != string(passBytes) { + return errors.New("passwords do not match") + } + } token, err := fleet.Setup(flEmail, flPassword, flOrgName)