]> git.ipfire.org Git - thirdparty/wireguard-tools.git/commit
wg-quick: fsync the temporary file before renaming
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 31 Oct 2017 17:13:31 +0000 (18:13 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 31 Oct 2017 17:13:31 +0000 (18:13 +0100)
commit6e313371cccc13c742a4ed3daaa4d826937f6596
tree3adcda34e110bf2fde5e531635d24839f87eb2d9
parenteb181e811c674080a6cf54bd8ab260dd65ce0b3f
wg-quick: fsync the temporary file before renaming

This ensures that on an unclean shutdown, we either see the old content
or the new content, but not empty content.

Suggested-by: Ka Ho Ng <ngkaho1234@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
src/wg-quick.bash