[pve-devel] applied: [PATCH common 2/2] add a generalized 'read and confirm password' sub

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jun 12 15:03:57 CEST 2018


On 6/12/18 12:33 PM, Dominik Csapak wrote:
> to use everywhere we read two passwords and compare them
> 
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  src/PVE/PTY.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/PVE/PTY.pm b/src/PVE/PTY.pm
> index 23d76c0..e433c4e 100644
> --- a/src/PVE/PTY.pm
> +++ b/src/PVE/PTY.pm
> @@ -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 {
> 

applied




More information about the pve-devel mailing list