5
0
mirror of git://git.proxmox.com/git/pve-common.git synced 2024-12-24 01:33:48 +03:00

add a generalized 'read and confirm password' sub

to use everywhere we read two passwords and compare them

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-06-12 12:33:47 +02:00 committed by Thomas Lamprecht
parent 6142051558
commit ac927fbcfd

View File

@ -228,6 +228,13 @@ sub read_password($;$$) {
return $password;
}
sub get_confirmed_password {
my $pw1 = read_password('Enter new password: ');
my $pw2 = read_password('Retype new password: ');
die "passwords do not match\n" if $pw1 ne $pw2;
return $pw1;
}
# Class functions
sub new {