|
From: Jamie C. <jca...@we...> - 2008-01-27 21:06:26
|
<p>Hi Philippe,<br /><br />Thanks for pointing this out - the problem here is that Webmin doesn't understand this new DHCPd option format with the curly brackets, causing it's parser to go into an infinite loop.<br /><br />Do you plan to work on a patch to properly handle and display these types of options? If so, I'd be glad to include it in a future Webmin release..<br /><br /> - Jamie<br /></p><p>
On 25/Jan/2008 06:07 Philippe Teissier wrote ..
</p><blockquote type="cite">
Hi,<br /><br />I needed to use option 122 (DOCSIS) in my DHCPD.conf and it appears that Webmin had some problem with DHCPD syntax to write it. It hangs the parser, giving me an almost empty page instead of my subnets and groups. <br />
<br />Here are the lines in the dhcpd.conf :<br /><br />option space docsis-ccc;<br />option docsis-ccc.dhcp-server-1 code 1 = ip-address;<br />option docsis-ccc.dhcp-server-2 code 2 = ip-address;<br /><br />option docsis-ccc.provision-server code 3 = { integer 8, string }; ## hangs<br />
<br />option docsis-ccc.krb-realm-name code 6 = string;<br />option docsis-ccc code 122 = encapsulate docsis-ccc; ## misunderstood<br /><br />Two of those line are misunderstood by Webmin dhcpd's module<br /><br />* The 4th line is the one which hangs the parser. It defines a record (int 8, string) as the type of the "provision server suboption". And webmin does not like it.<br />
For the moment, I just commented out this line as I do not user the provision server parameter.<br />* The last line, with the encapsulate type, is also misunderstood, but does not hang the code. Instead, webmin will parse and silently forget encapsulate's parameter (here docsis-ccc). After a "client optiont" change in webmin, the dhcpd.conf will contain "option docsis-ccc code 122 = encapsulate;" and then DHCPD's parser will hang (cause this is a syntax error).<br />
<br />(more about this option syntax by the end of this document <a href="http://www.linuxmanpages.com/man5/dhcp-options.5.php">http://www.linuxmanpages.com/man5/dhcp-options.5.php</a>)<br /><br />I wrote a fast hack for that 2nd problem in order to prevent users from crashing dhcpd.<br />
<br />[root@localhost dhcpd]# diff edit_options.cgi.Before_patch edit_options.cgi<br />168,169c168,176<br />< printf "<input name=dtype_$i size=10 value='%s'>\n",<br />< $o->{'values'}->[4];<br />
---<br />> if ($o->{'values'}->[4] eq "encapsulate") {<br />> printf "<input name=dtype_$i size=10 value='%s'>\n",<br />> $o->{'values'}->[4]. " ".$o->{'values'}->[5];<br />
><br />> } else {<br />> printf "<input name=dtype_$i size=10 value='%s'>\n",<br />> $o->{'values'}->[4];<br />> }<br />
> <br />[root@localhost dhcpd]# diff save_options.cgi.Before_patch save_options.cgi<br />116c116<br />< $in{"dtype_$i"} =~ /^[a-z0-9\.\-\_]+$/i ||<br />---<br />> $in{"dtype_$i"} =~ /^(encapsulate |)[a-z0-9\.\-\_]+$/i ||<br />
<br /><br />I didn't found anything about this bug in the tracking system. It's the 1st time I look at webmin's code, so I'll try to have a deeper look at it, and achieve a better patch with support of encapsulate, records, and even arrays which are also unsupported I can imagine.<br clear="all" />
<br />-- <br />Philippe Teissier<br /><a href="reply_mail.cgi?new=1&to=philippe%2Eteissier%40m4tp%2Eorg">phi...@m4...</a>
</blockquote><br />
|