]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/PTY.pm
fix #1819: fork_worker: ensure sync'ed workers control terminal
[pve-common.git] / src / PVE / PTY.pm
index fa781962bd5cce8d596fc09c69b530b81b331543..e433c4ec442a6cfdd1fae24e242ce1432215b760 100644 (file)
@@ -165,7 +165,7 @@ sub tcsetsize($$$) {
        or die "failed to set window size: $!\n";
 }
 
        or die "failed to set window size: $!\n";
 }
 
-sub read_password(;$$) {
+sub read_password($;$$) {
     my ($query, $infd, $outfd) = @_;
 
     my $password = '';
     my ($query, $infd, $outfd) = @_;
 
     my $password = '';
@@ -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
 
 sub new {
 # Class functions
 
 sub new {