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

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

Issue 2767663002: Revert of Allow handles through for official builds too (partial revert) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 3 years, 9 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 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 if (logging::IsLoggingToFileEnabled()) { 808 if (logging::IsLoggingToFileEnabled()) {
809 DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute()); 809 DCHECK(base::FilePath(logging::GetLogFileFullPath()).IsAbsolute());
810 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, 810 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES,
811 sandbox::TargetPolicy::FILES_ALLOW_ANY, 811 sandbox::TargetPolicy::FILES_ALLOW_ANY,
812 logging::GetLogFileFullPath().c_str()); 812 logging::GetLogFileFullPath().c_str());
813 if (result != sandbox::SBOX_ALL_OK) 813 if (result != sandbox::SBOX_ALL_OK)
814 return result; 814 return result;
815 } 815 }
816 } 816 }
817 817
818 #if !defined(OFFICIAL_BUILD)
818 // If stdout/stderr point to a Windows console, these calls will 819 // If stdout/stderr point to a Windows console, these calls will
819 // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS. 820 // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS.
820 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE)); 821 policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
821 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE)); 822 policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
823 #endif
822 824
823 if (!delegate->PreSpawnTarget(policy.get())) 825 if (!delegate->PreSpawnTarget(policy.get()))
824 return sandbox::SBOX_ERROR_DELEGATE_PRE_SPAWN; 826 return sandbox::SBOX_ERROR_DELEGATE_PRE_SPAWN;
825 827
826 TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS"); 828 TRACE_EVENT_BEGIN0("startup", "StartProcessWithAccess::LAUNCHPROCESS");
827 829
828 PROCESS_INFORMATION temp_process_info = {}; 830 PROCESS_INFORMATION temp_process_info = {};
829 sandbox::ResultCode last_warning = sandbox::SBOX_ALL_OK; 831 sandbox::ResultCode last_warning = sandbox::SBOX_ALL_OK;
830 DWORD last_error = ERROR_SUCCESS; 832 DWORD last_error = ERROR_SUCCESS;
831 result = g_broker_services->SpawnTarget( 833 result = g_broker_services->SpawnTarget(
(...skipping 27 matching lines...) Expand all
859 } 861 }
860 862
861 delegate->PostSpawnTarget(target.process_handle()); 863 delegate->PostSpawnTarget(target.process_handle());
862 864
863 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1)); 865 CHECK(ResumeThread(target.thread_handle()) != static_cast<DWORD>(-1));
864 *process = base::Process(target.TakeProcessHandle()); 866 *process = base::Process(target.TakeProcessHandle());
865 return sandbox::SBOX_ALL_OK; 867 return sandbox::SBOX_ALL_OK;
866 } 868 }
867 869
868 } // namespace content 870 } // 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