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.

Bug: 19224089

Change-Id: I1709cdd5e5c6dfa3073e42c644fae941b43401cc
Signed-off-by: Vinit Deshpande <vinitd@google.com>
1 file changed