aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/wpa_ctrl.c
diff options
context:
space:
mode:
authorAmarnath Hullur Subramanyam <amarnath@qca.qualcomm.com>2015-09-23 19:39:41 (GMT)
committerJouni Malinen <j@w1.fi>2015-09-24 10:15:57 (GMT)
commit10cac5b1a2549a3731e870c574bdd64df7d92877 (patch)
treea2526c170a50000e9bee586f17e1c8e561dfdbc2 /src/common/wpa_ctrl.c
parentc9cfa6a9af47459ba65ff9905c47932a0119adf0 (diff)
downloadhostap-10cac5b1a2549a3731e870c574bdd64df7d92877.zip
hostap-10cac5b1a2549a3731e870c574bdd64df7d92877.tar.gz
hostap-10cac5b1a2549a3731e870c574bdd64df7d92877.tar.bz2
Android: Set ctrl_iface client socket group (AID_WIFI) separately
Split chown() call in wpa_ctrl_open() and wpa_ctrl_open2() to allow the group id to be set even if the process does not have privileges to change the owner. This is needed for modules that need to communicate with wpa_supplicant since without the group change, wpa_supplicant may not have privileges to send the response to a control interface command. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/common/wpa_ctrl.c')
-rw-r--r--src/common/wpa_ctrl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/wpa_ctrl.c b/src/common/wpa_ctrl.c
index 820dd12..5733aa6 100644
--- a/src/common/wpa_ctrl.c
+++ b/src/common/wpa_ctrl.c
@@ -152,6 +152,8 @@ try_again:
#ifdef ANDROID
chmod(ctrl->local.sun_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
+ /* Set group even if we do not have privileges to change owner */
+ chown(ctrl->local.sun_path, -1, AID_WIFI);
chown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI);
if (os_strncmp(ctrl_path, "@android:", 9) == 0) {