X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=test%2Fauth-test.pl;fp=test%2Fauth-test.pl;h=60429a98c36daf348a046c8a84f637fbbd366c97;hp=50a7f899caec9824adef943e54bc4a6e22784b45;hb=b34d76e7262bbc7e314c4723b06dfaf3c5d0908b;hpb=765305e21001f0331d76865b7c4022397ce0982c diff --git a/test/auth-test.pl b/test/auth-test.pl index 50a7f89..60429a9 100644 --- a/test/auth-test.pl +++ b/test/auth-test.pl @@ -1,21 +1,13 @@ #!/usr/bin/perl -w use strict; -use Term::ReadLine; +use PVE::PTY; use PVE::AccessControl; my $username = shift; die "Username missing" if !$username; -sub read_password { - my $term = new Term::ReadLine ('pveum'); - my $attribs = $term->Attribs; - $attribs->{redisplay_function} = $attribs->{shadow_redisplay}; - my $input = $term->readline('password: '); - return $input; -} - -my $password = read_password(); +my $password = PVE::PTY::read_password('password: '); PVE::AccessControl::authenticate_user($username,$password); print "Authentication Successful!!\n";