diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 19:58:24 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 19:58:24 +0000 |
commit | d09d9e45bef20ee63ebec755e5a90bc3d4e1fee4 (patch) | |
tree | 758c54e920c7abc1a9ad44f6b0f9e7ce908506f2 /etc/inc/config.inc | |
parent | 1d5a6e182eca43949d49b6415defd16c7085c9ae (diff) | |
download | pfsense-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.inc | 5 |
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']); |