From 0c514cee09d91c2bcb630b1f417ae2c64e789c49 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 10 May 2017 17:37:47 +0200 Subject: [PATCH] Revert "Allow CNAME overrides for unbound (#1617)" This reverts commit d3492abdef2798716abfb65ece46b3ff758b14d2. Per author request: CNAME does not fully work in unbound at this point. --- src/etc/inc/plugins.inc.d/unbound.inc | 3 --- src/www/services_unbound_host_edit.php | 34 ++------------------------ src/www/services_unbound_overrides.php | 3 --- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/unbound.inc b/src/etc/inc/plugins.inc.d/unbound.inc index 6a9a98cb2..fd6ccdd51 100644 --- a/src/etc/inc/plugins.inc.d/unbound.inc +++ b/src/etc/inc/plugins.inc.d/unbound.inc @@ -599,9 +599,6 @@ function unbound_add_host_entries() case 'MX': $unbound_entries .= "local-data: \"{$host['host']}{$host['domain']} IN MX {$host['mxprio']} {$host['mx']}\"\n"; break; - case 'CNAME': - $unbound_entries .= "local-data: \"{$host['host']}{$host['domain']} IN {$host['rr']} {$host['cname']}\"\n"; - break; } if (!empty($host['descr']) && isset($config['unbound']['txtsupport'])) { diff --git a/src/www/services_unbound_host_edit.php b/src/www/services_unbound_host_edit.php index 842e72ab2..2b0f75c08 100644 --- a/src/www/services_unbound_host_edit.php +++ b/src/www/services_unbound_host_edit.php @@ -48,7 +48,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $id = $_GET['id']; } $pconfig = array(); - foreach (array('rr', 'host', 'domain', 'ip', 'mxprio', 'mx', 'descr', 'cname') as $fieldname) { + foreach (array('rr', 'host', 'domain', 'ip', 'mxprio', 'mx', 'descr') as $fieldname) { if (isset($id) && !empty($a_hosts[$id][$fieldname])) { $pconfig[$fieldname] = $a_hosts[$id][$fieldname]; } else { @@ -100,15 +100,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext("A valid MX host must be specified."); } break; - case 'CNAME': - $reqdfields = explode(" ", "cname"); - $reqdfieldsn = array(gettext("Hostname")); - do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors); - - if (!empty($pconfig['cname']) && !is_hostname($pconfig['cname'])) { - $input_errors[] = gettext("A valid hostname must be specified."); - } - break; default: $input_errors[] = gettext("A valid resource record type must be specified."); break; @@ -122,7 +113,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $hostent['ip'] = $pconfig['ip']; $hostent['mxprio'] = $pconfig['mxprio']; $hostent['mx'] = $pconfig['mx']; - $hostent['cname'] = $pconfig['cname']; $hostent['descr'] = $pconfig['descr']; if (isset($id)) { @@ -149,29 +139,19 @@ include("head.inc"); $("#rr").change(function() { $(".a_aaa_rec").hide(); $(".mx_rec").hide(); - $(".cname_rec").hide(); switch ($(this).val()) { case 'A': $('#ip').prop('disabled', false); $('#mxprio').prop('disabled', true); $('#mx').prop('disabled', true); - $('#cname').prop('disabled', true); $(".a_aaa_rec").show(); break; case 'MX': $('#ip').prop('disabled', true); $('#mxprio').prop('disabled', false); $('#mx').prop('disabled', false); - $('#cname').prop('disabled', true); $(".mx_rec").show(); break; - case 'CNAME': - $('#ip').prop('disabled', true); - $('#mxprio').prop('disabled', true); - $('#mx').prop('disabled', true); - $('#cname').prop('disabled', false); - $(".cname_rec").show(); - break; } $( window ).resize(); // call window resize, which will re-apply zebra }); @@ -222,7 +202,7 @@ include("head.inc"); - - - diff --git a/src/www/services_unbound_overrides.php b/src/www/services_unbound_overrides.php index 453190f27..dac9b2791 100644 --- a/src/www/services_unbound_overrides.php +++ b/src/www/services_unbound_overrides.php @@ -186,9 +186,6 @@ include_once("head.inc"); case 'MX': print $hostent['mxprio'] . " " . $hostent['mx']; break; - case 'CNAME': - print $hostent['cname']; - break; default: print ' '; break;