Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jim-p 2011-07-04 11:11:11 -04:00
commit 769c4591ac
4 changed files with 40 additions and 6 deletions

View File

@ -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)) {

View File

@ -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;

View File

@ -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 <mk@neon1.net>.
# 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"

View File

@ -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.");