diff options
author | Renato Botelho <renato@netgate.com> | 2015-11-03 17:54:57 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-11-03 17:57:24 -0200 |
commit | f3e15492165e03d055bcf958962f8c39e6ac5449 (patch) | |
tree | 74902f0b8ccefc0d95e7a901ef6855cf936b53d1 /src/etc/inc | |
parent | 1dade399763608bcd59d7505ba36aee624868579 (diff) | |
download | pfsense-f3e15492165e03d055bcf958962f8c39e6ac5449.zip pfsense-f3e15492165e03d055bcf958962f8c39e6ac5449.tar.gz |
A new fix for #4130:
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
Diffstat (limited to 'src/etc/inc')
-rw-r--r-- | src/etc/inc/ipsec.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/etc/inc/ipsec.inc b/src/etc/inc/ipsec.inc index b60dd49..8a27623 100644 --- a/src/etc/inc/ipsec.inc +++ b/src/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); |