summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/filter.inc1
-rw-r--r--etc/inc/interfaces.inc3
-rw-r--r--etc/inc/lb.inc2
-rw-r--r--etc/inc/openvpn.inc8
-rw-r--r--etc/inc/pfsense-utils.inc12
-rw-r--r--etc/inc/pkg-utils.inc6
-rw-r--r--etc/inc/shaper.inc2
-rw-r--r--etc/inc/system.inc1
-rw-r--r--etc/inc/util.inc7
-rw-r--r--etc/inc/vpn.inc3
-rw-r--r--etc/inc/xmlrpc_client.inc4
11 files changed, 39 insertions, 10 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 7d09e41..3be4049 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1455,6 +1455,7 @@ EOD;
/* pass traffic between statically routed subnets and the subnet on the
interface in question to avoid problems with complicated routing
topologies */
+ $sa = "";
if (is_array($config['staticroutes']['route']) && count($config['staticroutes']['route'])) {
foreach ($config['staticroutes']['route'] as $route) {
unset($sa);
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 4c97418..dc2810f 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -1390,7 +1390,7 @@ function get_current_wan_address($interface = "wan") {
$wancfg = $config['interfaces'][$interface];
$interface = filter_translate_type_to_real_interface($interface);
-
+ $ifinfo = "";
if(in_array($wancfg['ipaddr'], array('dhcp'))) {
/* get interface info with netstat */
exec("/usr/bin/netstat -nWI " . escapeshellarg($interface) . " -f inet", $ifinfo);
@@ -1456,6 +1456,7 @@ function get_number_of_bridged_interfaces() {
$bridges_total = 0;
$bridges = split("\n", `/sbin/ifconfig -a | /usr/bin/grep bridge | grep flags`);
foreach($bridges as $bridge) {
+ $match_array = "";
preg_match_all("/bridge(.*):/",$bridge,$match_array);
if($match_array[1][0] <> "") {
if($match_array[1][0] > $bridges_total)
diff --git a/etc/inc/lb.inc b/etc/inc/lb.inc
index 8bb4ca2..62a41fd 100644
--- a/etc/inc/lb.inc
+++ b/etc/inc/lb.inc
@@ -123,7 +123,9 @@ require_once("functions.inc");
}
function get_state($ip){
+ $result = "";
$pingcmd = exec("/usr/local/bin/sudo /sbin/ping -c1 -t1 -n ".$ip,$result);
+ $match = "";
if (preg_match_all('/.*100\%\spacket\sloss.*/',$result[count($result)-1], $match))
return 0;
if (preg_match_all('/.*0\%\spacket\sloss.*/',$result[count($result)-2], $match))
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index ee151f4..52a5851 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -439,7 +439,7 @@ EOD;
/* Define an OVPN Server tunnel interface in the interfaces array and assign a name */
function ovpn_server_iface(){
- global $config, $g;
+ global $config, $g, $bridge_configure, $filter_configure;
unset($filter_configure);
unset($bridge_configure);
@@ -1018,7 +1018,7 @@ EOD;
/* Define an OVPN tunnel interface in the interfaces array for each client */
function ovpn_client_iface(){
- global $config;
+ global $config, $filter_configure, $bridge_configure;
unset($filter_configure);
unset($bridge_configure);
@@ -1386,7 +1386,7 @@ function ovpn_ccd_sort() {
/* called by interfaces_opt.php */
function ovpn_config_post() {
- global $_POST, $optcfg, $pconfig;
+ global $_POST, $optcfg, $pconfig, $input_errors;
unset($input_errors);
@@ -1414,7 +1414,7 @@ function ovpn_config_post() {
}
function check_bridging($bridge) {
- global $config;
+ global $config, $input_errors, $index;
unset($input_errors);
/* double bridging? */
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 2c6f0e3..11bfec5 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -46,6 +46,8 @@ function get_tmp_file() {
* null
******/
function get_dns_servers() {
+ $lastseen = "";
+ $matches = "";
$dns_servers = array();
$dns = `cat /etc/resolv.conf`;
$dns_s = split("\n", $dns);
@@ -230,7 +232,7 @@ function setup_polling() {
foreach ($iflist as $ifent => $ifname) {
$supported_ints = array('dc', 'em', 'fwe', 'fwip', 'fxp', 'ixgb', 'ste',
'nge', 're', 'rl', 'sf', 'sis', 'ste', 'vge', 'vr', 'xl');
- if (in_array($int_family, $supported_ints) and isset($config['system']['polling'])) {
+ if (in_array($ifname, $supported_ints) and isset($config['system']['polling'])) {
mwexec("/sbin/ifconfig {$interface} polling");
} else {
mwexec("/sbin/ifconfig {$interface} -polling");
@@ -760,6 +762,7 @@ function exec_command_and_return_text($command) {
*/
function execute_command_return_output($command) {
global $fd_log;
+ $lasttext = "";
$fd = popen($command . " 2>&1 ", "r");
echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = \"\";</script>";
$counter = 0;
@@ -848,6 +851,7 @@ function gather_altq_queue_stats($dont_return_root_queues) {
$stats = `/sbin/pfctl -vvsq & /bin/sleep 5;/usr/bin/killall pfctl 2>/dev/null`;
$stats_array = split("\n", $stats);
$queue_stats = array();
+ $match_array = "";
foreach ($stats_array as $stats_line) {
if (preg_match_all("/queue\s+(\w+)\s+/",$stats_line,$match_array))
$queue_name = $match_array[1][0];
@@ -932,7 +936,7 @@ function backup_vip_config_section() {
* to disk/cf.
*/
function restore_config_section($section, $new_contents) {
- global $config;
+ global $config, $g;
conf_mount_rw();
$fout = fopen("{$g['tmp_path']}/tmpxml","w");
fwrite($fout, $new_contents);
@@ -951,6 +955,7 @@ function restore_config_section($section, $new_contents) {
* written by nf@bigpond.net.au
*/
function http_post($server, $port, $url, $vars) {
+ global $errstr;
$user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)";
$urlencoded = "";
while (list($key,$value) = each($vars))
@@ -971,6 +976,7 @@ Content-Length: $content_length
";
+ $errno = "";
$fp = fsockopen($server, $port, $errno, $errstr);
if (!$fp) {
return false;
@@ -1071,6 +1077,7 @@ function rmdir_recursive($path,$follow_links=false) {
*/
function get_memory() {
if(file_exists("/var/log/dmesg.boot")) {
+ $matches = "";
$mem = `cat /var/log/dmesg.boot | grep memory`;
if (preg_match_all("/real memory = .* \((.*) MB/", $mem, $matches))
$real = $matches[1];
@@ -1151,6 +1158,7 @@ function check_firmware_version($tocheck = "all", $return_php = true) {
}
function get_disk_info() {
+ $diskout = "";
exec("df -h | grep -w '/' | awk '{ print $2, $3, $4, $5 }'", $diskout);
return explode(' ', $diskout[0]);
// $size, $used, $avail, $cap
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index 15b305e..dd56e4d 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -277,6 +277,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url =
download_file_with_progress_bar($base_url . '/' . $filename, $fetchto);
$static_output .= " (extracting)";
update_output_window($static_output);
+ $slaveout = "";
exec("/usr/bin/tar --fast-read -O -f {$fetchto} -x +CONTENTS 2>&1", $slaveout);
$workingdir = preg_grep("/instmp/", $slaveout);
$workingdir = $workingdir[0];
@@ -297,6 +298,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url =
}
}
}
+ $pkgaddout = "";
exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_add -fv {$fetchto} 2>&1", $pkgaddout);
@fwrite($fd_log, $pkgname . " " . print_r($pkgaddout, true) . "\n");
return true;
@@ -329,6 +331,7 @@ function download_file_with_progress_bar($url_file, $destination_file) {
function read_header($ch, $string) {
global $file_size, $fout;
+ $regs = "";
$length = strlen($string);
ereg("(Content-Length:) (.*)", $string, $regs);
if($regs[2] <> "") {
@@ -543,6 +546,7 @@ function install_package_xml($pkg) {
download_file_with_progress_bar($afn['item'][0], $prefix . $filename);
if(stristr($filename, ".tgz") <> "") {
fwrite($fd_log, "Extracting tarball to -C for " . $filename . "...\n");
+ $tarout = "";
exec("/usr/bin/tar xvzf " . $prefix . $filename . " -C / 2>&1", $tarout);
fwrite($fd_log, print_r($tarout, true) . "\n");
}
@@ -625,6 +629,8 @@ function delete_package($pkg) {
}
function delete_package_recursive($pkg) {
+ $info = "";
+ $pkgdb = "";
exec("/usr/sbin/pkg_info -r " . $pkg . " 2>&1", $info);
exec("cat {$g['tmp_path']}/y | /usr/sbin/pkg_delete " . $pkg ." > /dev/null 2>&1");
exec("/bin/ls /var/db/pkg", $pkgdb);
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 461f916..00316b1 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -307,6 +307,8 @@ function filter_generate_pf_altq_rules() {
/* I don't think we're in IPFW anymore Toto */
global $config, $g, $tcpflags;
+
+ $i = 0;
$lancfg = $config['interfaces']['lan'];
$pptpdcfg = $config['pptpd'];
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index fdf11ca..dc3a850 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -940,6 +940,7 @@ function system_dmesg_save() {
echo "system_dmesg_save() being called $mt\n";
}
+ $dmesg = "";
exec("/sbin/dmesg", $dmesg);
/* find last copyright line (output from previous boots may be present) */
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 14ead40..4235adf 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -273,6 +273,7 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
break;
case "media":
$intlist = explode(" ", trim(shell_exec("/sbin/ifconfig -l")));
+ $ifconfig = "";
exec("/sbin/ifconfig -a", $ifconfig);
$regexp = '/(' . implode('|', $intlist) . '):\s/';
$ifstatus = preg_grep('/status:/', $ifconfig);
@@ -283,9 +284,11 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
break;
}
/* build interface list with netstat */
+ $linkinfo = "";
exec("/usr/bin/netstat -inW -f link | awk '{ print $1, $4 }'", $linkinfo);
array_shift($linkinfo);
/* build ip address list with netstat */
+ $ipinfo = "";
exec("/usr/bin/netstat -inW -f inet | awk '{ print $1, $4 }'", $ipinfo);
array_shift($ipinfo);
foreach($linkinfo as $link) {
@@ -330,7 +333,8 @@ function get_interface_list($mode = "active", $keyby = "physical", $vfaces = "")
function mwexec($command) {
global $g;
-
+ $oarr = "";
+ $retval = "";
if ($g['debug']) {
if (!$_SERVER['REMOTE_ADDR'])
echo "mwexec(): $command\n";
@@ -490,6 +494,7 @@ function verify_digital_signature($fname) {
/* obtain MAC address given an IP address by looking at the ARP table */
function arp_get_mac_by_ip($ip) {
mwexec("/sbin/ping -c 1 -t 1 {$ip}");
+ $arpoutput = "";
exec("/usr/sbin/arp -n {$ip}", $arpoutput);
if ($arpoutput[0]) {
diff --git a/etc/inc/vpn.inc b/etc/inc/vpn.inc
index 18bc8a4..c98462a 100644
--- a/etc/inc/vpn.inc
+++ b/etc/inc/vpn.inc
@@ -69,6 +69,7 @@ function vpn_ipsec_failover_configure() {
}
function find_last_gif_device() {
+ $regs = "";
$last_gif_found = -1;
if (!($fp = popen("/sbin/ifconfig -l", "r"))) return -1;
$ifconfig_data = fread($fp, 4096);
@@ -85,7 +86,7 @@ function find_last_gif_device() {
}
function vpn_ipsec_configure($ipchg = false) {
- global $config, $g;
+ global $config, $g, $sa, $sn;
if($g['booting'] == true) {
/* determine if we should load the via padlock module */
diff --git a/etc/inc/xmlrpc_client.inc b/etc/inc/xmlrpc_client.inc
index 9b5b655..6b58b1f 100644
--- a/etc/inc/xmlrpc_client.inc
+++ b/etc/inc/xmlrpc_client.inc
@@ -729,6 +729,7 @@ class XML_RPC_Client extends XML_RPC_Base {
$this->proxy_user = $proxy_user;
$this->proxy_pass = $proxy_pass;
+ $match = "";
preg_match('@^(http://|https://|ssl://)?(.*)$@', $server, $match);
if ($match[1] == '') {
if ($port == 443) {
@@ -1297,7 +1298,7 @@ class XML_RPC_Message extends XML_RPC_Base
function getEncoding($data)
{
global $XML_RPC_defencoding;
-
+ $match = "";
if (preg_match('/<\?xml[^>]*\s*encoding\s*=\s*[\'"]([^"\']*)[\'"]/i',
$data, $match))
{
@@ -1834,6 +1835,7 @@ function XML_RPC_iso8601_encode($timet, $utc = 0)
function XML_RPC_iso8601_decode($idate, $utc = 0)
{
$t = 0;
+ $regs = "";
if (ereg('([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})', $idate, $regs)) {
if ($utc) {
$t = gmmktime($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]);
OpenPOWER on IntegriCloud