зеркало из 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[] = {
|
const SpecialPermission specialPermissions[] = {
|
||||||
// FIXME/bug 785592: implement a CameraBridge so we don't have
|
// FIXME/bug 785592: implement a CameraBridge so we don't have
|
||||||
// to hack around with OS permissions
|
// to hack around with OS permissions
|
||||||
{ "camera", base::PRIVILEGES_CAMERA },
|
{ "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 }
|
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < ArrayLength(specialPermissions); ++i) {
|
for (size_t i = 0; i < ArrayLength(specialPermissions); ++i) {
|
||||||
const char* const permission = specialPermissions[i].perm;
|
const char* const permission = specialPermissions[i].perm;
|
||||||
|
|
|
@ -130,7 +130,6 @@ enum ChildPrivileges {
|
||||||
PRIVILEGES_DEFAULT,
|
PRIVILEGES_DEFAULT,
|
||||||
PRIVILEGES_UNPRIVILEGED,
|
PRIVILEGES_UNPRIVILEGED,
|
||||||
PRIVILEGES_CAMERA,
|
PRIVILEGES_CAMERA,
|
||||||
PRIVILEGES_VIDEO,
|
|
||||||
PRIVILEGES_INHERIT,
|
PRIVILEGES_INHERIT,
|
||||||
PRIVILEGES_LAST
|
PRIVILEGES_LAST
|
||||||
};
|
};
|
||||||
|
|
|
@ -303,14 +303,7 @@ void SetCurrentProcessPrivileges(ChildPrivileges privs) {
|
||||||
uid += getpid();
|
uid += getpid();
|
||||||
}
|
}
|
||||||
if (privs == PRIVILEGES_CAMERA) {
|
if (privs == PRIVILEGES_CAMERA) {
|
||||||
gid_t groups[] = { AID_AUDIO, AID_CAMERA, AID_SDCARD_RW };
|
gid_t groups[] = { 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 };
|
|
||||||
if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) {
|
if (setgroups(sizeof(groups) / sizeof(groups[0]), groups) != 0) {
|
||||||
DLOG(ERROR) << "FAILED TO setgroups() CHILD PROCESS";
|
DLOG(ERROR) << "FAILED TO setgroups() CHILD PROCESS";
|
||||||
_exit(127);
|
_exit(127);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче