2020-01-17 21:05:03 +08:00
|
|
|
# Copyright 2019 Google LLC
|
2019-05-06 20:03:29 +08:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2019-06-07 22:27:06 +08:00
|
|
|
add_subdirectory(examples)
|
2019-05-06 20:03:29 +08:00
|
|
|
add_subdirectory(unwind)
|
|
|
|
add_subdirectory(util)
|
2020-02-20 23:45:22 +08:00
|
|
|
add_subdirectory(network_proxy)
|
2019-05-06 20:03:29 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:bpfdisassembler
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_bpfdisassembler ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
bpfdisassembler.cc
|
|
|
|
bpfdisassembler.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::bpfdisassembler ALIAS sandbox2_bpfdisassembler)
|
|
|
|
target_link_libraries(sandbox2_bpfdisassembler PRIVATE
|
|
|
|
absl::strings
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:regs
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_regs ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
regs.cc
|
|
|
|
regs.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::regs ALIAS sandbox2_regs)
|
|
|
|
target_link_libraries(sandbox2_regs PRIVATE
|
|
|
|
absl::core_headers
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
|
|
|
sapi::strerror
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::syscall
|
|
|
|
sandbox2::violation_proto
|
|
|
|
sapi::base
|
|
|
|
sapi::status
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:syscall
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_syscall ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
syscall.cc
|
|
|
|
syscall.h
|
|
|
|
syscall_defs.cc
|
|
|
|
syscall_defs.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::syscall ALIAS sandbox2_syscall)
|
|
|
|
target_link_libraries(sandbox2_syscall
|
2020-11-25 22:15:06 +08:00
|
|
|
PRIVATE absl::algorithm_container
|
|
|
|
absl::span
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
2019-07-30 21:48:16 +08:00
|
|
|
PUBLIC glog::glog
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:result
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_result ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
result.cc
|
|
|
|
result.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::result ALIAS sandbox2_result)
|
|
|
|
target_link_libraries(sandbox2_result PRIVATE
|
|
|
|
absl::base
|
|
|
|
absl::memory
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::regs
|
|
|
|
sandbox2::syscall
|
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::status
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:logserver_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(_sandbox2_logserver_pb_h _sandbox2_logserver_pb_cc
|
2019-05-06 20:03:29 +08:00
|
|
|
logserver.proto
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_logserver_proto ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
${_sandbox2_logserver_pb_cc}
|
|
|
|
${_sandbox2_logserver_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sandbox2::logserver_proto ALIAS sandbox2_logserver_proto)
|
2019-07-26 20:50:45 +08:00
|
|
|
target_link_libraries(sandbox2_logserver_proto
|
|
|
|
PRIVATE sapi::base
|
|
|
|
PUBLIC protobuf::libprotobuf
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:logserver
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_logserver ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
logserver.cc
|
|
|
|
logserver.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::logserver ALIAS sandbox2_logserver)
|
|
|
|
target_link_libraries(sandbox2_logserver
|
|
|
|
PRIVATE absl::memory
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::logserver_proto
|
|
|
|
sapi::base
|
2019-07-26 20:50:45 +08:00
|
|
|
PUBLIC glog::glog
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:logsink
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_logsink ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
logsink.cc
|
|
|
|
logsink.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::logsink ALIAS sandbox2_logsink)
|
|
|
|
target_link_libraries(sandbox2_logsink
|
|
|
|
PRIVATE absl::strings
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::logserver_proto
|
|
|
|
sapi::base
|
2021-01-06 18:34:28 +08:00
|
|
|
PUBLIC absl::synchronization
|
|
|
|
glog::glog
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:ipc
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_ipc ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
ipc.cc
|
|
|
|
ipc.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::ipc ALIAS sandbox2_ipc)
|
|
|
|
target_link_libraries(sandbox2_ipc PRIVATE
|
|
|
|
absl::core_headers
|
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::logserver
|
|
|
|
sandbox2::logsink
|
|
|
|
sandbox2::network_proxy_client
|
|
|
|
sandbox2::network_proxy_server
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:policy
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_policy ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
policy.cc
|
|
|
|
policy.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::policy ALIAS sandbox2_policy)
|
|
|
|
target_link_libraries(sandbox2_policy PRIVATE
|
|
|
|
absl::core_headers
|
|
|
|
absl::optional
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::bpfdisassembler
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::namespace
|
|
|
|
sandbox2::regs
|
|
|
|
sandbox2::syscall
|
|
|
|
sandbox2::violation_proto
|
|
|
|
sapi::base
|
2019-06-05 15:25:50 +08:00
|
|
|
sapi::flags
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:notify
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_notify ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
notify.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::notify ALIAS sandbox2_notify)
|
|
|
|
target_link_libraries(sandbox2_notify PRIVATE
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::result
|
|
|
|
sandbox2::syscall
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:limits
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_limits ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
limits.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::limits ALIAS sandbox2_limits)
|
|
|
|
target_link_libraries(sandbox2_limits PRIVATE
|
|
|
|
absl::core_headers
|
|
|
|
absl::time
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:forkserver_bin
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_forkserver_bin
|
2019-05-06 20:03:29 +08:00
|
|
|
forkserver_bin.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_forkserver_bin PROPERTIES
|
|
|
|
OUTPUT_NAME forkserver_bin)
|
|
|
|
add_executable(sandbox2::forkserver_bin ALIAS sandbox2_forkserver_bin)
|
|
|
|
target_link_libraries(sandbox2_forkserver_bin PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::core_headers
|
|
|
|
absl::strings
|
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::forkserver
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
2020-12-15 01:15:40 +08:00
|
|
|
PUBLIC glog::glog
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:forkserver_bin_embed
|
2020-12-14 17:13:03 +08:00
|
|
|
sapi_cc_embed_data(NAME sandbox2_forkserver_bin_embed
|
|
|
|
OUTPUT_NAME forkserver_bin_embed
|
2019-05-06 20:03:29 +08:00
|
|
|
NAMESPACE ""
|
2020-12-14 17:13:03 +08:00
|
|
|
SOURCES sandbox2::forkserver_bin
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
add_library(sandbox2::forkserver_bin_embed ALIAS sandbox2_forkserver_bin_embed)
|
2019-05-06 20:03:29 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:global_forkserver
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_global_forkserver ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
global_forkclient.cc
|
|
|
|
global_forkclient.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::global_forkserver ALIAS sandbox2_global_forkserver)
|
2020-11-06 00:47:34 +08:00
|
|
|
target_link_libraries(sandbox2_global_forkserver
|
|
|
|
PRIVATE absl::memory
|
|
|
|
absl::strings
|
|
|
|
glog::glog
|
|
|
|
sandbox2::client
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::fileops
|
2020-11-06 00:47:34 +08:00
|
|
|
sandbox2::forkserver_bin_embed
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2020-11-06 00:47:34 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::embed_file
|
|
|
|
sapi::raw_logging
|
2020-12-02 19:05:06 +08:00
|
|
|
PUBLIC absl::core_headers
|
|
|
|
absl::synchronization
|
|
|
|
sandbox2::comms
|
2020-11-06 00:47:34 +08:00
|
|
|
sandbox2::fork_client
|
|
|
|
sandbox2::forkserver_proto
|
2020-12-10 02:53:06 +08:00
|
|
|
sapi::flags
|
2020-11-06 00:47:34 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:start_global_forkserver_lib_constructor
|
|
|
|
# Use only if Sandbox2 global forkserver has to be started very early on.
|
|
|
|
# By default the forkserver is started on demand.
|
|
|
|
add_library(sandbox2_start_global_forkserver_lib_constructor STATIC
|
|
|
|
global_forkclient_lib_ctor.cc
|
|
|
|
)
|
|
|
|
add_library(sandbox2::start_global_forkserver_lib_constructor ALIAS
|
|
|
|
sandbox2_start_global_forkserver_lib_constructor)
|
|
|
|
target_link_libraries(sandbox2_start_global_forkserver_lib_constructor PRIVATE
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::core_headers
|
|
|
|
sapi::base
|
2020-12-10 18:49:25 +08:00
|
|
|
sandbox2::fork_client
|
2020-11-06 00:47:34 +08:00
|
|
|
sandbox2::global_forkserver
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
2019-07-09 16:53:31 +08:00
|
|
|
# sandboxed_api/sandbox2:executor
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_executor ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
executor.cc
|
|
|
|
executor.h
|
2019-07-09 16:53:31 +08:00
|
|
|
)
|
|
|
|
add_library(sandbox2::executor ALIAS sandbox2_executor)
|
2020-12-15 01:15:40 +08:00
|
|
|
target_link_libraries(sandbox2_executor
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::memory
|
|
|
|
sandbox2::forkserver_proto
|
|
|
|
sandbox2::ipc
|
|
|
|
sandbox2::limits
|
|
|
|
sandbox2::namespace
|
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::status_proto
|
2021-01-28 18:20:13 +08:00
|
|
|
PUBLIC absl::span
|
|
|
|
absl::strings
|
|
|
|
glog::glog
|
|
|
|
sapi::fileops
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::fork_client
|
|
|
|
sandbox2::global_forkserver
|
2019-07-09 16:53:31 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:sandbox2
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_sandbox2 ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
monitor.cc
|
|
|
|
monitor.h
|
|
|
|
policybuilder.cc
|
|
|
|
policybuilder.h
|
|
|
|
sandbox2.cc
|
|
|
|
sandbox2.h
|
2019-07-09 16:31:48 +08:00
|
|
|
stack_trace.cc
|
|
|
|
stack_trace.h
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
add_library(sandbox2::sandbox2 ALIAS sandbox2_sandbox2)
|
|
|
|
target_link_libraries(sandbox2_sandbox2
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::flat_hash_map
|
|
|
|
absl::flat_hash_set
|
|
|
|
absl::memory
|
|
|
|
absl::optional
|
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
|
|
|
absl::synchronization
|
2020-12-15 01:15:40 +08:00
|
|
|
sapi::base
|
|
|
|
PUBLIC absl::status
|
|
|
|
absl::statusor
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::time
|
2020-12-15 01:15:40 +08:00
|
|
|
sapi::flags
|
|
|
|
sapi::status
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::client
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::comms
|
2019-07-09 16:53:31 +08:00
|
|
|
sandbox2::executor
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::file_base
|
|
|
|
sapi::fileops
|
2020-07-17 19:54:20 +08:00
|
|
|
sandbox2::fork_client
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::forkserver_proto
|
|
|
|
sandbox2::global_forkserver
|
|
|
|
sandbox2::ipc
|
|
|
|
sandbox2::limits
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::logsink
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::mounts
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::mounttree_proto
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::namespace
|
|
|
|
sandbox2::network_proxy_client
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::network_proxy_server
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::notify
|
|
|
|
sandbox2::policy
|
|
|
|
sandbox2::regs
|
|
|
|
sandbox2::result
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::syscall
|
|
|
|
sandbox2::unwind
|
|
|
|
sandbox2::unwind_proto
|
|
|
|
sandbox2::util
|
|
|
|
sandbox2::violation_proto
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:client
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_client ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
client.cc
|
|
|
|
client.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::client ALIAS sandbox2_client)
|
|
|
|
target_link_libraries(sandbox2_client
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::memory
|
|
|
|
absl::strings
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2019-05-06 20:03:29 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
2021-01-06 18:34:28 +08:00
|
|
|
PUBLIC absl::flat_hash_map
|
2019-07-26 20:50:45 +08:00
|
|
|
sandbox2::comms
|
2021-01-06 18:34:28 +08:00
|
|
|
sandbox2::logsink
|
|
|
|
sandbox2::network_proxy_client
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
2020-04-08 04:26:15 +08:00
|
|
|
# sandboxed_api/sandbox2:sanitizer
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_sanitizer ${SAPI_LIB_TYPE}
|
2020-04-08 04:26:15 +08:00
|
|
|
sanitizer.cc
|
|
|
|
sanitizer.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::sanitizer ALIAS sandbox2_sanitizer)
|
|
|
|
target_link_libraries(sandbox2_sanitizer
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::file_helpers
|
|
|
|
sapi::fileops
|
|
|
|
sapi::strerror
|
2020-04-08 04:26:15 +08:00
|
|
|
sapi::raw_logging
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::base
|
2020-04-08 04:26:15 +08:00
|
|
|
)
|
|
|
|
|
2019-05-06 20:03:29 +08:00
|
|
|
# sandboxed_api/sandbox2:forkserver
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_forkserver ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
forkserver.cc
|
|
|
|
forkserver.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::forkserver ALIAS sandbox2_forkserver)
|
|
|
|
target_link_libraries(sandbox2_forkserver PRIVATE
|
2019-11-20 01:01:59 +08:00
|
|
|
absl::memory
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
|
|
|
absl::statusor
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
|
|
|
libcap::libcap
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::fileops
|
2020-07-17 19:54:20 +08:00
|
|
|
sandbox2::fork_client
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::forkserver_proto
|
|
|
|
sandbox2::namespace
|
|
|
|
sandbox2::policy
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::syscall
|
|
|
|
sandbox2::unwind
|
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
)
|
|
|
|
|
2020-07-17 19:54:20 +08:00
|
|
|
# sandboxed_api/sandbox2:fork_client
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_fork_client ${SAPI_LIB_TYPE}
|
2020-07-17 19:54:20 +08:00
|
|
|
fork_client.cc
|
|
|
|
fork_client.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::fork_client ALIAS sandbox2_fork_client)
|
|
|
|
target_link_libraries(sandbox2_fork_client PRIVATE
|
|
|
|
absl::core_headers
|
|
|
|
absl::synchronization
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::forkserver_proto
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
)
|
|
|
|
|
2019-05-06 20:03:29 +08:00
|
|
|
# sandboxed_api/sandbox2:mounts
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_mounts ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
mounts.cc
|
|
|
|
mounts.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::mounts ALIAS sandbox2_mounts)
|
2020-12-15 01:15:40 +08:00
|
|
|
target_link_libraries(sandbox2_mounts
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::flat_hash_set
|
|
|
|
absl::status
|
|
|
|
absl::statusor
|
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
|
|
|
protobuf::libprotobuf
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
|
|
|
sapi::file_base
|
|
|
|
sapi::fileops
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::minielf
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2020-12-15 01:15:40 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
sapi::status
|
|
|
|
PUBLIC sandbox2::mounttree_proto
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:namespace
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_namespace ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
namespace.cc
|
|
|
|
namespace.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::namespace ALIAS sandbox2_namespace)
|
|
|
|
target_link_libraries(sandbox2_namespace PRIVATE
|
|
|
|
absl::core_headers
|
2019-11-20 01:01:59 +08:00
|
|
|
absl::memory
|
2019-05-06 20:03:29 +08:00
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
2020-02-28 01:23:44 +08:00
|
|
|
protobuf::libprotobuf
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::file_base
|
|
|
|
sapi::fileops
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::mounts
|
|
|
|
sandbox2::mounttree_proto
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2019-05-06 20:03:29 +08:00
|
|
|
sandbox2::util
|
|
|
|
sandbox2::violation_proto
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:forkingclient
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_forkingclient ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
forkingclient.cc
|
|
|
|
forkingclient.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::forkingclient ALIAS sandbox2_forkingclient)
|
2019-06-07 22:27:06 +08:00
|
|
|
target_link_libraries(sandbox2_forkingclient
|
|
|
|
PRIVATE absl::memory
|
2021-01-06 18:34:28 +08:00
|
|
|
glog::glog
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2019-06-07 22:27:06 +08:00
|
|
|
sapi::base
|
2019-07-26 20:50:45 +08:00
|
|
|
PUBLIC sandbox2::client
|
2021-01-06 18:34:28 +08:00
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::forkserver
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:util
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_util ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
util.cc
|
|
|
|
util.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::util ALIAS sandbox2_util)
|
2019-07-26 20:50:45 +08:00
|
|
|
target_link_libraries(sandbox2_util
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
|
|
|
sapi::file_base
|
|
|
|
sapi::fileops
|
|
|
|
sapi::strerror
|
2019-07-26 20:50:45 +08:00
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
2020-02-28 01:23:44 +08:00
|
|
|
PUBLIC absl::status
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::statusor
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
target_compile_options(sandbox2_util PRIVATE
|
|
|
|
# The default is 16384, however we need to do a clone with a
|
|
|
|
# stack-allocated buffer -- and PTHREAD_STACK_MIN also happens to be 16384.
|
|
|
|
# Thus the slight increase.
|
|
|
|
-Wframe-larger-than=17000
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:buffer
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_buffer ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
buffer.cc
|
|
|
|
buffer.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::buffer ALIAS sandbox2_buffer)
|
2020-12-15 01:15:40 +08:00
|
|
|
target_link_libraries(sandbox2_buffer
|
|
|
|
PRIVATE absl::core_headers
|
|
|
|
absl::memory
|
|
|
|
absl::status
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::status
|
|
|
|
PUBLIC absl::statusor
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:forkserver_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(_sandbox2_forkserver_pb_h _sandbox2_forkserver_pb_cc
|
2019-05-06 20:03:29 +08:00
|
|
|
forkserver.proto
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_forkserver_proto ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
${_sandbox2_forkserver_pb_cc}
|
|
|
|
${_sandbox2_forkserver_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sandbox2::forkserver_proto ALIAS sandbox2_forkserver_proto)
|
|
|
|
target_link_libraries(sandbox2_forkserver_proto PRIVATE
|
|
|
|
protobuf::libprotobuf
|
|
|
|
sandbox2::mounttree_proto
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:mounttree_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(_sandbox2_mounttree_pb_h _sandbox2_mounttree_pb_cc
|
2019-05-06 20:03:29 +08:00
|
|
|
mounttree.proto
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_mounttree_proto ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
${_sandbox2_mounttree_pb_cc}
|
|
|
|
${_sandbox2_mounttree_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sandbox2::mounttree_proto ALIAS sandbox2_mounttree_proto)
|
|
|
|
target_link_libraries(sandbox2_mounttree_proto PRIVATE
|
|
|
|
protobuf::libprotobuf
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:comms
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_comms ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
comms.cc
|
|
|
|
comms.h
|
|
|
|
)
|
|
|
|
add_library(sandbox2::comms ALIAS sandbox2_comms)
|
2019-07-26 20:50:45 +08:00
|
|
|
target_link_libraries(sandbox2_comms
|
|
|
|
PRIVATE absl::memory
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
|
|
|
absl::statusor
|
2019-07-26 20:50:45 +08:00
|
|
|
absl::str_format
|
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::strerror
|
2019-07-26 20:50:45 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::base
|
|
|
|
sapi::raw_logging
|
|
|
|
sapi::status_proto
|
|
|
|
PUBLIC absl::core_headers
|
2020-02-28 01:23:44 +08:00
|
|
|
absl::status
|
2019-07-26 20:50:45 +08:00
|
|
|
absl::synchronization
|
2020-02-28 01:23:44 +08:00
|
|
|
protobuf::libprotobuf
|
2019-07-26 20:50:45 +08:00
|
|
|
sapi::status
|
2019-05-06 20:03:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:violation_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(_sandbox2_violation_pb_cc _sandbox2_violation_pb_h
|
2019-05-06 20:03:29 +08:00
|
|
|
violation.proto
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_violation_proto ${SAPI_LIB_TYPE}
|
2019-05-06 20:03:29 +08:00
|
|
|
${_sandbox2_violation_pb_cc}
|
|
|
|
${_sandbox2_violation_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sandbox2::violation_proto ALIAS sandbox2_violation_proto)
|
|
|
|
target_link_libraries(sandbox2_violation_proto PRIVATE
|
|
|
|
protobuf::libprotobuf
|
|
|
|
sandbox2::mounttree_proto
|
|
|
|
sapi::base
|
|
|
|
)
|
|
|
|
|
2019-07-15 19:42:39 +08:00
|
|
|
if(SAPI_ENABLE_TESTS)
|
|
|
|
add_subdirectory(testcases)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:syscall_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_syscall_test
|
2019-07-15 19:42:39 +08:00
|
|
|
syscall_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_syscall_test PROPERTIES
|
|
|
|
OUTPUT_NAME syscall_test
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_syscall_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::syscall
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_syscall_test)
|
2019-07-15 19:42:39 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:mounts_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_mounts_test
|
2019-07-15 19:42:39 +08:00
|
|
|
mounts_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_mounts_test PROPERTIES
|
|
|
|
OUTPUT_NAME mounts_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_mounts_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_minimal_dynamic
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_mounts_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::strings
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::file_base
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::mounts
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::temp_file
|
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_mounts_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:namespace_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_namespace_test
|
2019-07-15 19:42:39 +08:00
|
|
|
namespace_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_namespace_test PROPERTIES
|
|
|
|
OUTPUT_NAME namespace_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_namespace_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_hostname
|
|
|
|
sandbox2::testcase_namespace
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_namespace_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::comms
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
|
|
|
sapi::fileops
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::namespace
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
|
|
|
sapi::temp_file
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_namespace_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:buffer_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_buffer_test
|
2019-07-15 19:42:39 +08:00
|
|
|
buffer_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_buffer_test PROPERTIES
|
|
|
|
OUTPUT_NAME buffer_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_buffer_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_buffer
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_buffer_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
sandbox2::buffer
|
|
|
|
sandbox2::comms
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::ipc
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_buffer_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:comms_test_proto
|
2020-03-19 01:47:02 +08:00
|
|
|
sapi_protobuf_generate_cpp(
|
|
|
|
_sandbox2_comms_test_pb_h _sandbox2_comms_test_pb_cc
|
2019-07-15 19:42:39 +08:00
|
|
|
comms_test.proto
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
add_library(sandbox2_comms_test_proto ${SAPI_LIB_TYPE}
|
2019-07-15 19:42:39 +08:00
|
|
|
${_sandbox2_comms_test_pb_cc}
|
|
|
|
${_sandbox2_comms_test_pb_h}
|
|
|
|
)
|
|
|
|
add_library(sandbox2::comms_test_proto ALIAS sandbox2_comms_test_proto)
|
2019-07-30 21:48:16 +08:00
|
|
|
target_link_libraries(sandbox2_comms_test_proto
|
|
|
|
PRIVATE sapi::base
|
|
|
|
PUBLIC protobuf::libprotobuf
|
2019-07-15 19:42:39 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:comms_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_comms_test
|
2019-07-15 19:42:39 +08:00
|
|
|
comms_test.cc
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
target_link_libraries(sandbox2_comms_test
|
|
|
|
PRIVATE absl::fixed_array
|
|
|
|
absl::strings
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::comms_test_proto
|
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
PUBLIC glog::glog
|
2020-12-14 17:13:03 +08:00
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_comms_test)
|
2019-07-15 19:42:39 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:forkserver_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_forkserver_test
|
2019-07-15 19:42:39 +08:00
|
|
|
forkserver_test.cc
|
|
|
|
global_forkclient.h
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_forkserver_test PROPERTIES
|
|
|
|
OUTPUT_NAME forkserver_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_forkserver_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_minimal
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_forkserver_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::strings
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::forkserver
|
|
|
|
sandbox2::forkserver_proto
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_forkserver_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:limits_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_limits_test
|
2019-07-15 19:42:39 +08:00
|
|
|
limits_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_limits_test PROPERTIES
|
|
|
|
OUTPUT_NAME limits_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_limits_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_limits
|
|
|
|
sandbox2::testcase_minimal
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_limits_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
sandbox2::bpf_helper
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::limits
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_limits_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:notify_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_notify_test
|
2019-07-15 19:42:39 +08:00
|
|
|
notify_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_notify_test PROPERTIES
|
|
|
|
OUTPUT_NAME notify_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_notify_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_personality
|
|
|
|
sandbox2::testcase_pidcomms
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_notify_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::regs
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_notify_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:policy_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_policy_test
|
2019-07-15 19:42:39 +08:00
|
|
|
policy_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_policy_test PROPERTIES
|
|
|
|
OUTPUT_NAME policy_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_policy_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_add_policy_on_syscalls
|
|
|
|
sandbox2::testcase_malloc_system
|
|
|
|
sandbox2::testcase_minimal
|
|
|
|
sandbox2::testcase_minimal_dynamic
|
|
|
|
sandbox2::testcase_policy
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_policy_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::limits
|
|
|
|
sandbox2::regs
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_policy_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:sandbox2_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_sandbox2_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_sandbox2_test PROPERTIES
|
|
|
|
OUTPUT_NAME sandbox2_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_sandbox2_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_abort
|
|
|
|
sandbox2::testcase_minimal
|
|
|
|
sandbox2::testcase_sleep
|
|
|
|
sandbox2::testcase_tsync
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_sandbox2_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::config
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_sandbox2_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:sanitizer_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_sanitizer_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sanitizer_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_sanitizer_test PROPERTIES
|
|
|
|
OUTPUT_NAME sanitizer_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_sanitizer_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_sanitizer
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_sanitizer_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::client
|
|
|
|
sandbox2::comms
|
|
|
|
sandbox2::sandbox2
|
2020-04-08 04:26:15 +08:00
|
|
|
sandbox2::sanitizer
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_sanitizer_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:util_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_util_test
|
2019-07-15 19:42:39 +08:00
|
|
|
util_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_util_test PROPERTIES
|
|
|
|
OUTPUT_NAME util_test
|
|
|
|
)
|
|
|
|
target_link_libraries(sandbox2_util_test PRIVATE
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::file_base
|
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_util_test)
|
2019-07-15 19:42:39 +08:00
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:stack_trace_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_stack_trace_test
|
2019-07-15 19:42:39 +08:00
|
|
|
stack_trace_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_stack_trace_test PROPERTIES
|
|
|
|
OUTPUT_NAME stack_trace_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_stack_trace_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_symbolize
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_stack_trace_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
2020-09-03 22:40:09 +08:00
|
|
|
absl::status
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::fileops
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::global_forkserver
|
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::temp_file
|
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::util
|
|
|
|
sapi::flags
|
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_stack_trace_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:ipc_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_ipc_test
|
2019-07-15 19:42:39 +08:00
|
|
|
ipc_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_ipc_test PROPERTIES
|
|
|
|
OUTPUT_NAME ipc_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_ipc_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_ipc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
target_link_libraries(sandbox2_ipc_test PRIVATE
|
2019-07-15 19:42:39 +08:00
|
|
|
absl::memory
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::comms
|
2020-12-15 01:15:40 +08:00
|
|
|
sandbox2::ipc
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::sandbox2
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2019-07-15 19:42:39 +08:00
|
|
|
sapi::flags
|
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
gtest_discover_tests_xcompile(sandbox2_ipc_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
|
|
|
|
# sandboxed_api/sandbox2:policybuilder_test
|
2020-12-14 17:13:03 +08:00
|
|
|
add_executable(sandbox2_policybuilder_test
|
2019-07-15 19:42:39 +08:00
|
|
|
policybuilder_test.cc
|
|
|
|
)
|
2020-12-14 17:13:03 +08:00
|
|
|
set_target_properties(sandbox2_policybuilder_test PROPERTIES
|
|
|
|
OUTPUT_NAME policybuilder_test
|
|
|
|
)
|
|
|
|
add_dependencies(sandbox2_policybuilder_test
|
2019-07-15 19:42:39 +08:00
|
|
|
sandbox2::testcase_print_fds
|
|
|
|
)
|
2020-12-15 01:15:40 +08:00
|
|
|
target_link_libraries(sandbox2_policybuilder_test
|
|
|
|
PRIVATE absl::memory
|
|
|
|
absl::strings
|
|
|
|
sandbox2::bpf_helper
|
|
|
|
sandbox2::comms
|
2021-01-14 01:25:25 +08:00
|
|
|
sapi::testing
|
2020-12-15 01:15:40 +08:00
|
|
|
sapi::flags
|
|
|
|
sapi::status_matchers
|
|
|
|
sapi::test_main
|
|
|
|
PUBLIC sandbox2::sandbox2
|
|
|
|
)
|
|
|
|
gtest_discover_tests_xcompile(sandbox2_policybuilder_test PROPERTIES
|
2019-07-15 19:42:39 +08:00
|
|
|
ENVIRONMENT "TEST_TMPDIR=/tmp"
|
|
|
|
ENVIRONMENT "TEST_SRCDIR=${PROJECT_BINARY_DIR}"
|
|
|
|
)
|
|
|
|
endif()
|
2020-12-16 22:45:33 +08:00
|
|
|
|
|
|
|
configure_file(
|
|
|
|
"${PROJECT_SOURCE_DIR}/cmake/sandbox2.pc.in"
|
|
|
|
"${PROJECT_BINARY_DIR}/sandbox2.pc"
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
2021-01-14 01:25:25 +08:00
|
|
|
install(FILES "${PROJECT_BINARY_DIR}/sandbox2.pc"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|