diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2013-12-12 03:00:26 +0000 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2013-12-12 03:00:26 +0000 |
commit | a8c66f20082b4e0d5925e1888a11012aa1e467b4 (patch) | |
tree | ccf4dfdc909c75a52caf74cc0cf8aaf3eef3d630 /net-dns | |
parent | Remove unneeded useflag from metadata.xml (diff) | |
download | historical-a8c66f20082b4e0d5925e1888a11012aa1e467b4.tar.gz historical-a8c66f20082b4e0d5925e1888a11012aa1e467b4.tar.bz2 historical-a8c66f20082b4e0d5925e1888a11012aa1e467b4.zip |
Version bump fixing bugs #485536 and #493354 in the process.
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Manifest-Sign-Key: 0x6F48D3DA05C2DADB!
Diffstat (limited to 'net-dns')
-rw-r--r-- | net-dns/rbldnsd/ChangeLog | 9 | ||||
-rw-r--r-- | net-dns/rbldnsd/Manifest | 29 | ||||
-rw-r--r-- | net-dns/rbldnsd/files/confd-0.997a | 35 | ||||
-rw-r--r-- | net-dns/rbldnsd/files/initd-0.997a | 25 | ||||
-rw-r--r-- | net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch | 329 | ||||
-rw-r--r-- | net-dns/rbldnsd/rbldnsd-0.997a.ebuild | 64 |
6 files changed, 489 insertions, 2 deletions
diff --git a/net-dns/rbldnsd/ChangeLog b/net-dns/rbldnsd/ChangeLog index 64a0522b3ba1..6da6ade506d1 100644 --- a/net-dns/rbldnsd/ChangeLog +++ b/net-dns/rbldnsd/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-dns/rbldnsd # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/rbldnsd/ChangeLog,v 1.26 2013/12/04 18:31:47 mjo Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-dns/rbldnsd/ChangeLog,v 1.27 2013/12/12 03:00:03 mjo Exp $ + +*rbldnsd-0.997a (12 Dec 2013) + + 12 Dec 2013; Michael Orlitzky <mjo@gentoo.org> +files/confd-0.997a, + +files/initd-0.997a, +files/rbldnsd-0.997a-robust-ipv6-test-support.patch, + +rbldnsd-0.997a.ebuild: + Version bump fixing bugs #485536 and #493354 in the process. 04 Dec 2013; Michael Orlitzky <mjo@gentoo.org> metadata.xml: Remove proxy-maintainers herd, use @gentoo.org email address for maintainer, diff --git a/net-dns/rbldnsd/Manifest b/net-dns/rbldnsd/Manifest index 020d232b57af..58e741c8cf53 100644 --- a/net-dns/rbldnsd/Manifest +++ b/net-dns/rbldnsd/Manifest @@ -1,12 +1,39 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA256 + AUX confd 635 SHA256 24ec9e68e2f19e27048b37f5cb502e096de5757bb733807dfddac41ecc304eba SHA512 33208edcce5b91f64fa7b60d3fe6798e97464d839ecf2af4af081080706f623ce9bc16ef62a796e0d1e64e726194974d95868723121e1daa208a9df5e6a53a34 WHIRLPOOL b7f73521c3b76a6d4f4271cbd099296086a61b30b11fc43a14115b2cb9c4c6a2e6414cf604dd4dfaa5936016a78528bfb79e529c18fcdaa332e424ccd2ad7f8a AUX confd-0.997 994 SHA256 bf4459b36f9caa59c6b4a39514e1590e81bec21328c2af88a71a85041349eefd SHA512 c11b2a6e2784c691f593bcfd2c0ac0f2559eff7970d200fad4f8560c9a13db0840380d83403d6e779fd5f0a126cdbe8676bba8352a10b13f60660f7602cba01b WHIRLPOOL f50d39a2941fea98e19b1abdf24ff888e63ac007df42770918f31d49c2900f0c101f85ec7645d7dd60e7a7f469ac1e8b83bf60e92afa6d3a5db41641e49d930c +AUX confd-0.997a 1370 SHA256 dc440295d2a45023a1fdf6f1c16fea7b6c0608082b250b1150dc85278e36fac3 SHA512 5518ceeaf6ae674a301c9b77f8a3654bf6f06c65acdf7107b01f165e92c4cd1c290d89060cc4242ef504e790eca42548cef432cbdbd8e9d05685e25adee234db WHIRLPOOL be2ba3f0bb1ffcb840f2d78ec02e95c8b571430856e0697285ffedc1d7b99ded8034a5e99e7290bd79b99078d5aaad573fd3c58257441c0bc7db8396c4c0215a AUX example 495 SHA256 716411e82cbfdcf93278f1b66578329ca5f7f91d2dcda51959fd047f1c0454b8 SHA512 114b1eefea2017802291113951e5d9d0288a4c862b4ec7163b01b190aaac1b9748e7454b038320409ecc3975f76b7584c791507ec53c91fe86a61261d918b25c WHIRLPOOL 8b926cb970a5cebadff2e4d551ebe58b452be3e3f482a4c8590c4acbd3158fe7b69b537eaefa61dae9a3a2f9f5384fd1e99ec9a7895f2b9e465e7449c68223b1 AUX initd 475 SHA256 e1002cc31ba33061916cfe6caf26ed12b5cca6dd77149ad07304642db9218a62 SHA512 afd0e51f1c189d0e234fd15b617a4374fe858608cf1314230ffc24cac69313e771bb295aaadf37f8e18389a8874dc6c491a35d505d8a30b0c04a863621640384 WHIRLPOOL 971b09cf2dfe685a509f1155101c0eaeea8a55e92d16aebda509604fc9feb42ce2899aaa05a1622568f9dc8e6efd663f828d4e95b9b71d63a0155bbeaa9322f2 AUX initd-0.997 653 SHA256 78b37dbe49cfe4f981e9cce8898cadd06a1586bfb37dce8176bf811bd4948fc8 SHA512 2e40329682c59741bf11abe798dc9524368a625d0ac593f8c4f57979e403a96e08ac245fec350f9f9ecd45d2f6b7f01b1df2c8b6195df98ebfe3e52889e4b26c WHIRLPOOL 8f4d881ff15ac232ec3674edeb3716e07926cf79888822ac5b56c19ee40640a005fcbc6ec3661b87a5fef194e09bd124aaab61a1628d0d0a2df16d78a4a97ea8 +AUX initd-0.997a 651 SHA256 ed11279a20019798cfe23195571b5a5482c102e0bc356a989e74887a353a64e3 SHA512 b5fff4e9c79a497e71171fd4e7c1cbdd644ac641a9f41b88efdafe9f8e49259090776f571ac9fa64b1468001083b7ada06735e2e1104a15b0dabe3e963146a23 WHIRLPOOL 3616d7ad40dbd9c2de9b6837c41ea39263dd63bafbfd55d72cbb3c015db992755e4a6890f10091ef98e004354df438c40c9679f1909922f554f6ab003c114956 AUX rbldnsd-0.996b-asneeded.patch 305 SHA256 7eb48018e8d4a2784d3766a48a1ad88a3771ab161f90aa96d62f4b154a170817 SHA512 d5acb0e893469967eae6251e5d0698b89cda3e1753f6b7fb06f9c2e22e2df8fd952b682dfd8a4444db2907a4a62367cd4a706629acca015507163fff8bc518af WHIRLPOOL ae906c72875b08d0605df0fb652fa8dcf48fa3964eb01afb7651020da312215ebcadf055fc6a1db6d157b7905bce495fb8745cc2915a84f9b091b73d412067e0 +AUX rbldnsd-0.997a-robust-ipv6-test-support.patch 10866 SHA256 a1e29bc52a2d69c73c50300628aba0187556491246c54fbd6bb518e231f0bf89 SHA512 37f47f5305c074a8d1267f0879fe96a311589321a11db61ac27f5cc9db246f126811cc86343a4535a14487a52dc30312c70783470a154e8e750f276098d3e5a8 WHIRLPOOL e2366b5064768b105980d4c8f8572d93b7a24b45f8fddd9ec34944017fc5de3037c6808ffeeb40b6107751ebb617b8dc22aaff36363dbfd6010b207be8b352b4 DIST rbldnsd-0.997.tar.gz 148762 SHA256 c61fc0d9b6efb2cc823e47c4e3bce44a0fbd3e1ca7377dccdc22618bc1c22368 SHA512 d9aff718e77907c1eb800a12493ad211e3130ef2ad1770a2f1e2292e96ea9d815ee687f7445e656b0f0201c4f8707426bd0230d9bd3efef4e2f611262fc5ea84 WHIRLPOOL 4157197309836fca4f4eb7ce45a0fe103e4cd4666258233b0ea2ed24deab26048325b16ba72d9cdbbac39b513c7957b152bd4a0e564f2d7cec594098d701bf6c +DIST rbldnsd-0.997a.tar.gz 144771 SHA256 9c17c6bde6995058204a66805444039d31523a7d4ef40cec059e505a0882a8ef SHA512 9a3e1a0ad2cd9dd08bcc114c70213a875e984f3761fa32c44fe544d8173f54330fe355ad229a120e64b8f4c8286187d0baa055526d3a85bc846df070bb213529 WHIRLPOOL b453396c9876fd4972c6028b5916ae9717d60d555e5bb33bc97f0a8910ee516a80d1a3cb6030a3850ec304794f4a00fd9f3dced0d5c7fd1388e7d87d53fedb24 DIST rbldnsd_0.996b.tar.gz 113128 SHA256 475afe5be8729a76b7c23e2f3d5ce1c773775140406a58bfb7477fac5a528342 SHA512 ff5060d719becd7b1e08cd86f213830a1232774abce3de56599743c9e44b4e3d59e7f9ace18d2619c967038aad728908091efb2ac1591a5ca6c7aa9f84d3a084 WHIRLPOOL 1016bb55746fe772b44705ad65b9153971cc34a737697e3b5d2a0cd8972341e9ecacf8e9c28285a2729c18181891d38569b3b8e5a72e7b3ab6b175d2f123098b EBUILD rbldnsd-0.996b.ebuild 1327 SHA256 ee522dc4b3a6cbc22749f4cf3fd1effc5d8c64447a1d40aa4cf39e969d3b54cd SHA512 a3b0d9ac1c0eb773c820af7a5289184329d6cf1f162395bb1442170251e1ac27c14ac214818fc750ddbfc58c527b0fa7175f282bdc6b07493bde8ed0e3fa21d4 WHIRLPOOL 266e696f3ed2d53d46d8fcca7dca4e49a57e8e6f19f1120fbe7827dfba40a7dfdefd0ae4cd8882e5827b45e79b3ad68465703b69dda20af0509ff5b0ca550a53 EBUILD rbldnsd-0.997.ebuild 1486 SHA256 3a17ebad94dccbd32aa0abed6b3e3e849c4abdd0f5a579ff3d0b9cf59de5f057 SHA512 84ff356fdbe0ca230413a51fd226da297f4dc4a8a6fdfa28dad66bde49f074c45ba3ddff346da3bf018f6ee3c5242ecb38f0d5271790ed6652f08f98f4d83035 WHIRLPOOL dbdbc68b31b2f48c4215bc6074442f4ee8a3173a7aec6d25a0efd780b1c3a7ec6717ef7449f6a915175afc037cbe75878f643bf71278f56d6c0c8e58027c162d -MISC ChangeLog 3672 SHA256 05931e58bb6a8c0356119f4fa5d45da775f2292cb9323b73c365ce52a6490fc4 SHA512 8d59571638642c496f7d116c03d6d82b58a5e0a31264145e51d169787c4a37c428d94cd9e062360a88a86f5d4ecf925f2958312123a1aab617aa135a9c92d438 WHIRLPOOL 50a8690c01f50fd36656573f814e8cf868e74279878f3997c283af0f7f3570cac6746e2c5cd40d803b794d8a4c5a39745bae3e682f327f66a8d3e8abcbd1dc85 +EBUILD rbldnsd-0.997a.ebuild 1561 SHA256 e0f7bdc3069b7407d5c0fe379c69d7a7ad9d77aa4521b91b0706dcd142a7a968 SHA512 22f03524fd3319a46cad7b23664b9bdf8fb5c97a78b88f889f9e4a96f4d879033d3e5f1c714159f069e6567ab6d2c0c6749f1d29be3f57ada9052183b0b0e032 WHIRLPOOL 9e309f2380a3f963e326faff51a4c172d9fea6b4b6752cc9a140b38cde47d7875cc12ec74459524b42ba9548dd3764047d8963dcbbc57f208b4f1e9e971bbe29 +MISC ChangeLog 3940 SHA256 a5d375dc743ac5e4bba588d5709ba42f5d5f34fe44bd3551b830281df3517117 SHA512 6aea1f9de5f888cca28ea07c8b7f88af3c39a1aeba892fdf8f291dd9c2db5d9e7c7beb22c9e7a9631cbb56d79fb36c2a64b70666a47326291ef3c111a272845a WHIRLPOOL 8e91a20dfc53fac8285c2cebf2e2e974c234c474d92200ff092b1c79d832a348c7a75d6a9f2dc94973f5e8b344d0465455cd619122129664296e9058e0d55d68 MISC metadata.xml 1119 SHA256 8c153c63c1d5cb7712b6643a206a70c4ca43923710777b8b09489b0718ec67ff SHA512 0456e0c642454c6242d7ca30477292612436d15c8d94eb513bfa6e957eb9becf4dac871357e74dd2026abf0ea2e99ec61a1d590fbb162f90dcd718bd0e8a43c6 WHIRLPOOL 5354b24ec62d0ec3259bea6f45a3f45816a2b15002f09f2fe7d768e96c68938ec8b634f7b92530ea2ee965211c075803e04c7f3b38535d59874aaaecc3ecc166 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (GNU/Linux) + +iQJ8BAEBCABmBQJSqSa5XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxNEU5RDcyRDdCMUFGREVGQzBCNDFDMUY2 +RjQ4RDNEQTA1QzJEQURCAAoJEG9I09oFwtrbrZgQAIwvPhsrDND1R6FOeUchbnWC +gHYo3R+lO4cMI4ll+lrNe7/x1/h5+HOtSKYXtpKS2kCZZvgThoOk10NJA+yn7qZb +o5ejT5WFXuFiYqT4IUgucJhp7qv38L6EFnXws9p8y4qFJnfe5TX2kZWkwHMksCqM +g9zt2gL2qULWRZ/fR7cz77di1ma4KPDTd5Rhmu6luUhrd6bQjHfOSrqn3AXrKn7w +SwCKisNpKypJPem8TeKHBNQEip4GN5l/FrET8+K68MS6YOqthyM+QugicXWXkhrQ +apSTpSv5CYbSA7M4Me3SrLquepupLa6JfUzuCY/nUs2xp40k/brEoDZyW/E354ID +7ZKQBdmOtyy8GkOLWN2kg6iE+IYoyW8nByQgPitHm+wBNEMAbVUWoG2SvUqLFpm0 +QsiuIOJCL6pww9Nn7j8JaAze4hztBmych1//c00FxM+uICJ0UXJ3nCJZne7q2mlQ +jck/avvHXuEWWpK0fjcFm3E7mykNuxX8qEwGXTjdjVhqkq9iK7mvszeH5QSMq6nk +EJEsgjacUHyzvRme+0XK9QwLHZTniQp8Ml49veNMljZq+9tVP23L9CqJVn8N4wrP +TW6phi7CZt0Chx3mhOs0S7foYL4/fmA7qRL8w2S88ryZ2eycNpv+Fo40dCpzbHbt +7LMQYB9qLD6XA6s1Btv2 +=y40G +-----END PGP SIGNATURE----- diff --git a/net-dns/rbldnsd/files/confd-0.997a b/net-dns/rbldnsd/files/confd-0.997a new file mode 100644 index 000000000000..0fb7685001e0 --- /dev/null +++ b/net-dns/rbldnsd/files/confd-0.997a @@ -0,0 +1,35 @@ +# A whitespace-separated list of addresses on which to listen. The +# syntax is "host:port", where the port defaults to 53. +# +# Note that by default the rbldnsd init script does not require any +# interfaces other than lo to be "up" (see bug #439092). So if you +# LISTEN on a non-loopback interface, you should specify a dependency +# on that interface using rc_need. An example is given below assuming +# that net.lan0 provides 192.168.0.1. +# +# rc_need="net.lan0" +# +# LISTEN="127.0.0.1 +# 192.168.0.1" +# +LISTEN="localhost" + + +# A whitespace-separated list of RBL zones. For the correct syntax, please +# see the rbldnsd(8) man page. The following $ZONES will look for +# files named "badguys.example.com" and "spammers.example.net" (in the +# appropriate format) under /var/db/rbldnsd, and use those same names +# for the blacklists contained therein. +ZONES="badguys.example.com:ip4set:badguys.example.com + spammers.example.net:ip4tset:spammers.example.net" + + +# Add any additional options for the rbldnsd daemon below. The -a and +# -vv below are suggested for performance/security reasons. They are +# described in the man page. +# +# The rootdir (-r) and PID (-p) options are passed automatically, with +# rootdir set to /var/db/rbldnsd (where you should put your zone +# files). The daemon will run as the rbldns user, which was created by +# portage. +OPTIONS="-a -vv" diff --git a/net-dns/rbldnsd/files/initd-0.997a b/net-dns/rbldnsd/files/initd-0.997a new file mode 100644 index 000000000000..13806265c25b --- /dev/null +++ b/net-dns/rbldnsd/files/initd-0.997a @@ -0,0 +1,25 @@ +#!/sbin/runscript +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/rbldnsd/files/initd-0.997a,v 1.1 2013/12/12 03:00:03 mjo Exp $ + +start() { + ebegin "Starting rbldnsd" + + start-stop-daemon --start --quiet --pidfile /run/rbldnsd.pid \ + --exec /usr/sbin/rbldnsd -- \ + -r /var/db/rbldnsd \ + -p /run/rbldnsd.pid \ + $(for x in ${LISTEN}; do echo "-b ${x}"; done) \ + ${OPTIONS} \ + ${ZONES} + + eend $? +} + +stop() { + ebegin "Stopping rbldnsd" + start-stop-daemon --stop --quiet --pidfile /run/rbldnsd.pid \ + --exec /usr/sbin/rbldnsd + eend $? +} 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 new file mode 100644 index 000000000000..5621075fbae2 --- /dev/null +++ b/net-dns/rbldnsd/files/rbldnsd-0.997a-robust-ipv6-test-support.patch @@ -0,0 +1,329 @@ +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 ++ * - http://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.997a.ebuild b/net-dns/rbldnsd/rbldnsd-0.997a.ebuild new file mode 100644 index 000000000000..533a8426681f --- /dev/null +++ b/net-dns/rbldnsd/rbldnsd-0.997a.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/rbldnsd/rbldnsd-0.997a.ebuild,v 1.1 2013/12/12 03:00:03 mjo Exp $ + +EAPI=5 +PYTHON_COMPAT=( python{2_6,2_7} ) + +inherit eutils toolchain-funcs user python-single-r1 + +DESCRIPTION="DNS server designed to serve blacklist zones" +HOMEPAGE="http://www.corpit.ru/mjt/rbldnsd.html" +SRC_URI="http://www.corpit.ru/mjt/rbldnsd/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~hppa ~sparc ~x86 ~x86-fbsd" +IUSE="ipv6 test zlib" + +RDEPEND="zlib? ( sys-libs/zlib )" +DEPEND="${RDEPEND} + test? ( ${PYTHON_DEPS} + dev-python/pydns:2[${PYTHON_USEDEP}] )" + +src_prepare() { + epatch "${FILESDIR}/${P}-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() { + dosbin rbldnsd + doman rbldnsd.8 + keepdir /var/db/rbldnsd + dodoc CHANGES* TODO NEWS README* + newinitd "${FILESDIR}"/initd-${PV} rbldnsd + newconfd "${FILESDIR}"/confd-${PV} rbldnsd +} + +pkg_postinst() { + enewgroup rbldns + enewuser rbldns -1 -1 /var/db/rbldnsd rbldns + chown rbldns:rbldns /var/db/rbldnsd +} |