Skip to content

Commit 696bb1b

Browse files
committed
Create wpa_supplicant.conf with chmod=660
This is necessary for allowing the backup service to backup and restore wpa_supplicant.conf. Signed-off-by: Mike Lockwood <[email protected]>
1 parent 18785c2 commit 696bb1b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

config_file.c

+6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "base64.h"
2424
#include "eap_methods.h"
2525

26+
#include <sys/stat.h>
27+
2628

2729
/**
2830
* wpa_config_get_line - Read the next configuration file line
@@ -258,6 +260,10 @@ struct wpa_config * wpa_config_read(const char *name)
258260
os_free(config);
259261
return NULL;
260262
}
263+
/* When creating the config file, give group read/write access
264+
* to allow backup and restoring the file.
265+
*/
266+
chmod(name, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
261267

262268
while (wpa_config_get_line(buf, sizeof(buf), f, &line, &pos)) {
263269
if (os_strcmp(pos, "network={") == 0) {

0 commit comments

Comments
 (0)