From 5364d2c2f24115fd1c27a19099a2321fe93fa5d4 Mon Sep 17 00:00:00 2001 From: tausq <> Date: Tue, 5 Oct 1999 00:54:29 +0000 Subject: [PATCH] Added key fetching code to fingerserv Added --no-default-keyring and --no-options to Util.pm --- ud-fingerserv | 16 ++++++++++++---- web/Util.pm | 7 ++++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ud-fingerserv b/ud-fingerserv index 0e49f03..915715d 100755 --- a/ud-fingerserv +++ b/ud-fingerserv @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: ud-fingerserv,v 1.1 1999/10/04 06:51:45 tausq Exp $ +# $Id: ud-fingerserv,v 1.2 1999/10/05 02:54:29 tausq Exp $ # (c) 1999 Randolph Chung. Licensed under the GPL. @@ -17,10 +17,12 @@ my %attrs = ( 'cn' => 'First name', 'mn' => 'Middle name', 'sn' => 'Last name', - 'keyfingerprint' => 'Fingerprint' + 'keyfingerprint' => 'Fingerprint', + 'key' => 'Key block', + 'ircnick' => 'IRC nickname' ); -my @summarykeys = ('cn', 'mn', 'sn', 'keyfingerprint'); +my @summarykeys = ('cn', 'mn', 'sn', 'ircnick', 'keyfingerprint', 'key'); my ($ldap, $mesg, $dn, $entries, $data, %output, $key, $hostlist, $hostdetails, $selected, %summary); sub DieHandler { @@ -61,6 +63,12 @@ while ($client = $server->accept()) { foreach $dn (sort {$entries->{$a}->{sn}->[0] <=> $entries->{$b}->{sn}->[0]} keys(%$entries)) { $data = $entries->{$dn}; + $data->{key} = []; + foreach (@{$data->{keyfingerprint}}) { + push (@{$data->{key}}, "\n".&Util::FetchKey($_)); + } + + print $client "$dn\n"; if (!$fields) { foreach $key (@summarykeys) { foreach (@{$data->{$key}}) { @@ -69,7 +77,7 @@ while ($client = $server->accept()) { } } } else { - print "$fields\n"; +# print "$fields\n"; foreach $key (split(/,/, $fields)) { foreach (@{$data->{$key}}) { print $client "$attrs{$key}: "; diff --git a/web/Util.pm b/web/Util.pm index 4cbec32..89ef3fb 100644 --- a/web/Util.pm +++ b/web/Util.pm @@ -6,6 +6,7 @@ use Crypt::Blowfish; my $blocksize = 8; # A blowfish block is 8 bytes my $configfile = "/etc/userdir-ldap/userdir-ldap.conf"; +#my $configfile = "./userdir-ldap.conf"; my %config = &ReadConfigFile; @@ -169,7 +170,7 @@ sub FormatFingerPrint { sub FetchKey { my $fingerprint = shift; - my ($out, $keyringparam); + my ($out, $keyringparam) = undef; foreach (split(/:/, $config{keyrings})) { $keyringparam .= "--keyring $_ "; @@ -179,10 +180,10 @@ sub FetchKey { $fingerprint = "0x".$fingerprint; $/ = undef; # just suck it up .... - open(FP, "$config{gpg} $keyringparam --list-sigs --fingerprint $fingerprint|"); + open(FP, "$config{gpg} --no-options --no-default-keyring $keyringparam --list-sigs --fingerprint $fingerprint|"); $out = ; close FP; - open(FP, "$config{gpg} $keyringparam --export -a $fingerprint|"); + open(FP, "$config{gpg} --no-options --no-default-keyring $keyringparam --export -a $fingerprint|"); $out .= ; close FP; $/ = "\n"; -- 2.20.1