From 5fb1095cd2a5949f9f44fc985c0fe8aab77185ef Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 3 Sep 2017 10:02:48 +0200 Subject: [PATCH 1/3] Move BIND command channel port to avoid clashing with Unbound (Bug #7271) Improve check for rndc-confgen and add error handling while here. Always regenerate the template to avoid stale config issues on package upgrades. --- dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc b/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc index d747ba9be0ac..ea7523eca12d 100644 --- a/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc +++ b/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc @@ -109,13 +109,17 @@ function bind_sync() { conf_mount_rw(); // Create rndc $rndc_confgen = "/usr/local/sbin/rndc-confgen"; - if (!file_exists(BIND_LOCALBASE."/etc/rndc-confgen.pfsense") && file_exists($rndc_confgen)) { - exec("$rndc_confgen ", $rndc_conf); + if (is_executable($rndc_confgen)) { + // Bug #7271: do not use the default command channel port, it conflicts with Unbound + unlink_if_exists(BIND_LOCALBASE . "/etc/rndc-confgen.pfsense"); + exec("$rndc_confgen -p 8953 ", $rndc_conf); $confgen_file = ""; foreach ($rndc_conf as $line) { $confgen_file .= "$line\n"; } file_put_contents(BIND_LOCALBASE."/etc/rndc-confgen.pfsense", $confgen_file); + } else { + log_error("[bind] $rndc_confgen not found, please reinstall bind package."); } $rndc_bindconf = ""; $rndc_file = ""; From b359b3ab177a8c442e2bc0f6cd35d6c88287bbf2 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sun, 3 Sep 2017 10:03:50 +0200 Subject: [PATCH 2/3] Bump port revision --- dns/pfSense-pkg-bind9/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/pfSense-pkg-bind9/Makefile b/dns/pfSense-pkg-bind9/Makefile index 2e869467da2b..07b5786f2c57 100644 --- a/dns/pfSense-pkg-bind9/Makefile +++ b/dns/pfSense-pkg-bind9/Makefile @@ -2,7 +2,7 @@ PORTNAME= pfSense-pkg-bind PORTVERSION= 9.11 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= dns net ipv6 MASTER_SITES= # empty DISTFILES= # empty From 3f0f3dc99d3d1e22850d072c987efb11accb7a25 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 21 Oct 2017 14:28:22 +0200 Subject: [PATCH 3/3] Remove useless conf_mount_{ro,rw} calls --- dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc b/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc index ea7523eca12d..cd75a03ed4b7 100644 --- a/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc +++ b/dns/pfSense-pkg-bind9/files/usr/local/pkg/bind.inc @@ -106,7 +106,6 @@ if (!function_exists('pf_version')) { function bind_sync() { global $config; - conf_mount_rw(); // Create rndc $rndc_confgen = "/usr/local/sbin/rndc-confgen"; if (is_executable($rndc_confgen)) { @@ -739,7 +738,6 @@ EOD; } // Sync to backup servers bind_sync_on_changes(); - conf_mount_ro(); } function bind_print_javascript_type_zone() { @@ -879,9 +877,8 @@ EOD; {$BIND_LOCALBASE}/sbin/named {$ip_version} -c /etc/namedb/named.conf -u bind -t /cf/named/ fi EOD; - conf_mount_rw(); + write_rcfile($rc); - conf_mount_ro(); } /* Uses XMLRPC to synchronize the changes to a remote node */