| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 321 |
| 322 base::FilePath debug_message(long_path_buf); | 322 base::FilePath debug_message(long_path_buf); |
| 323 debug_message = debug_message.AppendASCII("debug_message.exe"); | 323 debug_message = debug_message.AppendASCII("debug_message.exe"); |
| 324 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS, | 324 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS, |
| 325 sandbox::TargetPolicy::PROCESS_MIN_EXEC, | 325 sandbox::TargetPolicy::PROCESS_MIN_EXEC, |
| 326 debug_message.value().c_str()); | 326 debug_message.value().c_str()); |
| 327 if (result != sandbox::SBOX_ALL_OK) | 327 if (result != sandbox::SBOX_ALL_OK) |
| 328 return false; | 328 return false; |
| 329 #endif // NDEBUG | 329 #endif // NDEBUG |
| 330 | 330 |
| 331 // Add the policy for read-only PDB file access for AddressSanitizer. | 331 // Add the policy for read-only PDB file access for stack traces. |
| 332 #if defined(ADDRESS_SANITIZER) | 332 #if !defined(OFFICIAL_BUILD) |
| 333 base::FilePath exe; | 333 base::FilePath exe; |
| 334 if (!PathService::Get(base::FILE_EXE, &exe)) | 334 if (!PathService::Get(base::FILE_EXE, &exe)) |
| 335 return false; | 335 return false; |
| 336 base::FilePath pdb_path = exe.DirName().Append(L"*.pdb"); | 336 base::FilePath pdb_path = exe.DirName().Append(L"*.pdb"); |
| 337 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 337 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
| 338 sandbox::TargetPolicy::FILES_ALLOW_READONLY, | 338 sandbox::TargetPolicy::FILES_ALLOW_READONLY, |
| 339 pdb_path.value().c_str()); | 339 pdb_path.value().c_str()); |
| 340 if (result != sandbox::SBOX_ALL_OK) | 340 if (result != sandbox::SBOX_ALL_OK) |
| 341 return false; | 341 return false; |
| 342 #endif | 342 #endif |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 } | 827 } |
| 828 | 828 |
| 829 return false; | 829 return false; |
| 830 } | 830 } |
| 831 | 831 |
| 832 bool BrokerAddTargetPeer(HANDLE peer_process) { | 832 bool BrokerAddTargetPeer(HANDLE peer_process) { |
| 833 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; | 833 return g_broker_services->AddTargetPeer(peer_process) == sandbox::SBOX_ALL_OK; |
| 834 } | 834 } |
| 835 | 835 |
| 836 } // namespace content | 836 } // namespace content |
| OLD | NEW |