[Pkg-privacy-commits] [msva-perl] 339/356: blunder onward instead of failing hard if we cannot retrieve the port number

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:42:11 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 f67cef2ebe7a6b74d989334307243123fcf58f88
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Fri Mar 16 02:12:37 2012 -0400

    blunder onward instead of failing hard if we cannot retrieve the port number
---
 Crypt/Monkeysphere/MSVA.pm | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Crypt/Monkeysphere/MSVA.pm b/Crypt/Monkeysphere/MSVA.pm
index 4c29380..b1ef6a3 100755
--- a/Crypt/Monkeysphere/MSVA.pm
+++ b/Crypt/Monkeysphere/MSVA.pm
@@ -766,12 +766,13 @@
     }
     if (!defined($self->port) || $self->port == 0) {
       my $port = @{ $server->{server}->{sock} }[0]->sockport();
-      if ((! defined($port)) || ($port < 1) || ($port >= 65536)) {
-        msvalog('error', "got nonsense port: %d.\n", $port);
-        $server->set_exit_status(11);
-        $server->server_close();
-      }
-      if ((exists $ENV{MSVA_PORT}) && (($ENV{MSVA_PORT} + 0) != $port)) {
+      if (! defined($port)) {
+        msvalog('error', "got undefined port.\nRecording as 0.\n", $port);
+        $port = 0;
+      } elsif (($port < 1) || ($port >= 65536)) {
+        msvalog('error', "got nonsense port: %d.\nRecording as 0.\n", $port);
+        $port = 0;
+      } elsif ((exists $ENV{MSVA_PORT}) && (($ENV{MSVA_PORT} + 0) != $port)) {
         msvalog('error', "Explicitly requested port %d, but got port: %d.", ($ENV{MSVA_PORT}+0), $port);
         $server->set_exit_status(13);
         $server->server_close();

-- 
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