summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2017-04-04 14:47:35 -0400
committerjim-p <jimp@pfsense.org>2017-04-04 14:48:09 -0400
commit593f052172b0969dfe9e9db755a9a41200e67ab1 (patch)
treeac683fafac328bfe7a607219fde3727e6fe21d3c /src
parent421907192bc11c1aa1787d8c139dcd0e1f110c15 (diff)
downloadpfsense-593f052172b0969dfe9e9db755a9a41200e67ab1.zip
pfsense-593f052172b0969dfe9e9db755a9a41200e67ab1.tar.gz
Improve XMLRPC failure messages/exception handling. Fixes #7448
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/xmlrpc_client.inc3
-rwxr-xr-xsrc/etc/rc.filter_synchronize7
2 files changed, 7 insertions, 3 deletions
diff --git a/src/etc/inc/xmlrpc_client.inc b/src/etc/inc/xmlrpc_client.inc
index 26a93be..962265d 100644
--- a/src/etc/inc/xmlrpc_client.inc
+++ b/src/etc/inc/xmlrpc_client.inc
@@ -111,7 +111,8 @@ class pfsense_xmlrpc_client {
if ($previouserror == null) {
// CurlException doesnt get filled with PreviousError,
// however we dont want to show the stacktrace included in the 'message' to non sysadmin users
- $this->error = "CurlException calling XMLRPC method {$method} #" . $e->getMessage();
+ preg_match("/HTTP_Request2_ConnectionException: (.*) in \/.*/", $e->getMessage(), $errormsg);
+ $this->error = "A communications error occurred while attempting to call XMLRPC method {$method}: " . $errormsg[1];
} else {
$this->error = "CurlException calling XMLRPC method {$method} #" . $previouserror->getMessage();
}
diff --git a/src/etc/rc.filter_synchronize b/src/etc/rc.filter_synchronize
index a6f6aa7..2eb9d6c 100755
--- a/src/etc/rc.filter_synchronize
+++ b/src/etc/rc.filter_synchronize
@@ -96,8 +96,11 @@ function carp_check_version() {
$resp = $rpc_client->xmlrpc_method('host_firmware_version');
log_error(sprintf(gettext("XMLRPC versioncheck:").$resp['config_version'] ." -- ". $config['version']));
- if (!isset($resp['config_version']) ||
- ($resp['config_version'] != $config['version'])) {
+ if (!isset($resp['config_version'])) {
+ update_filter_reload_status("The {$g['product_name']} software configuration version of the other member could not be determined. Skipping synchronization to avoid causing a problem!");
+ log_error("The {$g['product_name']} software configuration version of the other member could not be determined. Skipping synchronization to avoid causing a problem!");
+ return false;
+ } elseif ($resp['config_version'] != $config['version']) {
update_filter_reload_status("The other member is on a different configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
log_error("The other member is on a different configuration version of {$g['product_name']}. Sync will not be done to prevent problems!");
return false;
OpenPOWER on IntegriCloud