Gentoo Archives: gentoo-commits

From: Sven Wegener <swegener@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/, net-dns/pdns-recursor/files/
Date: Sat, 02 Apr 2022 14:10:06
Message-Id: 1648908524.fbcc363ce82b0b66f07e51825776e9a9a833aaad.swegener@gentoo
1 commit: fbcc363ce82b0b66f07e51825776e9a9a833aaad
2 Author: Sven Wegener <swegener <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 2 14:02:37 2022 +0000
4 Commit: Sven Wegener <swegener <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 2 14:08:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbcc363c
7
8 net-dns/pdns-recursor: Revision bump, bug #713746 and #836580
9
10 Closes: https://bugs.gentoo.org/713746
11 Closes: https://bugs.gentoo.org/836580
12 Package-Manager: Portage-3.0.30, Repoman-3.0.3
13 Signed-off-by: Sven Wegener <swegener <AT> gentoo.org>
14
15 .../files/pdns-recursor-4.6.1-parseACL.patch | 13 +++
16 .../pdns-recursor/pdns-recursor-4.6.1-r1.ebuild | 92 ++++++++++++++++++++++
17 2 files changed, 105 insertions(+)
18
19 diff --git a/net-dns/pdns-recursor/files/pdns-recursor-4.6.1-parseACL.patch b/net-dns/pdns-recursor/files/pdns-recursor-4.6.1-parseACL.patch
20 new file mode 100644
21 index 000000000000..0d29a24f160f
22 --- /dev/null
23 +++ b/net-dns/pdns-recursor/files/pdns-recursor-4.6.1-parseACL.patch
24 @@ -0,0 +1,13 @@
25 +diff --git i/pdns_recursor.cc w/pdns_recursor.cc
26 +index 1700a9fde..ed09f2680 100644
27 +--- i/pdns_recursor.cc
28 ++++ w/pdns_recursor.cc
29 +@@ -4844,7 +4844,7 @@ void parseACLs()
30 +
31 + auto allowFrom = parseACL("allow-from-file", "allow-from");
32 +
33 +- if(allowFrom->size() == 0) {
34 ++ if(allowFrom != nullptr && allowFrom->size() == 0) {
35 + if(::arg()["local-address"]!="127.0.0.1" && ::arg().asNum("local-port")==53)
36 + g_log<<Logger::Warning<<"WARNING: Allowing queries from all IP addresses - this can be a security risk!"<<endl;
37 + allowFrom = nullptr;
38
39 diff --git a/net-dns/pdns-recursor/pdns-recursor-4.6.1-r1.ebuild b/net-dns/pdns-recursor/pdns-recursor-4.6.1-r1.ebuild
40 new file mode 100644
41 index 000000000000..fff451a76927
42 --- /dev/null
43 +++ b/net-dns/pdns-recursor/pdns-recursor-4.6.1-r1.ebuild
44 @@ -0,0 +1,92 @@
45 +# Copyright 1999-2022 Gentoo Authors
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +EAPI=7
49 +
50 +LUA_COMPAT=( lua5-{1..4} luajit )
51 +
52 +inherit flag-o-matic lua-single
53 +
54 +DESCRIPTION="The PowerDNS Recursor"
55 +HOMEPAGE="https://www.powerdns.com/"
56 +SRC_URI="https://downloads.powerdns.com/releases/${P/_/-}.tar.bz2"
57 +
58 +LICENSE="GPL-2"
59 +SLOT="0"
60 +KEYWORDS="~amd64 ~arm ~x86"
61 +IUSE="debug dnstap snmp sodium systemd test"
62 +REQUIRED_USE="${LUA_REQUIRED_USE}"
63 +RESTRICT="!test? ( test )"
64 +
65 +DEPEND="${LUA_DEPS}
66 + dnstap? ( dev-libs/fstrm )
67 + systemd? ( sys-apps/systemd:0= )
68 + snmp? ( net-analyzer/net-snmp )
69 + sodium? ( dev-libs/libsodium:= )
70 + elibc_glibc? (
71 + arm? ( >=sys-libs/glibc-2.34 )
72 + x86? ( >=sys-libs/glibc-2.34 )
73 + )
74 + dev-libs/openssl:=
75 + >=dev-libs/boost-1.35:=[context]"
76 +RDEPEND="${DEPEND}
77 + !<net-dns/pdns-2.9.20-r1
78 + acct-user/pdns
79 + acct-group/pdns"
80 +BDEPEND="virtual/pkgconfig"
81 +
82 +S="${WORKDIR}"/${P/_/-}
83 +
84 +PATCHES=(
85 + "${FILESDIR}"/${P}-parseACL.patch
86 +)
87 +
88 +pkg_setup() {
89 + lua-single_pkg_setup
90 + filter-flags -ftree-vectorize
91 + append-lfs-flags
92 + append-cppflags -D_TIME_BITS=64
93 +}
94 +
95 +src_configure() {
96 + econf \
97 + --sysconfdir=/etc/powerdns \
98 + --with-nod-cache-dir=/var/lib/powerdns \
99 + --with-service-user=pdns \
100 + --with-service-group=pdns \
101 + --with-lua="${ELUA}" \
102 + $(use_enable debug verbose-logging) \
103 + $(use_enable systemd) \
104 + $(use_enable dnstap dnstap) \
105 + $(use_enable test unit-tests) \
106 + $(use_with sodium libsodium) \
107 + $(use_with snmp net-snmp)
108 +}
109 +
110 +src_install() {
111 + default
112 +
113 + mv "${D}"/etc/powerdns/recursor.conf{-dist,}
114 +
115 + # set defaults: setuid=nobody, setgid=nobody
116 + sed -i \
117 + -e 's/^# set\([ug]\)id=$/set\1id=pdns/' \
118 + -e 's/^# quiet=$/quiet=on/' \
119 + -e 's/^# chroot=$/chroot=\/var\/lib\/powerdns/' \
120 + "${D}"/etc/powerdns/recursor.conf
121 +
122 + newinitd "${FILESDIR}"/pdns-recursor-r2 pdns-recursor
123 +}
124 +
125 +pkg_postinst() {
126 + local old
127 +
128 + for old in ${REPLACING_VERSIONS}; do
129 + ver_test ${old} -lt 4.0.0-r1 || continue
130 +
131 + ewarn "Starting with 4.0.0-r1 the init script has been renamed from precursor"
132 + ewarn "to pdns-recursor, please update your runlevels accordingly."
133 +
134 + break
135 + done
136 +}