1996-04-26 21:35:11 +00:00
|
|
|
#!/usr/bin/suidperl
|
|
|
|
#
|
|
|
|
# Search /etc/skeykeys for the skey string for this user OR user specified
|
|
|
|
# in 1st parameter.
|
|
|
|
#
|
1999-08-28 01:08:13 +00:00
|
|
|
# $FreeBSD$
|
1996-04-26 21:35:11 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
die "usage: keyinfo [user]\n" unless $#ARGV < 1;
|
|
|
|
|
|
|
|
open(K, "/etc/skeykeys") || exit 1;
|
|
|
|
|
|
|
|
if ($#ARGV == 0) {
|
|
|
|
$user = $ARGV[0];
|
|
|
|
} else {
|
|
|
|
$user = (getpwuid($<))[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
while (<K>) {
|
|
|
|
($id, $seq, $serial) = split;
|
|
|
|
if ($id eq $user) {
|
|
|
|
printf "%d %s\n", $seq - 1, $serial;
|
|
|
|
exit 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
exit 1;
|
|
|
|
|