Make sure configuration is saved to storage device
authorMitchell Wills <mwills@google.com>
Tue, 25 Aug 2015 00:24:30 +0000 (17:24 -0700)
committerJouni Malinen <j@w1.fi>
Thu, 27 Aug 2015 15:06:05 +0000 (18:06 +0300)
commita218e1ded44cc88072f4e1896fdd8bd24f1829ac
tree607da96fae809f1fa2b9dc719dc1c432e1bb8a87
parent6aaa661af1acc65403ad6f5557f356bd623ba97b
Make sure configuration is saved to storage device

Config file is written to a temp file and then it is renamed to the
original config file. However, it is possible that the rename operation
will be commited to storage while file data will be still in cache
causing original config file to be empty or partially written in case of
a system reboot without a clean shutdown. Make this less likely to occur
by forcing the data to be written to the storage device before renaming
the file.

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
src/utils/os.h
src/utils/os_internal.c
src/utils/os_none.c
src/utils/os_unix.c
src/utils/os_win32.c
wpa_supplicant/config_file.c