Bug 1430118 - Look for log file names in the passed environment. r=bobowen

MozReview-Commit-ID: HVUDYoEwjCd

--HG--
extra : rebase_source : 4121114558901489cd3954f433fe70bdea32a683
This commit is contained in:
Gian-Carlo Pascutto 2018-01-17 09:54:48 +01:00
Родитель 6071f20f6c
Коммит e5687f9731
1 изменённых файлов: 10 добавлений и 2 удалений

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

@ -213,7 +213,11 @@ SandboxBroker::LaunchApp(const wchar_t *aPath,
#endif
// Enable the child process to write log files when setup
wchar_t const* logFileName = _wgetenv(L"MOZ_LOG_FILE");
wchar_t const* logFileName = nullptr;
auto it = aEnvironment.find(ENVIRONMENT_LITERAL("MOZ_LOG_FILE"));
if (it != aEnvironment.end()) {
logFileName = (it->second).c_str();
}
char const* logFileModules = getenv("MOZ_LOG");
if (logFileName && logFileModules) {
bool rotate = false;
@ -238,7 +242,11 @@ SandboxBroker::LaunchApp(const wchar_t *aPath,
}
}
logFileName = _wgetenv(L"NSPR_LOG_FILE");
logFileName = nullptr;
it = aEnvironment.find(ENVIRONMENT_LITERAL("NSPR_LOG_FILE"));
if (it != aEnvironment.end()) {
logFileName = (it->second).c_str();
}
if (logFileName) {
mPolicy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
sandbox::TargetPolicy::FILES_ALLOW_ANY, logFileName);