From 8c27e19c1c20f05db9e9e061dffb3aa56d8275b9 Mon Sep 17 00:00:00 2001 From: Jorge Lucangeli Obes Date: Fri, 29 Sep 2017 14:56:07 -0400 Subject: [PATCH] run-as: Keep supplementary groups. This broke TCP debugging because processes don't inherit the AID_INET group. Bug: 67058466 Test: adb shell run-as com.example.native_activity groups prints "inet". Change-Id: Ieb461dccda8611057bb2d16334e584eb5e57c8b1 --- run-as/run-as.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/run-as/run-as.cpp b/run-as/run-as.cpp index e7b8cc2c8..b27cfad7c 100644 --- a/run-as/run-as.cpp +++ b/run-as/run-as.cpp @@ -194,6 +194,7 @@ int main(int argc, char* argv[]) { ScopedMinijail j(minijail_new()); minijail_change_uid(j.get(), uid); minijail_change_gid(j.get(), gid); + minijail_keep_supplementary_gids(j.get()); minijail_enter(j.get()); if (selinux_android_setcontext(uid, 0, info.seinfo, pkgname) < 0) {