Browse Source

Android: Allow setgroups to be overridden from build configuration

ANDROID_SETGROUPS_OVERRIDE macro can now be used to override setgroups()
values based on build configuration.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Deepthi Gowri 12 years ago
parent
commit
83e7aedf72
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/utils/os_unix.c

+ 4 - 0
src/utils/os_unix.c

@@ -257,7 +257,11 @@ int os_program_init(void)
 	 * We ignore errors here since errors are normal if we
 	 * are already running as non-root.
 	 */
+#ifdef ANDROID_SETGROUPS_OVERRIDE
+	gid_t groups[] = { ANDROID_SETGROUPS_OVERRIDE };
+#else /* ANDROID_SETGROUPS_OVERRIDE */
 	gid_t groups[] = { AID_INET, AID_WIFI, AID_KEYSTORE };
+#endif /* ANDROID_SETGROUPS_OVERRIDE */
 	struct __user_cap_header_struct header;
 	struct __user_cap_data_struct cap;