From 38b357bdb50b820d63646d49849b41b4908a744d Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 16 Apr 2010 18:38:36 +0000 Subject: [PATCH 01/10] Do not use the presence of lan as an indicator of having only one interface. Actually deduce that from the count of interfaces. It is perfectly legal on 2.0 to not have a lan interface and only opt/wan ones. --- usr/local/www/fbegin.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/local/www/fbegin.inc b/usr/local/www/fbegin.inc index 3f69cd6257..29b94642c9 100755 --- a/usr/local/www/fbegin.inc +++ b/usr/local/www/fbegin.inc @@ -105,12 +105,11 @@ $interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfac // Firewall $firewall_menu = array(); $firewall_menu[] = array("Aliases", "/firewall_aliases.php"); -if($config['interfaces']['lan']) +if(count($config['interfaces']) > 1) $firewall_menu[] = array("NAT", "/firewall_nat.php"); $firewall_menu[] = array("Rules", "/firewall_rules.php"); $firewall_menu[] = array("Schedules", "/firewall_schedule.php"); -if($config['interfaces']['lan']) - $firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); +$firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); $firewall_menu[] = array("Virtual IPs", "/firewall_virtual_ip.php"); $firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0); @@ -128,7 +127,7 @@ $services_menu[] = array("OLSR", "/pkg_edit.php?xml=olsrd.xml&id=0"); $services_menu[] = array("PPPoE Server", "/vpn_pppoe.php"); $services_menu[] = array("RIP", "/pkg_edit.php?xml=routed/routed.xml&id=0"); $services_menu[] = array("SNMP", "/services_snmp.php"); -if($config['interfaces']['lan']) { +if(count($config['interfaces']) > 1) { /* no use for UPnP in single-interface deployments remove to reduce user confusion */ @@ -166,7 +165,7 @@ $status_menu[] = array("RRD Graphs", "/status_rrd_graph.php"); $status_menu[] = array("Services", "/status_services.php"); $status_menu[] = array("System Logs", "/diag_logs.php"); $status_menu[] = array("Traffic Graph", "/status_graph.php?if=wan"); -if($config['interfaces']['lan']) +if(count($config['interfaces']) > 1) $status_menu[] = array("UPnP", "/status_upnp.php"); $ifentries = get_configured_interface_with_descr(); foreach ($ifentries as $ent => $entdesc) { From f691243dac0bb4c4a322154ef839cac0d0c5db4e Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 16 Apr 2010 18:41:25 +0000 Subject: [PATCH 02/10] Do not use the presence of lan as an indicator of having only one interface. Actually deduce that from the count of interfaces. It is perfectly legal on 2.0 to not have a lan interface and only opt/wan ones. --- usr/local/www/system_advanced_firewall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/system_advanced_firewall.php b/usr/local/www/system_advanced_firewall.php index d9db0fb203..06e2ff5777 100644 --- a/usr/local/www/system_advanced_firewall.php +++ b/usr/local/www/system_advanced_firewall.php @@ -287,7 +287,7 @@ function update_description(itemnum) {   - + 1): ?> Network Address Translation From cfdce2add91f7fbf17094f4b636e6d5488cc4094 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 16 Apr 2010 19:08:32 +0000 Subject: [PATCH 03/10] Ticket #508. Make TFTP proxy configurable by System Advanced->Firewall/NAT for several interfaces. --- etc/inc/filter.inc | 11 +++++++++-- usr/local/www/system_advanced_firewall.php | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index a143a31c5a..bee212a0e1 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1062,6 +1062,14 @@ function filter_nat_rules_generate() { $natrules .= "# TFTP proxy\n"; $natrules .= "rdr-anchor \"tftp-proxy/*\"\n"; + if (!empty($config['system']['tftpinterface'])) { + $tftpifs = explode(",", $config['system']['tftpinterface']); + foreach($tftpifs as $tftpif) { + if ($FilterIflist[$tftpif]) + $natrules .= "rdr pass on {$FilterIflist[$tftpif]['if']} proto udp from any to any port tftp -> 127.0.0.1 port tftp\n"; + } + } + $interface_counter = 0; $vpns_list = filter_get_vpns_list(); $direct_networks_list = filter_get_direct_networks_list(); @@ -2016,8 +2024,7 @@ EOD; # package manager late specific hook anchor "packagelate" -EOD; - $ipfrules .= <<Enter value for Reflection timeout in seconds. + + TFTP Proxy + + + Choose the interfaces where you want TFTP proxy help to be enabled. + +   From 09bbbebbcff5d516a03ffe9f54113c56e9a13009 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 16 Apr 2010 19:38:46 +0000 Subject: [PATCH 04/10] Ticket #511. Actually return the rules from all the packages not just the first one. --- etc/inc/filter.inc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index bee212a0e1..1e3f692831 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -2460,11 +2460,10 @@ function discover_pkg_rules($ruletype) { log_error($errorrules); file_put_contents("{$g['tmp_path']}/rules.packages.{$pkg_inc}", "#{$errorrules}\n"); return ""; - } else { - return $rules; } } } + return $rules; } ?> From 842fb73b8beca3ab991643f97170b30da2fbbb05 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sat, 17 Apr 2010 15:49:13 -0400 Subject: [PATCH 05/10] use 6969 for tftp-proxy --- etc/inc/filter.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 1e3f692831..12d07ef7c0 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1066,7 +1066,7 @@ function filter_nat_rules_generate() { $tftpifs = explode(",", $config['system']['tftpinterface']); foreach($tftpifs as $tftpif) { if ($FilterIflist[$tftpif]) - $natrules .= "rdr pass on {$FilterIflist[$tftpif]['if']} proto udp from any to any port tftp -> 127.0.0.1 port tftp\n"; + $natrules .= "rdr pass on {$FilterIflist[$tftpif]['if']} proto udp from any to any port tftp -> 127.0.0.1 port 6969\n"; } } @@ -1091,7 +1091,7 @@ function filter_nat_rules_generate() { // Open inetd.conf write handle $inetd_fd = fopen("/var/etc/inetd.conf","w"); /* add tftp protocol helper */ - fwrite($inetd_fd, "tftp\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy\ttftp-proxy -v\n"); + fwrite($inetd_fd, "tftp-proxy\tdgram\tudp\twait\t\troot\t/usr/local/sbin/tftp-proxy\ttftp-proxy -v\n"); if(isset($config['nat']['rule'])) { if(!isset($config['system']['disablenatreflection'])) { @@ -2466,4 +2466,4 @@ function discover_pkg_rules($ruletype) { return $rules; } -?> +?> \ No newline at end of file From 1467b79f5565f4ca907a9468f1924c59940aa36b Mon Sep 17 00:00:00 2001 From: pierrepomes Date: Sat, 17 Apr 2010 20:27:58 -0400 Subject: [PATCH 06/10] Use FQDN for HELLO SMTP command. Ticket #443 --- etc/inc/notices.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index d2cf50598f..51605dba18 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -297,6 +297,7 @@ function notify_via_smtp($message) { $smtp->ssl = 0; $smtp->debug = 0; $smtp->html_debug = 0; + $smtp->localhost=$config['system']['hostname'].".".$config['system']['domain']; if($config['notifications']['smtp']['fromaddress']) $from = $config['notifications']['smtp']['fromaddress']; From addbcae775ae23b6fa41d76c419cd54f73c22d8b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 17 Apr 2010 21:56:11 -0400 Subject: [PATCH 07/10] Fix growl issues. Ticket #518 Ticket #519 Submibtted-by: Blake Skinner --- etc/inc/notices.inc | 13 ++++++--- .../www/system_advanced_notifications.php | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 51605dba18..6880844e05 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -346,9 +346,12 @@ function notify_via_growl($message) { global $config; $growl_ip = $config['notifications']['growl']['ipaddress']; $growl_password = $config['notifications']['growl']['password']; + $growl_name = $config['notifications']['growl']['name']; + $growl_notification = $config['notifications']['growl']['notification_name']; + if(!empty($growl_ip)) { - $growl = new Growl($growl_ip, $growl_password); - $growl->notify("pfSense growl alert", "pfSense", "{$message}"); + $growl = new Growl($growl_ip, $growl_password, $growl_name); + $growl->notify("{$growl_notification}", "pfSense", "{$message}"); } } @@ -365,8 +368,12 @@ function register_via_growl() { global $config; $growl_ip = $config['notifications']['growl']['ipaddress']; $growl_password = $config['notifications']['growl']['password']; + $growl_name = $config['notifications']['growl']['name']; + $growl_notification = $config['notifications']['growl']['notification_name']; + if($growl_ip) { - $growl = new Growl($growl_ip, $growl_password); + $growl = new Growl($growl_ip, $growl_password, $growl_name); + $growl->addNotification($growl_notification); $growl->register(); } } diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index 1905a515a6..6b8b12189e 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -46,6 +46,17 @@ if($config['notifications']['growl']['password']) if($config['notifications']['growl']['ipaddress']) $pconfig['ipaddress'] = $config['notifications']['growl']['ipaddress']; +if($config['notifications']['growl']['notification_name']) + $pconfig['notification_name'] = $config['notifications']['growl']['notification_name']; +else + $pconfig['notification_name'] = 'pfSense growl alert'; + +if($config['notifications']['growl']['name']) + $pconfig['name'] = $config['notifications']['growl']['name']; +else + $pconfig['name'] = 'PHP-Growl'; + + // SMTP if($config['notifications']['smtp']['ipaddress']) $pconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress']; @@ -81,6 +92,8 @@ if ($_POST) { // Growl $config['notifications']['growl']['ipaddress'] = $_POST['ipaddress']; $config['notifications']['growl']['password'] = $_POST['password']; + $config['notifications']['growl']['name'] = $_POST['name']; + $config['notifications']['growl']['notification_name'] = $_POST['notification_name']; // SMTP $config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress']; @@ -147,6 +160,20 @@ include("head.inc"); Growl + + Registration Name + + '>
+ Enter the name to register with the Growl server (default: PHP-Growl). + + + + Notification Name + + '>
+ Enter a name for the Growl notifications (default: pfSense growl alert). + + IP Address From 43cea754cf44de2cde9ab71ab9d84e8671915e4a Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 18 Apr 2010 16:53:19 -0400 Subject: [PATCH 08/10] show port and proto --- usr/local/www/vpn_openvpn_server.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/local/www/vpn_openvpn_server.php b/usr/local/www/vpn_openvpn_server.php index f77c8cb1e4..fdf4af49bc 100644 --- a/usr/local/www/vpn_openvpn_server.php +++ b/usr/local/www/vpn_openvpn_server.php @@ -1178,7 +1178,7 @@ function netbios_change() { - + @@ -1195,7 +1195,7 @@ function netbios_change() {
DisabledProtocolProtocol / Port Tunnel Network Description - + / @@ -1260,4 +1260,4 @@ function set_checked($var,& $chk) { $chk = ''; } -?> +?> \ No newline at end of file From 7b7e5b3063e8ce8c7b99378f63f81e18ed2b15b6 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 18 Apr 2010 18:24:06 -0400 Subject: [PATCH 09/10] remove commented out bit that causes annoying pop ups in IE. Ticket #299 --- usr/local/www/javascript/sorttable.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/usr/local/www/javascript/sorttable.js b/usr/local/www/javascript/sorttable.js index b7950f1420..c8c72be838 100644 --- a/usr/local/www/javascript/sorttable.js +++ b/usr/local/www/javascript/sorttable.js @@ -363,18 +363,6 @@ if (document.addEventListener) { document.addEventListener("DOMContentLoaded", sorttable.init, false); } -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write("