From: Deepthi Gowri Date: Wed, 6 Feb 2013 22:36:16 +0000 (+0200) Subject: Android: Allow setgroups to be overridden from build configuration X-Git-Tag: aosp-kk-from-upstream~587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83e7aedf729aa7db8ab0dba7bab724564a33fcd2;p=thirdparty%2Fhostap.git 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 --- diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 23a93bece..cc22e83cc 100644 --- a/src/utils/os_unix.c +++ b/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;