X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=Util.pm;h=98668c38e7f3bb7c92a636281a76aaa699679a18;hb=e8250d78d091445fbd422fed5d3ae9ab2516eada;hp=8efabfb517959e15db7ad806cb2831608c5f5886;hpb=be1495662e4a4404faa46a81befb2dbf30a794cd;p=mirror%2Fuserdir-ldap-cgi.git diff --git a/Util.pm b/Util.pm index 8efabfb..98668c3 100644 --- a/Util.pm +++ b/Util.pm @@ -180,6 +180,7 @@ sub FormatFingerPrint { sub FetchKey { my $fingerprint = shift; + my $signatures = shift; my ($out, $keyringparam) = undef; foreach (split(/:/, $config{keyrings})) { @@ -189,10 +190,13 @@ sub FetchKey { $fingerprint =~ s/\s//g; $fingerprint = "0x".$fingerprint; + local $ENV{PATH} = ''; $/ = undef; # just suck it up .... - open(FP, "$config{gpg} --no-options --no-default-keyring $keyringparam --check-sigs --fingerprint $fingerprint|"); - $out = ; - close FP; + if ($signatures) { + open(FP, "$config{gpg} --no-options --no-default-keyring $keyringparam --list-sigs --fingerprint $fingerprint|"); + $out = ; + close FP; + } open(FP, "$config{gpg} --no-options --no-default-keyring $keyringparam --export -a $fingerprint|"); $out .= ; close FP; @@ -252,7 +256,7 @@ sub LookupCountry { my $htmlhdrsent = 0; sub HTMLSendHeader { - print "Content-type: text/html\n\n" if (!$htmlhdrsent); + print "Content-type: text/html; charset=utf-8\n\n" if (!$htmlhdrsent); $htmlhdrsent = 1; } @@ -321,7 +325,8 @@ sub ReadConfigFile { if ((!/^\s*#/) && ($_ ne "")) { # Chop off any trailing comments s/#.*//; - ($attr, $setting) = split(/=/, $_, 2); + /([^=]+)=(.*)/; + ($attr, $setting) = ($1, $2); $setting =~ s/"//g; #" $setting =~ s/;$//; $attr =~ s/^\s+//; $attr =~ s/\s+$//;