summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEray Aslan <eras@gentoo.org>2012-11-20 15:21:09 +0000
committerEray Aslan <eras@gentoo.org>2012-11-20 15:21:09 +0000
commit6079706ae18b75fcc0e2e81dd50e2a9e44d83777 (patch)
treef2cce06c245203b086279a4e08643189a1a12e08 /mail-filter/libspf2
parentStable for HPPA (bug #443788). (diff)
downloadgentoo-2-6079706ae18b75fcc0e2e81dd50e2a9e44d83777.tar.gz
gentoo-2-6079706ae18b75fcc0e2e81dd50e2a9e44d83777.tar.bz2
gentoo-2-6079706ae18b75fcc0e2e81dd50e2a9e44d83777.zip
Fix ipv6 failures - bug #443984. Thanks to Peter Danzmayr
(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
Diffstat (limited to 'mail-filter/libspf2')
-rw-r--r--mail-filter/libspf2/ChangeLog8
-rw-r--r--mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch61
-rw-r--r--mail-filter/libspf2/libspf2-1.2.9-r3.ebuild43
3 files changed, 111 insertions, 1 deletions
diff --git a/mail-filter/libspf2/ChangeLog b/mail-filter/libspf2/ChangeLog
index 614b135aca48..78b4dac48511 100644
--- a/mail-filter/libspf2/ChangeLog
+++ b/mail-filter/libspf2/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for mail-filter/libspf2
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/libspf2/ChangeLog,v 1.46 2012/11/03 09:31:28 eras Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/libspf2/ChangeLog,v 1.47 2012/11/20 15:21:09 eras Exp $
+
+*libspf2-1.2.9-r3 (20 Nov 2012)
+
+ 20 Nov 2012; Eray Aslan <eras@gentoo.org> +files/libspf2-1.2.9-ipv6.patch,
+ +libspf2-1.2.9-r3.ebuild:
+ Fix ipv6 failures - bug #443984. Thanks to Peter Danzmayr
03 Nov 2012; Eray Aslan <eras@gentoo.org> libspf2-1.2.9-r2.ebuild:
Add static USE flag to control building static binaries
diff --git a/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch b/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch
new file mode 100644
index 000000000000..76e8cd37c27d
--- /dev/null
+++ b/mail-filter/libspf2/files/libspf2-1.2.9-ipv6.patch
@@ -0,0 +1,61 @@
+$NetBSD: patch-aa,v 1.1 2009/09/08 10:36:27 tron Exp $
+
+Fix an abort() caused by miscalculating the size of an internal buffer.
+This can crash applications using "libspf2" (e.g. "milter-greylist")
+in an e-mail gets delivered via SMTP over IPv6 depending on the
+remote machine's IPv6 address.
+
+--- src/libspf2/spf_expand.c.orig 2008-11-03 21:29:00.000000000 +0000
++++ src/libspf2/spf_expand.c 2009-09-08 11:27:52.000000000 +0100
+@@ -245,7 +245,7 @@
+ case PARM_CLIENT_IP: /* SMTP client IP */
+ #ifdef COMPUTE
+ if (compute_length) {
+- len = sizeof(ip6_buf);
++ len = sizeof(ip6_rbuf);
+ if (d->dv.url_encode)
+ len *= 3;
+ buflen += len;
+
+http://www.gossamer-threads.com/lists/spf/devel/35098
+
+--- src/libspf2/spf_compile.c 2008-11-03 15:37:33.000000000 -0500
++++ src/libspf2/spf_compile.c 2009-09-07 23:46:02.000000000 -0400
+@@ -778,7 +778,7 @@
+ const char *end;
+ const char *p;
+
+- char buf[ INET_ADDRSTRLEN ];
++ char buf[ INET6_ADDRSTRLEN ];
+ size_t len;
+ int err;
+
+--- src/libspf2/spf_interpret.c 2008-10-22 11:47:43.000000000 -0400
++++ src/libspf2/spf_interpret.c 2009-09-08 00:42:25.000000000 -0400
+@@ -505,7 +505,7 @@
+ char dst_ip6_buf[ INET6_ADDRSTRLEN ];
+
+ struct in6_addr src_ipv6;
+- int cidr, mask;
++ int cidr, cidr_save, mask;
+ int i;
+ int match;
+
+@@ -517,6 +517,7 @@
+ cidr = SPF_i_mech_cidr(spf_request, mech);
+ if ( cidr == 0 )
+ cidr = 128;
++ cidr_save = cidr;
+
+ match = TRUE;
+ for( i = 0; i < array_elem( ipv6.s6_addr ) && match; i++ )
+@@ -538,7 +539,7 @@
+ INET_NTOP(AF_INET6, &ipv6.s6_addr,
+ dst_ip6_buf, sizeof(dst_ip6_buf));
+ SPF_debugf( "ip_match: %s == %s (/%d): %d",
+- src_ip6_buf, dst_ip6_buf, cidr, match );
++ src_ip6_buf, dst_ip6_buf, cidr_save, match );
+ }
+
+ return match;
+
diff --git a/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild b/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild
new file mode 100644
index 000000000000..cc4cb64de488
--- /dev/null
+++ b/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/libspf2/libspf2-1.2.9-r3.ebuild,v 1.1 2012/11/20 15:21:09 eras Exp $
+
+EAPI=4
+inherit eutils autotools
+
+DESCRIPTION="libspf2 implements the Sender Policy Framework, a part of the SPF/SRS protocol pair."
+HOMEPAGE="http://www.libspf2.org"
+SRC_URI="http://www.libspf2.org/spf/libspf2-${PV}.tar.gz"
+
+LICENSE="|| ( LGPL-2.1 BSD-2 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="static static-libs"
+
+DEPEND=""
+RDEPEND="!dev-perl/Mail-SPF-Query"
+REQUIRED_USE="static? ( static-libs )"
+
+src_prepare() {
+ epatch "${FILESDIR}/${P}-ipv6.patch"
+ if ! use static; then
+ sed -i -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
+ -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
+ -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
+ -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am \
+ || die
+ eautoreconf
+ fi
+}
+
+src_configure() {
+ econf \
+ $(use_enable static-libs static)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+ dodoc README TODO INSTALL
+
+ use static-libs || rm -f "${D}"/usr/lib*/libspf2.la
+}