summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-07-06 13:55:54 -0300
committerRenato Botelho <renato@netgate.com>2015-07-06 13:55:54 -0300
commit38b35612ea912ae72233b2a310f47f8b6d8fe586 (patch)
tree24a4fab0947aab3e081b9df215b7742fd2b10cee /etc
parenta83602e84aa317e98db3bc1684438d120fe2d650 (diff)
downloadpfsense-38b35612ea912ae72233b2a310f47f8b6d8fe586.zip
pfsense-38b35612ea912ae72233b2a310f47f8b6d8fe586.tar.gz
Make sure config.xml is safe on disk when restoring a backup, ticket #4803
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.lib.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index ad9300e..1caa096 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -218,6 +218,7 @@ function restore_backup($file) {
conf_mount_rw();
unlink_if_exists("{$g['tmp_path']}/config.cache");
copy("$file", "/cf/conf/config.xml");
+ pfSense_fsync("/cf/conf/config.xml");
disable_security_checks();
log_error(sprintf(gettext('%1$s is restoring the configuration %2$s'), $g['product_name'], $file));
file_notice("config.xml", sprintf(gettext('%1$s is restoring the configuration %2$s'), $g['product_name'], $file), "pfSenseConfigurator", "");
OpenPOWER on IntegriCloud