summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 00:57:00 +0000
committerjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-21 00:57:00 +0000
commit144fabf2711340da2d9c25f3cdccb55002517a4c (patch)
treeaae57c0cbb5303107ad0711abc446b392eaca291 /content
parent528885a5b342ae44e83001ad215f537d2d747d20 (diff)
downloadchromium_src-144fabf2711340da2d9c25f3cdccb55002517a4c.zip
chromium_src-144fabf2711340da2d9c25f3cdccb55002517a4c.tar.gz
chromium_src-144fabf2711340da2d9c25f3cdccb55002517a4c.tar.bz2
Disable seccomp-legacy if --no-sandbox is passed.
BUG=143795 Review URL: https://chromiumcodereview.appspot.com/10834419 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152458 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/sandbox_linux.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/content/common/sandbox_linux.cc b/content/common/sandbox_linux.cc
index 6384d22..fb39c11 100644
--- a/content/common/sandbox_linux.cc
+++ b/content/common/sandbox_linux.cc
@@ -37,15 +37,17 @@ void LogSandboxStarted(const std::string& sandbox_name) {
// Implement the command line enabling logic for seccomp-legacy.
bool IsSeccompLegacyDesired() {
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kNoSandbox)) {
+ return false;
+ }
#if defined(SECCOMP_SANDBOX)
#if defined(NDEBUG)
// Off by default. Allow turning on with a switch.
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableSeccompSandbox);
+ return command_line->HasSwitch(switches::kEnableSeccompSandbox);
#else
// On by default. Allow turning off with a switch.
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableSeccompSandbox);
+ return !command_line->HasSwitch(switches::kDisableSeccompSandbox);
#endif // NDEBUG
#endif // SECCOMP_SANDBOX
return false;