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); |