1 |
idl0r 14/01/31 21:24:49 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: bind-9.9.5-r1.ebuild |
5 |
Removed: bind-9.9.5.ebuild |
6 |
Log: |
7 |
Fix bug 482590 |
8 |
|
9 |
(Portage version: 2.2.8-r1/cvs/Linux x86_64, signed Manifest commit with key B427ABC8) |
10 |
|
11 |
Revision Changes Path |
12 |
1.488 net-dns/bind/ChangeLog |
13 |
|
14 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?rev=1.488&view=markup |
15 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?rev=1.488&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/ChangeLog?r1=1.487&r2=1.488 |
17 |
|
18 |
Index: ChangeLog |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v |
21 |
retrieving revision 1.487 |
22 |
retrieving revision 1.488 |
23 |
diff -u -r1.487 -r1.488 |
24 |
--- ChangeLog 31 Jan 2014 21:14:24 -0000 1.487 |
25 |
+++ ChangeLog 31 Jan 2014 21:24:49 -0000 1.488 |
26 |
@@ -1,6 +1,12 @@ |
27 |
# ChangeLog for net-dns/bind |
28 |
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 |
29 |
-# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.487 2014/01/31 21:14:24 idl0r Exp $ |
30 |
+# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/ChangeLog,v 1.488 2014/01/31 21:24:49 idl0r Exp $ |
31 |
+ |
32 |
+*bind-9.9.5-r1 (31 Jan 2014) |
33 |
+ |
34 |
+ 31 Jan 2014; Christian Ruppert <idl0r@g.o> -bind-9.9.5.ebuild, |
35 |
+ +bind-9.9.5-r1.ebuild, +files/named.conf-r7, +files/named.init-r13: |
36 |
+ Fix bug 482590 |
37 |
|
38 |
31 Jan 2014; Christian Ruppert <idl0r@g.o> bind-9.9.5.ebuild: |
39 |
Fix static-libs |
40 |
|
41 |
|
42 |
|
43 |
1.1 net-dns/bind/bind-9.9.5-r1.ebuild |
44 |
|
45 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.9.5-r1.ebuild?rev=1.1&view=markup |
46 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-dns/bind/bind-9.9.5-r1.ebuild?rev=1.1&content-type=text/plain |
47 |
|
48 |
Index: bind-9.9.5-r1.ebuild |
49 |
=================================================================== |
50 |
# Copyright 1999-2014 Gentoo Foundation |
51 |
# Distributed under the terms of the GNU General Public License v2 |
52 |
# $Header: /var/cvsroot/gentoo-x86/net-dns/bind/bind-9.9.5-r1.ebuild,v 1.1 2014/01/31 21:24:49 idl0r Exp $ |
53 |
|
54 |
# Re dlz/mysql and threads, needs to be verified.. |
55 |
# MySQL uses thread local storage in its C api. Thus MySQL |
56 |
# requires that each thread of an application execute a MySQL |
57 |
# thread initialization to setup the thread local storage. |
58 |
# This is impossible to do safely while staying within the DLZ |
59 |
# driver API. This is a limitation caused by MySQL, and not the DLZ API. |
60 |
# Because of this BIND MUST only run with a single thread when |
61 |
# using the MySQL driver. |
62 |
|
63 |
EAPI="5" |
64 |
|
65 |
PYTHON_DEPEND="python? 2:2.7 3" |
66 |
SUPPORT_PYTHON_ABIS="1" |
67 |
|
68 |
inherit python eutils autotools toolchain-funcs flag-o-matic multilib db-use user systemd |
69 |
|
70 |
MY_PV="${PV/_p/-P}" |
71 |
MY_PV="${MY_PV/_rc/rc}" |
72 |
MY_P="${PN}-${MY_PV}" |
73 |
|
74 |
SDB_LDAP_VER="1.1.0-fc14" |
75 |
|
76 |
# bind-9.8.0-P1-geoip-1.3.patch |
77 |
GEOIP_PV=1.3 |
78 |
#GEOIP_PV_AGAINST="${MY_PV}" |
79 |
GEOIP_PV_AGAINST="9.9.2" |
80 |
GEOIP_P="bind-${GEOIP_PV_AGAINST}-geoip-${GEOIP_PV}" |
81 |
GEOIP_PATCH_A="${GEOIP_P}.patch" |
82 |
GEOIP_DOC_A="bind-geoip-1.3-readme.txt" |
83 |
GEOIP_SRC_URI_BASE="http://bind-geoip.googlecode.com/" |
84 |
|
85 |
RRL_PV="${MY_PV}" |
86 |
|
87 |
# GeoIP: http://bind-geoip.googlecode.com/ |
88 |
# SDB-LDAP: http://bind9-ldap.bayour.com/ |
89 |
|
90 |
# geoip? ( ${GEOIP_SRC_URI_BASE}/files/${GEOIP_DOC_A} |
91 |
# ${GEOIP_SRC_URI_BASE}/files/${GEOIP_PATCH_A} ) |
92 |
|
93 |
DESCRIPTION="BIND - Berkeley Internet Name Domain - Name Server" |
94 |
HOMEPAGE="http://www.isc.org/software/bind" |
95 |
SRC_URI="ftp://ftp.isc.org/isc/bind9/${MY_PV}/${MY_P}.tar.gz |
96 |
doc? ( mirror://gentoo/dyndns-samples.tbz2 ) |
97 |
geoip? ( ${GEOIP_SRC_URI_BASE}/files/${GEOIP_DOC_A} |
98 |
http://dev.gentoo.org/~idl0r/${P}-geoip.patch ) |
99 |
sdb-ldap? ( |
100 |
http://ftp.disconnected-by-peer.at/pub/bind-sdb-ldap-${SDB_LDAP_VER}.patch.bz2 |
101 |
)" |
102 |
|
103 |
LICENSE="GPL-2 ISC BSD BSD-2 HPND JNIC openssl" |
104 |
SLOT="0" |
105 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
106 |
IUSE="berkdb caps dlz doc filter-aaaa fixed-rrset geoip gost gssapi idn ipv6 |
107 |
ldap mysql odbc postgres python rpz rrl sdb-ldap selinux ssl static-libs threads |
108 |
urandom xml" |
109 |
# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687 |
110 |
|
111 |
REQUIRED_USE="postgres? ( dlz ) |
112 |
berkdb? ( dlz ) |
113 |
mysql? ( dlz !threads ) |
114 |
odbc? ( dlz ) |
115 |
ldap? ( dlz ) |
116 |
sdb-ldap? ( dlz ) |
117 |
gost? ( ssl ) |
118 |
threads? ( caps )" |
119 |
|
120 |
DEPEND="ssl? ( dev-libs/openssl:0[-bindist] ) |
121 |
mysql? ( >=virtual/mysql-4.0 ) |
122 |
odbc? ( >=dev-db/unixODBC-2.2.6 ) |
123 |
ldap? ( net-nds/openldap ) |
124 |
idn? ( net-dns/idnkit ) |
125 |
postgres? ( dev-db/postgresql-base ) |
126 |
caps? ( >=sys-libs/libcap-2.1.0 ) |
127 |
xml? ( dev-libs/libxml2 ) |
128 |
geoip? ( >=dev-libs/geoip-1.4.6 ) |
129 |
gssapi? ( virtual/krb5 ) |
130 |
sdb-ldap? ( net-nds/openldap ) |
131 |
gost? ( >=dev-libs/openssl-1.0.0:0[-bindist] ) |
132 |
python? ( virtual/python-argparse )" |
133 |
|
134 |
RDEPEND="${DEPEND} |
135 |
selinux? ( sec-policy/selinux-bind ) |
136 |
|| ( sys-process/psmisc >=sys-freebsd/freebsd-ubin-9.0_rc sys-process/fuser-bsd )" |
137 |
|
138 |
S="${WORKDIR}/${MY_P}" |
139 |
|
140 |
# bug 479092, requires networking |
141 |
RESTRICT="test" |
142 |
|
143 |
pkg_setup() { |
144 |
ebegin "Creating named group and user" |
145 |
enewgroup named 40 |
146 |
enewuser named 40 -1 /etc/bind named |
147 |
eend ${?} |
148 |
|
149 |
if use python; then |
150 |
python_pkg_setup |
151 |
fi |
152 |
} |
153 |
|
154 |
src_prepare() { |
155 |
# Adjusting PATHs in manpages |
156 |
for i in bin/{named/named.8,check/named-checkconf.8,rndc/rndc.8} ; do |
157 |
sed -i \ |
158 |
-e 's:/etc/named.conf:/etc/bind/named.conf:g' \ |
159 |
-e 's:/etc/rndc.conf:/etc/bind/rndc.conf:g' \ |
160 |
-e 's:/etc/rndc.key:/etc/bind/rndc.key:g' \ |
161 |
"${i}" || die "sed failed, ${i} doesn't exist" |
162 |
done |
163 |
|
164 |
if use dlz; then |
165 |
# bind fails to reconnect to MySQL5 databases, bug #180720, patch by Nicolas Brousse |
166 |
# (http://www.shell-tips.com/2007/09/04/bind-950-patch-dlz-mysql-5-for-auto-reconnect/) |
167 |
if use mysql && has_version ">=dev-db/mysql-5"; then |
168 |
epatch "${FILESDIR}"/bind-dlzmysql5-reconnect.patch |
169 |
fi |
170 |
|
171 |
if use odbc; then |
172 |
epatch "${FILESDIR}/${PN}-9.7.3-odbc-dlz-detect.patch" |
173 |
fi |
174 |
|
175 |
# sdb-ldap patch as per bug #160567 |
176 |
# Upstream URL: http://bind9-ldap.bayour.com/ |
177 |
# New patch take from bug 302735 |
178 |
if use sdb-ldap; then |
179 |
epatch "${WORKDIR}"/${PN}-sdb-ldap-${SDB_LDAP_VER}.patch |
180 |
cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named/ |
181 |
cp -fp contrib/sdb/ldap/{ldap2zone.1,ldap2zone.c} bin/tools/ |
182 |
cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/tools/ |
183 |
fi |
184 |
fi |
185 |
|
186 |
# should be installed by bind-tools |
187 |
sed -i -r -e "s:(nsupdate|dig) ::g" bin/Makefile.in || die |
188 |
|
189 |
if use geoip; then |
190 |
# cp "${DISTDIR}"/${GEOIP_PATCH_A} "${S}" || die |
191 |
# sed -i -e 's:^ RELEASETYPE=: RELEASETYPE=-P:' \ |
192 |
# -e 's:RELEASEVER=:RELEASEVER=2:' \ |
193 |
# ${GEOIP_PATCH_A} || die |
194 |
# sed -i -e 's:^ PATCHVER=2: PATCHVER=4:' ${GEOIP_PATCH_A} || die |
195 |
# epatch -F0 ${GEOIP_PATCH_A} |
196 |
epatch -F0 "${DISTDIR}/${P}-geoip.patch" |
197 |
fi |
198 |
|
199 |
# Disable tests for now, bug 406399 |
200 |
sed -i '/^SUBDIRS/s:tests::' bin/Makefile.in lib/Makefile.in || die |
201 |
|
202 |
# bug #220361 |
203 |
rm aclocal.m4 |
204 |
rm -rf libtool.m4/ |
205 |
eautoreconf |
206 |
} |
207 |
|
208 |
src_configure() { |
209 |
local myconf="" |
210 |
|
211 |
if use urandom; then |
212 |
myconf="${myconf} --with-randomdev=/dev/urandom" |
213 |
else |
214 |
myconf="${myconf} --with-randomdev=/dev/random" |
215 |
fi |
216 |
|
217 |
use geoip && myconf="${myconf} --with-geoip" |
218 |
|
219 |
# bug #158664 |
220 |
# gcc-specs-ssp && replace-flags -O[23s] -O |
221 |
|
222 |
# To include db.h from proper path |
223 |
use berkdb && append-flags "-I$(db_includedir)" |
224 |
|
225 |
export BUILD_CC=$(tc-getBUILD_CC) |
226 |
econf \ |
227 |
--sysconfdir=/etc/bind \ |
228 |
--localstatedir=/var \ |
229 |
--with-libtool \ |
230 |
--enable-full-report \ |
231 |
$(use_enable threads) \ |
232 |
$(use_with dlz dlopen) \ |
233 |
$(use_with dlz dlz-filesystem) \ |
234 |
$(use_with dlz dlz-stub) \ |
235 |
$(use_with postgres dlz-postgres) \ |
236 |
$(use_with mysql dlz-mysql) \ |
237 |
$(use_with berkdb dlz-bdb) \ |
238 |
$(use_with ldap dlz-ldap) \ |
239 |
$(use_with odbc dlz-odbc) \ |
240 |
$(use_with ssl openssl "${EPREFIX}"/usr) \ |
241 |
$(use_with ssl ecdsa) \ |
242 |
$(use_with idn) \ |
243 |
$(use_enable ipv6) \ |
244 |
$(use_with xml libxml2) \ |
245 |
$(use_enable xml newstats) \ |
246 |
$(use_with gssapi) \ |
247 |
$(use_enable rpz rpz-nsip) \ |
248 |
$(use_enable rpz rpz-nsdname) \ |
249 |
$(use_enable caps linux-caps) \ |
250 |
$(use_with gost) \ |
251 |
$(use_enable filter-aaaa) \ |
252 |
$(use_enable fixed-rrset) \ |
253 |
$(use_enable rrl) \ |
254 |
$(use_with python) \ |
255 |
--without-readline \ |
256 |
${myconf} |
257 |
|
258 |
# $(use_enable static-libs static) \ |
259 |
|
260 |
# bug #151839 |
261 |
echo '#undef SO_BSDCOMPAT' >> config.h |
262 |
} |
263 |
|
264 |
src_install() { |
265 |
emake DESTDIR="${D}" install |
266 |
|
267 |
dodoc CHANGES FAQ README |
268 |
|
269 |
if use idn; then |
270 |
dodoc contrib/idn/README.idnkit |
271 |
fi |
272 |
|
273 |
if use doc; then |
274 |
dodoc doc/arm/Bv9ARM.pdf |
275 |
|
276 |
docinto misc |
277 |
dodoc doc/misc/* |
278 |
|
279 |
# might a 'html' useflag make sense? |
280 |
docinto html |
281 |
dohtml -r doc/arm/* |
282 |
|
283 |
docinto contrib |
284 |
dodoc contrib/named-bootconf/named-bootconf.sh \ |
285 |
contrib/nanny/nanny.pl |
286 |
|
287 |
# some handy-dandy dynamic dns examples |
288 |
pushd "${D}"/usr/share/doc/${PF} 1>/dev/null |
289 |
tar xf "${DISTDIR}"/dyndns-samples.tbz2 || die |
290 |
popd 1>/dev/null |
291 |
fi |
292 |
|
293 |
use geoip && dodoc "${DISTDIR}"/${GEOIP_DOC_A} |
294 |
|
295 |
insinto /etc/bind |
296 |
newins "${FILESDIR}"/named.conf-r7 named.conf |
297 |
|
298 |
# ftp://ftp.rs.internic.net/domain/named.cache: |
299 |
insinto /var/bind |
300 |
doins "${FILESDIR}"/named.cache |
301 |
|
302 |
insinto /var/bind/pri |
303 |
newins "${FILESDIR}"/127.zone-r1 127.zone |
304 |
newins "${FILESDIR}"/localhost.zone-r3 localhost.zone |
305 |
|
306 |
newinitd "${FILESDIR}"/named.init-r13 named |
307 |
newconfd "${FILESDIR}"/named.confd-r6 named |
308 |
|
309 |
if use gost; then |
310 |
sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}/' "${D}/etc/init.d/named" || die |
311 |
else |
312 |
sed -i -e 's/^OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-1}$/OPENSSL_LIBGOST=${OPENSSL_LIBGOST:-0}/' "${D}/etc/init.d/named" || die |
313 |
fi |
314 |
|
315 |
newenvd "${FILESDIR}"/10bind.env 10bind |
316 |
|
317 |
# Let's get rid of those tools and their manpages since they're provided by bind-tools |
318 |
rm -f "${D}"/usr/share/man/man1/{dig,host,nslookup}.1* |
319 |
rm -f "${D}"/usr/share/man/man8/{dnssec-keygen,nsupdate}.8* |
320 |
rm -f "${D}"/usr/bin/{dig,host,nslookup,dnssec-keygen,nsupdate} |
321 |
rm -f "${D}"/usr/sbin/{dig,host,nslookup,dnssec-keygen,nsupdate} |
322 |
|
323 |
# bug 405251, library archives aren't properly handled by --enable/disable-static |
324 |
if ! use static-libs; then |
325 |
find "${D}" -type f -name '*.a' -delete || die |
326 |
fi |
327 |
|
328 |
# bug 405251 |
329 |
find "${D}" -type f -name '*.la' -delete || die |
330 |
|
331 |
if use python; then |
332 |
install_python_tools() { |
333 |
python_convert_shebangs $PYTHON_ABI bin/python/dnssec-checkds bin/python/dnssec-coverage |
334 |
exeinto /usr/sbin |
335 |
newexe bin/python/dnssec-checkds dnssec-checkds-${PYTHON_ABI} |
336 |
newexe bin/python/dnssec-coverage dnssec-coverage-${PYTHON_ABI} |
337 |
} |
338 |
python_execute_function install_python_tools |
339 |
|
340 |
rm -f "${D}/usr/sbin/dnssec-"{checkds,coverage} |
341 |
python_generate_wrapper_scripts "${D}usr/sbin/dnssec-checkds" |
342 |
python_generate_wrapper_scripts "${D}usr/sbin/dnssec-coverage" |
343 |
fi |
344 |
|
345 |
# bug 450406 |
346 |
dosym named.cache /var/bind/root.cache |
347 |
|
348 |
dosym /var/bind/pri /etc/bind/pri |
349 |
dosym /var/bind/sec /etc/bind/sec |
350 |
dosym /var/bind/dyn /etc/bind/dyn |
351 |
keepdir /var/bind/{pri,sec,dyn} |
352 |
|
353 |
dodir /var/log/named |
354 |
|
355 |
fowners root:named /{etc,var}/bind /var/log/named /var/bind/{sec,pri,dyn} |
356 |
fowners root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf} |
357 |
fperms 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf} |
358 |
fperms 0750 /etc/bind /var/bind/pri |
359 |
fperms 0770 /var/log/named /var/bind/{,sec,dyn} |
360 |
|
361 |
systemd_dounit "${FILESDIR}/named.service" |
362 |
systemd_dotmpfilesd "${FILESDIR}/named.conf" |
363 |
exeinto /usr/libexec |
364 |
doexe "${FILESDIR}/generate-rndc-key.sh" |
365 |
} |
366 |
|
367 |
pkg_postinst() { |
368 |
if [ ! -f '/etc/bind/rndc.key' ]; then |
369 |
if use urandom; then |
370 |
einfo "Using /dev/urandom for generating rndc.key" |
371 |
/usr/sbin/rndc-confgen -r /dev/urandom -a |
372 |
echo |
373 |
else |
374 |
einfo "Using /dev/random for generating rndc.key" |
375 |
/usr/sbin/rndc-confgen -a |
376 |
echo |
377 |
fi |
378 |
chown root:named /etc/bind/rndc.key |
379 |
chmod 0640 /etc/bind/rndc.key |
380 |
fi |
381 |
|
382 |
einfo |
383 |
einfo "You can edit /etc/conf.d/named to customize named settings" |
384 |
einfo |
385 |
use mysql || use postgres || use ldap && { |
386 |
elog "If your named depends on MySQL/PostgreSQL or LDAP," |
387 |
elog "uncomment the specified rc_named_* lines in your" |
388 |
elog "/etc/conf.d/named config to ensure they'll start before bind" |
389 |
einfo |
390 |
} |
391 |
einfo "If you'd like to run bind in a chroot AND this is a new" |
392 |
einfo "install OR your bind doesn't already run in a chroot:" |
393 |
einfo "1) Uncomment and set the CHROOT variable in /etc/conf.d/named." |
394 |
einfo "2) Run \`emerge --config '=${CATEGORY}/${PF}'\`" |
395 |
einfo |
396 |
|
397 |
CHROOT=$(source /etc/conf.d/named 2>/dev/null; echo ${CHROOT}) |
398 |
if [[ -n ${CHROOT} ]]; then |
399 |
elog "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!" |
400 |
elog "To enable the old behaviour (without using mount) uncomment the" |
401 |
elog "CHROOT_NOMOUNT option in your /etc/conf.d/named config." |
402 |
elog "If you decide to use the new/default method, ensure to make backup" |
403 |
elog "first and merge your existing configs/zones to /etc/bind and" |
404 |
elog "/var/bind because bind will now mount the needed directories into" |
405 |
elog "the chroot dir." |
406 |
fi |
407 |
|
408 |
ewarn |
409 |
ewarn "NOTE: /var/bind/named.ca has been renamed to /var/bind/named.cache" |
410 |
ewarn "you may need to fix your named.conf!" |
411 |
ewarn |
412 |
ewarn "NOTE: If you upgrade from <net-dns/bind-9.4.3_p5-r1, you may encounter permission problems" |
413 |
ewarn "To fix the permissions do:" |
414 |
ewarn "chown root:named /{etc,var}/bind /run/named/ /var/log/named /var/bind/{sec,pri,dyn}" |
415 |
ewarn "chown root:named /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}" |
416 |
ewarn "chmod 0640 /var/bind/named.cache /var/bind/pri/{127,localhost}.zone /etc/bind/{bind.keys,named.conf}" |
417 |
ewarn "chmod 0750 /etc/bind /var/bind/pri" |
418 |
ewarn "chmod 0770 /run/named/ /var/log/named /var/bind/{,sec,dyn}" |
419 |
ewarn |
420 |
} |
421 |
|
422 |
pkg_config() { |
423 |
CHROOT=$(source /etc/conf.d/named; echo ${CHROOT}) |
424 |
CHROOT_NOMOUNT=$(source /etc/conf.d/named; echo ${CHROOT_NOMOUNT}) |
425 |
CHROOT_GEOIP=$(source /etc/conf.d/named; echo ${CHROOT_GEOIP}) |
426 |
|
427 |
if [[ -z "${CHROOT}" ]]; then |
428 |
eerror "This config script is designed to automate setting up" |
429 |
eerror "a chrooted bind/named. To do so, please first uncomment" |
430 |
eerror "and set the CHROOT variable in '/etc/conf.d/named'." |
431 |
die "Unset CHROOT" |
432 |
fi |
433 |
if [[ -d "${CHROOT}" ]]; then |
434 |
ewarn "NOTE: As of net-dns/bind-9.4.3_p5-r1 the chroot part of the init-script got some major changes!" |
435 |
ewarn "To enable the old behaviour (without using mount) uncomment the" |
436 |
ewarn "CHROOT_NOMOUNT option in your /etc/conf.d/named config." |
437 |
ewarn |
438 |
ewarn "${CHROOT} already exists... some things might become overridden" |
439 |
ewarn "press CTRL+C if you don't want to continue" |
440 |
sleep 10 |
441 |
fi |
442 |
|
443 |
echo; einfo "Setting up the chroot directory..." |
444 |
|
445 |
mkdir -m 0750 -p ${CHROOT} |
446 |
mkdir -m 0755 -p ${CHROOT}/{dev,etc,var/log,run} |
447 |
mkdir -m 0750 -p ${CHROOT}/etc/bind |
448 |
mkdir -m 0770 -p ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ |
449 |
# As of bind 9.8.0 |
450 |
if has_version net-dns/bind[gost]; then |
451 |
if [ "$(get_libdir)" = "lib64" ]; then |
452 |
mkdir -m 0755 -p ${CHROOT}/usr/lib64/engines |
453 |
ln -s lib64 ${CHROOT}/usr/lib |
454 |
else |
455 |
mkdir -m 0755 -p ${CHROOT}/usr/lib/engines |
456 |
fi |
457 |
fi |
458 |
chown root:named ${CHROOT} ${CHROOT}/var/{bind,log/named} ${CHROOT}/run/named/ ${CHROOT}/etc/bind |
459 |
|
460 |
mknod ${CHROOT}/dev/null c 1 3 |
461 |
chmod 0666 ${CHROOT}/dev/null |
462 |
|
463 |
mknod ${CHROOT}/dev/zero c 1 5 |
464 |
chmod 0666 ${CHROOT}/dev/zero |
465 |
|
466 |
if use urandom; then |
467 |
mknod ${CHROOT}/dev/urandom c 1 9 |
468 |
chmod 0666 ${CHROOT}/dev/urandom |
469 |
else |
470 |
mknod ${CHROOT}/dev/random c 1 8 |
471 |
chmod 0666 ${CHROOT}/dev/random |
472 |
fi |
473 |
|
474 |
if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then |
475 |
cp -a /etc/bind ${CHROOT}/etc/ |
476 |
cp -a /var/bind ${CHROOT}/var/ |
477 |
fi |
478 |
|
479 |
if [ "${CHROOT_GEOIP:-0}" -eq 1 ]; then |
480 |
mkdir -m 0755 -p ${CHROOT}/usr/share/GeoIP |
481 |
fi |
482 |
|
483 |
elog "You may need to add the following line to your syslog-ng.conf:" |
484 |
elog "source jail { unix-stream(\"${CHROOT}/dev/log\"); };" |
485 |
} |