summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobbert Rijkse <robbert@rijkse.me>2017-05-09 19:52:13 -0400
committerRobbert Rijkse <robbert@rijkse.me>2017-05-09 19:52:13 -0400
commit49d9b45f92b67757555e84fa199f623f4165b962 (patch)
tree9f091aec3a10bc86dcbcce13a380543ff3cbcecb /src
parent409165fde88e11eb057173c5d223eedc79d8d13c (diff)
downloadpfsense-49d9b45f92b67757555e84fa199f623f4165b962.zip
pfsense-49d9b45f92b67757555e84fa199f623f4165b962.tar.gz
Make the changes suggested by jim-p and changed the way the disable function work to ensure the manually added host entries or DHCP reservations still work.
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/system.inc9
-rw-r--r--src/etc/inc/unbound.inc35
-rw-r--r--src/usr/local/www/services_unbound_advanced.php5
3 files changed, 23 insertions, 26 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 7d1618f..6081a55 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -489,7 +489,10 @@ function system_hosts_dhcpd_entries() {
/* Concatenate local, dnsmasq/unbound and dhcpd/dhcpdv6 hosts entries */
function system_hosts_entries($dnscfg) {
- $local = system_hosts_local_entries();
+ $local = array();
+ if (!isset($dnscfg['disable_auto_added_host_entries'])) {
+ $local = system_hosts_local_entries();
+ }
$dns = array();
$dhcpd = array();
@@ -1192,7 +1195,7 @@ EOD;
}
}
}
-
+
$syslogd_sockets = "";
foreach ($log_sockets as $log_socket) {
// Ensure that the log directory exists
@@ -2155,7 +2158,7 @@ function system_dmesg_save() {
fclose($fd);
unset($dmesg);
-
+
// vm-bhyve expects dmesg.boot at the standard location
@symlink("{$g['varlog_path']}/dmesg.boot", "{$g['varrun_path']}/dmesg.boot");
diff --git a/src/etc/inc/unbound.inc b/src/etc/inc/unbound.inc
index 6185f63..428a523 100644
--- a/src/etc/inc/unbound.inc
+++ b/src/etc/inc/unbound.inc
@@ -549,29 +549,24 @@ function unbound_add_host_entries($cfgsubdir = "") {
}
$unbound_entries = "local-zone: \"{$config['system']['domain']}\" {$system_domain_local_zone_type}\n";
+ }
- $hosts = system_hosts_entries($config['unbound']);
- $added_ptr = array();
- foreach ($hosts as $host) {
- if (is_ipaddrv4($host['ipaddr'])) {
- $type = 'A';
- } else if (is_ipaddrv6($host['ipaddr'])) {
- $type = 'AAAA';
- } else {
- continue;
- }
+ $hosts = system_hosts_entries($config['unbound']);
+ $added_ptr = array();
+ foreach ($hosts as $host) {
+ if (is_ipaddrv4($host['ipaddr'])) {
+ $type = 'A';
+ } else if (is_ipaddrv6($host['ipaddr'])) {
+ $type = 'AAAA';
+ } else {
+ continue;
+ }
- if (!$added_ptr[$host['ipaddr']]) {
- $unbound_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['fqdn']}\"\n";
- $added_ptr[$host['ipaddr']] = true;
- }
- $unbound_entries .= "local-data: \"{$host['fqdn']} {$type} {$host['ipaddr']}\"\n";
+ if (!$added_ptr[$host['ipaddr']]) {
+ $unbound_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['fqdn']}\"\n";
+ $added_ptr[$host['ipaddr']] = true;
}
- }
- else {
- // Adds a comment to the file to make it clear it's there for a reason and to clear the file
- // when the user enables this option.
- $unbound_entries = "# Empty since file generation has been disabled in the options.";
+ $unbound_entries .= "local-data: \"{$host['fqdn']} {$type} {$host['ipaddr']}\"\n";
}
// Write out entries
diff --git a/src/usr/local/www/services_unbound_advanced.php b/src/usr/local/www/services_unbound_advanced.php
index efe7269..2620d3e 100644
--- a/src/usr/local/www/services_unbound_advanced.php
+++ b/src/usr/local/www/services_unbound_advanced.php
@@ -71,7 +71,7 @@ if (isset($config['unbound']['disable_auto_added_access_control'])) {
$pconfig['disable_auto_added_access_control'] = true;
}
-if (isset($config['unbound']['disable_auto_host_entries'])) {
+if (isset($config['unbound']['disable_auto_added_host_entries'])) {
$pconfig['disable_auto_added_host_entries'] = true;
}
@@ -364,8 +364,7 @@ $section->addInput(new Form_Checkbox(
'Disable Auto-added Host Entries',
'Disable the automatically-added host entries',
$pconfig['disable_auto_added_host_entries']
-))->setHelp('By default, the primary IPv4 and IPv6 addresses of the pfsense machine are added as records for the pfSense system domain (System | General Setup | Domain). ' .
- 'This disables the auto generation of these entries.');
+))->setHelp('By default, the primary IPv4 and IPv6 addresses of of this firewall are added as records for the system domain of this firewall as configured in %1$sSystem: General Setup%2$s. This disables the auto generation of these entries.', '<a href="system.php">', '</a>');
$section->addInput(new Form_Checkbox(
'use_caps',
OpenPOWER on IntegriCloud