Allow multiple retries for interactive password input

Restic used to quit if the repository password was typed incorrectly once.
Restic will now ask the user again for the repository password if typed incorrectly.
The user will now get three tries to input the correct password before restic quits.
This commit is contained in:
Gary Kim committed 2019-06-13 20:11:02 +08:00
1 parent 5bd5db4294
commit fea2464d4d
3 files changed
+32 -7

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@ import (
var (
// ErrNoKeyFound is returned when no key for the repository could be decrypted.
ErrNoKeyFound = errors.Fatal("wrong password or no key found")
ErrNoKeyFound = errors.New("wrong password or no key found")
// ErrMaxKeysReached is returned when the maximum number of keys was checked and no key could be found.
ErrMaxKeysReached = errors.Fatal("maximum number of keys reached")