aboutsummaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorAmarnath Hullur Subramanyam <amarnath@qca.qualcomm.com>2015-09-23 12:39:41 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-10-08 13:53:06 -0700
commit86eb5446383b3effa5f1e42dda5867a80a63c10c (patch)
tree10c65f25f5bf124d0142d1a5e86bc92d7bf194c4 /src/common
parentd38ac1e31cd8cbbc2d00170761b32dcd3bd4eab7 (diff)
downloadandroid_external_wpa_supplicant_8-86eb5446383b3effa5f1e42dda5867a80a63c10c.tar.gz
android_external_wpa_supplicant_8-86eb5446383b3effa5f1e42dda5867a80a63c10c.tar.bz2
android_external_wpa_supplicant_8-86eb5446383b3effa5f1e42dda5867a80a63c10c.zip
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> Git-commit: 10cac5b1a2549a3731e870c574bdd64df7d92877 Git-repo: git://w1.fi/srv/git/hostap.git Change-Id: Ic04d9996c51c514f1aa1bef6fd104a3e5c8d7668 CRs-Fixed: 913406
Diffstat (limited to 'src/common')
-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 820dd128..5733aa60 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) {