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

Unified Diff: chrome/browser/zygote_host_linux.cc

Issue 149689: Linux: move hardcoded paths to GYP variables. (Closed)
Patch Set: ... Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/common.gypi ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « build/common.gypi ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698