OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 | 6 |
7 declare_args() { | 7 declare_args() { |
8 compile_suid_client = is_linux | 8 compile_suid_client = is_linux |
9 | 9 |
10 compile_credentials = is_linux | 10 compile_credentials = is_linux |
11 | 11 |
12 compile_seccomp_bpf_demo = | 12 compile_seccomp_bpf_demo = |
13 (is_linux && (cpu_arch == "x86" || cpu_arch == "x64")) | 13 is_linux && (cpu_arch == "x86" || cpu_arch == "x64") |
14 } | 14 } |
15 | 15 |
16 # We have two principal targets: sandbox and sandbox_linux_unittests | 16 # We have two principal targets: sandbox and sandbox_linux_unittests |
17 # All other targets are listed as dependencies. | 17 # All other targets are listed as dependencies. |
18 # There is one notable exception: for historical reasons, chrome_sandbox is | 18 # There is one notable exception: for historical reasons, chrome_sandbox is |
19 # the setuid sandbox and is its own target. | 19 # the setuid sandbox and is its own target. |
20 | 20 |
21 group("sandbox") { | 21 group("sandbox") { |
22 deps = [ | 22 deps = [ |
23 ":sandbox_services", | 23 ":sandbox_services", |
(...skipping 27 matching lines...) Expand all Loading... |
51 "//testing/gtest", | 51 "//testing/gtest", |
52 ] | 52 ] |
53 | 53 |
54 if (use_seccomp_bpf) { | 54 if (use_seccomp_bpf) { |
55 sources += [ | 55 sources += [ |
56 "seccomp-bpf/bpf_tester_compatibility_delegate.h", | 56 "seccomp-bpf/bpf_tester_compatibility_delegate.h", |
57 "seccomp-bpf/bpf_tests.h", | 57 "seccomp-bpf/bpf_tests.h", |
58 "seccomp-bpf/sandbox_bpf_test_runner.cc", | 58 "seccomp-bpf/sandbox_bpf_test_runner.cc", |
59 "seccomp-bpf/sandbox_bpf_test_runner.h", | 59 "seccomp-bpf/sandbox_bpf_test_runner.h", |
60 ] | 60 ] |
61 deps += [ | 61 deps += [ ":seccomp_bpf" ] |
62 ":seccomp_bpf", | |
63 ] | |
64 } | 62 } |
65 } | 63 } |
66 | 64 |
67 # The main sandboxing test target. | 65 # The main sandboxing test target. |
68 test("sandbox_linux_unittests") { | 66 test("sandbox_linux_unittests") { |
69 sources = [ | 67 sources = [ |
70 "services/scoped_process_unittest.cc", | 68 "services/scoped_process_unittest.cc", |
71 "services/syscall_wrappers_unittest.cc", | 69 "services/syscall_wrappers_unittest.cc", |
72 "services/thread_helpers_unittests.cc", | 70 "services/thread_helpers_unittests.cc", |
73 "services/yama_unittests.cc", | 71 "services/yama_unittests.cc", |
(...skipping 13 matching lines...) Expand all Loading... |
87 "//base/test:test_support", | 85 "//base/test:test_support", |
88 "//testing/gtest", | 86 "//testing/gtest", |
89 ] | 87 ] |
90 | 88 |
91 if (is_linux) { | 89 if (is_linux) { |
92 # Don't use this on Android. | 90 # Don't use this on Android. |
93 libs = [ "rt" ] | 91 libs = [ "rt" ] |
94 } | 92 } |
95 | 93 |
96 if (compile_suid_client) { | 94 if (compile_suid_client) { |
97 sources += [ | 95 sources += [ "suid/client/setuid_sandbox_client_unittest.cc" ] |
98 "suid/client/setuid_sandbox_client_unittest.cc", | |
99 ] | |
100 } | 96 } |
101 if (use_seccomp_bpf) { | 97 if (use_seccomp_bpf) { |
102 sources += [ | 98 sources += [ |
103 "bpf_dsl/bpf_dsl_more_unittest.cc", | 99 "bpf_dsl/bpf_dsl_more_unittest.cc", |
104 "bpf_dsl/bpf_dsl_unittest.cc", | 100 "bpf_dsl/bpf_dsl_unittest.cc", |
105 "bpf_dsl/cons_unittest.cc", | 101 "bpf_dsl/cons_unittest.cc", |
106 "seccomp-bpf-helpers/baseline_policy_unittest.cc", | 102 "seccomp-bpf-helpers/baseline_policy_unittest.cc", |
107 "seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc", | 103 "seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc", |
108 "seccomp-bpf/bpf_tests_unittest.cc", | 104 "seccomp-bpf/bpf_tests_unittest.cc", |
109 "seccomp-bpf/codegen_unittest.cc", | 105 "seccomp-bpf/codegen_unittest.cc", |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ] | 189 ] |
194 defines = [ "SANDBOX_IMPLEMENTATION" ] | 190 defines = [ "SANDBOX_IMPLEMENTATION" ] |
195 | 191 |
196 deps = [ | 192 deps = [ |
197 "//base", | 193 "//base", |
198 ":seccomp_bpf", | 194 ":seccomp_bpf", |
199 ] | 195 ] |
200 } | 196 } |
201 | 197 |
202 if (is_linux) { | 198 if (is_linux) { |
203 # The setuid sandbox for Linux. | 199 # The setuid sandbox for Linux. |
204 executable("chrome_sandbox") { | 200 executable("chrome_sandbox") { |
205 sources = [ | 201 sources = [ |
206 "suid/common/sandbox.h", | 202 "suid/common/sandbox.h", |
207 "suid/common/suid_unsafe_environment_variables.h", | 203 "suid/common/suid_unsafe_environment_variables.h", |
208 "suid/process_util.h", | 204 "suid/process_util.h", |
209 "suid/process_util_linux.c", | 205 "suid/process_util_linux.c", |
210 "suid/sandbox.c", | 206 "suid/sandbox.c", |
211 ] | 207 ] |
212 | 208 |
213 cflags = [ | 209 cflags = [ |
214 # For ULLONG_MAX | 210 # For ULLONG_MAX |
215 "-std=gnu99", | 211 "-std=gnu99", |
| 212 |
216 # These files have a suspicious comparison. | 213 # These files have a suspicious comparison. |
217 # TODO fix this and re-enable this warning. | 214 # TODO fix this and re-enable this warning. |
218 "-Wno-sign-compare", | 215 "-Wno-sign-compare", |
219 ] | 216 ] |
220 } | 217 } |
221 } | 218 } |
222 | 219 |
223 component("sandbox_services") { | 220 component("sandbox_services") { |
224 sources = [ | 221 sources = [ |
225 "services/init_process_reaper.cc", | 222 "services/init_process_reaper.cc", |
(...skipping 21 matching lines...) Expand all Loading... |
247 | 244 |
248 defines = [ "SANDBOX_IMPLEMENTATION" ] | 245 defines = [ "SANDBOX_IMPLEMENTATION" ] |
249 | 246 |
250 if (compile_credentials) { | 247 if (compile_credentials) { |
251 sources += [ | 248 sources += [ |
252 "services/credentials.cc", | 249 "services/credentials.cc", |
253 "services/credentials.h", | 250 "services/credentials.h", |
254 "services/proc_util.cc", | 251 "services/proc_util.cc", |
255 "services/proc_util.h", | 252 "services/proc_util.h", |
256 ] | 253 ] |
| 254 |
257 # For capabilities.cc. | 255 # For capabilities.cc. |
258 configs += [ "//build/config/linux:libcap" ] | 256 configs += [ "//build/config/linux:libcap" ] |
259 } | 257 } |
260 | 258 |
261 deps = [ | 259 deps = [ |
262 "//base", | 260 "//base", |
263 ] | 261 ] |
264 } | 262 } |
265 | 263 |
266 source_set("sandbox_services_headers") { | 264 source_set("sandbox_services_headers") { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 # | 316 # |
319 # args = [ | 317 # args = [ |
320 # rebase_path(in_file, root_build_dir), | 318 # rebase_path(in_file, root_build_dir), |
321 # "-o", rebase_path(out_file, root_build_dir), | 319 # "-o", rebase_path(out_file, root_build_dir), |
322 # ] | 320 # ] |
323 # | 321 # |
324 # deps = [ | 322 # deps = [ |
325 # ":sandbox_linux_unittests", | 323 # ":sandbox_linux_unittests", |
326 # ] | 324 # ] |
327 #} | 325 #} |
328 | |
329 # TODO(GYP) convert this. | 326 # TODO(GYP) convert this. |
330 # { | 327 # { |
331 # 'target_name': 'sandbox_linux_jni_unittests_apk', | 328 # 'target_name': 'sandbox_linux_jni_unittests_apk', |
332 # 'type': 'none', | 329 # 'type': 'none', |
333 # 'variables': { | 330 # 'variables': { |
334 # 'test_suite_name': 'sandbox_linux_jni_unittests', | 331 # 'test_suite_name': 'sandbox_linux_jni_unittests', |
335 # }, | 332 # }, |
336 # 'dependencies': [ | 333 # 'dependencies': [ |
337 # 'sandbox_linux_jni_unittests', | 334 # 'sandbox_linux_jni_unittests', |
338 # ], | 335 # ], |
339 # 'includes': [ '../../build/apk_test.gypi' ], | 336 # 'includes': [ '../../build/apk_test.gypi' ], |
340 # } | 337 # } |
341 } | 338 } |
OLD | NEW |