#!/usr/local/bin/perl
use
blib;
use
strict;
use
warnings;
use
AFS::KTC_TOKEN;
use
AFS::KTC_PRINCIPAL;
use
AFS::KTC_EKEY;
die
"Usage: $0 user\n"
if
(
$#ARGV
!= 0);
my
$princ
=
shift
;
setpag;
system
"tokens"
;
my
$user
= AFS::KTC_PRINCIPAL->new(
$princ
);
my
$password
= AFS::KTC_EKEY->UserReadPassword(
"Password:"
);
my
$pw
;
my
$reason
=
''
;
my
$ok
= AFS::KTC_TOKEN->UserAuthenticateGeneral(
$user
,
$password
, 300,
&AFS::KA_USERAUTH_VERSION
|
&AFS::KA_USERAUTH_DOSETPAG
,
$pw
,
$reason
);
"AFS::CODE = $AFS::CODE\n"
;
"pwexpires = $pw\n"
;
"reason = $reason\n"
;
system
"tokens"
;