]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Android: Allow setgroups to be overridden from build configuration
authorDeepthi Gowri <deepthi@codeaurora.org>
Wed, 6 Feb 2013 22:36:16 +0000 (00:36 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 8 Feb 2013 09:53:58 +0000 (11:53 +0200)
ANDROID_SETGROUPS_OVERRIDE macro can now be used to override setgroups()
values based on build configuration.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

src/utils/os_unix.c

index 23a93becea43c744ae445337c6e992c75d848c58..cc22e83ccea0c0060b52ab399c52ee7449092f62 100644 (file)
@@ -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;