Don't write to wpa_supplicant.conf directly
authorVinit Deshpande <vinitd@google.com>
Thu, 5 Feb 2015 20:48:02 +0000 (12:48 -0800)
committerJouni Malinen <j@w1.fi>
Sat, 7 Feb 2015 13:37:13 +0000 (15:37 +0200)
commit663ae2f417bc1896cbe1fef917b9ade06bfd4071
tree2e1496b144b9f7af6d3ae4f66c24ae11797bafd4
parent4cfc46934d8a984306737465053a8bd330a2c14d
Don't write to wpa_supplicant.conf directly

There is a chance that wpa_supplicant may get killed during
the time it is writing config file. If this happens, user
information like SSIDs and passwords can be lost forever.

This change works around that by writing config to a
temporary file and then renaming the file to the correct name.

Signed-off-by: Vinit Deshpande <vinitd@google.com>
wpa_supplicant/config_file.c