Skip to content

Commit

Permalink
validate old passwd firstly when changing passwd (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
Honglei-Cong authored and laizy committed May 20, 2019
1 parent 71b18bc commit 041caf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/account_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ func accountSet(ctx *cli.Context) error {
return err
}
defer common.ClearPasswd(passwd)
// verify old password
if _, err := wallet.GetAccountByAddress(address, passwd); err != nil {
return fmt.Errorf("invalid old password: %s", err)
}
PrintInfoMsg("Please input new password:")
newPass, err := password.GetConfirmedPassword()
defer common.ClearPasswd(newPass)
Expand Down

0 comments on commit 041caf6

Please sign in to comment.