]> git.proxmox.com Git - mirror_lxc.git/commitdiff
utils: hide unnecessary symbols
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 21 Jul 2020 11:15:25 +0000 (13:15 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 21 Jul 2020 11:15:25 +0000 (13:15 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/Makefile.am
src/lxc/utils.h
src/tests/Makefile.am

index 57b9536362db04e519d77535c22c9db7788fbe82..f3e15f6b95092b7a004597048988180d75a2ccd8 100644 (file)
@@ -356,7 +356,8 @@ lxc_attach_SOURCES = tools/lxc_attach.c \
                     state.c state.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_attach_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -387,7 +388,8 @@ lxc_autostart_SOURCES = tools/lxc_autostart.c \
                        state.c state.h \
                        string_utils.c string_utils.h \
                        sync.c sync.h \
-                       terminal.c terminal.h
+                       terminal.c terminal.h \
+                       utils.c utils.h
 if ENABLE_SECCOMP
 lxc_autostart_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -418,7 +420,8 @@ lxc_cgroup_SOURCES = tools/lxc_cgroup.c \
                     state.c state.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_cgroup_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -449,7 +452,8 @@ lxc_config_SOURCES = tools/lxc_config.c \
                     state.c state.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_config_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -480,7 +484,8 @@ lxc_console_SOURCES = tools/lxc_console.c \
                      state.c state.h \
                      string_utils.c string_utils.h \
                      sync.c sync.h \
-                     terminal.c terminal.h
+                     terminal.c terminal.h \
+                     utils.c utils.h
 if ENABLE_SECCOMP
 lxc_console_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -511,7 +516,8 @@ lxc_destroy_SOURCES = tools/lxc_destroy.c \
                      state.c state.h \
                      string_utils.c string_utils.h \
                      sync.c sync.h \
-                     terminal.c terminal.h
+                     terminal.c terminal.h \
+                     utils.c utils.h
 if ENABLE_SECCOMP
 lxc_destroy_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -542,7 +548,8 @@ lxc_device_SOURCES = tools/lxc_device.c \
                     state.c state.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_device_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -573,7 +580,8 @@ lxc_execute_SOURCES = tools/lxc_execute.c \
                      state.c state.h \
                      string_utils.c string_utils.h \
                      sync.c sync.h \
-                     terminal.c terminal.h
+                     terminal.c terminal.h \
+                     utils.c utils.h
 if ENABLE_SECCOMP
 lxc_execute_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -604,7 +612,8 @@ lxc_freeze_SOURCES = tools/lxc_freeze.c \
                     state.c state.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_freeze_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -635,7 +644,8 @@ lxc_info_SOURCES = tools/lxc_info.c \
                   state.c state.h \
                   string_utils.c string_utils.h \
                   sync.c sync.h \
-                  terminal.c terminal.h
+                  terminal.c terminal.h \
+                  utils.c utils.h
 if ENABLE_SECCOMP
 lxc_info_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -667,7 +677,8 @@ lxc_monitor_SOURCES = tools/lxc_monitor.c \
                      state.c state.h \
                      string_utils.c string_utils.h \
                      sync.c sync.h \
-                     terminal.c terminal.h
+                     terminal.c terminal.h \
+                     utils.c utils.h
 if ENABLE_SECCOMP
 lxc_monitor_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -699,7 +710,8 @@ lxc_ls_SOURCES = tools/lxc_ls.c \
                 state.c state.h \
                 string_utils.c string_utils.h \
                 sync.c sync.h \
-                terminal.c terminal.h
+                terminal.c terminal.h \
+                utils.c utils.h
 if ENABLE_SECCOMP
 lxc_ls_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -731,7 +743,8 @@ lxc_copy_SOURCES = tools/lxc_copy.c \
                   storage/storage_utils.c storage/storage_utils.h \
                   string_utils.c string_utils.h \
                   sync.c sync.h \
-                  terminal.c terminal.h
+                  terminal.c terminal.h \
+                  utils.c utils.h
 if ENABLE_SECCOMP
 lxc_copy_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -762,7 +775,8 @@ lxc_start_SOURCES = tools/lxc_start.c \
                    state.c state.h \
                    string_utils.c string_utils.h \
                    sync.c sync.h \
-                   terminal.c terminal.h
+                   terminal.c terminal.h \
+                   utils.c utils.h
 if ENABLE_SECCOMP
 lxc_start_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -793,7 +807,8 @@ lxc_stop_SOURCES = tools/lxc_stop.c \
                   state.c state.h \
                   string_utils.c string_utils.h \
                   sync.c sync.h \
-                  terminal.c terminal.h
+                  terminal.c terminal.h \
+                  utils.c utils.h
 if ENABLE_SECCOMP
 lxc_stop_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -824,7 +839,8 @@ lxc_top_SOURCES = tools/lxc_top.c \
                  state.c state.h \
                  string_utils.c string_utils.h \
                  sync.c sync.h \
-                 terminal.c terminal.h
+                 terminal.c terminal.h \
+                 utils.c utils.h
 if ENABLE_SECCOMP
 lxc_top_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -855,7 +871,8 @@ lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \
                       state.c state.h \
                       string_utils.c string_utils.h \
                       sync.c sync.h \
-                      terminal.c terminal.h
+                      terminal.c terminal.h \
+                      utils.c utils.h
 if ENABLE_SECCOMP
 lxc_unfreeze_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -888,7 +905,8 @@ lxc_unshare_SOURCES = tools/lxc_unshare.c \
                      sync.c sync.h \
                      syscall_numbers.h \
                      syscall_wrappers.h \
-                     terminal.c terminal.h
+                     terminal.c terminal.h \
+                     utils.c utils.h
 if ENABLE_SECCOMP
 lxc_unshare_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -919,7 +937,8 @@ lxc_wait_SOURCES = tools/lxc_wait.c \
                   state.c state.h \
                   string_utils.c string_utils.h \
                   sync.c sync.h \
-                  terminal.c terminal.h
+                  terminal.c terminal.h \
+                  utils.c utils.h
 if ENABLE_SECCOMP
 lxc_wait_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -951,7 +970,8 @@ lxc_create_SOURCES = tools/lxc_create.c \
                     storage/storage_utils.c storage/storage_utils.h \
                     string_utils.c string_utils.h \
                     sync.c sync.h \
-                    terminal.c terminal.h
+                    terminal.c terminal.h \
+                    utils.c utils.h
 if ENABLE_SECCOMP
 lxc_create_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -982,7 +1002,8 @@ lxc_snapshot_SOURCES = tools/lxc_snapshot.c \
                       state.c state.h \
                       string_utils.c string_utils.h \
                       sync.c sync.h \
-                      terminal.c terminal.h
+                      terminal.c terminal.h \
+                      utils.c utils.h
 if ENABLE_SECCOMP
 lxc_snapshot_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -1013,7 +1034,8 @@ lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \
                         state.c state.h \
                         string_utils.c string_utils.h \
                         sync.c sync.h \
-                        terminal.c terminal.h
+                        terminal.c terminal.h \
+                        utils.c utils.h
 if ENABLE_SECCOMP
 lxc_checkpoint_SOURCES += seccomp.c lxcseccomp.h
 endif
@@ -1102,7 +1124,8 @@ lxc_user_nic_SOURCES = cmd/lxc_user_nic.c \
                       sync.c sync.h \
                       syscall_numbers.h \
                       syscall_wrappers.h \
-                      terminal.c terminal.h
+                      terminal.c terminal.h \
+                      utils.c utils.h
 if ENABLE_SECCOMP
 lxc_user_nic_SOURCES += seccomp.c lxcseccomp.h
 endif
index 8e6fbc44f577729223dea28d8610898fb51887dd..3f9a4091506470daf8ac103cfc55c66631e5bdb2 100644 (file)
@@ -21,6 +21,7 @@
 #include <sys/vfs.h>
 #include <unistd.h>
 
+#include "compiler.h"
 #include "file_utils.h"
 #include "initutils.h"
 #include "macro.h"
 #include "string_utils.h"
 
 /* returns 1 on success, 0 if there were any failures */
-extern int lxc_rmdir_onedev(const char *path, const char *exclude);
-extern int get_u16(unsigned short *val, const char *arg, int base);
-extern int mkdir_p(const char *dir, mode_t mode);
-extern char *get_rundir(void);
+__hidden extern int lxc_rmdir_onedev(const char *path, const char *exclude);
+__hidden extern int get_u16(unsigned short *val, const char *arg, int base);
+__hidden extern int mkdir_p(const char *dir, mode_t mode);
+__hidden extern char *get_rundir(void);
 
 /* Define getline() if missing from the C library */
 #ifndef HAVE_GETLINE
@@ -64,14 +65,14 @@ struct lxc_popen_FILE {
  * Returns pointer to struct lxc_popen_FILE, that should be freed with lxc_pclose().
  * On error returns NULL.
  */
-extern struct lxc_popen_FILE *lxc_popen(const char *command);
+__hidden extern struct lxc_popen_FILE *lxc_popen(const char *command);
 
 /* pclose() replacement to be used on struct lxc_popen_FILE *,
  * returned by lxc_popen().
  * Waits for associated process to terminate, returns its exit status and
  * frees resources, pointed to by struct lxc_popen_FILE *.
  */
-extern int lxc_pclose(struct lxc_popen_FILE *fp);
+__hidden extern int lxc_pclose(struct lxc_popen_FILE *fp);
 
 static inline void __auto_lxc_pclose__(struct lxc_popen_FILE **f)
 {
@@ -83,16 +84,16 @@ static inline void __auto_lxc_pclose__(struct lxc_popen_FILE **f)
 /*
  * wait on a child we forked
  */
-extern int wait_for_pid(pid_t pid);
-extern int lxc_wait_for_pid_status(pid_t pid);
-extern int wait_for_pidfd(int pidfd);
+__hidden extern int wait_for_pid(pid_t pid);
+__hidden extern int lxc_wait_for_pid_status(pid_t pid);
+__hidden extern int wait_for_pidfd(int pidfd);
 
 #if HAVE_OPENSSL
-extern int sha1sum_file(char *fnam, unsigned char *md_value, unsigned int *md_len);
+__hidden extern int sha1sum_file(char *fnam, unsigned char *md_value, unsigned int *md_len);
 #endif
 
 /* initialize rand with urandom */
-extern int randseed(bool);
+__hidden extern int randseed(bool);
 
 /* are we unprivileged with respect to our namespaces */
 inline static bool am_guest_unpriv(void) {
@@ -126,52 +127,51 @@ inline static bool am_host_unpriv(void)
 /*
  * parse /proc/self/uid_map to find what @orig maps to
  */
-extern uid_t get_ns_uid(uid_t orig);
+__hidden extern uid_t get_ns_uid(uid_t orig);
 /*
  * parse /proc/self/gid_map to find what @orig maps to
  */
-extern gid_t get_ns_gid(gid_t orig);
+__hidden extern gid_t get_ns_gid(gid_t orig);
 
-extern bool dir_exists(const char *path);
+__hidden extern bool dir_exists(const char *path);
 
 #define FNV1A_64_INIT ((uint64_t)0xcbf29ce484222325ULL)
-extern uint64_t fnv_64a_buf(void *buf, size_t len, uint64_t hval);
-
-extern bool is_shared_mountpoint(const char *path);
-extern int detect_shared_rootfs(void);
-extern bool detect_ramfs_rootfs(void);
-extern char *on_path(const char *cmd, const char *rootfs);
-extern bool cgns_supported(void);
-extern char *choose_init(const char *rootfs);
-extern bool switch_to_ns(pid_t pid, const char *ns);
-extern char *get_template_path(const char *t);
-extern int safe_mount(const char *src, const char *dest, const char *fstype,
-                     unsigned long flags, const void *data,
-                     const char *rootfs);
-extern int lxc_mount_proc_if_needed(const char *rootfs);
-extern int open_devnull(void);
-extern int set_stdfds(int fd);
-extern int null_stdfds(void);
-extern int lxc_preserve_ns(const int pid, const char *ns);
+__hidden extern uint64_t fnv_64a_buf(void *buf, size_t len, uint64_t hval);
+
+__hidden extern bool is_shared_mountpoint(const char *path);
+__hidden extern int detect_shared_rootfs(void);
+__hidden extern bool detect_ramfs_rootfs(void);
+__hidden extern char *on_path(const char *cmd, const char *rootfs);
+__hidden extern bool cgns_supported(void);
+__hidden extern char *choose_init(const char *rootfs);
+__hidden extern bool switch_to_ns(pid_t pid, const char *ns);
+__hidden extern char *get_template_path(const char *t);
+__hidden extern int safe_mount(const char *src, const char *dest, const char *fstype,
+                              unsigned long flags, const void *data, const char *rootfs);
+__hidden extern int lxc_mount_proc_if_needed(const char *rootfs);
+__hidden extern int open_devnull(void);
+__hidden extern int set_stdfds(int fd);
+__hidden extern int null_stdfds(void);
+__hidden extern int lxc_preserve_ns(const int pid, const char *ns);
 
 /* Check whether a signal is blocked by a process. */
-extern bool task_blocks_signal(pid_t pid, int signal);
+__hidden extern bool task_blocks_signal(pid_t pid, int signal);
 
 /* Switch to a new uid and gid.
  * If LXC_INVALID_{G,U}ID is passed then the set{g,u}id() will not be called.
  */
-extern bool lxc_switch_uid_gid(uid_t uid, gid_t gid);
-extern bool lxc_setgroups(int size, gid_t list[]);
+__hidden extern bool lxc_switch_uid_gid(uid_t uid, gid_t gid);
+__hidden extern bool lxc_setgroups(int size, gid_t list[]);
 
 /* Find an unused loop device and associate it with source. */
-extern int lxc_prepare_loop_dev(const char *source, char *loop_dev, int flags);
+__hidden extern int lxc_prepare_loop_dev(const char *source, char *loop_dev, int flags);
 
 /* Clear all mounts on a given node.
  * >= 0 successfully cleared. The number returned is the number of umounts
  *      performed.
  * < 0  error umounting. Return -errno.
  */
-extern int lxc_unstack_mountpoint(const char *path, bool lazy);
+__hidden extern int lxc_unstack_mountpoint(const char *path, bool lazy);
 
 /*
  * run_command runs a command and collect it's std{err,out} output in buf.
@@ -185,8 +185,7 @@ extern int lxc_unstack_mountpoint(const char *path, bool lazy);
  *                     function must exec.
  * @param[in] args     Arguments to be passed to child_fn.
  */
-extern int run_command(char *buf, size_t buf_size, int (*child_fn)(void *),
-                      void *args);
+__hidden extern int run_command(char *buf, size_t buf_size, int (*child_fn)(void *), void *args);
 
 /*
  * run_command runs a command and collect it's std{err,out} output in buf, returns exit status.
@@ -200,10 +199,10 @@ extern int run_command(char *buf, size_t buf_size, int (*child_fn)(void *),
  *                     function must exec.
  * @param[in] args     Arguments to be passed to child_fn.
  */
-extern int run_command_status(char *buf, size_t buf_size, int (*child_fn)(void *),
-                      void *args);
+__hidden extern int run_command_status(char *buf, size_t buf_size, int (*child_fn)(void *),
+                                      void *args);
 
-extern bool lxc_nic_exists(char *nic);
+__hidden extern bool lxc_nic_exists(char *nic);
 
 static inline uint64_t lxc_getpagesize(void)
 {
@@ -224,16 +223,16 @@ static inline uint64_t lxc_getpagesize(void)
  * If the caller passes in 0 they will receive 0 in return since this is invalid
  * input and 0 is not a power of 2.
  */
-extern uint64_t lxc_find_next_power2(uint64_t n);
+__hidden extern uint64_t lxc_find_next_power2(uint64_t n);
 
 /* Set a signal the child process will receive after the parent has died. */
-extern int lxc_set_death_signal(int signal, pid_t parent, int parent_status_fd);
-extern int fd_cloexec(int fd, bool cloexec);
-extern int lxc_rm_rf(const char *dirname);
-extern int lxc_setup_keyring(char *keyring_label);
-extern bool lxc_can_use_pidfd(int pidfd);
+__hidden extern int lxc_set_death_signal(int signal, pid_t parent, int parent_status_fd);
+__hidden extern int fd_cloexec(int fd, bool cloexec);
+__hidden extern int lxc_rm_rf(const char *dirname);
+__hidden extern int lxc_setup_keyring(char *keyring_label);
+__hidden extern bool lxc_can_use_pidfd(int pidfd);
 
-extern int fix_stdio_permissions(uid_t uid);
+__hidden extern int fix_stdio_permissions(uid_t uid);
 
 static inline bool uid_valid(uid_t uid)
 {
@@ -245,6 +244,6 @@ static inline bool gid_valid(gid_t gid)
        return gid != LXC_INVALID_GID;
 }
 
-extern bool multiply_overflow(int64_t base, uint64_t mult, int64_t *res);
+__hidden extern bool multiply_overflow(int64_t base, uint64_t mult, int64_t *res);
 
 #endif /* __LXC_UTILS_H */
index 1fdcee07ad898734ca2ef422b970a80febd42321..3a544c3c08c8b29c3cb22793e324faae955782f4 100644 (file)
@@ -32,12 +32,43 @@ lxc_test_api_reboot_SOURCES = api_reboot.c \
                              ../lxc/state.c ../lxc/state.h \
                              ../lxc/sync.c ../lxc/sync.h \
                              ../lxc/string_utils.c ../lxc/string_utils.h \
-                             ../lxc/terminal.c ../lxc/terminal.h
+                             ../lxc/terminal.c ../lxc/terminal.h \
+                             ../lxc/utils.c ../lxc/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_apparmor_SOURCES = aa.c \
+                           ../lxc/af_unix.c ../lxc/af_unix.h \
+                           ../lxc/caps.c ../lxc/caps.h \
+                           ../lxc/commands.c ../lxc/commands.h \
+                           ../lxc/commands_utils.c ../lxc/commands_utils.h \
+                           ../lxc/conf.c ../lxc/conf.h \
+                           ../lxc/confile.c ../lxc/confile.h \
+                           ../lxc/confile_utils.c ../lxc/confile_utils.h \
+                           ../lxc/error.c ../lxc/error.h \
+                           ../lxc/file_utils.c ../lxc/file_utils.h \
+                           ../lxc/initutils.c ../lxc/initutils.h \
+                           ../lxc/log.c ../lxc/log.h \
+                           ../lxc/lxclock.c ../lxc/lxclock.h \
+                           ../lxc/mainloop.c ../lxc/mainloop.h \
+                           ../lxc/monitor.c ../lxc/monitor.h \
+                           ../lxc/namespace.c ../lxc/namespace.h \
+                           ../lxc/network.c ../lxc/network.h \
+                           ../lxc/nl.c ../lxc/nl.h \
+                           ../lxc/parse.c ../lxc/parse.h \
+                           ../lxc/process_utils.c ../lxc/process_utils.h \
+                           ../lxc/ringbuf.c ../lxc/ringbuf.h \
+                           ../lxc/start.c ../lxc/start.h \
+                           ../lxc/state.c ../lxc/state.h \
+                           ../lxc/sync.c ../lxc/sync.h \
+                           ../lxc/string_utils.c ../lxc/string_utils.h \
+                           ../lxc/terminal.c ../lxc/terminal.h \
+                           ../lxc/utils.c ../lxc/utils.h
+if ENABLE_SECCOMP
+lxc_test_apparmor_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
 lxc_test_attach_SOURCES = attach.c \
                          ../lxc/af_unix.c ../lxc/af_unix.h \
                          ../lxc/caps.c ../lxc/caps.h \
@@ -63,7 +94,8 @@ lxc_test_attach_SOURCES = attach.c \
                          ../lxc/state.c ../lxc/state.h \
                          ../lxc/sync.c ../lxc/sync.h \
                          ../lxc/string_utils.c ../lxc/string_utils.h \
-                         ../lxc/terminal.c ../lxc/terminal.h
+                         ../lxc/terminal.c ../lxc/terminal.h \
+                         ../lxc/utils.c ../lxc/utils.h
 if ENABLE_SECCOMP
 lxc_test_attach_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
 endif
@@ -94,7 +126,8 @@ lxc_test_cgpath_SOURCES = cgpath.c \
                          ../lxc/state.c ../lxc/state.h \
                          ../lxc/sync.c ../lxc/sync.h \
                          ../lxc/string_utils.c ../lxc/string_utils.h \
-                         ../lxc/terminal.c ../lxc/terminal.h
+                         ../lxc/terminal.c ../lxc/terminal.h \
+                         ../lxc/utils.c ../lxc/utils.h
 if ENABLE_SECCOMP
 lxc_test_cgpath_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
 endif
@@ -127,7 +160,8 @@ lxc_test_config_jump_table_SOURCES = config_jump_table.c \
                                     ../lxc/state.c ../lxc/state.h \
                                     ../lxc/sync.c ../lxc/sync.h \
                                     ../lxc/string_utils.c ../lxc/string_utils.h \
-                                    ../lxc/terminal.c ../lxc/terminal.h
+                                    ../lxc/terminal.c ../lxc/terminal.h \
+                                    ../lxc/utils.c ../lxc/utils.h
 if ENABLE_SECCOMP
 lxc_test_config_jump_table_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
 endif
@@ -144,17 +178,70 @@ lxc_test_getkeys_SOURCES = getkeys.c
 lxc_test_get_item_SOURCES = get_item.c
 lxc_test_list_SOURCES = list.c
 lxc_test_locktests_SOURCES = locktests.c \
+                            ../lxc/af_unix.c ../lxc/af_unix.h \
                             ../lxc/caps.c ../lxc/caps.h \
+                            ../lxc/commands.c ../lxc/commands.h \
+                            ../lxc/commands_utils.c ../lxc/commands_utils.h \
+                            ../lxc/conf.c ../lxc/conf.h \
+                            ../lxc/confile.c ../lxc/confile.h \
+                            ../lxc/confile_utils.c ../lxc/confile_utils.h \
+                            ../lxc/error.c ../lxc/error.h \
                             ../lxc/file_utils.c ../lxc/file_utils.h \
+                            ../lxc/initutils.c ../lxc/initutils.h \
                             ../lxc/log.c ../lxc/log.h \
                             ../lxc/lxclock.c ../lxc/lxclock.h \
-                            ../lxc/string_utils.c ../lxc/string_utils.h
+                            ../lxc/mainloop.c ../lxc/mainloop.h \
+                            ../lxc/monitor.c ../lxc/monitor.h \
+                            ../lxc/namespace.c ../lxc/namespace.h \
+                            ../lxc/network.c ../lxc/network.h \
+                            ../lxc/nl.c ../lxc/nl.h \
+                            ../lxc/parse.c ../lxc/parse.h \
+                            ../lxc/process_utils.c ../lxc/process_utils.h \
+                            ../lxc/ringbuf.c ../lxc/ringbuf.h \
+                            ../lxc/start.c ../lxc/start.h \
+                            ../lxc/state.c ../lxc/state.h \
+                            ../lxc/sync.c ../lxc/sync.h \
+                            ../lxc/string_utils.c ../lxc/string_utils.h \
+                            ../lxc/terminal.c ../lxc/terminal.h \
+                            ../lxc/utils.c ../lxc/utils.h
+if ENABLE_SECCOMP
+lxc_test_locktests_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
 lxc_test_lxcpath_SOURCES = lxcpath.c
 lxc_test_may_control_SOURCES = may_control.c
 lxc_test_mount_injection_SOURCES = mount_injection.c \
                                   lxctest.h \
+                                  ../lxc/af_unix.c ../lxc/af_unix.h \
+                                  ../lxc/caps.c ../lxc/caps.h \
+                                  ../lxc/commands.c ../lxc/commands.h \
+                                  ../lxc/commands_utils.c ../lxc/commands_utils.h \
+                                  ../lxc/conf.c ../lxc/conf.h \
+                                  ../lxc/confile.c ../lxc/confile.h \
+                                  ../lxc/confile_utils.c ../lxc/confile_utils.h \
+                                  ../lxc/error.c ../lxc/error.h \
                                   ../lxc/file_utils.c ../lxc/file_utils.h \
-                                  ../lxc/string_utils.c ../lxc/string_utils.h
+                                  ../lxc/initutils.c ../lxc/initutils.h \
+                                  ../lxc/log.c ../lxc/log.h \
+                                  ../lxc/lxclock.c ../lxc/lxclock.h \
+                                  ../lxc/mainloop.c ../lxc/mainloop.h \
+                                  ../lxc/monitor.c ../lxc/monitor.h \
+                                  ../lxc/namespace.c ../lxc/namespace.h \
+                                  ../lxc/network.c ../lxc/network.h \
+                                  ../lxc/nl.c ../lxc/nl.h \
+                                  ../lxc/parse.c ../lxc/parse.h \
+                                  ../lxc/process_utils.c ../lxc/process_utils.h \
+                                  ../lxc/ringbuf.c ../lxc/ringbuf.h \
+                                  ../lxc/start.c ../lxc/start.h \
+                                  ../lxc/state.c ../lxc/state.h \
+                                  ../lxc/sync.c ../lxc/sync.h \
+                                  ../lxc/string_utils.c ../lxc/string_utils.h \
+                                  ../lxc/terminal.c ../lxc/terminal.h \
+                                  ../lxc/utils.c ../lxc/utils.h
+if ENABLE_SECCOMP
+lxc_test_mount_injection_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
+endif
+
 lxc_test_parse_config_file_SOURCES = parse_config_file.c \
                                     lxctest.h \
                                     ../lxc/af_unix.c ../lxc/af_unix.h \
@@ -181,7 +268,8 @@ lxc_test_parse_config_file_SOURCES = parse_config_file.c \
                                     ../lxc/state.c ../lxc/state.h \
                                     ../lxc/sync.c ../lxc/sync.h \
                                     ../lxc/string_utils.c ../lxc/string_utils.h \
-                                    ../lxc/terminal.c ../lxc/terminal.h
+                                    ../lxc/terminal.c ../lxc/terminal.h \
+                                    ../lxc/utils.c ../lxc/utils.h
 if ENABLE_SECCOMP
 lxc_test_parse_config_file_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
 endif
@@ -235,7 +323,8 @@ lxc_test_utils_SOURCES = lxc-test-utils.c \
                          ../lxc/state.c ../lxc/state.h \
                          ../lxc/sync.c ../lxc/sync.h \
                          ../lxc/string_utils.c ../lxc/string_utils.h \
-                         ../lxc/terminal.c ../lxc/terminal.h
+                         ../lxc/terminal.c ../lxc/terminal.h \
+                         ../lxc/utils.c ../lxc/utils.h
 if ENABLE_SECCOMP
 lxc_test_utils_SOURCES += ../lxc/seccomp.c ../lxc/lxcseccomp.h
 endif