summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-11-03 17:54:57 -0200
committerRenato Botelho <renato@netgate.com>2015-11-03 17:54:57 -0200
commitde0ecc0e071f5f3c677ae16513fa36538576ebfd (patch)
treec74d84fa7c211d971e8e8efe42e45858625c98d0
parentd6d9144e203f6fc350b4c96dc49271553e121b02 (diff)
downloadpfsense-de0ecc0e071f5f3c677ae16513fa36538576ebfd.zip
pfsense-de0ecc0e071f5f3c677ae16513fa36538576ebfd.tar.gz
A new fix for #4130:RELENG_2_2_5
The fix added for this bug, that check xml file size is < 200 to decide if file must or not be read created a new issue, single entry is not showed. Instead of doing this, check parse_xml_config() return and return empty array when it's -1 While here, prevent errors saying parse_xml_config() doesn't exist and make sure xmlparse.inc is required
-rw-r--r--etc/inc/ipsec.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/inc/ipsec.inc b/etc/inc/ipsec.inc
index b60dd49..8a27623 100644
--- a/etc/inc/ipsec.inc
+++ b/etc/inc/ipsec.inc
@@ -559,13 +559,21 @@ function ipsec_dump_mobile() {
return array();
}
- /* This is needed for fixing #4130 */
- if (filesize("{$g['tmp_path']}/strongswan_leases.xml") < 200) {
+ if (filesize("{$g['tmp_path']}/strongswan_leases.xml") == 0) {
return array();
}
+ if (!function_exists('parse_xml_config')) {
+ require_once('xmlparse.inc');
+ }
+
$custom_listtags = array('lease', 'pool');
$response = parse_xml_config("{$g['tmp_path']}/strongswan_leases.xml", "leases");
+
+ if ($response == -1) {
+ return array();
+ }
+
@unlink("{$g['tmp_path']}/strongswan_leases.xml");
unset($custom_listtags, $_gb);
OpenPOWER on IntegriCloud