]> git.proxmox.com Git - pve-access-control.git/blobdiff - test/auth-test.pl
bump version to 5.1-3
[pve-access-control.git] / test / auth-test.pl
index 50a7f899caec9824adef943e54bc4a6e22784b45..60429a98c36daf348a046c8a84f637fbbd366c97 100644 (file)
@@ -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";