Bug 921817 - Enable sandbox in non-preallocated child processes. r=kang, r=bent

This commit is contained in:
Jed Davis
2013-10-15 10:02:26 -04:00
parent e95d3d7411
commit 8dbc2041aa

View File

@@ -1502,6 +1502,17 @@ ContentParent::ContentParent(mozIApplication* aApp,
} }
} }
#ifdef MOZ_CONTENT_SANDBOX
// Bug 921817. We enable the sandbox in RecvSetProcessPrivileges,
// which is where a preallocated process drops unnecessary privileges,
// but a non-preallocated process will already have changed its
// uid/gid/etc immediately after forking. Thus, we send this message,
// which is otherwise a no-op, to sandbox it at an appropriate point
// during startup.
if (aOSPrivileges != base::PRIVILEGES_INHERIT) {
SendSetProcessPrivileges(base::PRIVILEGES_INHERIT);
}
#endif
} }
#ifdef MOZ_NUWA_PROCESS #ifdef MOZ_NUWA_PROCESS