From aa6798c07088b4a45f85e2626576e33876d04263 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 7 Jul 2011 15:16:21 -0400 Subject: [PATCH 1/9] $g needs to be a global. Resolves #1654 --- etc/inc/services.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index c020641c1b..accf74e173 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1272,6 +1272,7 @@ function configure_cron() { } function upnp_action ($action) { + global $g, $config; switch($action) { case "start": if (file_exists('/var/etc/miniupnpd.conf')) { From 10f5d53cbf453ff8440e5de5cb09cce72deb2bc3 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 7 Jul 2011 15:57:18 -0400 Subject: [PATCH 2/9] Reconfigure wan/lan when finishing wizard, or the new IPs will not be applied. --- usr/local/www/wizards/setup_wizard.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 401be3e821..08870e126e 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -590,6 +590,8 @@ } unset($config['wizardtemp']); write_config(); + interface_reconfigure("wan"); + interface_reconfigure("lan"); reload_all(); mwexec_bg("/etc/rc.update_bogons.sh now"); ]]> From 9bc59815c6eba7051a401404d4d0b0c7842a9d2f Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Thu, 7 Jul 2011 18:10:40 -0400 Subject: [PATCH 3/9] Bug #1641 fix. DHCP server default gateway needs input validation. --- usr/local/www/services_dhcp.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index d02fef6fb3..fdd70a90d6 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -216,6 +216,13 @@ if ($_POST) { $input_errors[] = gettext("A valid IP address must be specified for the gateway."); if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); + $parent_ip = get_interface_ip($_POST['if']); + if (is_ipaddr($parent_ip)) { + $parent_sn = get_interface_subnet($_POST['if']); + if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) { + $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']); + } + } if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); From 5909b520a76b5440e306c9aaef32e4f99fffb2b7 Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Thu, 7 Jul 2011 20:46:21 -0400 Subject: [PATCH 4/9] Bug #1639. Port alias missing input validation in firewall_rules_edit.php. --- usr/local/www/firewall_rules_edit.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index 97493bf78a..a100065e98 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -302,6 +302,26 @@ if ($_POST) { $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstbeginport']); if ($_POST['dstendport'] && !is_portoralias($_POST['dstendport'])) $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."),$_POST['dstendport']); + if ( !$_POST['srcbeginport_cust'] && $_POST['srcendport_cust']) + if (is_alias($_POST['srcendport_cust'])) + $input_errors[] = 'If you put port alias in Source port range to: field you must put the same port alias in from: field'; + if ( $_POST['srcbeginport_cust'] && $_POST['srcendport_cust']){ + if (is_alias($_POST['srcendport_cust']) && is_alias($_POST['srcendport_cust']) && $_POST['srcbeginport_cust'] != $_POST['srcendport_cust']) + $input_errors[] = 'The same port alias must be used in Source port range from: and to: fields'; + if ((is_alias($_POST['srcbeginport_cust']) && (!is_alias($_POST['srcendport_cust']) && $_POST['srcendport_cust']!='')) || + ((!is_alias($_POST['srcbeginport_cust']) && $_POST['srcbeginport_cust']!='') && is_alias($_POST['srcendport_cust']))) + $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Source port range from: and to: field'; + } + if ( !$_POST['dstbeginport_cust'] && $_POST['dstendport_cust']) + if (is_alias($_POST['dstendport_cust'])) + $input_errors[] = 'If you put port alias in Destination port range to: field you must put the same port alias in from: field'; + if ( $_POST['dstbeginport_cust'] && $_POST['dstendport_cust']){ + if (is_alias($_POST['dstendport_cust']) && is_alias($_POST['dstendport_cust']) && $_POST['dstbeginport_cust'] != $_POST['dstendport_cust']) + $input_errors[] = 'The same port alias must be used in Destination port range from: and to: fields'; + if ((is_alias($_POST['dstbeginport_cust']) && (!is_alias($_POST['dstendport_cust']) && $_POST['dstendport_cust']!='')) || + ((!is_alias($_POST['dstbeginport_cust']) && $_POST['dstbeginport_cust']!='') && is_alias($_POST['dstendport_cust']))) + $input_errors[] = 'You cannot specify numbers and port aliases at the same time in Destination port range from: and to: field'; + } /* if user enters an alias and selects "network" then disallow. */ if($_POST['srctype'] == "network") { From 89bb7dcc4b9687c4c06603e59eac0918cb07a3e1 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 8 Jul 2011 21:16:24 +0000 Subject: [PATCH 5/9] Ticket #1564. Give +x to the script so it can be executed. Simple hah :) --- etc/rc.stop_packages | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 etc/rc.stop_packages diff --git a/etc/rc.stop_packages b/etc/rc.stop_packages old mode 100644 new mode 100755 From 5eeb1d9d278b9ca718ea50906b13437b6c6ceac1 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 9 Jul 2011 03:23:49 -0400 Subject: [PATCH 6/9] fix text --- etc/rc.initial.firmware_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 8d16098869..f4363c6497 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -93,7 +93,7 @@ switch ($command) { exec("fetch -1 -w15 -a -v -o /root/firmware.tgz.md5 \"$url.md5\""); } else { echo "\n\nWARNING.\n"; - echo "\nCould not locate a MD5 file. We cannot verify the download once its done.\n\n"; + echo "\nCould not locate a MD5 file. We cannot verify the download once completed.\n\n"; sleep(15); } if(file_exists("/root/firmware.tgz.md5")) { From f745b8ef215242e1e6f5fa0b93d2f77fe7397f96 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 10 Jul 2011 01:07:24 -0400 Subject: [PATCH 7/9] fix text --- usr/local/www/services_dhcp_relay.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/services_dhcp_relay.php b/usr/local/www/services_dhcp_relay.php index 37a983780f..d0f11084a2 100755 --- a/usr/local/www/services_dhcp_relay.php +++ b/usr/local/www/services_dhcp_relay.php @@ -180,7 +180,7 @@ function enable_change(enable_over) {
- + From 7988ce7581efee9aef0184edfb2eeb2f352477a8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 10 Jul 2011 12:03:50 -0400 Subject: [PATCH 8/9] Do not check to see if gateay falls within a null value. Resolves #1664 --- usr/local/www/services_dhcp.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index fdd70a90d6..4045ead8f6 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -217,12 +217,10 @@ if ($_POST) { if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); $parent_ip = get_interface_ip($_POST['if']); - if (is_ipaddr($parent_ip)) { + if (is_ipaddr($parent_ip) && $_POST['gateway']) $parent_sn = get_interface_subnet($_POST['if']); - if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) { + if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']); - } - } if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers."); From 45d1024db3d3d32fb26f2b6c42460cbe98e24096 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 10 Jul 2011 12:04:34 -0400 Subject: [PATCH 9/9] Do not check to see if gateay falls within a null value. Resolves #1664 --- usr/local/www/services_dhcp.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 4045ead8f6..17fbb8085f 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -217,10 +217,11 @@ if ($_POST) { if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers."); $parent_ip = get_interface_ip($_POST['if']); - if (is_ipaddr($parent_ip) && $_POST['gateway']) + if (is_ipaddr($parent_ip) && $_POST['gateway']) { $parent_sn = get_interface_subnet($_POST['if']); if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway'])) $input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']); + } if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");