diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 20:08:13 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2007-04-21 20:08:13 +0000 |
commit | e3461aa1d0bc85a1ca9a6a09fb34a15da770f49e (patch) | |
tree | 474bb3d915a008685d8be4268308ea9b56aa4864 /etc/inc/config.inc | |
parent | d75c7f7e7476f0e166537e49a70aa446ed391251 (diff) | |
download | pfsense-e3461aa1d0bc85a1ca9a6a09fb34a15da770f49e.zip pfsense-e3461aa1d0bc85a1ca9a6a09fb34a15da770f49e.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.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index a81a3d8..d89bcc4 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(); } + config_unlock(); } /****f* config/parse_config_bootup |