Gentoo Archives: gentoo-commits

From: "Michael Orlitzky (mjo)" <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-filter/spamassassin/files: net-dns-0.76_compatibility.patch
Date: Fri, 27 Feb 2015 23:30:41
Message-Id: 20150227233033.689D512B23@oystercatcher.gentoo.org
1 mjo 15/02/27 23:30:33
2
3 Added: net-dns-0.76_compatibility.patch
4 Log:
5 Revbump to fix bug #541100. Thanks to Markus Oehme for the report and the fix.
6
7 (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x6F48D3DA05C2DADB!)
8
9 Revision Changes Path
10 1.1 mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch?rev=1.1&content-type=text/plain
14
15 Index: net-dns-0.76_compatibility.patch
16 ===================================================================
17 From the upstream bug report at,
18
19 https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7057
20
21 Net::DNS version 0.76 changed the field name holding a set of nameservers
22 in a Net::DNS::Resolver object: it used to be 'nameservers',
23 but is now split into two fields: 'nameserver4' and 'nameserver6'.
24
25 Mail/SpamAssassin/DnsResolver.pm relied on the internal field name
26 of a Net::DNS::Resolver object to obtain a default list of
27 recursive name servers, so the change in Net::DNS broke that.
28
29 As a result, SpamAssassin now fails DNS checks and reports:
30 dns: eval failed: available_nameservers: No DNS servers available!
31 when used with Net::DNS 0.76 or later and no DNS servers are
32 configured explicitly in a custom .cf file (config option: dns_server).
33
34 The problem was reported by Walter Hurry on a mailing list, 2014-06-17.
35
36 The solution is to use an official access method to obtain this
37 information from Net::DNS::Resolver. Apparently early versions
38 of Net::DNS lacked such official access method, which is why we
39 needed to peek under the Net::DNS hood.
40
41 --- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:47:04 1603517
42 +++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:48:04 1603518
43 @@ -204,8 +204,10 @@
44 @ns_addr_port = @{$self->{conf}->{dns_servers}};
45 dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port));
46 } elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf
47 - @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}),
48 - @{$res->{nameservers}});
49 + my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers
50 + : @{$res->{nameservers}};
51 + my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port};
52 + @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns);
53 dbg("dns: servers obtained from Net::DNS : %s", join(', ',@ns_addr_port));
54 }
55 return @ns_addr_port;