summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_unbound.php
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 /usr/local/www/services_unbound.php
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 'usr/local/www/services_unbound.php')
-rw-r--r--usr/local/www/services_unbound.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/local/www/services_unbound.php b/usr/local/www/services_unbound.php
index 52d976d..2b943dd 100644
--- a/usr/local/www/services_unbound.php
+++ b/usr/local/www/services_unbound.php
@@ -81,7 +81,7 @@ if (isset($config['unbound']['txtsupport'])) {
}
$pconfig['port'] = $config['unbound']['port'];
-$pconfig['custom_options'] = $config['unbound']['custom_options'];
+$pconfig['custom_options'] = base64_decode($config['unbound']['custom_options']);
if (empty($config['unbound']['active_interface'])) {
$pconfig['active_interface'] = array();
@@ -171,7 +171,7 @@ if ($_POST) {
$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
}
- $a_unboundcfg['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
+ $a_unboundcfg['custom_options'] = base64_encode(str_replace("\r\n", "\n", $_POST['custom_options']));
if (!$input_errors) {
write_config("DNS Resolver configured.");
OpenPOWER on IntegriCloud