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

Side by Side Diff: content/common/seccomp_sandbox.h

Issue 7570002: linux: turn seccomp on by default in debug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/zygote_main_linux.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_SECCOMP_SANDBOX_H_ 5 #ifndef CONTENT_COMMON_SECCOMP_SANDBOX_H_
6 #define CONTENT_COMMON_SECCOMP_SANDBOX_H_ 6 #define CONTENT_COMMON_SECCOMP_SANDBOX_H_
7 #pragma once 7 #pragma once
8 8
9 // Seccomp enable/disable logic is centralized here. 9 // Seccomp enable/disable logic is centralized here.
10 // - We define SECCOMP_SANDBOX if seccomp is compiled in at all: currently, 10 // - We define SECCOMP_SANDBOX if seccomp is compiled in at all: currently,
(...skipping 11 matching lines...) Expand all
22 #define SECCOMP_SANDBOX 22 #define SECCOMP_SANDBOX
23 #include "seccompsandbox/sandbox.h" 23 #include "seccompsandbox/sandbox.h"
24 #endif 24 #endif
25 25
26 #if defined(SECCOMP_SANDBOX) 26 #if defined(SECCOMP_SANDBOX)
27 // Return true if seccomp is enabled. 27 // Return true if seccomp is enabled.
28 static bool SeccompSandboxEnabled() { 28 static bool SeccompSandboxEnabled() {
29 // TODO(evan): turn on for release too once we've flushed out all the bugs, 29 // TODO(evan): turn on for release too once we've flushed out all the bugs,
30 // allowing us to delete this file entirely and just rely on the "disabled" 30 // allowing us to delete this file entirely and just rely on the "disabled"
31 // switch. 31 // switch.
32 #ifdef NDEBUG
33 // Off by default; allow turning on with a switch.
32 return CommandLine::ForCurrentProcess()->HasSwitch( 34 return CommandLine::ForCurrentProcess()->HasSwitch(
33 switches::kEnableSeccompSandbox) && 35 switches::kEnableSeccompSandbox);
34 !CommandLine::ForCurrentProcess()->HasSwitch( 36 #else
35 switches::kDisableSeccompSandbox); 37 // On by default; allow turning off with a switch.
38 return !CommandLine::ForCurrentProcess()->HasSwitch(
39 switches::kDisableSeccompSandbox);
40 #endif // NDEBUG
36 } 41 }
37 #endif 42 #endif // SECCOMP_SANDBOX
38 43
39 #endif // CONTENT_COMMON_SECCOMP_SANDBOX_H_ 44 #endif // CONTENT_COMMON_SECCOMP_SANDBOX_H_
OLDNEW
« no previous file with comments | « content/browser/zygote_main_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698