diff options
author | Renato Botelho <renato@netgate.com> | 2015-07-06 12:42:45 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-07-06 12:43:01 -0300 |
commit | d0577bd23e8a71403dc2c20d64fe1fdca50f91b1 (patch) | |
tree | a46f97d40f42bddf43fab2627586911d8c526757 /etc/inc | |
parent | 8cbb22c653349b9d6ed015b6aadbd1f23e655ac2 (diff) | |
download | pfsense-d0577bd23e8a71403dc2c20d64fe1fdca50f91b1.zip pfsense-d0577bd23e8a71403dc2c20d64fe1fdca50f91b1.tar.gz |
Use right function pfSense_fsync to make sure config file is safe on disk, ticket #4803
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.lib.inc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 5eb3d5c..dedb3ac 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -379,7 +379,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 /"); } @@ -493,9 +493,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 |