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

Side by Side Diff: content/common/sandbox_win.cc

Issue 2810903002: Revert of Allow handles through for official builds too (partial revert) (patchset #3 id:40001 of h… (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/process/launch_win.cc ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/common/sandbox_win.h" 5 #include "content/common/sandbox_win.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 if (logging::IsLoggingToFileEnabled()) { 807 if (logging::IsLoggingToFileEnabled()) {
808 DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute()); 808 DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute());
809 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, 809 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
810 sandbox::TargetPolicy::FILES_ALLOW_ANY, 810 sandbox::TargetPolicy::FILES_ALLOW_ANY,
811 logging::GetLogFileFullPath().c_str()); 811 logging::GetLogFileFullPath().c_str());
812 if (result != sandbox::SBOX_ALL_OK) 812 if (result != sandbox::SBOX_ALL_OK)
813 return result; 813 return result;
814 } 814 }
815 } 815 }
816 816
817 #if !defined(OFFICIAL_BUILD)
817 // If stdout/stderr point to a Windows console, these calls will 818 // If stdout/stderr point to a Windows console, these calls will
818 // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS. 819 // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS.
819 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)); 820 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
820 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE)); 821 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
822 #endif
821 823
822 if (!delegate->PreSpawnTarget(policy.get())) 824 if (!delegate->PreSpawnTarget(policy.get()))
823 return sandbox::SBOX_ERROR_DELEGATE_PRE_SPAWN; 825 return sandbox::SBOX_ERROR_DELEGATE_PRE_SPAWN;
824 826
825 TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS"); 827 TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS");
826 828
827 PROCESS_INFORMATION temp_process_info = {}; 829 PROCESS_INFORMATION temp_process_info = {};
828 sandbox::ResultCode last_warning = sandbox::SBOX_ALL_OK; 830 sandbox::ResultCode last_warning = sandbox::SBOX_ALL_OK;
829 DWORD last_error = ERROR_SUCCESS; 831 DWORD last_error = ERROR_SUCCESS;
830 result = g_broker_services->SpawnTarget( 832 result = g_broker_services->SpawnTarget(
(...skipping 20 matching lines...) Expand all
851 } 853 }
852 854
853 delegate->PostSpawnTarget(target.process_handle()); 855 delegate->PostSpawnTarget(target.process_handle());
854 856
855 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); 857 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1));
856 *process = base::Process(target.TakeProcessHandle()); 858 *process = base::Process(target.TakeProcessHandle());
857 return sandbox::SBOX_ALL_OK; 859 return sandbox::SBOX_ALL_OK;
858 } 860 }
859 861
860 } // namespace content 862 } // namespace content
OLDNEW
« no previous file with comments | « base/process/launch_win.cc ('k') | content/test/content_browser_test_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698