[PATCH] Allow RW access to wpa_supplicant config file
Jouni Malinen
j
Sun Feb 27 03:52:51 PST 2011
On Fri, Feb 25, 2011 at 02:24:45PM -0800, Dmitry Shmidt wrote:
> Subject: [PATCH] Allow RW access to wpa_supplicant config file
> diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c
> @@ -288,6 +290,13 @@ struct wpa_config * wpa_config_read(const char *name)
> +#ifdef CONFIG_RW_CONFIG_FILE
> + /* When creating the config file, give group read/write access
> + * to allow backup and restoring the file.
> + */
> + chmod(name, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
> +#endif
Why would this be done when _reading_ the configuration file (this is in
wpa_config_read)? The comment here does not match with that.. Was this
supposed to go into wpa_config_write? And even there, I'm not sure I
understand the need for this to be within wpa_supplicant. I would assume
something external is used to create the configuration file before
starting wpa_supplicant. Shouldn't that program set the file permissions
properly? wpa_supplicant can rewrite the file contents, but it does not
change the permissions..
--
Jouni Malinen PGP id EFC895FA
More information about the Hostap
mailing list