OLD | NEW |
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 Loading... |
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 |
OLD | NEW |