https://redmine.pfsense.org/https://redmine.pfsense.org/favicon.ico?16780521162009-11-18T22:21:45ZpfSense bugtrackerpfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2632009-11-18T22:21:45ZPierre POMESpierre.pomes@gmail.com
<ul></ul><p>I am working on it, two targets :<br />- make sure the 2.0 gui does not allow to enter fqdn reservation.<br />- during the upgrade from 1.2.x, strip domain part from fqdn reservation.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2642009-11-18T22:54:26ZChris Buechlercbuechler@gmail.com
<ul></ul><p>The first part is good.</p>
<p>On the second, I would prefer to avoid changing people's configuration. If they already have a FQDN in the config, assuming it's the periods that are hosing dhcpd, just strip the periods before writing out that field in dhcpd.conf. i.e. if they have blah.blah.com in there just make it blahblahcom. Then the input validation would prevent them from saving any changes to that reservation on 2.0, which is fine.</p>
<p>One reason being there's no telling what some people may have in their configuration. If someone has host.example.com, host.example.net, and host.example.org, if you strip the domain you're left with three with just 'host'.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2752009-11-22T19:56:17ZPierre POMESpierre.pomes@gmail.com
<ul></ul><p>Hi,</p>
<p>My cloned repo is updated with the first part. For the second one, you are right, I will follow your advices, and request a merge once it will be ok.</p>
<p>There is another issue in services_dhcp_edit.php, affecting all pfsense versions: the host name verification is done on $_POST['host'], however the field name in the HTML form is 'hostname'. This means you can easily break the dhcp server config because the hostname is not verified at all. I guess this needs to be fixed en RELENG_1_2 ?</p>
<p>Pierre</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2802009-11-23T17:07:32ZPierre POMESpierre.pomes@gmail.com
<ul></ul><p>Question for the dhcp server config upgrade: may it be an option to change version number from 6.0 to 6.1 (etc/inc/global.inc), so that an upgrade function "upgrade_060_061" (etc/inc/upgrade.inc) can handle dhcp server config upgrades ?</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2812009-11-23T17:08:58ZChris Buechlercbuechler@gmail.com
<ul></ul><p>why does the config need to be upgraded?</p>
<p>By the way - Scott fixed the hostname verification in RELENG_1_2 yesterday, thanks for that.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2822009-11-23T17:14:45ZPierre POMESpierre.pomes@gmail.com
<ul></ul><blockquote>
<p>why does the config need to be upgraded?</p>
</blockquote>
<p>As you mentionned in earlier post of this tickets, the '.' in static mappings should be removed when upgrading from 1.2 to 2.0 (blah.blah.com should me rewritten to blahblahcom). Otherwise, dhcp server won't start after the upgrade. That's why I propose to wrote an upgrade function.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2832009-11-23T17:16:31ZChris Buechlercbuechler@gmail.com
<ul></ul><p>Oh, I didn't mean changing the actual entries in the config.xml. Just when they're written out from the config.xml to the dhcpd.conf, strip them then. We prefer to avoid changing configurations as much as possible since that can potentially introduce serious bugs.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2842009-11-23T17:26:02ZPierre POMESpierre.pomes@gmail.com
<ul></ul><p>Ok, I misunderstood, sorry. It's clear now ;-)</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=2962009-11-24T20:08:40ZPierre POMESpierre.pomes@gmail.com
<ul></ul><p>I finally applied the same subsitution already done for " " (replaced by "_") when creating dhcpd.conf (goal was to preserve the same behaviour for substitution). So "." are also replaced with "_".</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=3282009-11-27T17:00:25ZPierre POMESpierre.pomes@gmail.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset <a class="changeset" title="Fix hostname checking when entering a dhcp static mapping and replace "." with "_" when writing "..." href="https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/46c5b763ef26269b50d303fc62793c58a42eefb1">46c5b763ef26269b50d303fc62793c58a42eefb1</a>.</p> pfSense - Bug #159: "." in hostname creates invalid dhcpd.confhttps://redmine.pfsense.org/issues/159?journal_id=3342009-11-27T18:01:34ZChris Buechlercbuechler@gmail.com
<ul></ul><p>this is good now, thanks!</p>