From 6c2d1c898f917f067a0b48c2bc860233e5f287d2 Mon Sep 17 00:00:00 2001 From: Petr Písař Date: Mar 04 2019 08:07:42 +0000 Subject: Fix a flaw in IPv6-support.patch tests visible when localhost resolves to one address only --- diff --git a/RPC-XML-0.80-fix_host_name_test.patch b/RPC-XML-0.80-fix_host_name_test.patch new file mode 100644 index 0000000..875c432 --- /dev/null +++ b/RPC-XML-0.80-fix_host_name_test.patch @@ -0,0 +1,71 @@ +MIME-Version: 1.0 +X-Spam-Status: No, score=-1.121 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, SPF_NEUTRAL=0.779] autolearn=no +Content-Disposition: inline +X-Cpan.org: This message routed through the cpan.org mail forwarding service. Please use PAUSE pause.perl.org to configure your delivery settings. +X-Spam-Flag: NO +X-RT-Interface: API +X-Virus-Scanned: Debian amavisd-new at bestpractical.com +Message-ID: <20190301231017.mrm4rmdrtjq6cteo@work> +content-type: text/plain; charset="utf-8" +X-RT-Original-Encoding: utf-8 +X-Spam-Score: -1.121 +Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 46E5D2401F3 for ; Fri, 1 Mar 2019 18:17:22 -0500 (EST) +Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z45FyKRQ-6d9 for ; Fri, 1 Mar 2019 18:17:21 -0500 (EST) +Received: from xx1.develooper.com (xx1.develooper.com [207.171.7.115]) by hipster.bestpractical.com (Postfix) with ESMTPS id C534D240052 for ; Fri, 1 Mar 2019 18:17:20 -0500 (EST) +Received: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id CE8CA7C19E for ; Fri, 1 Mar 2019 15:17:19 -0800 (PST) +Received: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 91E467CF8A for ; Fri, 1 Mar 2019 15:17:17 -0800 (PST) +Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id CB36E7C19E for ; Fri, 1 Mar 2019 15:17:16 -0800 (PST) +Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id C540941B36 for ; Sat, 2 Mar 2019 00:10:24 +0100 (CET) +Delivered-To: cpan-bug+RPC-XML@hipster.bestpractical.com +Subject: Re: [rt.cpan.org #120472] +Return-Path: +X-Original-To: cpan-bug+RPC-XML@hipster.bestpractical.com +X-RT-Mail-Extension: rpc-xml +Date: Sat, 2 Mar 2019 00:10:17 +0100 +X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INVALID_MSGID_NO_FQDN 0, SINGLE_URI_IN_BODY 0, SPF_PASS 0, URI_WITH_PATH_ONLY 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FROM_UTF_Q 0, __HAS_FROM 0, __HAS_MSGID 0, __HTTPS_URI 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __NO_HTML_TAG_RAW 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_NEGATE 0, __SUBJ_REPLY 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NOT_IMG 0, __URI_NO_MAILTO 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0, __zen.spamhaus.org_ERROR ' +X-Spam-Level: +X-Greylist: delayed 409 seconds by postgrey-1.34 at xx1.develooper.com; Fri, 01 Mar 2019 15:17:16 PST +X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2019.3.1.230917 +To: bug-RPC-XML@rt.cpan.org +From: Fabian Grünbichler +RT-Message-ID: +Content-Length: 1733 + +the patch attached in this queue actually has a bug itself, which the +following diff (full patch/commit[1]) fixes: + +it does break for IPv4 only systems where 'localhost' only resolves to +'127.0.0.1', since '127.0.0.1' cmp '127.0.0.1' == 0. in case resolve +(which ignores $res->[0]/$family) returns '::1' (or any other value) in +addition to '127.0.0.1', the problem is actually hidden since '::1' cmp +'127.0.0.1' is truthy, not false. switching to 'eq' does the right +thing, since we don't care about ordering. + +1: https://salsa.debian.org/perl-team/modules/packages/librpc-xml-perl/commit/31c9c4a78dcff0beb5c19d7363848c08c9b319f9 + +diff --git a/t/40_server.t b/t/40_server.t +index 379b956..86c49ed 100644 +--- a/t/40_server.t ++++ b/t/40_server.t +@@ -317,7 +317,7 @@ SKIP: { + } + + $res = $res->value->value; +- ok(grep({ $_ cmp $res->[3]} resolve($res->[0], 'localhost')), ++ ok(grep({ $_ eq $res->[3]} resolve($res->[0], 'localhost')), + 'Third live req: Correct IP addr from peerhost'); + is($res->[1], Socket::inet_pton($res->[0], $res->[3]), + 'Third request: peeraddr packet matches converted peerhost'); +diff --git a/t/40_server_xmllibxml.t b/t/40_server_xmllibxml.t +index 8aeaece..68952f4 100644 +--- a/t/40_server_xmllibxml.t ++++ b/t/40_server_xmllibxml.t +@@ -214,7 +214,7 @@ SKIP: { + } + + $res = $res->value->value; +- ok(grep({ $_ cmp $res->[3]} resolve($res->[0], 'localhost')), ++ ok(grep({ $_ eq $res->[3]} resolve($res->[0], 'localhost')), + 'Third live req: Correct IP addr from peerhost'); + is($res->[1], Socket::inet_pton($res->[0], $res->[3]), + 'Third request: peeraddr packet matches converted peerhost'); diff --git a/perl-RPC-XML.spec b/perl-RPC-XML.spec index ae2805b..a9e8c16 100644 --- a/perl-RPC-XML.spec +++ b/perl-RPC-XML.spec @@ -2,7 +2,7 @@ Name: perl-%{cpan_name} Version: 0.80 -Release: 11%{?dist} +Release: 12%{?dist} Summary: Set of classes for core data, message and XML handling License: Artistic 2.0 or LGPLv2 URL: https://metacpan.org/release/%{cpan_name} @@ -10,6 +10,9 @@ Source0: https://cpan.metacpan.org/authors/id/R/RJ/RJRAY/%{cpan_name}-%{version} Source1: README.license # Add IPv6 support needed for IPv6-capable HTTP::Daemon, CPAN RT#120472 Patch0: RPC-XML-0.80-IPv6-support.patch +# Fix a flaw in IPv6-support.patch tests visible when localhost resolves to one address +# only, CPAN RT#120472 +Patch1: RPC-XML-0.80-fix_host_name_test.patch BuildArch: noarch BuildRequires: coreutils BuildRequires: findutils @@ -103,6 +106,7 @@ running RPC::XML under mod_perl. %prep %setup -qn %{cpan_name}-%{version} %patch0 -p1 +%patch1 -p1 cp -p %{SOURCE1} . %build @@ -132,6 +136,10 @@ make test %{perl_vendorlib}/Apache %changelog +* Mon Mar 04 2019 Petr Pisar - 0.80-12 +- Fix a flaw in IPv6-support.patch tests visible when localhost resolves to one + address only (CPAN RT#120472) + * Fri Feb 01 2019 Fedora Release Engineering - 0.80-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild