From 9c98ee85df45ccca8495a92286769e7e2f2c75a3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 2 Jul 2011 22:40:29 -0400 Subject: [PATCH 1/7] If rc.local exists launch it --- etc/rc.initial | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/rc.initial b/etc/rc.initial index 3d600f14a5..097080c43c 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -24,6 +24,11 @@ if [ -f "/tmp/donotbootup" ]; then exit fi +if [ -f /etc/rc.local ]; then + echo ">>> Launching rc.local" + sh /etc/rc.local +fi + CONFIG="/cf/conf/config.xml" WORD="https" From 2ba6c4ab463a6e42dd9b72b6c8905e6e3b5237c2 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 2 Jul 2011 22:41:34 -0400 Subject: [PATCH 2/7] Remove $id. Bump (C) date --- etc/rc.initial | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etc/rc.initial b/etc/rc.initial index 097080c43c..523ac62faa 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -1,9 +1,8 @@ #!/bin/sh -# $Id$ # /etc/rc.initial # part of pfSense by Scott Ullrich -# Copyright (C) 2004-2010 Scott Ullrich, All rights reserved. +# Copyright (C) 2004-2011 Scott Ullrich, All rights reserved. # originally based on m0n0wall (http://neon1.net/m0n0wall) # Copyright (C) 2003-2004 Manuel Kasper . # All rights reserved. From ae660b3ce7d7e2b1f34cb9f1b52eb4ce21e17c42 Mon Sep 17 00:00:00 2001 From: Evgeny Yurchenko Date: Sun, 3 Jul 2011 03:18:23 -0400 Subject: [PATCH 3/7] Feature#1603. URL table aliases should be usable within network type aliases. --- etc/inc/filter.inc | 21 ++++++++++++++++++++- usr/local/www/firewall_aliases_edit.php | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 81b30806b9..d4a1391f46 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -452,6 +452,15 @@ function filter_generate_scrubing() { return $scrubrules; } +function get_alias_type($name) { + global $config; + + foreach ($config['aliases']['alias'] as $alias) + if ($name == $alias['name']) + return $alias['type']; + return ""; +} + function filter_generate_nested_alias($name, $alias, &$aliasnesting, &$aliasaddrnesting) { global $aliastable, $filterdns; @@ -465,8 +474,18 @@ function filter_generate_nested_alias($name, $alias, &$aliasnesting, &$aliasaddr $linelength = strlen($builtlist); $tmpline = ""; if(is_alias($address)) { + if (get_alias_type($address) == 'urltable'){ + // Feature#1603. For this type of alias we do not need to recursively call filter_generate_nested_alias. Just load IPs from the file. + $urlfn = alias_expand_urltable($address); + if ($file_as_arr=file($urlfn)){ + foreach($file_as_arr as $line){ + $address= rtrim($line); + $tmpline .= " $address"; + } + } + } /* We already expanded this alias so there is no neccessity to do it again. */ - if(!isset($aliasnesting[$address])) + else if(!isset($aliasnesting[$address])) $tmpline = filter_generate_nested_alias($address, $aliastable[$address], $aliasnesting, $aliasaddrnesting); } else if(!isset($aliasaddrnesting[$address])) { if(!is_ipaddr($address) && !is_subnet($address) && !is_port($address)) { diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 860274015b..9d0f120302 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -252,7 +252,10 @@ if ($_POST) { if($_POST["address{$x}"] <> "") { if (is_alias($_POST["address{$x}"])) { if (!alias_same_type($_POST["address{$x}"], $_POST['type'])) - $wrongaliases .= " " . $_POST["address{$x}"]; + // But alias type network can include alias type urltable. Feature#1603. + if (!($_POST['type'] == 'network' && + get_alias_type($_POST["address{$x}"]) == 'urltable')) + $wrongaliases .= " " . $_POST["address{$x}"]; } else if ($_POST['type'] == "port") { if (!is_port($_POST["address{$x}"])) $input_errors[] = $_POST["address{$x}"] . " " . gettext("is not a valid port or alias."); From 5f8e5e1460ba685c6f6ca95b37dde614aae20299 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 3 Jul 2011 14:27:15 -0400 Subject: [PATCH 4/7] Launch rc.local into & --- etc/rc.initial | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etc/rc.initial b/etc/rc.initial index 523ac62faa..e6c5de2d52 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -24,8 +24,11 @@ if [ -f "/tmp/donotbootup" ]; then fi if [ -f /etc/rc.local ]; then - echo ">>> Launching rc.local" - sh /etc/rc.local + RCLOCALPWD=`ps awux | grep sendmail | grep -v grep | awk '{ print $2 }'` + if [ "$RCLOCALPWD" = "" ]; then + echo ">>> Launching rc.local in background..." + sh /etc/rc.local & + fi fi CONFIG="/cf/conf/config.xml" From a32c7a23294257e5e23ab9417292905098f48850 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 3 Jul 2011 14:28:28 -0400 Subject: [PATCH 5/7] Fix copy and pasto --- etc/rc.initial | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/rc.initial b/etc/rc.initial index e6c5de2d52..792f7102d8 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -24,7 +24,7 @@ if [ -f "/tmp/donotbootup" ]; then fi if [ -f /etc/rc.local ]; then - RCLOCALPWD=`ps awux | grep sendmail | grep -v grep | awk '{ print $2 }'` + RCLOCALPWD=`ps awux | grep rc.local | grep -v grep | awk '{ print $2 }'` if [ "$RCLOCALPWD" = "" ]; then echo ">>> Launching rc.local in background..." sh /etc/rc.local & From 32cd7c36b5ed97d2354c7e16fe6048aa38f85c9c Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 3 Jul 2011 22:41:06 -0400 Subject: [PATCH 6/7] Add rc.local.running if rc.local is running so it can reattach after a console logout --- etc/rc.initial | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/rc.initial b/etc/rc.initial index 792f7102d8..ac34e83d42 100755 --- a/etc/rc.initial +++ b/etc/rc.initial @@ -28,6 +28,11 @@ if [ -f /etc/rc.local ]; then if [ "$RCLOCALPWD" = "" ]; then echo ">>> Launching rc.local in background..." sh /etc/rc.local & + else + if [ -f /etc/rc.local.running ]; then + echo ">>> Launching rc.local.running in background..." + sh /etc/rc.local.running & + fi fi fi From d9489532794da8d73e6d6e9e65431ac4b78789a6 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Mon, 4 Jul 2011 01:13:13 -0400 Subject: [PATCH 7/7] Don't check OpenVPN ports in use against disabled clients or servers --- etc/inc/openvpn.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 5e4dd1e493..c39bcc86b9 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -137,13 +137,13 @@ function openvpn_port_used($prot, $port) { if (is_array($config['openvpn']['openvpn-server'])) foreach ($config['openvpn']['openvpn-server'] as & $settings) if ($port == $settings['local_port'] && - $prot == $settings['protocol']) + $prot == $settings['protocol'] && !isset($settings['disable'])) return $settings['vpnid']; if (is_array($config['openvpn']['openvpn-client'])) foreach ($config['openvpn']['openvpn-client'] as & $settings) if ($port == $settings['local_port'] && - $prot == $settings['protocol']) + $prot == $settings['protocol'] && !isset($settings['disable'])) return $settings['vpnid']; return 0; @@ -969,4 +969,4 @@ function openvpn_refresh_crls() { } } -?> +?> \ No newline at end of file