mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 13:13:24 +00: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;
|
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
|
# Class functions
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
|
Loading…
Reference in New Issue
Block a user