From deba8115d2c2af26df42966b91ef04ff4dd79cde Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 14 May 2020 11:09:11 +0100 Subject: gentoo resync : 14.05.2020 --- net-dns/rbldnsd/Manifest | 4 +- .../rbldnsd-0.997a-robust-ipv6-test-support.patch | 329 --------------------- net-dns/rbldnsd/rbldnsd-0.998b-r2.ebuild | 2 +- net-dns/rbldnsd/rbldnsd-0.998b.ebuild | 68 ----- 4 files changed, 2 insertions(+), 401 deletions(-) delete mode 100644 net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch delete mode 100644 net-dns/rbldnsd/rbldnsd-0.998b.ebuild (limited to 'net-dns/rbldnsd') diff --git a/net-dns/rbldnsd/Manifest b/net-dns/rbldnsd/Manifest index 36e8de7302b8..8a05bb134e43 100644 --- a/net-dns/rbldnsd/Manifest +++ b/net-dns/rbldnsd/Manifest @@ -1,7 +1,5 @@ AUX confd-0.997a 1375 BLAKE2B 61980080ecad7a64ed547f19de7ca827057cca1ed4c4c724c5600faa8e1f5ae2845fef95a39a79ba297155ca7a0c33e1ed38eff86de65e19cc6c38fdd7b89944 SHA512 c26f561a0906704c8eb32d8748428b120489cb02d0c9b5ea814b7b4eb71e2ccdddc153d442ebcc46789e65c8c3aa3a305bbf56e6030f3b9994c6d7d247120669 AUX initd-0.997a 546 BLAKE2B 6f7a5220598bc37e7b3c59db65fd38f17ed68c407a9ff1c486c2052fba166fbcd854bca5dc6cedf59b497998d968077b39e790168dc7e93ee62fa29b4c5864fa SHA512 2d18c5126ee1cf79e45881cf358f9d9299387dc1b2c0ee2433f85f617694ba11fb2c80703c18002995dc3d1f3d9d561b9b473a9c705b5b0c8ff282385b2e3170 -AUX rbldnsd-0.997a-robust-ipv6-test-support.patch 10867 BLAKE2B b2470f4a364c490b01cc8c2349d18d54ce6bc44f0113883bab763742cd798a0edec8add591a716ea99ac2d121bb1070bda1109d40018a91c162aaede3a2bc31d SHA512 a502df0c102a92dbccba482741ef628cde409f6d87d8467b66a0e4f595f8b28b9e99db0832ca27e3dbf317018b33f666b8bb8962988177cfaf1e0d28b6bf21d6 DIST rbldnsd-0.998b.tar.gz 154022 BLAKE2B f0bf03bef69853d45c3546c6fd3e58ffb95e76192ecb64f71f6799c6041749b1d117bed2bb21edbf1dec81d1684334b3af7d60b35d49089efb3a5e28752be6db SHA512 9b9c8694824a99b4ad120a22dbe4b05351867434e43ed0d8137990d3ece90ed67349965b6ed0450066d6663c1858545774c733b0d7afff304095de500ba30175 -EBUILD rbldnsd-0.998b-r2.ebuild 1381 BLAKE2B 16628ac9446d7461667a3312d594fe5ff062c4c588279476c95bf85585714ddd2078dca42013cfe10a415c875c4aa7d26bd2e310ddcd546945eb5870d64088d0 SHA512 97eaa7053f834e7a9085399639c04a09fc93e4a9099237fc8640ae990188a48c50adb4ff405d218af130b042eb93c8b02e2e5c612b756ea29e8a076ac40f54dc -EBUILD rbldnsd-0.998b.ebuild 1472 BLAKE2B 7a7ebdef464ea1998c1360e8d4f1f4482b969a5dfa7f5b106fb83afaa4f7318350857df6bfb638aad2452f6fc8b7b145b03f0a0d989959813e0baf0bbeb00388 SHA512 949ef4af3ddba281fc09ab95f11a8fa5ce7584e7aef18862b8b8095915a184c9973a8678d1da91d3383bd23edf97d07180cd30a17af08b2face5866af80788e7 +EBUILD rbldnsd-0.998b-r2.ebuild 1380 BLAKE2B 6a66f2ccc6813a6dd8bc6f644558a7b76d6f31815ce0d16b1075c6e4174faf32cff23f6afe18a046eeea4e6bb58740245a7e880b79424d0cbc397da965935b3d SHA512 044a71cc5b855cfe4003a5e5ff9f10f9adbb0f906d774c803b8023640985a302bee1e1941da9d96db8c27a88424e38ba91a915c47d6d0cff0968c0ae95c3b363 MISC metadata.xml 1219 BLAKE2B 78d1de3d2e056e8d1441e929686a9cf1d073348f2b58ef263ffee7c6e9c03ad59b387c6112fdcb845915b1d5f41eaf6825f21510e7d085852ab49567412eb867 SHA512 23bddced94702b936cadbaf9a6a51cfd8506715a766cbef9dbb0fb69bf02443e0c8636b6237f98fd3922d0c43fb17c7c2850074e6bdefc2c9af3731a01971f8f diff --git a/net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch b/net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch deleted file mode 100644 index e1ac1535dc99..000000000000 --- a/net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch +++ /dev/null @@ -1,329 +0,0 @@ -diff --git a/NEWS b/NEWS -index 8d8bdd9..4d8c01d 100644 ---- a/NEWS -+++ b/NEWS -@@ -1,6 +1,19 @@ - This file describes user-visible changes in rbldnsd. - Newer news is at the top. - -+Next release -+ -+ - fix tests for systems without ipv6 support, or when ipv6 is -+ disabled in rbldnsd at compile-time -+ -+ - fix tests for API change in pydns >= 2.3.6 -+ -+ - It is no longer an error to request binding to a particular -+ address/port more than once. (The subsequent requests are simply -+ ignored.) (This avoids confusion on certain systems/configurations -+ where gethostbyname("localhost") can return 127.0.0.1 multiple -+ times.) -+ - 0.997a (23 Jul 2013) - - - minor fixes/changes in packaging, no code changes. -diff --git a/rbldnsd.c b/rbldnsd.c -index abf1d01..8322bdd 100644 ---- a/rbldnsd.c -+++ b/rbldnsd.c -@@ -203,10 +203,79 @@ static volatile int signalled; - #define SIGNALLED_ZSTATS 0x10 - #define SIGNALLED_TERM 0x20 - -+static inline int sockaddr_in_equal(const struct sockaddr_in *addr1, -+ const struct sockaddr_in *addr2) -+{ -+ return (addr1->sin_port == addr2->sin_port -+ && addr1->sin_addr.s_addr == addr2->sin_addr.s_addr); -+} -+ -+#ifndef NO_IPv6 -+static inline int sockaddr_in6_equal(const struct sockaddr_in6 *addr1, -+ const struct sockaddr_in6 *addr2) -+{ -+ if (memcmp(addr1->sin6_addr.s6_addr, addr2->sin6_addr.s6_addr, 16) != 0) -+ return 0; -+ return (addr1->sin6_port == addr2->sin6_port -+ && addr1->sin6_flowinfo == addr2->sin6_flowinfo -+ && addr1->sin6_scope_id == addr2->sin6_scope_id); -+} -+#endif -+ -+static inline int sockaddr_equal(const struct sockaddr *addr1, -+ const struct sockaddr *addr2) -+{ -+ if (addr1->sa_family != addr2->sa_family) -+ return 0; -+ switch (addr1->sa_family) { -+ case AF_INET: -+ return sockaddr_in_equal((const struct sockaddr_in *)addr1, -+ (const struct sockaddr_in *)addr2); -+#ifndef NO_IPv6 -+ return sockaddr_in6_equal((const struct sockaddr_in6 *)addr1, -+ (const struct sockaddr_in6 *)addr2); -+#endif -+ default: -+ error(0, "unknown address family (%d)", addr1->sa_family); -+ } -+} -+ -+/* already_bound(addr, addrlen) -+ * -+ * Determine whether we've already bound to a particular address. -+ * This is here mostly to deal with the fact that on certain systems, -+ * gethostbyname()/getaddrinfo() can return a duplicate 127.0.0.1 -+ * for 'localhost'. See -+ * - https://sourceware.org/bugzilla/show_bug.cgi?id=4980 -+ * - https://bugzilla.redhat.com/show_bug.cgi?id=496300 -+ */ -+static int already_bound(const struct sockaddr *addr, socklen_t addrlen) { -+#ifdef NO_IPv6 -+ struct sockaddr_in addr_buf; -+#else -+ struct sockaddr_in6 addr_buf; -+#endif -+ struct sockaddr *boundaddr = (struct sockaddr *)&addr_buf; -+ socklen_t buflen; -+ int i; -+ -+ for (i = 0; i < numsock; i++) { -+ buflen = sizeof(addr_buf); -+ if (getsockname(sock[i], boundaddr, &buflen) < 0) -+ error(errno, "getsockname failed"); -+ if (buflen == addrlen && sockaddr_equal(boundaddr, addr)) -+ return 1; -+ } -+ return 0; -+} -+ - #ifdef NO_IPv6 - static void newsocket(struct sockaddr_in *sin) { - int fd; - const char *host = ip4atos(ntohl(sin->sin_addr.s_addr)); -+ -+ if (already_bound((struct sockaddr *)sin, sizeof(*sin))) -+ return; - if (numsock >= MAXSOCK) - error(0, "too many listening sockets (%d max)", MAXSOCK); - fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); -@@ -223,6 +292,8 @@ static int newsocket(struct addrinfo *ai) { - int fd; - char host[NI_MAXHOST], serv[NI_MAXSERV]; - -+ if (already_bound(ai->ai_addr, ai->ai_addrlen)) -+ return 1; - if (numsock >= MAXSOCK) - error(0, "too many listening sockets (%d max)", MAXSOCK); - fd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol); -diff --git a/rbldnsd.py b/rbldnsd.py -index 9300ef2..4b78dee 100644 ---- a/rbldnsd.py -+++ b/rbldnsd.py -@@ -2,6 +2,7 @@ - - - """ -+import errno - from itertools import count - import subprocess - from tempfile import NamedTemporaryFile, TemporaryFile -@@ -12,6 +13,14 @@ try: - import DNS - except ImportError: - raise RuntimeError("The pydns library is not installed") -+try: -+ from DNS import SocketError as DNS_SocketError -+except ImportError: -+ class DNS_SocketError(Exception): -+ """ Dummy, never raised. -+ -+ (Older versions of pydns before 2.3.6 do not raise SocketError.) -+ """ - - DUMMY_ZONE_HEADER = """ - $SOA 0 example.org. hostmaster.example.com. 0 1h 1h 2d 1h -@@ -113,7 +122,6 @@ class Rbldnsd(object): - stderr=self.stderr) - - # wait for rbldnsd to start responding -- time.sleep(0.1) - for retry in count(): - if daemon.poll() is not None: - raise DaemonError( -@@ -124,12 +132,18 @@ class Rbldnsd(object): - break - except QueryRefused: - break -+ except DNS_SocketError as ex: -+ # pydns >= 2.3.6 -+ wrapped_error = ex.args[0] -+ if wrapped_error.errno != errno.ECONNREFUSED: -+ raise - except DNS.DNSError as ex: -+ # pydns < 2.3.6 - if str(ex) != 'no working nameservers found': - raise -- elif retries > 10: -- raise DaemonError( -- "rbldnsd does not seem to be responding") -+ if retry > 10: -+ raise DaemonError("rbldnsd does not seem to be responding") -+ time.sleep(0.1) - - def _stop_daemon(self): - daemon = self._daemon -@@ -150,6 +164,22 @@ class Rbldnsd(object): - raise DaemonError("rbldnsd exited with code %d" - % daemon.returncode) - -+ @property -+ def no_ipv6(self): -+ """ Was rbldnsd compiled with -DNO_IPv6? -+ """ -+ # If rbldnsd was compiled with -DNO_IPv6, the (therefore -+ # unsupported) '-6' command-line switch will not be described -+ # in the help message -+ cmd = [self.daemon_bin, '-h'] -+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) -+ help_message = proc.stdout.readlines() -+ if proc.wait() != 0: -+ raise subprocess.CalledProcessError(proc.returncode, cmd) -+ return not any(line.lstrip().startswith('-6 ') -+ for line in help_message) -+ -+ - class TestRbldnsd(unittest.TestCase): - def test(self): - rbldnsd = Rbldnsd() -diff --git a/test_acl.py b/test_acl.py -index d93ca0a..10bed1c 100644 ---- a/test_acl.py -+++ b/test_acl.py -@@ -1,5 +1,8 @@ - """ Tests for the acl dataset - """ -+from functools import wraps -+import socket -+import sys - from tempfile import NamedTemporaryFile - import unittest - -@@ -9,6 +12,35 @@ __all__ = [ - 'TestAclDataset', - ] - -+try: -+ from unittest import skipIf -+except ImportError: -+ # hokey replacement (for python <= 2.6) -+ def skipIf(condition, reason): -+ if condition: -+ def decorate(f): -+ @wraps(f) -+ def skipped(*args, **kw): -+ sys.stderr.write("skipped test: %s " % reason) -+ return skipped -+ return decorate -+ else: -+ return lambda f: f -+ -+def _have_ipv6(): -+ # Check for IPv6 support -+ if not getattr(socket, 'has_ipv6', False): -+ return False # no python support for ipv6 -+ elif Rbldnsd().no_ipv6: -+ return False # rbldnsd compiled with -DNO_IPv6 -+ try: -+ socket.socket(socket.AF_INET6, socket.SOCK_DGRAM).close() -+ except socket.error: -+ return False # no kernel (or libc) support for ipv6? -+ return True -+ -+no_ipv6 = not _have_ipv6() -+ - def daemon(acl, addr='localhost'): - """ Create an Rbldnsd instance with given ACL - """ -@@ -33,11 +65,13 @@ class TestAclDataset(unittest.TestCase): - addr='127.0.0.1') as dnsd: - self.assertEqual(dnsd.query('test.example.com'), 'Success') - -+ @skipIf(no_ipv6, "IPv6 unsupported") - def test_refuse_ipv6(self): - with daemon(acl=["::1 :refuse"], - addr='::1') as dnsd: - self.assertRaises(QueryRefused, dnsd.query, 'test.example.com') - -+ @skipIf(no_ipv6, "IPv6 unsupported") - def test_pass_ipv6(self): - with daemon(acl=[ "0/0 :refuse", - "0::1 :pass" ], -diff --git a/test_ip4trie.py b/test_ip4trie.py -index fe9e78f..2cce09b 100644 ---- a/test_ip4trie.py -+++ b/test_ip4trie.py -@@ -9,7 +9,7 @@ __all__ = [ - ] - - def ip4trie(zone_data): -- """ Run rbldnsd with an ip6trie dataset -+ """ Run rbldnsd with an ip4trie dataset - """ - dnsd = Rbldnsd() - dnsd.add_dataset('ip4trie', ZoneFile(zone_data)) -diff --git a/test_ip6trie.py b/test_ip6trie.py -index d3600db..377c5dd 100644 ---- a/test_ip6trie.py -+++ b/test_ip6trie.py -@@ -15,15 +15,6 @@ def ip6trie(zone_data): - dnsd.add_dataset('ip6trie', ZoneFile(zone_data)) - return dnsd - --def rfc3152(ip6addr, domain='example.com'): -- from socket import inet_pton, AF_INET6 -- from struct import unpack -- -- bytes = unpack("16B", inet_pton(AF_INET6, ip6addr)) -- nibbles = '.'.join("%x.%x" % (byte & 0xf, (byte >> 4) & 0xf) -- for byte in reversed(bytes)) -- return "%s.%s" % (nibbles, domain) -- - class TestIp6TrieDataset(unittest.TestCase): - def test_exclusion(self): - with ip6trie(["dead::/16 listed", -@@ -31,5 +22,35 @@ class TestIp6TrieDataset(unittest.TestCase): - self.assertEqual(dnsd.query(rfc3152("dead::beef")), None) - self.assertEqual(dnsd.query(rfc3152("dead::beee")), "listed") - -+ -+def rfc3152(ip6addr, domain='example.com'): -+ return "%s.%s" % ('.'.join(reversed(_to_nibbles(ip6addr))), domain) -+ -+def _to_nibbles(ip6addr): -+ """ Convert ip6 address (in rfc4291 notation) to a sequence of nibbles -+ -+ NB: We avoid the use of socket.inet_pton(AF_INET6, ip6addr) here -+ because it fails (with 'error: can't use AF_INET6, IPv6 is -+ disabled') when python has been compiled without IPv6 support. See -+ http://www.corpit.ru/pipermail/rbldnsd/2013q3/001181.html -+ -+ """ -+ def _split_words(addr): -+ return [ int(w, 16) for w in addr.split(':') ] if addr else [] -+ -+ if '::' in ip6addr: -+ head, tail = [ _split_words(s) for s in ip6addr.split('::', 1) ] -+ nzeros = 8 - len(head) - len(tail) -+ assert nzeros >= 0 -+ words = head + [ 0 ] * nzeros + tail -+ else: -+ words = _split_words(ip6addr) -+ -+ assert len(words) == 8 -+ for word in words: -+ assert 0 <= word <= 0xffff -+ -+ return ''.join("%04x" % word for word in words) -+ - if __name__ == '__main__': - unittest.main() diff --git a/net-dns/rbldnsd/rbldnsd-0.998b-r2.ebuild b/net-dns/rbldnsd/rbldnsd-0.998b-r2.ebuild index 2f619e646646..05062e179054 100644 --- a/net-dns/rbldnsd/rbldnsd-0.998b-r2.ebuild +++ b/net-dns/rbldnsd/rbldnsd-0.998b-r2.ebuild @@ -11,7 +11,7 @@ SRC_URI="https://github.com/spamhaus/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-2" SLOT="0" -KEYWORDS="amd64 ~hppa ~sparc x86" +KEYWORDS="amd64 hppa ~sparc x86" IUSE="ipv6 zlib" RDEPEND="zlib? ( sys-libs/zlib )" diff --git a/net-dns/rbldnsd/rbldnsd-0.998b.ebuild b/net-dns/rbldnsd/rbldnsd-0.998b.ebuild deleted file mode 100644 index 9fb92e9d2adb..000000000000 --- a/net-dns/rbldnsd/rbldnsd-0.998b.ebuild +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 1999-2020 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -PYTHON_COMPAT=( python2_7 ) - -inherit toolchain-funcs user python-any-r1 - -DESCRIPTION="DNS server designed to serve blacklist zones" -HOMEPAGE="https://rbldnsd.io/" -SRC_URI="https://github.com/spamhaus/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="amd64 hppa ~sparc x86" -IUSE="ipv6 test zlib" -RESTRICT="!test? ( test )" - -RDEPEND="zlib? ( sys-libs/zlib )" -DEPEND="${RDEPEND}" -BDEPEND=" - test? ( - ${RDEPEND} - ${PYTHON_DEPS} - $(python_gen_any_dep 'dev-python/pydns:2[${PYTHON_USEDEP}]') - )" - -PATCHES=( - "${FILESDIR}/rbldnsd-0.997a-robust-ipv6-test-support.patch" -) - -src_configure() { - # The ./configure file is handwritten and doesn't support a `make - # install` target, so there are no --prefix options. The econf - # function appends those automatically, so we can't use it. - ./configure \ - $(use_enable ipv6) \ - $(use_enable zlib) \ - || die "./configure failed" -} - -src_compile() { - emake \ - AR="$(tc-getAR)" \ - CC="$(tc-getCC)" \ - RANLIB="$(tc-getRANLIB)" -} - -src_test() { - emake check \ - CC="$(tc-getCC)" \ - PYTHON="${PYTHON}" -} - -src_install() { - einstalldocs - dosbin rbldnsd - doman rbldnsd.8 - keepdir /var/db/rbldnsd - newinitd "${FILESDIR}"/initd-0.997a rbldnsd - newconfd "${FILESDIR}"/confd-0.997a rbldnsd -} - -pkg_preinst() { - enewgroup rbldns - enewuser rbldns -1 -1 -1 rbldns - fowners rbldns:rbldns /var/db/rbldnsd -} -- cgit v1.2.3