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:44:29 -0200
commitcfb5073f83fa80e5b40476b12ea91ff5114c60fc (patch)
tree1234f5caf3e191785ad6ce4585efeaf9dd58657a /etc/inc
parentfbf3d06ee49ccc3136997306b20b807c7a4b8c85 (diff)
downloadpfsense-cfb5073f83fa80e5b40476b12ea91ff5114c60fc.zip
pfsense-cfb5073f83fa80e5b40476b12ea91ff5114c60fc.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 f991491..3999f44 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