Bug 1667294 - Skip parts of SandboxBroker::LaunchApp when launching a Thunderbird process. r=tkikuchi

Thunderbird does not yet have the same blocklist initialization as Firefox, so we skip calling InitDllBlocklistOOP to avoid a MOZ_RELEASE_ASSERT.

Differential Revision: https://phabricator.services.mozilla.com/D99173
This commit is contained in:
Geoff Lankow 2021-01-19 22:33:02 +00:00
parent 8b497747e3
commit 610cbaea58
2 changed files with 17 additions and 1 deletions

View File

@ -38,6 +38,13 @@ void ModuleLoadFrame::StaticInit(
// the launcher process blocklist.
gFallbackLoaderAPI.SetObserver(aNewObserver);
sLoaderAPI = &gFallbackLoaderAPI;
if (aOutWinLauncherFunctions) {
aOutWinLauncherFunctions->mHandleLauncherError =
[](const mozilla::LauncherError&, const char*) {};
// We intentionally leave mInitDllBlocklistOOP null to make sure calling
// mInitDllBlocklistOOP in non-Firefox hits MOZ_RELEASE_ASSERT.
}
return;
}

View File

@ -313,7 +313,16 @@ bool SandboxBroker::LaunchApp(const wchar_t* aPath, const wchar_t* aArguments,
last_error, last_warning);
}
if (XRE_GetChildProcBinPathType(aProcessType) == BinPathType::Self) {
#ifdef MOZ_THUNDERBIRD
// In Thunderbird, mInitDllBlocklistOOP is null, so InitDllBlocklistOOP would
// hit MOZ_RELEASE_ASSERT.
constexpr bool isThunderbird = true;
#else
constexpr bool isThunderbird = false;
#endif
if (!isThunderbird &&
XRE_GetChildProcBinPathType(aProcessType) == BinPathType::Self) {
RefPtr<DllServices> dllSvc(DllServices::Get());
LauncherVoidResultWithLineInfo blocklistInitOk =
dllSvc->InitDllBlocklistOOP(aPath, targetInfo.hProcess,