From 57313614561d4d7c53d7f41e33b275b6f5199fcf Mon Sep 17 00:00:00 2001 From: "agl@chromium.org" Date: Wed, 15 Jul 2009 22:48:37 +0000 Subject: Linux: move hardcoded paths to GYP variables. This patch removes the hardcoded paths for the sandbox binary location and the chrome binary location for the sandbox. Instead, you can now set GYP variables for these things. Indeed, you have to set a GYP variable in order to use the sandbox now. GYP variables can be set on the command line, if you run gyp.py directly, with -D key=value. Or you can export GYP_DEFINES="key=value key2=value2". Now, in order to use the sandbox you should set: linux_sandbox_path=/opt/google/chrome/chrome-sandbox linux_sandbox_chrome_path=/opt/google/chrome/chrome (changing the paths as needed, of course). See the comments in build/common.gypi For development see http://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment Because developers need to setup a special sandbox binary. http://codereview.chromium.org/149689 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20801 0039d316-1c4b-4281-b951-d872f2087c98 --- sandbox/linux/suid/sandbox.cc | 11 ++++++++++- sandbox/sandbox.gyp | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'sandbox') diff --git a/sandbox/linux/suid/sandbox.cc b/sandbox/linux/suid/sandbox.cc index ea53406..a2332d8 100644 --- a/sandbox/linux/suid/sandbox.cc +++ b/sandbox/linux/suid/sandbox.cc @@ -25,7 +25,16 @@ #define CLONE_NEWPID 0x20000000 #endif -static const char kChromeBinary[] = "/opt/google/chrome/chrome"; +#if !defined(LINUX_SANDBOX_CHROME_PATH) && \ + !defined(CHROME_DEVEL_SANDBOX) +#error LINUX_SANDBOX_CHROME_PATH must be defined to be the location of the \ + Chrome binary, or CHROME_DEVEL_SANDBOX must be defined +#endif + +#if defined(LINUX_SANDBOX_CHROME_PATH) +static const char kChromeBinary[] = LINUX_SANDBOX_CHROME_PATH; +#endif + static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D"; // These are the magic byte values which the sandboxed process uses to request diff --git a/sandbox/sandbox.gyp b/sandbox/sandbox.gyp index 76e5dd3..6ca2cef 100644 --- a/sandbox/sandbox.gyp +++ b/sandbox/sandbox.gyp @@ -19,6 +19,9 @@ }, ], ], + 'defines': [ + 'LINUX_SANDBOX_CHROME_PATH="<(linux_sandbox_chrome_path)"', + ], 'sources': [ 'linux/suid/sandbox.cc', ], -- cgit v1.1