The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/usr/local/bin/perl

use blib;
use AFS::KAS;
use AFS::KTC_PRINCIPAL;
use AFS::KTC_TOKEN;
use AFS::KTC_EKEY;
use AFS qw(raise_exception setpag);

die "Usage: admin\n" if ($#ARGV != 0);

raise_exception(1);

setpag;

my $princ = AFS::KTC_PRINCIPAL->new(shift);
my $key   = AFS::KTC_EKEY->ReadPassword($princ->name."'s Password:");
my $token = AFS::KTC_TOKEN->GetAdminToken($princ, $key, 300);

my $kas   = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE);
print "AFS::CODE = $AFS::CODE\n";