avoid some spurious error messages when no agent is found msva-perl/0.8
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 21:11:39 +0000 (16:11 -0500)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 20 Dec 2010 21:11:39 +0000 (16:11 -0500)
Crypt/Monkeysphere/MSVA.pm
gpgkeys_hkpms

index bd81606b306e294b2ed2ab1ca3bac441579c0243..cadfee6e5b576bc07c9f59a1f35403e5785c14cf 100755 (executable)
   sub getpidswithsocketinode {
     my $sockid = shift;
 
+    if (! defined ($sockid)) {
+      msvalog('verbose', "No client socket ID to check.  The MSVA is probably not running as a service.\n");
+      return [];
+    }
     # this appears to be how Linux symlinks open sockets in /proc/*/fd,
     # as of at least 2.6.26:
     my $socktarget = sprintf('socket:[%d]', $sockid);
index 03a79f28c8f41eb520c22d85021dfe3aa7e5b409..75ce01bcb293cb5a66dff56f0470e0084ab8ad8c 100755 (executable)
@@ -92,6 +92,7 @@ use warnings;
         ($status, $ret) = $self->{client}->query_agent('https', $self->{config}->{host}, 'server', 'x509pem', $certpem, 'never');
       } else {
         use Crypt::Monkeysphere::MSVA;
+        $self->{logger}->log('verbose', "Could not find a running agent (MONKEYSPHERE_VALIDATION_AGENT_SOCKET env var).\nFalling back to in-process certificate checks.\n");
         # If there is no running agent, we might want to be able to fall
         # back here.