Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(804)

Unified Diff: sandbox/win/src/handle_dispatcher.cc

Issue 136543008: Use the same handle for checking and duplicating in DuplicateHandleProxy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed double handle close Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sandbox/win/src/handle_policy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/handle_dispatcher.cc
diff --git a/sandbox/win/src/handle_dispatcher.cc b/sandbox/win/src/handle_dispatcher.cc
index 26b8fc365ad4c1985e53c996331b5527b2e0df58..6acb6f9ceb3029ad1c95456d4ee3c04a0c46e2aa 100644
--- a/sandbox/win/src/handle_dispatcher.cc
+++ b/sandbox/win/src/handle_dispatcher.cc
@@ -53,10 +53,11 @@ bool HandleDispatcher::DuplicateHandleProxy(IPCInfo* ipc,
HANDLE handle_temp;
if (!::DuplicateHandle(ipc->client_info->process, source_handle,
::GetCurrentProcess(), &handle_temp,
- 0, FALSE, DUPLICATE_SAME_ACCESS)) {
+ 0, FALSE, DUPLICATE_SAME_ACCESS | options)) {
ipc->return_info.win32_result = ::GetLastError();
return false;
}
+ options &= ~DUPLICATE_CLOSE_SOURCE;
base::win::ScopedHandle handle(handle_temp);
// Get the object type (32 characters is safe; current max is 14).
@@ -78,8 +79,7 @@ bool HandleDispatcher::DuplicateHandleProxy(IPCInfo* ipc,
EvalResult eval = policy_base_->EvalPolicy(IPC_DUPLICATEHANDLEPROXY_TAG,
params.GetBase());
ipc->return_info.win32_result =
- HandlePolicy::DuplicateHandleProxyAction(eval, *ipc->client_info,
- source_handle,
+ HandlePolicy::DuplicateHandleProxyAction(eval, handle,
target_process_id,
&ipc->return_info.handle,
desired_access, options);
« no previous file with comments | « no previous file | sandbox/win/src/handle_policy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698