Index: sandbox/win/src/target_process.cc |
diff --git a/sandbox/win/src/target_process.cc b/sandbox/win/src/target_process.cc |
index e0284c3924b27cd8f2419b7eda5ea3dd06471267..8e1e938eefedc8641ba2c9dd4004cf91ec72b9b8 100644 |
--- a/sandbox/win/src/target_process.cc |
+++ b/sandbox/win/src/target_process.cc |
@@ -5,6 +5,7 @@ |
#include "sandbox/win/src/target_process.h" |
#include "base/basictypes.h" |
+#include "base/debug/alias.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/win/pe_image.h" |
#include "base/win/startup_information.h" |
@@ -157,6 +158,10 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
NULL, // Use current directory of the caller. |
startup_info.startup_info(), |
&temp_process_info)) { |
+ // TODO(shrikant): Remove following code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(exe_path); |
+ CHECK(FALSE); |
Will Harris
2015/04/15 23:56:29
Have you considered just returning a new SBOX erro
Shrikant Kelkar
2015/04/16 00:06:36
Yes, that's what I was communicating with reporter
Will Harris
2015/04/16 00:13:36
ah okay I meant instead of returning GetLastError
Shrikant Kelkar
2015/04/16 18:25:34
Basically, I don't want to make these changes perm
|
return ::GetLastError(); |
} |
} else { |
@@ -182,6 +187,12 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
// Assign the suspended target to the windows job object. |
if (!::AssignProcessToJobObject(job_, process_info.process_handle())) { |
win_result = ::GetLastError(); |
+ if (set_lockdown_token_after_create) { |
+ // TODO(shrikant): Remove this code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(&win_result); |
+ CHECK(FALSE); |
+ } |
::TerminateProcess(process_info.process_handle(), 0); |
return win_result; |
} |
@@ -194,6 +205,12 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
HANDLE temp_thread = process_info.thread_handle(); |
if (!::SetThreadToken(&temp_thread, initial_token_.Get())) { |
win_result = ::GetLastError(); |
+ if (set_lockdown_token_after_create) { |
+ // TODO(shrikant): Remove this code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(&win_result); |
+ CHECK(FALSE); |
+ } |
// It might be a security breach if we let the target run outside the job |
// so kill it before it causes damage. |
::TerminateProcess(process_info.process_handle(), 0); |
@@ -217,6 +234,10 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
sizeof(process_access_token)); |
if (!NT_SUCCESS(status)) { |
win_result = ::GetLastError(); |
+ // TODO(shrikant): Remove this code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(&win_result); |
+ CHECK(FALSE); |
::TerminateProcess(process_info.process_handle(), 0); // exit code |
return win_result; |
} |
@@ -226,6 +247,12 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
context.ContextFlags = CONTEXT_ALL; |
if (!::GetThreadContext(process_info.thread_handle(), &context)) { |
win_result = ::GetLastError(); |
+ if (set_lockdown_token_after_create) { |
+ // TODO(shrikant): Remove this code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(&win_result); |
+ CHECK(FALSE); |
+ } |
::TerminateProcess(process_info.process_handle(), 0); |
return win_result; |
} |
@@ -242,6 +269,12 @@ DWORD TargetProcess::Create(const wchar_t* exe_path, |
if (!target_info->DuplicateFrom(process_info)) { |
win_result = ::GetLastError(); // This may or may not be correct. |
+ if (set_lockdown_token_after_create) { |
+ // TODO(shrikant): Remove this code once we gather some crashes for |
+ // debugging appcontainer related failures (crbug.com/467920). |
+ base::debug::Alias(&win_result); |
+ CHECK(FALSE); |
+ } |
::TerminateProcess(process_info.process_handle(), 0); |
return win_result; |
} |