diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 240c25210a..ed61f82c58 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/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 28040ee6dd..913903d1e2 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; diff --git a/etc/rc.initial b/etc/rc.initial index 3d600f14a5..ac34e83d42 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. @@ -24,6 +23,19 @@ if [ -f "/tmp/donotbootup" ]; then exit fi +if [ -f /etc/rc.local ]; then + 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 & + else + if [ -f /etc/rc.local.running ]; then + echo ">>> Launching rc.local.running in background..." + sh /etc/rc.local.running & + fi + fi +fi + CONFIG="/cf/conf/config.xml" WORD="https" diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index b85065c00f..916e408a00 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.");