aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2001-11-06 04:00:55 +0000
committerWarner Losh <imp@FreeBSD.org>2001-11-06 04:00:55 +0000
commit7c698237a68106a6a71817e43fcb4f450d72c98e (patch)
treea1e0f49e9fbe378652bbd6bd432c2ee266ff4590
parent474e7788d5248e63a9e8906e3769544cb63fb58b (diff)
downloadsrc-7c698237a68106a6a71817e43fcb4f450d72c98e.tar.gz
src-7c698237a68106a6a71817e43fcb4f450d72c98e.zip
Back out last commit to RELENG_4_3 branch, that was a mistake
Notes
Notes: svn path=/releng/4.3/; revision=86125
-rw-r--r--usr.bin/keyinfo/keyinfo.pl27
1 files changed, 27 insertions, 0 deletions
diff --git a/usr.bin/keyinfo/keyinfo.pl b/usr.bin/keyinfo/keyinfo.pl
new file mode 100644
index 000000000000..8316c5896505
--- /dev/null
+++ b/usr.bin/keyinfo/keyinfo.pl
@@ -0,0 +1,27 @@
+#!/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;
+