summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-21 19:53:08 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-21 19:53:08 +0000
commit1d5a6e182eca43949d49b6415defd16c7085c9ae (patch)
tree60b7e7843384a81bbcb28647893d6236b41fd5eb
parent98e9940a72eb47545f130fff19374aba98348470 (diff)
downloadpfsense-1d5a6e182eca43949d49b6415defd16c7085c9ae.zip
pfsense-1d5a6e182eca43949d49b6415defd16c7085c9ae.tar.gz
When we iterate through the backup cache we call out to parse the configuration file. This can be fatal if the xml contents is corrupted and the process will die out. Instead of dieing, return -1 and let the process continue since we have further logic to detect these issues and restore a previous configuration, etc.
-rw-r--r--etc/inc/xmlparse.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/inc/xmlparse.inc b/etc/inc/xmlparse.inc
index 5fd5c70..c9b545d 100644
--- a/etc/inc/xmlparse.inc
+++ b/etc/inc/xmlparse.inc
@@ -161,9 +161,10 @@ function parse_xml_config_raw($cffile, $rootobj, $isstring = "false") {
while ($data = fread($fp, 4096)) {
if (!xml_parse($xml_parser, $data, feof($fp))) {
- die(sprintf("XML error: %s at line %d\n",
+ log_error(sprintf("XML error: %s at line %d\n",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
+ return -1;
}
}
xml_parser_free($xml_parser);
OpenPOWER on IntegriCloud