Bug 849330 - Camera recording needs AID_SDCARD_RW capability. r=dhylands, a=leo+

This commit is contained in:
vliu 2013-03-13 14:44:43 +08:00
Родитель 1e1004521c
Коммит c871b02cef
3 изменённых файлов: 2 добавлений и 13 удалений

Просмотреть файл

@ -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);