OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/sandbox_policy.h" | 5 #include "chrome/common/sandbox_policy.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/win_util.h" | 9 #include "app/win_util.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 333 } |
334 | 334 |
335 return true; | 335 return true; |
336 } | 336 } |
337 | 337 |
338 // Adds the custom policy rules for a given plugin. |trusted_plugins| contains | 338 // Adds the custom policy rules for a given plugin. |trusted_plugins| contains |
339 // the comma separate list of plugin dll names that should not be sandboxed. | 339 // the comma separate list of plugin dll names that should not be sandboxed. |
340 bool AddPolicyForPlugin(const CommandLine* cmd_line, | 340 bool AddPolicyForPlugin(const CommandLine* cmd_line, |
341 sandbox::TargetPolicy* policy) { | 341 sandbox::TargetPolicy* policy) { |
342 std::wstring plugin_dll = cmd_line-> | 342 std::wstring plugin_dll = cmd_line-> |
343 GetSwitchValue(switches::kPluginPath); | 343 GetSwitchValueNative(switches::kPluginPath); |
344 std::wstring trusted_plugins = CommandLine::ForCurrentProcess()-> | 344 std::wstring trusted_plugins = CommandLine::ForCurrentProcess()-> |
345 GetSwitchValue(switches::kTrustedPlugins); | 345 GetSwitchValueNative(switches::kTrustedPlugins); |
346 // Add the policy for the pipes. | 346 // Add the policy for the pipes. |
347 sandbox::ResultCode result = sandbox::SBOX_ALL_OK; | 347 sandbox::ResultCode result = sandbox::SBOX_ALL_OK; |
348 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, | 348 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES, |
349 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 349 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
350 L"\\\\.\\pipe\\chrome.*"); | 350 L"\\\\.\\pipe\\chrome.*"); |
351 if (result != sandbox::SBOX_ALL_OK) { | 351 if (result != sandbox::SBOX_ALL_OK) { |
352 NOTREACHED(); | 352 NOTREACHED(); |
353 return false; | 353 return false; |
354 } | 354 } |
355 | 355 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 537 |
538 // Help the process a little. It can't start the debugger by itself if | 538 // Help the process a little. It can't start the debugger by itself if |
539 // the process is in a sandbox. | 539 // the process is in a sandbox. |
540 if (child_needs_help) | 540 if (child_needs_help) |
541 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); | 541 DebugUtil::SpawnDebuggerOnProcess(target.dwProcessId); |
542 | 542 |
543 return process; | 543 return process; |
544 } | 544 } |
545 | 545 |
546 } // namespace sandbox | 546 } // namespace sandbox |
OLD | NEW |