summaryrefslogtreecommitdiffstats
path: root/chrome/common/sandbox_policy.cc
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-24 16:24:13 +0100
committerKristian Monsen <kristianm@google.com>2011-05-25 14:13:32 +0100
commit3f50c38dc070f4bb515c1b64450dae14f316474e (patch)
tree29f309f9534e05c47244eedb438fc612578d133b /chrome/common/sandbox_policy.cc
parente23bef148f7be2bdf9c3cb2cd3aa5ceebf1190fb (diff)
downloadexternal_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.zip
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.gz
external_chromium-3f50c38dc070f4bb515c1b64450dae14f316474e.tar.bz2
Merge Chromium at r10.0.634.0: Initial merge by git.
Change-Id: Iac2af492818d119bcc2562eb5fdabf5ab0b6df9c
Diffstat (limited to 'chrome/common/sandbox_policy.cc')
-rw-r--r--chrome/common/sandbox_policy.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/common/sandbox_policy.cc b/chrome/common/sandbox_policy.cc
index 2667cf9..7436ad2 100644
--- a/chrome/common/sandbox_policy.cc
+++ b/chrome/common/sandbox_policy.cc
@@ -6,7 +6,7 @@
#include <string>
-#include "app/win_util.h"
+#include "app/win/win_util.h"
#include "base/command_line.h"
#include "base/debug/debugger.h"
#include "base/debug/trace_event.h"
@@ -200,9 +200,15 @@ bool AddGenericPolicy(sandbox::TargetPolicy* policy) {
FilePath app_dir;
if (!PathService::Get(chrome::DIR_APP, &app_dir))
return false;
- std::wstring debug_message;
- if (!win_util::ConvertToLongPath(app_dir.value(), &debug_message))
+
+ wchar_t long_path_buf[MAX_PATH];
+ DWORD long_path_return_value = GetLongPathName(app_dir.value().c_str(),
+ long_path_buf,
+ MAX_PATH);
+ if (long_path_return_value == 0 || long_path_return_value >= MAX_PATH)
return false;
+
+ string16 debug_message(long_path_buf);
file_util::AppendToPath(&debug_message, L"debug_message.exe");
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_PROCESS,
sandbox::TargetPolicy::PROCESS_MIN_EXEC,
@@ -532,6 +538,7 @@ base::ProcessHandle StartProcessWithAccess(CommandLine* cmd_line,
if (!in_sandbox && (type == ChildProcessInfo::PLUGIN_PROCESS)) {
in_sandbox = browser_command_line.HasSwitch(switches::kSafePlugins) ||
(IsBuiltInFlash(cmd_line, NULL) &&
+ (base::win::GetVersion() > base::win::VERSION_XP) &&
!browser_command_line.HasSwitch(switches::kDisableFlashSandbox));
}