summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-04-21 20:08:21 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-04-21 20:08:21 +0000
commit8008038a816c97ca91747fd203abbf4886e9b98b (patch)
tree3e5496a4c5515521c1c3959a4d645feec6f53286 /etc/inc/config.inc
parent3e1aaa572ca0ac4db8b93c751f3a5d0a9f266bda (diff)
downloadpfsense-8008038a816c97ca91747fd203abbf4886e9b98b.zip
pfsense-8008038a816c97ca91747fd203abbf4886e9b98b.tar.gz
* Use copy instead of system() * Lock the configuration before doing this operation * Unlink config.cache if it exists * Send the image to RO after this operation
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index b29b210..e71b489 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -297,11 +297,15 @@ function discover_last_backup() {
}
function restore_backup($file) {
+ config_lock();
if(file_exists($file)) {
conf_mount_rw();
- system("cp $file /cf/conf/config.xml");
+ copy("$file /cf/conf/config.xml");
+ unlink_if_exists("/tmp/config.cache");
+ log_error("pfSense is restoring the configuration $file");
+ conf_mount_ro();
}
- log_error("pfSense is restoring the configuration $file");
+ config_unlock();
}
/****f* config/parse_config_bootup
OpenPOWER on IntegriCloud