Mail archive
alpine-devel

Re: [alpine-devel] SpamAssassin DNSBL tests fail after changes in perl (patch included)

From: Johan Dahlberg <johan_at_dnix.se>
Date: Mon, 22 Dec 2014 19:05:29 +0200

On Mon, 22 Dec 2014 at 17:12:13, Leonardo Arena wrote:
> On mer, 2014-12-17 at 11:49 +0200, Johan Dahlberg wrote:
> > --- SpamAssassin/DnsResolver.pm.bak
> > +++ SpamAssassin/DnsResolver.pm
> > _at_@ -204,8 +204,10 @@
> > _at_ns_addr_port = @{$self->{conf}->{dns_servers}};
> > dbg("dns: servers set by config to: %s", join(',
> > ',_at_ns_addr_port));
> > } elsif ($res) { # default as provided by Net::DNS, e.g.
> > /etc/resolv.conf
> > - _at_ns_addr_port = map(untaint_var("[$_]:" . $res->{port}),
> > - _at_{$res->{nameservers}});
> > + my _at_ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers
> > + :
> > _at_{$res->{nameservers}};
> > + my $port = $res->UNIVERSAL::can('port') ? $res->port :
> > $res->{port};
> > + _at_ns_addr_port = map(untaint_var("[$_]:" . $port), @ns);
> > dbg("dns: servers obtained from Net::DNS : %s", join(',
> > ',_at_ns_addr_port));
> > }
> > return _at_ns_addr_port;
>
>
> Hi,
> thanks for your contribution.
> Would it be possible to have a GIT patch? It would be easier and 100%
> error-free to apply.
> Thanks!
>
> R,
> leo

Hello, I'm not so used to working with git, but I think the attached
patch is correct.

Johan

--cNdxnHkX5QqsyA0e
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename="sa-dns-fix.patch"

diff --git a/lib/Mail/SpamAssassin/DnsResolver.pm.orig b/lib/Mail/SpamAssassin/DnsResolver.pm
index 41ae81c..fdc1e5e 100644
--- a/lib/Mail/SpamAssassin/DnsResolver.pm.orig
+++ b/lib/Mail/SpamAssassin/DnsResolver.pm
_at_@ -204,8 +204,10 @@ sub configured_nameservers {
     _at_ns_addr_port = @{$self->{conf}->{dns_servers}};
     dbg("dns: servers set by config to: %s", join(', ',_at_ns_addr_port));
   } elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf
- _at_ns_addr_port = map(untaint_var("[$_]:" . $res->{port}),
- _at_{$res->{nameservers}});
+ my _at_ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers
+ : _at_{$res->{nameservers}};
+ my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port};
+ _at_ns_addr_port = map(untaint_var("[$_]:" . $port), @ns);
     dbg("dns: servers obtained from Net::DNS : %s", join(', ',_at_ns_addr_port));
   }
   return _at_ns_addr_port;

--cNdxnHkX5QqsyA0e--

--St7VIuEGZ6dlpu13
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCAAGBQJUmE9YAAoJEAcoCTcJhy3fxKsP/i8Pgb8imdMYD+GjE2JDHaFE
Hv5TBO5Pv00kZemsmSo1qpp4xBIvoJz3xXSlTy+MQeD3G2zkEDLgaPE6AjqMu07Y
XtdNVrBiSD46B6/r9niC0ubwwuGQpehSSqTu0ml9FZctvTNwq2Gz2fJ7m5oGZ8Lz
W1tYL6SkXqmR2oFCwBEJrgs88TqM2vrmc9p+npUS2SGPJt6VMFCXZmAcOz6n5bXG
I4v27bDccksOgT9XwyPhm/irQ1zDnf043hI3gQXZoUhgui3HtQCUtJlMzv14SDm9
ntMtNcpL5Ak/yQ2/aRmIsOytgLEOjbMjfcl/lLlaNeotsnLMAZhNDxMBGe1JHXEZ
9njb+y4Hu2/8yHRYPuL7B+5sYzLSYJH8c4KiKOI1Lcx0vxNgrVeEJCwDIgWEDJu5
n592T0UTQoszDmK8BUCO2Gxbo0rgaCB8Oq/X+7xHcPyMJAG2/7mKcGHDZ2EPaJz1
zPBsqYHFMomn3xCeOAyZhuVjjweQfNPeSp/cJ4laehGdEwnITMp5DSnfywCALeON
vfJrmqgJEJLPo9W+nIzMl/7Zg+4PdzdeXNplMAnGWVpJclG4CIOKWKLOERZMmCs0
hQbutWWZ9d9Jvwpn1ukCCr1kW4nFhXuzku7+nIRVwUD+94xk6PR3P9TJoLUgGriZ
UBIFpJBs4hTxSDisf62W
=qqXc
-----END PGP SIGNATURE-----

--St7VIuEGZ6dlpu13--


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Mon Dec 22 2014 - 19:05:29 UTC