Bug#692311: FTBFS if non-local network communication is forbidden

Thadeu Lima de Souza Cascardo cascardo at debian.org
Wed Jan 20 16:06:56 GMT 2021


Source: libxml-stream-perl
Followup-For: Bug #692311

Here is a suggested patch. Can someone forward that upstream? I would
like to get this fixed as soon as possible, so would rather upload an
NMU with this patch in the next couple of days anyway. But I would
appreciate this being forwarded on my behalf.

Thanks.
Cascardo.


-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-3-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_US.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information
-------------- next part --------------
>From 6f085fab67ba07ff38284f9fb865a7eb29346460 Mon Sep 17 00:00:00 2001
From: Thadeu Lima de Souza Cascardo <cascardo at debian.org>
Date: Wed, 20 Jan 2021 13:02:16 -0300
Subject: [PATCH] Do not die when hostname cannot be resolved.

In case the local hostname cannot be resolved, use it instead of the
full reverse name, as it would have been done in case the reverse would
not work.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo at debian.org>
---
 lib/XML/Stream.pm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/XML/Stream.pm b/lib/XML/Stream.pm
index 410a7c4..4c993e2 100644
--- a/lib/XML/Stream.pm
+++ b/lib/XML/Stream.pm
@@ -205,8 +205,7 @@ sub new
     XML::Stream::Tools::setup_debug($self, %args); 
 
     my $hostname = hostname();
-    my $address = gethostbyname($hostname) ||
-        die("Cannot resolve $hostname: $!");
+    my $address = gethostbyname($hostname) || "";
     my $fullname = gethostbyaddr($address,AF_INET) || $hostname;
 
     $self->debug(1,"new: hostname = ($fullname)");
-- 
2.30.0



More information about the pkg-perl-maintainers mailing list