зеркало из https://github.com/mozilla/gecko-dev.git
Bug 849330 - Camera recording needs AID_SDCARD_RW capability. r=dhylands, a=leo+
This commit is contained in:
Родитель
1e1004521c
Коммит
c871b02cef
|
@ -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;
|
||||
|
|
|
@ -130,7 +130,6 @@ enum ChildPrivileges {
|
|||
PRIVILEGES_DEFAULT,
|
||||
PRIVILEGES_UNPRIVILEGED,
|
||||
PRIVILEGES_CAMERA,
|
||||
PRIVILEGES_VIDEO,
|
||||
PRIVILEGES_INHERIT,
|
||||
PRIVILEGES_LAST
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче