summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-21 19:58:24 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-21 19:58:24 +0000
commitd09d9e45bef20ee63ebec755e5a90bc3d4e1fee4 (patch)
tree758c54e920c7abc1a9ad44f6b0f9e7ce908506f2 /etc/inc/config.inc
parent1d5a6e182eca43949d49b6415defd16c7085c9ae (diff)
downloadpfsense-d09d9e45bef20ee63ebec755e5a90bc3d4e1fee4.zip
pfsense-d09d9e45bef20ee63ebec755e5a90bc3d4e1fee4.tar.gz
xmlparse now returns -1 when a file is corrupt. Detect this situatioon and notify the user that we are unlinking the file.
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index c19a694..6bdfc36 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -1635,6 +1635,11 @@ function cleanup_backupcache($revisions = 30) {
if($g['booting'])
print " " . $tocheck . "a";
$newxml = parse_xml_config($backup, $g['xml_rootobj']);
+ if($newxml == "-1") {
+ unlink($backup);
+ log_error("The backup cache file $backup is corrupted. Unlinking.");
+ continue;
+ }
if($newxml['revision']['description'] == "")
$newxml['revision']['description'] = "Unknown";
$tocache[$tocheck] = array('description' => $newxml['revision']['description']);
OpenPOWER on IntegriCloud