[Pkg-privacy-commits] [msva-perl] 115/356: close monkeysphere call, provide scaffolding for marginal UI

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository msva-perl.

commit ad4425bea8fa6702943c6aa53be1cd5961593abb
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Apr 29 10:22:24 2010 -0400

    close monkeysphere call, provide scaffolding for marginal UI
---
 Changelog |  1 +
 msva-perl | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/Changelog b/Changelog
index 39e415f..8590c10 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,7 @@
 msva-perl (0.3~pre) UNRELEASED;
 
   * packaging re-organization
+  * properly closing piped monkeysphere call
 
  -- Daniel Kahn Gillmor <dkg at fifthhorseman.net>  Tue, 23 Mar 2010 16:50:07 -0400
 
diff --git a/msva-perl b/msva-perl
index b7b6706..8d7d639 100755
--- a/msva-perl
+++ b/msva-perl
@@ -365,6 +365,7 @@ use strict;
           # clean up the path for taint-check mode:
           $ENV{PATH} = '/usr/local/bin:/usr/bin:/bin';
 
+          # FIXME: should test exit code of open() and do something intelligent with it.
           open($fh, '-|', 'monkeysphere', 'keys-for-userid', $uid);
           while(<$fh>) {
             my @keyinfo = parse_openssh_pubkey($_);
@@ -380,6 +381,16 @@ use strict;
               $ret->{message} = sprintf('Successfully validated "%s" through the OpenPGP Web of Trust.', $uid);
             }
           }
+          my $closeval = close($fh);
+          my $subproc_retval = POSIX::WEXITSTATUS($?);
+          if ((!$closeval) && ($! != 0)) {
+            msvalog('error', "Got bad errno from closing monkeysphere subprocess: %d \n", $!);
+          }
+          if ($subproc_retval != 0) {
+            msvalog('error', "Got bad return code from monkeysphere subprocess: %d \n", $subproc_retval);
+            # FIXME: marginal UI here?  do something with the return code?
+          }
+
         }
       } else {
         msvalog('error', "failed to decode %s\n", unpack('H*', $cert->pubkey()));

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git



More information about the Pkg-privacy-commits mailing list