diff --git a/hs20/client/osu_client.c b/hs20/client/osu_client.c index e452aa704..660342506 100644 --- a/hs20/client/osu_client.c +++ b/hs20/client/osu_client.c @@ -9,6 +9,9 @@ #include "includes.h" #include #include +#ifdef ANDROID +#include "private/android_filesystem_config.h" +#endif /* ANDROID */ #include "common.h" #include "utils/browser.h" @@ -571,6 +574,21 @@ int hs20_add_pps_mo(struct hs20_osu_client *ctx, const char *uri, } } +#ifdef ANDROID + /* Allow processes running with Group ID as AID_WIFI, + * to read files from SP/ directory */ + if (chown(fname, -1, AID_WIFI)) { + wpa_printf(MSG_INFO, "CTRL: Could not chown directory: %s", + strerror(errno)); + /* Try to continue anyway */ + } + if (chmod(fname, S_IRWXU | S_IRGRP | S_IXGRP) < 0) { + wpa_printf(MSG_INFO, "CTRL: Could not chmod directory: %s", + strerror(errno)); + /* Try to continue anyway */ + } +#endif /* ANDROID */ + snprintf(fname, fname_len, "SP/%s/pps.xml", fqdn); if (os_file_exists(fname)) {