diff options
author | Jason A. Donenfeld <zx2c4@gentoo.org> | 2016-06-08 10:04:12 +0200 |
---|---|---|
committer | Jason A. Donenfeld <zx2c4@gentoo.org> | 2016-06-08 10:04:23 +0200 |
commit | 6b942fddbba8dc6102a52a372ea2a7301995b606 (patch) | |
tree | c2288b316504c551c45a9545a6bfdb2d5363916f /mail-mta/opensmtpd | |
parent | net-analyzer/wireshark: Old. (diff) | |
download | gentoo-6b942fddbba8dc6102a52a372ea2a7301995b606.tar.gz gentoo-6b942fddbba8dc6102a52a372ea2a7301995b606.tar.bz2 gentoo-6b942fddbba8dc6102a52a372ea2a7301995b606.zip |
mail-mta/opensmtpd: repair snapshot for v6
Package-Manager: portage-2.3.0_rc1
Diffstat (limited to 'mail-mta/opensmtpd')
-rw-r--r-- | mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch | 50 | ||||
-rw-r--r-- | mail-mta/opensmtpd/opensmtpd-5.9.2.201606071034_p1-r1.ebuild | 94 |
2 files changed, 144 insertions, 0 deletions
diff --git a/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch b/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch new file mode 100644 index 000000000000..9841a7e99457 --- /dev/null +++ b/mail-mta/opensmtpd/files/opensmtpd-5.9.2.201606071034_p1-ipv6-net-pton.patch @@ -0,0 +1,50 @@ +From 988cff352d6b3dd5fe3224d7ebce361fca5c0b4f Mon Sep 17 00:00:00 2001 +From: gilles <gilles@poolp.org> +Date: Wed, 8 Jun 2016 08:23:02 +0200 +Subject: [PATCH] on systems with a broken inet_net_pton() that does not + support IPv6, fallback to broken_net_inet_pton_ipv6() when errno == + EAFNOSUPPORT + +--- + smtpd/to.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/smtpd/to.c b/smtpd/to.c +index 4a6a765..4b592be 100644 +--- a/smtpd/to.c ++++ b/smtpd/to.c +@@ -60,7 +60,7 @@ static int alias_is_filename(struct expandnode *, const char *, size_t); + static int alias_is_include(struct expandnode *, const char *, size_t); + static int alias_is_error(struct expandnode *, const char *, size_t); + +-static int temp_inet_net_pton_ipv6(const char *, void *, size_t); ++static int broken_inet_net_pton_ipv6(const char *, void *, size_t); + + const char * + sockaddr_to_text(struct sockaddr *sa) +@@ -301,8 +301,14 @@ text_to_netaddr(struct netaddr *netaddr, const char *s) + } else { + bits = inet_net_pton(AF_INET6, s, &ssin6.sin6_addr, + sizeof(struct in6_addr)); +- if (bits == -1) +- return 0; ++ if (bits == -1) { ++ if (errno != EAFNOSUPPORT) ++ return 0; ++ bits = broken_inet_net_pton_ipv6(s, &ssin6.sin6_addr, ++ sizeof(struct in6_addr)); ++ if (bits == -1) ++ return 0; ++ } + ssin6.sin6_family = AF_INET6; + memcpy(&ss, &ssin6, sizeof(ssin6)); + #ifdef HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN +@@ -896,7 +902,7 @@ alias_is_error(struct expandnode *alias, const char *line, size_t len) + } + + static int +-temp_inet_net_pton_ipv6(const char *src, void *dst, size_t size) ++broken_inet_net_pton_ipv6(const char *src, void *dst, size_t size) + { + int ret; + int bits; diff --git a/mail-mta/opensmtpd/opensmtpd-5.9.2.201606071034_p1-r1.ebuild b/mail-mta/opensmtpd/opensmtpd-5.9.2.201606071034_p1-r1.ebuild new file mode 100644 index 000000000000..bec67bd144fe --- /dev/null +++ b/mail-mta/opensmtpd/opensmtpd-5.9.2.201606071034_p1-r1.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit multilib user flag-o-matic eutils pam toolchain-funcs autotools systemd versionator + +DESCRIPTION="Lightweight but featured SMTP daemon from OpenBSD" +HOMEPAGE="http://www.opensmtpd.org/" +MY_P="${P}" +if [ $(get_last_version_component_index) -eq 4 ]; then + MY_P="${PN}-$(get_version_component_range 4-)" +fi +SRC_URI="https://www.opensmtpd.org/archives/${MY_P/_}.tar.gz" + +LICENSE="ISC BSD BSD-1 BSD-2 BSD-4" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="libressl pam +mta" + +DEPEND="!libressl? ( dev-libs/openssl:0 ) + libressl? ( dev-libs/libressl ) + sys-libs/zlib + pam? ( virtual/pam ) + sys-libs/db:= + dev-libs/libevent + app-misc/ca-certificates + net-mail/mailbase + net-libs/libasr + !mail-mta/courier + !mail-mta/esmtp + !mail-mta/exim + !mail-mta/mini-qmail + !mail-mta/msmtp[mta] + !mail-mta/netqmail + !mail-mta/nullmailer + !mail-mta/postfix + !mail-mta/qmail-ldap + !mail-mta/sendmail + !mail-mta/ssmtp[mta] +" +RDEPEND="${DEPEND}" + +S=${WORKDIR}/${MY_P/_} + +src_prepare() { + # Use /run instead of /var/run + sed -i -e '/pidfile_path/s:_PATH_VARRUN:"/run/":' openbsd-compat/pidfile.c || die + epatch "${FILESDIR}/${P}-ipv6-net-pton.patch" + epatch_user + eautoreconf +} + +src_configure() { + tc-export AR + AR="$(which "$AR")" econf \ + --with-table-db \ + --with-user-smtpd=smtpd \ + --with-user-queue=smtpq \ + --with-group-queue=smtpq \ + --with-path-socket=/run \ + --with-path-CAfile=/etc/ssl/certs/ca-certificates.crt \ + --sysconfdir=/etc/opensmtpd \ + $(use_with pam auth-pam) +} + +src_install() { + default + newinitd "${FILESDIR}"/smtpd.initd smtpd + systemd_dounit "${FILESDIR}"/smtpd.{service,socket} + use pam && newpamd "${FILESDIR}"/smtpd.pam smtpd + if use mta ; then + dodir /usr/sbin + dosym /usr/sbin/smtpctl /usr/sbin/sendmail + dosym /usr/sbin/smtpctl /usr/bin/sendmail + dosym /usr/sbin/smtpctl /usr/$(get_libdir)/sendmail + fi +} + +pkg_preinst() { + enewgroup smtpd 25 + enewuser smtpd 25 -1 /var/empty smtpd + enewgroup smtpq 252 + enewuser smtpq 252 -1 /var/empty smtpq +} + +pkg_postinst() { + einfo + einfo "Plugins for SQLite, MySQL, PostgreSQL, LDAP, socketmaps," + einfo "Redis, and many other useful addons and filters are" + einfo "available in the mail-filter/opensmtpd-extras package." + einfo +} |