From d0577bd23e8a71403dc2c20d64fe1fdca50f91b1 Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Mon, 6 Jul 2015 12:42:45 -0300 Subject: [PATCH] Use right function pfSense_fsync to make sure config file is safe on disk, ticket #4803 --- etc/inc/config.lib.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 5eb3d5c29c..dedb3accb2 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