Commit 144fabf2 authored by jln@chromium.org's avatar jln@chromium.org

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
parent 528885a5
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment