X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FPTY.pm;h=e433c4ec442a6cfdd1fae24e242ce1432215b760;hp=fa781962bd5cce8d596fc09c69b530b81b331543;hb=e97f807c388c10250f442b1f16c5315df2ffc2af;hpb=ee29490fe02663a55215a0f6f9e77e940f738eb6;ds=sidebyside diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm index fa78196..e433c4e 100644 --- a/src/PVE/PTY.pm +++ b/src/PVE/PTY.pm @@ -165,7 +165,7 @@ sub tcsetsize($$$) { or die "failed to set window size: $!\n"; } -sub read_password(;$$) { +sub read_password($;$$) { my ($query, $infd, $outfd) = @_; my $password = ''; @@ -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 {