commit:     03b0458f99af0352b933bec57b7aff351f2c4480
Author:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
AuthorDate: Sat May 29 14:18:18 2021 +0000
Commit:     Mikle Kolyada <zlogene <AT> gentoo <DOT> org>
CommitDate: Sat May 29 14:19:15 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03b0458f

net-dns/bind: fix rndc keygen

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Mikle Kolyada <zlogene <AT> gentoo.org>

 net-dns/bind/bind-9.16.15.ebuild | 24 ++++--------------------
 net-dns/bind/metadata.xml        |  1 -
 2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/net-dns/bind/bind-9.16.15.ebuild b/net-dns/bind/bind-9.16.15.ebuild
index 629ba6fe981..9fab32caeb8 100644
--- a/net-dns/bind/bind-9.16.15.ebuild
+++ b/net-dns/bind/bind-9.16.15.ebuild
@@ -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
 
@@ -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
@@ -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

diff --git a/net-dns/bind/metadata.xml b/net-dns/bind/metadata.xml
index e9cc55bb874..6bcb4fe262b 100644
--- a/net-dns/bind/metadata.xml
+++ b/net-dns/bind/metadata.xml
@@ -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>

Reply via email to