Set noecho when reading passwords
This commit is contained in:
parent
bb893d0bd5
commit
76fbde6d6b
|
@ -495,6 +495,7 @@
|
||||||
StringCompareConstantTime
|
StringCompareConstantTime
|
||||||
SysHostnameLong
|
SysHostnameLong
|
||||||
TermSizeAny
|
TermSizeAny
|
||||||
|
TermReadKey
|
||||||
Test2Harness
|
Test2Harness
|
||||||
TestMore
|
TestMore
|
||||||
TestPostgreSQL
|
TestPostgreSQL
|
||||||
|
|
|
@ -5,6 +5,7 @@ use warnings;
|
||||||
use Hydra::Schema;
|
use Hydra::Schema;
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Helper::Nix;
|
||||||
use Hydra::Model::DB;
|
use Hydra::Model::DB;
|
||||||
|
use Term::ReadKey;
|
||||||
use Getopt::Long qw(:config gnu_getopt);
|
use Getopt::Long qw(:config gnu_getopt);
|
||||||
|
|
||||||
sub showHelp {
|
sub showHelp {
|
||||||
|
@ -143,13 +144,17 @@ $db->txn_do(sub {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined $passwordPrompt) {
|
if (defined $passwordPrompt) {
|
||||||
|
ReadMode 2;
|
||||||
print STDERR "Password: ";
|
print STDERR "Password: ";
|
||||||
my $password = <STDIN> // "";
|
my $password = <STDIN> // "";
|
||||||
chomp $password;
|
chomp $password;
|
||||||
|
|
||||||
print STDERR "Password Confirmation: ";
|
print STDERR "\nPassword Confirmation: ";
|
||||||
my $passwordConfirm = <STDIN> // "";
|
my $passwordConfirm = <STDIN> // "";
|
||||||
chomp $passwordConfirm;
|
chomp $passwordConfirm;
|
||||||
|
ReadMode 0;
|
||||||
|
|
||||||
|
print STDERR "\n";
|
||||||
|
|
||||||
if ($password ne $passwordConfirm) {
|
if ($password ne $passwordConfirm) {
|
||||||
die "Passwords don't match."
|
die "Passwords don't match."
|
||||||
|
|
Loading…
Reference in a new issue