endif
if ENABLE_SECCOMP
-liblxc_la_SOURCES += seccomp.c
+liblxc_la_SOURCES += seccomp.c lxcseccomp.h
endif
if !HAVE_STRLCPY
log.c log.h \
rexec.c rexec.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_attach_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_autostart_SOURCES = tools/lxc_autostart.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_autostart_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_cgroup_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_config_SOURCES = tools/lxc_config.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_config_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_console_SOURCES = tools/lxc_console.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_console_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_destroy_SOURCES = tools/lxc_destroy.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_destroy_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_device_SOURCES = tools/lxc_device.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_device_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_execute_SOURCES = tools/lxc_execute.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_execute_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_freeze_SOURCES = tools/lxc_freeze.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_freeze_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_info_SOURCES = tools/lxc_info.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_info_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_monitor_SOURCES = tools/lxc_monitor.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
log.c log.h \
macro.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_monitor_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_ls_SOURCES = tools/lxc_ls.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
log.c log.h \
memory_utils.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_ls_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_copy_SOURCES = tools/lxc_copy.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
log.c log.h \
storage/storage_utils.c storage/storage_utils.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_copy_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_start_SOURCES = tools/lxc_start.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_start_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_stop_SOURCES = tools/lxc_stop.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_stop_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_top_SOURCES = tools/lxc_top.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_top_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_unfreeze_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_unshare_SOURCES = tools/lxc_unshare.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
string_utils.c string_utils.h \
syscall_numbers.h \
syscall_wrappers.h
+if ENABLE_SECCOMP
+lxc_unshare_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_wait_SOURCES = tools/lxc_wait.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_wait_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_create_SOURCES = tools/lxc_create.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
log.c log.h \
storage/storage_utils.c storage/storage_utils.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_create_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_snapshot_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
tools/arguments.c tools/arguments.h \
af_unix.c af_unix.h \
initutils.c initutils.h \
log.c log.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+lxc_checkpoint_SOURCES += seccomp.c lxcseccomp.h
+endif
+
endif
if ENABLE_COMMANDS
process_utils.c process_utils.h \
syscall_numbers.h \
string_utils.c string_utils.h
+if ENABLE_SECCOMP
+init_lxc_SOURCES += seccomp.c lxcseccomp.h
+endif
init_lxc_LDFLAGS = -pthread
string_utils.c string_utils.h \
syscall_numbers.h \
utils.c utils.h
+if ENABLE_SECCOMP
+lxc_monitord_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
../include/netns_ifaddrs.c ../include/netns_ifaddrs.h \
af_unix.c af_unix.h \
syscall_numbers.h \
string_utils.c string_utils.h \
syscall_wrappers.h
+if ENABLE_SECCOMP
+lxc_user_nic_SOURCES += seccomp.c lxcseccomp.h
+endif
+
lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c \
af_unix.c af_unix.h \
caps.c caps.h \
string_utils.c string_utils.h \
syscall_wrappers.h \
utils.c utils.h
+if ENABLE_SECCOMP
+lxc_usernsexec_SOURCES += seccomp.c lxcseccomp.h
+endif
endif
#include <sys/un.h>
#endif
+#include "compiler.h"
#include "conf.h"
#include "config.h"
#include "memory_utils.h"
#endif /* HAVE_DECL_SECCOMP_NOTIFY_FD */
};
-extern int lxc_seccomp_load(struct lxc_conf *conf);
-extern int lxc_read_seccomp_config(struct lxc_conf *conf);
-extern void lxc_seccomp_free(struct lxc_seccomp *seccomp);
-extern int seccomp_notify_handler(int fd, uint32_t events, void *data,
- struct lxc_epoll_descr *descr);
-extern void seccomp_conf_init(struct lxc_conf *conf);
-extern int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp,
- struct lxc_epoll_descr *descr,
- struct lxc_handler *handler);
-extern int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp,
- int socket_fd);
-extern int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp,
- int socket_fd);
-extern int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
- struct lxc_seccomp *seccomp);
+__hidden extern int lxc_seccomp_load(struct lxc_conf *conf);
+__hidden extern int lxc_read_seccomp_config(struct lxc_conf *conf);
+__hidden extern void lxc_seccomp_free(struct lxc_seccomp *seccomp);
+__hidden extern int seccomp_notify_handler(int fd, uint32_t events, void *data,
+ struct lxc_epoll_descr *descr);
+__hidden extern void seccomp_conf_init(struct lxc_conf *conf);
+__hidden extern int lxc_seccomp_setup_proxy(struct lxc_seccomp *seccomp,
+ struct lxc_epoll_descr *descr,
+ struct lxc_handler *handler);
+__hidden extern int lxc_seccomp_send_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd);
+__hidden extern int lxc_seccomp_recv_notifier_fd(struct lxc_seccomp *seccomp, int socket_fd);
+__hidden extern int lxc_seccomp_add_notifier(const char *name, const char *lxcpath,
+ struct lxc_seccomp *seccomp);
static inline int lxc_seccomp_get_notify_fd(struct lxc_seccomp *seccomp)
{
#if HAVE_DECL_SECCOMP_NOTIFY_FD
if ENABLE_TESTS
-LDADD = ../lxc/liblxc.la
+LDADD = ../lxc/liblxc.la \
+ @CAP_LIBS@ \
+ @OPENSSL_LIBS@ \
+ @SECCOMP_LIBS@ \
+ @SELINUX_LIBS@ \
+ @DLOG_LIBS@
lxc_test_api_reboot_SOURCES = api_reboot.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_api_reboot_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
lxc_test_apparmor_SOURCES = aa.c
lxc_test_attach_SOURCES = attach.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_attach_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
lxc_test_basic_SOURCES = basic.c
lxc_test_cgpath_SOURCES = cgpath.c \
../lxc/af_unix.c ../lxc/af_unix.h \
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_cgpath_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
lxc_test_clonetest_SOURCES = clonetest.c
lxc_test_concurrent_SOURCES = concurrent.c
lxc_test_config_jump_table_SOURCES = config_jump_table.c \
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_config_jump_table_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
lxc_test_console_SOURCES = console.c
lxc_test_console_log_SOURCES = console_log.c lxctest.h
lxc_test_containertests_SOURCES = containertests.c
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_parse_config_file_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \
lxctest.h \
../lxc/caps.c ../lxc/caps.h \
../lxc/network.c ../lxc/network.h \
../lxc/nl.c ../lxc/nl.h \
../lxc/string_utils.c ../lxc/string_utils.h
+if ENABLE_SECCOMP
+lxc_test_utils_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
AM_CFLAGS=-DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \
-DLXCPATH=\"$(LXCPATH)\" \