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

Side by Side Diff: minijail.cc

Issue 6881066: [minijail] Add the ability to set capabilities from the command line (Closed) Base URL: http://git.chromium.org/git/minijail.git@master
Patch Set: Created 9 years, 8 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 | « no previous file | minijail_main.cc » ('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) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium OS 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 // Some portions Copyright (c) 2009 The Chromium Authors. 4 // Some portions Copyright (c) 2009 The Chromium Authors.
5 // 5 //
6 // Implements MiniJail jailing logic. 6 // Implements MiniJail jailing logic.
7 7
8 #include "minijail.h" 8 #include "minijail.h"
9 9
10 #include <errno.h> 10 #include <errno.h>
11 11
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 if (!env->FilterSyscallsBySource()) { 72 if (!env->FilterSyscallsBySource()) {
73 return false; 73 return false;
74 } 74 }
75 } else if (opts->enforce_syscalls_benchmark()) { 75 } else if (opts->enforce_syscalls_benchmark()) {
76 if (!env->FilterSyscallsBenchmarkOnly()) { 76 if (!env->FilterSyscallsBenchmarkOnly()) {
77 return false; 77 return false;
78 } 78 }
79 } 79 }
80 80
81 if (opts->use_capabilities()) { 81 if (opts->use_capabilities()) {
82 // TODO(wad) use helpers to read caps from flags 82 if (!env->SanitizeCapabilities(opts->caps_bitmask())) {
83 if (!env->SanitizeCapabilities(0)) {
84 return false; 83 return false;
85 } 84 }
86 if (!env->SanitizeBoundingSet(0)) { 85 if (!env->SanitizeBoundingSet(opts->caps_bitmask())) {
87 return false; 86 return false;
88 } 87 }
89 } 88 }
90 return true; 89 return true;
91 } 90 }
92 91
93 } // namespace chromeos 92 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | minijail_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698