| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 ] | 188 ] |
| 193 defines = [ "SANDBOX_IMPLEMENTATION" ] | 189 defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 194 | 190 |
| 195 deps = [ | 191 deps = [ |
| 196 "//base", | 192 "//base", |
| 197 ":seccomp_bpf", | 193 ":seccomp_bpf", |
| 198 ] | 194 ] |
| 199 } | 195 } |
| 200 | 196 |
| 201 if (is_linux) { | 197 if (is_linux) { |
| 202 # The setuid sandbox for Linux. | 198 # The setuid sandbox for Linux. |
| 203 executable("chrome_sandbox") { | 199 executable("chrome_sandbox") { |
| 204 sources = [ | 200 sources = [ |
| 205 "suid/common/sandbox.h", | 201 "suid/common/sandbox.h", |
| 206 "suid/common/suid_unsafe_environment_variables.h", | 202 "suid/common/suid_unsafe_environment_variables.h", |
| 207 "suid/process_util.h", | 203 "suid/process_util.h", |
| 208 "suid/process_util_linux.c", | 204 "suid/process_util_linux.c", |
| 209 "suid/sandbox.c", | 205 "suid/sandbox.c", |
| 210 ] | 206 ] |
| 211 | 207 |
| 212 cflags = [ | 208 cflags = [ |
| 213 # For ULLONG_MAX | 209 # For ULLONG_MAX |
| 214 "-std=gnu99", | 210 "-std=gnu99", |
| 211 |
| 215 # These files have a suspicious comparison. | 212 # These files have a suspicious comparison. |
| 216 # TODO fix this and re-enable this warning. | 213 # TODO fix this and re-enable this warning. |
| 217 "-Wno-sign-compare", | 214 "-Wno-sign-compare", |
| 218 ] | 215 ] |
| 219 } | 216 } |
| 220 } | 217 } |
| 221 | 218 |
| 222 component("sandbox_services") { | 219 component("sandbox_services") { |
| 223 sources = [ | 220 sources = [ |
| 224 "services/init_process_reaper.cc", | 221 "services/init_process_reaper.cc", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 244 "syscall_broker/broker_process.h", | 241 "syscall_broker/broker_process.h", |
| 245 ] | 242 ] |
| 246 | 243 |
| 247 defines = [ "SANDBOX_IMPLEMENTATION" ] | 244 defines = [ "SANDBOX_IMPLEMENTATION" ] |
| 248 | 245 |
| 249 if (compile_credentials) { | 246 if (compile_credentials) { |
| 250 sources += [ | 247 sources += [ |
| 251 "services/credentials.cc", | 248 "services/credentials.cc", |
| 252 "services/credentials.h", | 249 "services/credentials.h", |
| 253 ] | 250 ] |
| 251 |
| 254 # For capabilities.cc. | 252 # For capabilities.cc. |
| 255 configs += [ "//build/config/linux:libcap" ] | 253 configs += [ "//build/config/linux:libcap" ] |
| 256 } | 254 } |
| 257 | 255 |
| 258 deps = [ | 256 deps = [ |
| 259 "//base", | 257 "//base", |
| 260 ] | 258 ] |
| 261 } | 259 } |
| 262 | 260 |
| 263 source_set("sandbox_services_headers") { | 261 source_set("sandbox_services_headers") { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 # | 313 # |
| 316 # args = [ | 314 # args = [ |
| 317 # rebase_path(in_file, root_build_dir), | 315 # rebase_path(in_file, root_build_dir), |
| 318 # "-o", rebase_path(out_file, root_build_dir), | 316 # "-o", rebase_path(out_file, root_build_dir), |
| 319 # ] | 317 # ] |
| 320 # | 318 # |
| 321 # deps = [ | 319 # deps = [ |
| 322 # ":sandbox_linux_unittests", | 320 # ":sandbox_linux_unittests", |
| 323 # ] | 321 # ] |
| 324 #} | 322 #} |
| 325 | |
| 326 # TODO(GYP) convert this. | 323 # TODO(GYP) convert this. |
| 327 # { | 324 # { |
| 328 # 'target_name': 'sandbox_linux_jni_unittests_apk', | 325 # 'target_name': 'sandbox_linux_jni_unittests_apk', |
| 329 # 'type': 'none', | 326 # 'type': 'none', |
| 330 # 'variables': { | 327 # 'variables': { |
| 331 # 'test_suite_name': 'sandbox_linux_jni_unittests', | 328 # 'test_suite_name': 'sandbox_linux_jni_unittests', |
| 332 # }, | 329 # }, |
| 333 # 'dependencies': [ | 330 # 'dependencies': [ |
| 334 # 'sandbox_linux_jni_unittests', | 331 # 'sandbox_linux_jni_unittests', |
| 335 # ], | 332 # ], |
| 336 # 'includes': [ '../../build/apk_test.gypi' ], | 333 # 'includes': [ '../../build/apk_test.gypi' ], |
| 337 # } | 334 # } |
| 338 } | 335 } |
| OLD | NEW |