SYSTEM WARNING: 'date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in '/usr/share/mantis/www/core.php' line 264

0002380: DHCP server don't start if you have a paratemer in "Custom Configuration Lines" that has double quotes (") - MantisBT Endian Bugtracker
Endian Issue Tracker

Please see now our new Bugtracker system: JIRA

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002380Endian FirewallOther Scriptspublic2009-11-05 10:362010-11-22 12:04
Assigned Tosimon-endian 
PlatformOSOS Version
Product Version2.3 
Target VersionFixed in Version2.3.1 
Summary0002380: DHCP server don't start if you have a paratemer in "Custom Configuration Lines" that has double quotes (")
DescriptionIf "Custom configuration lines" in dhcpserver has a parameter with double quotes, dhcp server start fails. I was trying to add this option:

option tftp-server-name "";

... but when a click save all, dhcp server start fails. Entering in
configuration files, I've found the problem. When efw save "Custom
configuration lines" textarea data, in configuration file
(/var/efw/dhcp/custom.tpl) is saves:

option tftp-server-name &quot192.168.1.23";

... instead of...

option tftp-server-name "";

... so dhcpserver don't understand the line and can't start.
Additional InformationI've been analyzing /home/httpd/cgi-bin/dhcp.cgi and I've been unable to
find where the hell it makes the conversion from " to " (maybe in
the POST data).

What I've done to solve it is to make a string substitution before data
is written to the file, changing this (in /home/httpd/cgi-bin/dhcp.cgi)...

    $dhcpsettings{'CUSTOM_GLOBAL'} =~ s/\r//; # LINE 472
    write_file($custom_global_file, $dhcpsettings{'CUSTOM_GLOBAL'});
    $dhcpsettings{'CUSTOM_GLOBAL'} = unset;
    &writehash("${swroot}/dhcp/settings", \%dhcpsettings);

...for this...

    $dhcpsettings{'CUSTOM_GLOBAL'} =~ s/\r//; # LINE 472
    $dhcpsettings{'CUSTOM_GLOBAL'} =~
s/\&quot\;/\"/g; # This is the line that
substitute " for ", so configuration file gets the right data.
    write_file($custom_global_file, $dhcpsettings{'CUSTOM_GLOBAL'});
    $dhcpsettings{'CUSTOM_GLOBAL'} = unset;
    &writehash("${swroot}/dhcp/settings", \%dhcpsettings);

It works, but I'm not sure if this is the best solution. I think it
should be better if there's a way to avoid that original data of "Custom
configuration lines" textarea was changed for html entities. In 2.2.
version this didn't happen, and I've been compairing dhcp.cgi files of
both version, but I can't find the issue.
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0002314closedsimon-endian DHCP fails start with CUSTOM DHCP-Option Field used 
duplicate of 0002190closedsimon-endian Using quotes in "Custom configuration lines" boxes are translated to """ in config file. 

-  Notes
arcanos (reporter)
2009-11-05 11:16

Correction, it saves...

option tftp-server-name ""

... instead of...

option tftp-server-name ""
arcanos (reporter)
2009-11-05 11:19

Sorry, but bug tracker is interpreting html entities. It saves (i hope now is ok):

option tftp-server-name \"\"
arcanos (reporter)
2009-11-05 11:20


option tftp-server-name ";
simon-endian (developer)
2009-11-05 11:24

please try patch located in 0002190, which fixes this problem

- Issue History
Date Modified Username Field Change
2009-11-05 10:36 arcanos New Issue
2009-11-05 11:16 arcanos Note Added: 0003245
2009-11-05 11:19 arcanos Note Added: 0003246
2009-11-05 11:20 arcanos Note Added: 0003247
2009-11-05 11:22 simon-endian Relationship added duplicate of 0002314
2009-11-05 11:22 simon-endian Relationship added duplicate of 0002190
2009-11-05 11:24 simon-endian Note Added: 0003249
2009-11-05 11:25 simon-endian Status new => resolved
2009-11-05 11:25 simon-endian Fixed in Version => 2.3.1
2009-11-05 11:25 simon-endian Resolution open => fixed
2009-11-05 11:25 simon-endian Assigned To => simon-endian
2010-11-22 12:04 peter-endian Status resolved => closed

Copyright © 2005-2008 Endian, SRL. All rights reserved.

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker