freebsd-dev/usr.bin/keyinfo/keyinfo.pl
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00

28 lines
441 B
Perl

#!/usr/bin/suidperl
#
# Search /etc/skeykeys for the skey string for this user OR user specified
# in 1st parameter.
#
# $FreeBSD$
#
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;