diff options
author | Renato Botelho <renato@netgate.com> | 2015-07-06 13:51:45 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-07-06 13:51:53 -0300 |
commit | a83602e84aa317e98db3bc1684438d120fe2d650 (patch) | |
tree | c5be5fc01d678c9208f37622c0fd7370f0a569d1 /etc | |
parent | bee2f2476ce8443bfca133b60efc234cbb508f18 (diff) | |
download | pfsense-a83602e84aa317e98db3bc1684438d120fe2d650.zip pfsense-a83602e84aa317e98db3bc1684438d120fe2d650.tar.gz |
Make sure temporary config file is safe on disk before rename, ticket #4803
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/config.lib.inc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index dedb3ac..ad9300e 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -486,7 +486,7 @@ function safe_write_file($file, $content, $force_binary) { fflush($fd); fclose($fd); - if (!rename($tmp_file, $file)) { + if (!pfSense_fsync($tmp_file) || !rename($tmp_file, $file)) { // Unable to move temporary file to original @unlink($tmp_file); return false; |