diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 20:08:21 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 20:08:21 +0000 |
commit | 8008038a816c97ca91747fd203abbf4886e9b98b (patch) | |
tree | 3e5496a4c5515521c1c3959a4d645feec6f53286 /etc/inc | |
parent | 3e1aaa572ca0ac4db8b93c751f3a5d0a9f266bda (diff) | |
download | pfsense-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')
-rw-r--r-- | etc/inc/config.inc | 8 |
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 |