summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-07-06 12:42:45 -0300
committerRenato Botelho <renato@netgate.com>2015-07-06 12:42:45 -0300
commitde7ae0bb52c8228d01bbdd31edbdb206d088e0f4 (patch)
tree687b6ff86f1cdaaf9b15acb5ea29b0396be35519
parentd04b109b6d70268a940970cd288013278eb31166 (diff)
downloadpfsense-de7ae0bb52c8228d01bbdd31edbdb206d088e0f4.zip
pfsense-de7ae0bb52c8228d01bbdd31edbdb206d088e0f4.tar.gz
Use right function pfSense_fsync to make sure config file is safe on disk, ticket #4803
-rw-r--r--etc/inc/config.lib.inc6
1 files changed, 2 insertions, 4 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index aede42d..dd0827f 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -365,7 +365,7 @@ function conf_mount_ro() {
clear_subsystem_dirty('mount');
/* sync data, then force a remount of /cf */
- pfSense_sync();
+ pfSense_fsync($g['cf_path']);
mwexec("/sbin/mount -u -r -f -o sync,noatime {$g['cf_path']}");
mwexec("/sbin/mount -u -r -f -o sync,noatime /");
}
@@ -473,9 +473,7 @@ function safe_write_file($file, $content, $force_binary) {
}
// Sync file before returning
- pfSense_sync();
-
- return true;
+ return pfSense_fsync(dirname($file));
}
/****f* config/write_config
OpenPOWER on IntegriCloud