forked from restic/restic
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reading the password from non-terminal stdin used io.ReadFull with a byte slice of length 1000. We are now using a Scanner to read one line of input, independent of its length. Additionally, if stdin is not a terminal, the password is read only once instead of twice (in an effort to detect typos). Fixes restic#2203
- Loading branch information
Showing
2 changed files
with
23 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Bugfix: Fix reading passwords from stdin | ||
|
||
Passwords for `init` and `key add` can now be read from non-terminal stdin | ||
without having to pad the input to 1000 characters. | ||
|
||
Additionally the password is now only read once from non-terminal stdin. | ||
|
||
*Heads up*: If you relied on restic checking for typos, you have to do it | ||
yourself now, before running the `init`, `key add`, or `key change` commands. | ||
|
||
https://github.com/restic/restic/issues/2203 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters