summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2010-02-04 21:50:50 -0500
committerChris Buechler <cmb@pfsense.org>2010-02-04 21:50:50 -0500
commite2d8ec152edce2e632e2eaf14476f2fafcf4cf8a (patch)
tree4cd3df1156db0b36400253207311022bd793be26
parent1f28c1e03fc2f87975781545d0087e5d42609366 (diff)
parent59c2ea378009024ae2f8e24db746f996233e83d1 (diff)
downloadpfsense-e2d8ec152edce2e632e2eaf14476f2fafcf4cf8a.zip
pfsense-e2d8ec152edce2e632e2eaf14476f2fafcf4cf8a.tar.gz
Merge branch 'RELENG_1_2' of http://gitweb.pfsense.org/pfsense/mainline into RELENG_1_2
-rw-r--r--etc/inc/filter.inc11
-rw-r--r--etc/inc/system.inc10
-rw-r--r--usr/local/www/diag_packet_capture.php71
-rwxr-xr-xusr/local/www/guiconfig.inc15
-rwxr-xr-xusr/local/www/xmlrpc.php9
5 files changed, 61 insertions, 55 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 8cc9635..ba71d04 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -3217,6 +3217,11 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens
$cli->setDebug(1);
/* send our XMLRPC message and timeout after 240 seconds */
$resp = $cli->send($msg, "240");
+ if($resp->faultCode()) {
+ $error = "A communications error occurred while attempting communication with {$url}:{$port} (pfsense.exec_php).";
+ log_error($error);
+ return;
+ }
if(!$resp) {
$error = "A communications error occured while attempting XMLRPC sync with username {$username} {$url}:{$port}.";
log_error($error);
@@ -3229,6 +3234,12 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens
log_error("XMLRPC sync successfully completed with {$url}:{$port}.");
$numberofruns = 3;
}
+ $parsed_response = XML_RPC_Decode($resp->value());
+ if(!is_array($firewall_info) && trim($firewall_info) == "Authentication failed") {
+ $error = "A authentication failure occurred while trying to access {$url}:{$port} (pfsense.exec_php).";
+ log_error($error);
+ $numberofruns = 5;
+ }
$numberofruns++;
}
}
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index b98889d..2a613a1 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -690,7 +690,7 @@ function system_generate_lighty_config($filename,
$port = 80,
$document_root = "/usr/local/www/",
$cert_location = "cert.pem",
- $max_procs = 2,
+ $max_procs = 4,
$max_requests = "1",
$fast_cgi_enable = true,
$captive_portal = false) {
@@ -735,19 +735,19 @@ function system_generate_lighty_config($filename,
}
if($avail > 97 and $avail < 128) {
- $max_procs = 1;
+ $max_procs = 2;
}
if($avail > 127 and $avail < 256) {
- $max_procs = 1;
+ $max_procs = 3;
}
if($avail > 255 and $avail < 384) {
- $max_procs = 3;
+ $max_procs = 4;
}
if($avail > 384) {
- $max_procs = 4;
+ $max_procs = 5;
}
if($captive_portal == true) {
diff --git a/usr/local/www/diag_packet_capture.php b/usr/local/www/diag_packet_capture.php
index 69fd677..a443a41 100644
--- a/usr/local/www/diag_packet_capture.php
+++ b/usr/local/www/diag_packet_capture.php
@@ -121,7 +121,7 @@ include("head.inc"); ?>
<td width="17%" valign="top" class="vncellreq">Interface</td>
<td width="83%" class="vtable">
<select name="interface" class="formfld">
- <?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
+<?php $interfaces = array('wan' => 'WAN', 'lan' => 'LAN');
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
if (isset($config['interfaces']['opt' . $i]['enable']) &&
!$config['interfaces']['opt' . $i]['bridge'])
@@ -129,9 +129,9 @@ include("head.inc"); ?>
}
foreach ($interfaces as $iface => $ifacename): ?>
<option value="<?=$iface;?>" <?php if ($selectedif == $iface) echo "selected"; ?>>
- <?php echo $ifacename;?>
+<?php echo $ifacename;?>
</option>
- <?php endforeach;?>
+<?php endforeach;?>
</select>
<br/>Select the interface the traffic will be passing through. Typically this will be the WAN interface.
</td>
@@ -189,7 +189,7 @@ include("head.inc"); ?>
<tr>
<td width="17%" valign="top">&nbsp;</td>
<td width="83%">
- <?php
+<?php
/*check to see if packet capture tcpdump is already running*/
$processcheck = (trim(shell_exec("ps axw -O pid= | grep tcpdump | grep $fn | grep -v pflog")));
@@ -208,7 +208,7 @@ include("head.inc"); ?>
echo "<input type=\"submit\" name=\"downloadbtn\" value=\"Download Capture\">";
echo "&nbsp;&nbsp;(The packet capture file was last updated: " . date("F jS, Y g:i:s a.", filemtime($fp.$fn)) . ")";
}
- ?>
+?>
</td>
</tr>
<tr>
@@ -217,57 +217,48 @@ include("head.inc"); ?>
echo "<font face='terminal' size='2'>";
if ($processisrunning == true)
echo("<strong>Packet Capture is running.</strong><br/>");
-
- if ($do_tcpdump) {
- if ($port != "")
- {
+ if ($do_tcpdump) {
+ if ($port != "") {
$searchport = "and port ".$port;
- if($host <> "")
- $searchport = "and port ".$port;
- else
- $searchport = "port ".$port;
- }
- else
- {
+ if($host <> "")
+ $searchport = "and port ".$port;
+ else
+ $searchport = "port ".$port;
+ } else {
$searchport = "";
}
- if ($host != "")
- {
+ if ($host != "") {
$searchhost = "host " . $host;
- }
- else
- {
+ } else {
$searchhost = "";
}
- if ($count != "0" )
- {
+ if ($count != "0" ) {
$searchcount = "-c " . $count;
- }
- else
- {
+ } else {
$searchcount = "";
}
- $selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
-
- if ($action == "Start")
- {
+ $selectedif = convert_friendly_interface_to_real_interface_name($selectedif);
+
+ if ($action == "Start") {
echo("<strong>Packet Capture is running.</strong><br/>");
mwexec_bg ("/usr/sbin/tcpdump -i $selectedif $searchcount -s $packetlength -w $fp$fn $searchhost $searchport");
- }
- else //action = stop
- {
-
+ } else {
+ //action = stop
echo("<strong>Packet Capture stopped. <br/><br/>Packets Captured:</strong><br/>");
- ?>
+?>
<textarea style="width:98%" name="code" rows="15" cols="66" wrap="off" readonly="readonly">
- <?php
- system ("/usr/sbin/tcpdump $disabledns $detail -r $fp$fn");?>
- </textarea><?php
+<?php
+ system ("/usr/sbin/tcpdump $disabledns $detail -r $fp$fn");
+ conf_mount_ro();
+?>
+ </textarea>
+<?php
}
- }?>
+ }
+?>
</td>
</tr>
<tr>
@@ -277,8 +268,6 @@ include("head.inc"); ?>
</td></tr></table>
<?php
-conf_mount_ro();
-
include("fend.inc");
?>
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index ebec2ec..5400e22 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -91,12 +91,15 @@ $d_ovpnclidirty_path = "/tmp/ovpn-cli.dirty";
/* used by progress bar */
$lastseen = "-1";
-if (file_exists($d_firmwarelock_path)) {
- if (!$d_isfwfile) {
- header("Location: system_firmware.php");
- exit;
- } else {
- return;
+/* Some ajax scripts still need access to GUI */
+if(!$ignorefirmwarelock) {
+ if (file_exists($d_firmwarelock_path)) {
+ if (!$d_isfwfile) {
+ header("Location: system_firmware.php");
+ exit;
+ } else {
+ return;
+ }
}
}
diff --git a/usr/local/www/xmlrpc.php b/usr/local/www/xmlrpc.php
index 564d58d..51fc345 100755
--- a/usr/local/www/xmlrpc.php
+++ b/usr/local/www/xmlrpc.php
@@ -55,7 +55,7 @@ $xmlrpc_g = array(
"return" => array(
"true" => new XML_RPC_Response(new XML_RPC_Value(true, $XML_RPC_Boolean)),
"false" => new XML_RPC_Response(new XML_RPC_Value(false, $XML_RPC_Boolean)),
- "authfail" => new XML_RPC_Response(0, $XML_RPC_erruser+1, "Authentication failure")
+ "authfail" => new XML_RPC_Response(new XML_RPC_Value("Authentication failed", $XML_RPC_String))
)
);
@@ -83,11 +83,14 @@ function exec_php_xmlrpc($raw_params) {
if(!xmlrpc_auth($params)) return $xmlrpc_g['return']['authfail'];
$exec_php = $params[0];
eval($exec_php);
- return $xmlrpc_g['return']['true'];
+ if($toreturn) {
+ $response = XML_RPC_encode($toreturn);
+ return new XML_RPC_Response($response);
+ } else
+ return $xmlrpc_g['return']['true'];
}
-
/*****************************/
OpenPOWER on IntegriCloud