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:
parent
6142051558
commit
ac927fbcfd
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user