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

Side by Side Diff: content/common/sandbox_linux.cc

Issue 10818015: Setuid sandbox client class readability meta-CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address first comments. Upload two more files. Created 8 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/common/sandbox_linux.h ('k') | sandbox/linux/suid/client/setuid_sandbox_client.h » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include <fcntl.h> 5 #include <fcntl.h>
6 #include <sys/stat.h> 6 #include <sys/stat.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/eintr_wrapper.h" 10 #include "base/eintr_wrapper.h"
(...skipping 21 matching lines...) Expand all
32 LOG(WARNING) << activated_sandbox; 32 LOG(WARNING) << activated_sandbox;
33 #else 33 #else
34 VLOG(1) << activated_sandbox; 34 VLOG(1) << activated_sandbox;
35 #endif 35 #endif
36 } 36 }
37 37
38 // Implement the command line enabling logic for seccomp-legacy. 38 // Implement the command line enabling logic for seccomp-legacy.
39 bool IsSeccompLegacyDesired() { 39 bool IsSeccompLegacyDesired() {
40 #if defined(SECCOMP_SANDBOX) 40 #if defined(SECCOMP_SANDBOX)
41 #if defined(NDEBUG) 41 #if defined(NDEBUG)
42 // Off by default; allow turning on with a switch. 42 // Off by default. Allow turning on with a switch.
43 return CommandLine::ForCurrentProcess()->HasSwitch( 43 return CommandLine::ForCurrentProcess()->HasSwitch(
44 switches::kEnableSeccompSandbox); 44 switches::kEnableSeccompSandbox);
45 #else 45 #else
46 // On by default; allow turning off with a switch. 46 // On by default. Allow turning off with a switch.
47 return !CommandLine::ForCurrentProcess()->HasSwitch( 47 return !CommandLine::ForCurrentProcess()->HasSwitch(
48 switches::kDisableSeccompSandbox); 48 switches::kDisableSeccompSandbox);
49 #endif // NDEBUG 49 #endif // NDEBUG
50 #endif // SECCOMP_SANDBOX 50 #endif // SECCOMP_SANDBOX
51 return false; 51 return false;
52 } 52 }
53 53
54 // Our "policy" on whether or not to enable seccomp-legacy. Only renderers are 54 // Our "policy" on whether or not to enable seccomp-legacy. Only renderers are
55 // supported. 55 // supported.
56 bool ShouldEnableSeccompLegacy(const std::string& process_type) { 56 bool ShouldEnableSeccompLegacy(const std::string& process_type) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 return seccomp_legacy_supported_; 226 return seccomp_legacy_supported_;
227 } 227 }
228 228
229 bool LinuxSandbox::seccomp_bpf_supported() const { 229 bool LinuxSandbox::seccomp_bpf_supported() const {
230 CHECK(pre_initialized_); 230 CHECK(pre_initialized_);
231 return seccomp_bpf_supported_; 231 return seccomp_bpf_supported_;
232 } 232 }
233 233
234 } // namespace content 234 } // namespace content
235 235
OLDNEW
« no previous file with comments | « content/common/sandbox_linux.h ('k') | sandbox/linux/suid/client/setuid_sandbox_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698