Index: chrome/browser/zygote_host_linux.cc |
diff --git a/chrome/browser/zygote_host_linux.cc b/chrome/browser/zygote_host_linux.cc |
index fc8b981480a7d54345e5df3540e3727eb6f86956..b8d42ee87d2e8ac7bdb6a359149af7d546de779d 100644 |
--- a/chrome/browser/zygote_host_linux.cc |
+++ b/chrome/browser/zygote_host_linux.cc |
@@ -22,13 +22,6 @@ |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_switches.h" |
-// Previously we just looked for the binary next to the Chromium binary. But |
-// this breaks people who do a build-all. |
-// NOTE packagers: change this. |
- |
-// static const char kSandboxBinary[] = "/opt/google/chrome/chrome-sandbox"; |
-static const char kSandboxBinary[] = "/false"; |
- |
ZygoteHost::ZygoteHost() { |
std::wstring chrome_path; |
CHECK(PathService::Get(base::FILE_EXE, &chrome_path)); |
@@ -51,15 +44,23 @@ ZygoteHost::ZygoteHost() { |
const char* sandbox_binary = NULL; |
struct stat st; |
+ |
+#if !defined(GOOGLE_CHROME_BUILD) |
Michael Moss
2009/07/15 21:19:49
Not sure why this needs to be only !GOOGLE_CHROME_
|
+ // In Chromium branded builds, developers can set an environment variable to |
+ // use the development sandbox. See |
+ // http://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment |
if (stat("/proc/self/exe", &st) == 0 && |
st.st_uid == getuid()) { |
sandbox_binary = getenv("CHROME_DEVEL_SANDBOX"); |
} |
+#endif |
+#if defined(LINUX_SANDBOX_PATH) |
if (!sandbox_binary) |
- sandbox_binary = kSandboxBinary; |
+ sandbox_binary = LINUX_SANDBOX_PATH; |
+#endif |
- if (stat(sandbox_binary, &st) == 0) { |
+ if (sandbox_binary && stat(sandbox_binary, &st) == 0) { |
if (access(sandbox_binary, X_OK) == 0 && |
(st.st_mode & S_ISUID) && |
(st.st_mode & S_IXOTH)) { |