summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-01-05 15:41:38 -0200
committerRenato Botelho <garga@FreeBSD.org>2015-01-05 15:41:38 -0200
commit0a23cddced057d929c53f3ad1e5d6898a3fada50 (patch)
tree4d6eaf1781ab55af6ae643367d89533a60088ba6 /etc/inc
parent24149c31763abff0f25da381c58b22e6f9c44658 (diff)
downloadpfsense-0a23cddced057d929c53f3ad1e5d6898a3fada50.zip
pfsense-0a23cddced057d929c53f3ad1e5d6898a3fada50.tar.gz
Fix #4090:
- Unbound advanced options may contain double quotes and it breaks the syntax when a backup is restored because newlines are trimmed. Save it in base64 format is a safe way to prevent it - Bump config version to 11.5 - Provide upgrade code to encode current config or the one that came from unbound package on 2.1.5
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/globals.inc2
-rw-r--r--etc/inc/unbound.inc2
-rw-r--r--etc/inc/upgrade_config.inc7
3 files changed, 9 insertions, 2 deletions
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc
index ae7352f..67c33ce 100644
--- a/etc/inc/globals.inc
+++ b/etc/inc/globals.inc
@@ -73,7 +73,7 @@ $g = array(
"disablecrashreporter" => false,
"crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php",
"debug" => false,
- "latest_config" => "11.4",
+ "latest_config" => "11.5",
"nopkg_platforms" => array("cdrom"),
"minimum_ram_warning" => "101",
"minimum_ram_warning_text" => "128 MB",
diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc
index 1bd2f7e..496ca66 100644
--- a/etc/inc/unbound.inc
+++ b/etc/inc/unbound.inc
@@ -205,7 +205,7 @@ EOF;
// Add custom Unbound options
if ($config['unbound']['custom_options']) {
- $custom_options_source = explode("\n", $config['unbound']['custom_options']);
+ $custom_options_source = explode("\n", base64_decode($config['unbound']['custom_options']));
$custom_options = "# Unbound custom options\n";
foreach ($custom_options_source as $ent)
$custom_options .= $ent."\n";
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 324e51e..72fc80f 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -3532,4 +3532,11 @@ function upgrade_113_to_114() {
$ph1ent['iketype'] = 'ikev1';
}
+function upgrade_114_to_115() {
+ global $config;
+
+ if (isset($config['unbound']['custom_options']))
+ $config['unbound']['custom_options'] = base64_encode($config['unbound']['custom_options']);
+}
+
?>
OpenPOWER on IntegriCloud