mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Make sure temporary config file is safe on disk before rename, ticket #4803
This commit is contained in:
parent
bee2f2476c
commit
a83602e84a
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user