From c871b02cef8f260cf00abb8560f5afb0fa8764f4 Mon Sep 17 00:00:00 2001 From: vliu Date: Wed, 13 Mar 2013 14:44:43 +0800 Subject: [PATCH] Bug 849330 - Camera recording needs AID_SDCARD_RW capability. r=dhylands, a=leo+ --- dom/ipc/ContentParent.cpp | 5 +---- ipc/chromium/src/base/process_util.h | 1 - ipc/chromium/src/base/process_util_linux.cc | 9 +-------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index b509f980077e..0bc4982881cf 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -392,10 +392,7 @@ PrivilegesForApp(mozIApplication* aApp) const SpecialPermission specialPermissions[] = { // FIXME/bug 785592: implement a CameraBridge so we don't have // to hack around with OS permissions - { "camera", base::PRIVILEGES_CAMERA }, - // FIXME/bug 793034: change our video architecture so that we - // can stream video from remote processes - { "deprecated-hwvideo", base::PRIVILEGES_VIDEO } + { "camera", base::PRIVILEGES_CAMERA } }; for (size_t i = 0; i < ArrayLength(specialPermissions); ++i) { const char* const permission = specialPermissions[i].perm; diff --git a/ipc/chromium/src/base/process_util.h b/ipc/chromium/src/base/process_util.h index f5141b18e89e..d372498610ed 100644 --- a/ipc/chromium/src/base/process_util.h +++ b/ipc/chromium/src/base/process_util.h @@ -130,7 +130,6 @@ enum ChildPrivileges { PRIVILEGES_DEFAULT, PRIVILEGES_UNPRIVILEGED, PRIVILEGES_CAMERA, - PRIVILEGES_VIDEO, PRIVILEGES_INHERIT, PRIVILEGES_LAST }; diff --git a/ipc/chromium/src/base/process_util_linux.cc b/ipc/chromium/src/base/process_util_linux.cc index 5b47a21563e4..b285f92c5f73 100644 --- a/ipc/chromium/src/base/process_util_linux.cc +++ b/ipc/chromium/src/base/process_util_linux.cc @@ -303,14 +303,7 @@ void SetCurrentProcessPrivileges(ChildPrivileges privs) { uid += getpid(); } if (privs == PRIVILEGES_CAMERA) { - gid_t groups[] = { AID_AUDIO, AID_CAMERA, AID_SDCARD_RW }; - if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) { - DLOG(ERROR) << "FAILED TO setgroups() CHILD PROCESS"; - _exit(127); - } - } - else if (privs == PRIVILEGES_VIDEO) { - gid_t groups[] = { AID_AUDIO, AID_MEDIA }; + gid_t groups[] = { AID_SDCARD_RW }; if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) { DLOG(ERROR) << "FAILED TO setgroups() CHILD PROCESS"; _exit(127);