Commit fe29a583 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

sandbox: Allow utility process to access the log file on Windows

Currently this is only allowed for renderer and gpu process. This CL
also allows it for utility process.

Also pass logging switches to the UtilityProcessHost. These switches
are already passed in ServiceUtilityProcessHost. Both are using
kUtilityProcess process type.

Bug: 888088
Change-Id: Ic26b9c9e6ce0c9024fb3ca4c8d352c5a283bef81
Reviewed-on: https://chromium-review.googlesource.com/1239172Reviewed-by: default avatarWill Harris <wfh@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593588}
parent 2fa34872
...@@ -294,9 +294,11 @@ bool UtilityProcessHost::StartProcess() { ...@@ -294,9 +294,11 @@ bool UtilityProcessHost::StartProcess() {
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
service_manager::switches::kEnableSandboxLogging, service_manager::switches::kEnableSandboxLogging,
#endif #endif
switches::kEnableLogging,
switches::kForceTextDirection, switches::kForceTextDirection,
switches::kForceUIDirection, switches::kForceUIDirection,
switches::kIgnoreCertificateErrors, switches::kIgnoreCertificateErrors,
switches::kLoggingLevel,
switches::kOverrideUseSoftwareGLForTests, switches::kOverrideUseSoftwareGLForTests,
switches::kOverrideEnabledCdmInterfaceVersion, switches::kOverrideEnabledCdmInterfaceVersion,
switches::kProxyServer, switches::kProxyServer,
...@@ -307,6 +309,8 @@ bool UtilityProcessHost::StartProcess() { ...@@ -307,6 +309,8 @@ bool UtilityProcessHost::StartProcess() {
switches::kUseMockCertVerifierForTesting, switches::kUseMockCertVerifierForTesting,
switches::kUtilityStartupDialog, switches::kUtilityStartupDialog,
switches::kUseGL, switches::kUseGL,
switches::kV,
switches::kVModule,
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
switches::kOrderfileMemoryOptimization, switches::kOrderfileMemoryOptimization,
#endif #endif
......
...@@ -938,9 +938,10 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess( ...@@ -938,9 +938,10 @@ sandbox::ResultCode SandboxWin::StartSandboxedProcess(
return result; return result;
} }
// Allow the renderer and gpu processes to access the log file. // Allow the renderer, gpu and utility processes to access the log file.
if (process_type == service_manager::switches::kRendererProcess || if (process_type == service_manager::switches::kRendererProcess ||
process_type == service_manager::switches::kGpuProcess) { process_type == service_manager::switches::kGpuProcess ||
process_type == service_manager::switches::kUtilityProcess) {
if (logging::IsLoggingToFileEnabled()) { if (logging::IsLoggingToFileEnabled()) {
DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute()); DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute());
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment