X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPVE%2FPTY.pm;h=fa781962bd5cce8d596fc09c69b530b81b331543;hb=7c5eeae56a3c05a0562efb62accf5c69058b8736;hp=1178ea7a2da01eb29e6b2373a50445197cdaa1ec;hpb=140642513383dfcebe381761c19b6d6c871bbe2b;p=pve-common.git diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm index 1178ea7..fa78196 100644 --- a/src/PVE/PTY.pm +++ b/src/PVE/PTY.pm @@ -194,10 +194,13 @@ sub read_password(;$$) { syswrite($outfd, $query, length($query)); while (($got = sysread($infd, $ch, 1))) { my ($ord) = unpack('C', $ch); - if ($ord == 0xD) { + last if $ord == 4; # ^D / EOF + if ($ord == 0xA || $ord == 0xD) { # newline, we're done syswrite($outfd, "\r\n", 2); last; + } elsif ($ord == 3) { # ^C + die "password input aborted\n"; } elsif ($ord == 0x7f) { # backspace - if it's the first key disable # asterisks