fix bug #85: allow root@pam to generate tickets for other users
[pve-access-control.git] / test / auth-test.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Term::ReadLine;
5 use PVE::AccessControl;
6
7 my $username = shift;
8 die "Username missing" if !$username;
9 sub read_password {
10
11 my $term = new Term::ReadLine ('pveum');
12 my $attribs = $term->Attribs;
13 $attribs->{redisplay_function} = $attribs->{shadow_redisplay};
14 my $input = $term->readline('password: ');
15 return $input;
16 }
17
18 my $password = read_password();
19 PVE::AccessControl::authenticate_user($username,$password);
20
21 print "Authentication Successful!!\n";
22
23 exit (0);