Skip to content

Commit

Permalink
net-dns/bind: fix rndc keygen
Browse files Browse the repository at this point in the history
Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene@gentoo.org>
  • Loading branch information
Zlogene committed May 29, 2021
1 parent bd28c3d commit 03b0458
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
24 changes: 4 additions & 20 deletions net-dns/bind/bind-9.16.15.ebuild
Expand Up @@ -36,8 +36,7 @@ SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux"
# -berkdb by default re bug 602682
IUSE="-berkdb +caps +dlz dnstap doc dnsrps fixed-rrset geoip geoip2 gssapi
json ldap lmdb mysql odbc postgres python selinux static-libs
urandom xml +zlib"
json ldap lmdb mysql odbc postgres python selinux static-libs xml +zlib"
# sdb-ldap - patch broken
# no PKCS11 currently as it requires OpenSSL to be patched, also see bug 409687

Expand Down Expand Up @@ -281,16 +280,9 @@ python_install() {
pkg_postinst() {
tmpfiles_process "${FILESDIR}"/named.conf

if [ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]; then
if use urandom; then
einfo "Using /dev/urandom for generating rndc.key"
/usr/sbin/rndc-confgen -r /dev/urandom -a
echo
else
einfo "Using /dev/random for generating rndc.key"
/usr/sbin/rndc-confgen -a
echo
fi
if [[ ! -f '/etc/bind/rndc.key' && ! -f '/etc/bind/rndc.conf' ]]; then
einfo "Using /dev/urandom for generating rndc.key"
/usr/sbin/rndc-confgen -a
chown root:named /etc/bind/rndc.key || die
chmod 0640 /etc/bind/rndc.key || die
fi
Expand Down Expand Up @@ -363,14 +355,6 @@ pkg_config() {
mknod ${CHROOT}/dev/zero c 1 5 || die
chmod 0666 ${CHROOT}/dev/zero || die

if use urandom; then
mknod ${CHROOT}/dev/urandom c 1 9 || die
chmod 0666 ${CHROOT}/dev/urandom || die
else
mknod ${CHROOT}/dev/random c 1 8 || die
chmod 0666 ${CHROOT}/dev/random || die
fi

if [ "${CHROOT_NOMOUNT:-0}" -ne 0 ]; then
cp -a /etc/bind ${CHROOT}/etc/ || die
cp -a /var/bind ${CHROOT}/var/ || die
Expand Down
1 change: 0 additions & 1 deletion net-dns/bind/metadata.xml
Expand Up @@ -18,6 +18,5 @@
<flag name="gssapi">Enable gssapi support</flag>
<flag name="json">Enable JSON statistics channel</flag>
<flag name="lmdb">Enable LMDB support to store configuration for 'addzone' zones</flag>
<flag name="urandom">Use /dev/urandom instead of /dev/random</flag>
</use>
</pkgmetadata>

0 comments on commit 03b0458

Please sign in to comment.