[PATCH] Allow RW access to wpa_supplicant config file

Dmitry Shmidt dimitrysh at google.com
Mon Feb 28 18:46:11 EST 2011


On Sun, Feb 27, 2011 at 3:52 AM, Jouni Malinen <j at w1.fi> wrote:
> 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..
>

You are right, RW permissions can be checked/set outside wpa_supplicant.

> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
Thanks,

Dmitry


More information about the HostAP mailing list