summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 10:00:44 +1200
committerAndrew Thompson <andrew@clonedev.co.nz>2011-08-17 10:02:11 +1200
commit8f9bffbc987a072b7d266011396726489ed92450 (patch)
treefda51022cb94b626dc33c0571cf35282d670ae35 /usr
parent2a319b4facc71c55e3b3943013300d9d5deacc79 (diff)
downloadpfsense-8f9bffbc987a072b7d266011396726489ed92450.zip
pfsense-8f9bffbc987a072b7d266011396726489ed92450.tar.gz
Allow custom dnsmasq options so ppl can set SRV records and such for xmpp/kerberos
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/services_dnsmasq.php49
1 files changed, 41 insertions, 8 deletions
diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php
index a58e6f8..b1731c3 100755
--- a/usr/local/www/services_dnsmasq.php
+++ b/usr/local/www/services_dnsmasq.php
@@ -48,6 +48,7 @@ $pconfig['enable'] = isset($config['dnsmasq']['enable']);
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
$pconfig['dhcpfirst'] = isset($config['dnsmasq']['dhcpfirst']);
+$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
if (!is_array($config['dnsmasq']['hosts']))
$config['dnsmasq']['hosts'] = array();
@@ -62,23 +63,36 @@ $a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
if ($_POST) {
$pconfig = $_POST;
+ unset($input_errors);
$config['dnsmasq']['enable'] = ($_POST['enable']) ? true : false;
$config['dnsmasq']['regdhcp'] = ($_POST['regdhcp']) ? true : false;
$config['dnsmasq']['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
$config['dnsmasq']['dhcpfirst'] = ($_POST['dhcpfirst']) ? true : false;
+ $config['dnsmasq']['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
- write_config();
+ if ($config['dnsmasq']['custom_options']) {
+ $args = '';
+ foreach (preg_split('/\s+/', $config['dnsmasq']['custom_options']) as $c)
+ $args .= "--$c ";
+ exec("/usr/local/sbin/dnsmasq --test $args", $output, $rc);
+ if ($rc != 0)
+ $input_errors[] = gettext("Invalid custom options");
+ }
+
+ if (!$input_errors) {
+ write_config();
- $retval = 0;
- $retval = services_dnsmasq_configure();
- $savemsg = get_std_save_message($retval);
+ $retval = 0;
+ $retval = services_dnsmasq_configure();
+ $savemsg = get_std_save_message($retval);
- // Relaod filter (we might need to sync to CARP hosts)
- filter_configure();
+ // Relaod filter (we might need to sync to CARP hosts)
+ filter_configure();
- if ($retval == 0)
- clear_subsystem_dirty('hosts');
+ if ($retval == 0)
+ clear_subsystem_dirty('hosts');
+ }
}
if ($_GET['act'] == "del") {
@@ -116,12 +130,18 @@ function enable_change(enable_over) {
document.iform.regdhcpstatic.disabled = endis;
document.iform.dhcpfirst.disabled = endis;
}
+function show_advanced_dns() {
+ document.getElementById("showadvbox").innerHTML='';
+ aodiv = document.getElementById('showadv');
+ aodiv.style.display = "block";
+}
//-->
</script>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<form action="services_dnsmasq.php" method="post" name="iform" id="iform">
+<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<?php if (is_subsystem_dirty('hosts')): ?><p>
<?php print_info_box_np(gettext("The DNS forwarder configuration has been changed") . ".<br>" . gettext("You must apply the changes in order for them to take effect."));?><br>
@@ -164,6 +184,19 @@ function enable_change(enable_over) {
</td>
</tr>
<tr>
+ <td class="vtable"><p>
+ <div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
+ <input type="button" onClick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>"></input> - <?=gettext("Show advanced option");?></a>
+ </div>
+ <div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
+ <strong><?=gettext("Advanced");?><br></strong>
+ <textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br/>
+ <?=gettext("Enter any additional options you would like to add to the dnsmasq configuration here, separated by a space or newline"); ?><br/>
+ </div>
+ </p>
+ </td>
+ </tr>
+ <tr>
<td>
<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)">
</td>
OpenPOWER on IntegriCloud