Bug 945562 - Camera also needs AID_SDCARD_R and AID_MEDIA_RW groups in jb. r=dhylands
authorIndrajeet Kumar <ikumar@codeaurora.org>
Mon, 09 Dec 2013 00:21:37 -0800
changeset 161548 0ae6abb440f5dcafb3dee9d0bf3af9bb41199338
parent 161547 65668f901993d6b1865c0ccd857253cf36218936
child 161549 d20f05508b0cc6be53847501413b511676f25a65
push id25885
push userkwierso@gmail.com
push dateSat, 21 Dec 2013 02:02:33 +0000
treeherdermozilla-central@33c392700cac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdhylands
bugs945562
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 945562 - Camera also needs AID_SDCARD_R and AID_MEDIA_RW groups in jb. r=dhylands
ipc/chromium/src/base/process_util_linux.cc
--- a/ipc/chromium/src/base/process_util_linux.cc
+++ b/ipc/chromium/src/base/process_util_linux.cc
@@ -298,17 +298,21 @@ void SetCurrentProcessPrivileges(ChildPr
     if (!pix_max_ok) {
       DLOG(ERROR) << "Can't safely get unique uid/gid";
       _exit(127);
     }
     gid += getpid();
     uid += getpid();
   }
   if (privs == PRIVILEGES_CAMERA) {
+#if ANDROID_VERSION < 17
     gid_t groups[] = { AID_SDCARD_RW };
+#else
+    gid_t groups[] = { AID_SDCARD_R, AID_SDCARD_RW, AID_MEDIA_RW };
+#endif
     if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) {
       DLOG(ERROR) << "FAILED TO setgroups() CHILD PROCESS";
       _exit(127);
     }
   }
 #endif
   if (setgid(gid) != 0) {
     DLOG(ERROR) << "FAILED TO setgid() CHILD PROCESS";