From 2d7f5dcd9a796352e5afd62511b5159739d025c9 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 2 Sep 2021 15:57:05 +0200 Subject: [PATCH 1/2] include: make all functions __hidden Signed-off-by: Christian Brauner --- src/include/fexecve.h | 4 +++- src/include/getgrgid_r.h | 4 +++- src/include/getline.h | 4 +++- src/include/lxcmntent.h | 13 ++++++++----- src/include/netns_ifaddrs.h | 4 ++-- src/include/openpty.h | 7 +++++-- src/include/prlimit.h | 6 ++++-- src/include/strchrnul.h | 2 +- src/include/strlcat.h | 3 ++- src/include/strlcpy.h | 3 ++- 10 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/include/fexecve.h b/src/include/fexecve.h index f822c18f6..4c0a8b0f5 100644 --- a/src/include/fexecve.h +++ b/src/include/fexecve.h @@ -21,7 +21,9 @@ #ifndef _LXC_FEXECVE_H #define _LXC_FEXECVE_H +#include "../lxc/compiler.h" #include -extern int fexecve(int fd, char *const argv[], char *const envp[]); + +__hidden extern int fexecve(int fd, char *const argv[], char *const envp[]); #endif /* _LXC_FEXECVE_H */ diff --git a/src/include/getgrgid_r.h b/src/include/getgrgid_r.h index d01395b61..6a8c418c9 100644 --- a/src/include/getgrgid_r.h +++ b/src/include/getgrgid_r.h @@ -26,7 +26,9 @@ #include #include -extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, +#include "../lxc/compiler.h" + +__hidden extern int getgrgid_r(gid_t gid, struct group *gr, char *buf, size_t size, struct group **res); #endif /* _GETGRGID_R_H */ diff --git a/src/include/getline.h b/src/include/getline.h index 68452daf1..cbf9db925 100644 --- a/src/include/getline.h +++ b/src/include/getline.h @@ -32,6 +32,8 @@ #include -extern ssize_t getline(char **outbuf, size_t *outsize, FILE *fp); +#include "../lxc/compiler.h" + +__hidden extern ssize_t getline(char **outbuf, size_t *outsize, FILE *fp); #endif diff --git a/src/include/lxcmntent.h b/src/include/lxcmntent.h index 1d45d4826..f8954b451 100644 --- a/src/include/lxcmntent.h +++ b/src/include/lxcmntent.h @@ -21,6 +21,8 @@ #ifndef _LXCMNTENT_H #define _LXCMNTENT_H +#include "../lxc/compiler.h" + #if IS_BIONIC struct mntent { @@ -32,20 +34,21 @@ struct mntent int mnt_passno; }; -extern struct mntent *getmntent (FILE *stream); -extern struct mntent *getmntent_r (FILE *stream, struct mntent *mp, char *buffer, int bufsiz); +__hidden extern struct mntent *getmntent(FILE *stream); +__hidden extern struct mntent *getmntent_r(FILE *stream, struct mntent *mp, + char *buffer, int bufsiz); #endif #if !defined(HAVE_SETMNTENT) || IS_BIONIC -FILE *setmntent (const char *file, const char *mode); +__hidden FILE *setmntent(const char *file, const char *mode); #endif #if !defined(HAVE_ENDMNTENT) || IS_BIONIC -int endmntent (FILE *stream); +__hidden int endmntent(FILE *stream); #endif #if !defined(HAVE_HASMNTOPT) || IS_BIONIC -extern char *hasmntopt (const struct mntent *mnt, const char *opt); +__hidden extern char *hasmntopt(const struct mntent *mnt, const char *opt); #endif #endif diff --git a/src/include/netns_ifaddrs.h b/src/include/netns_ifaddrs.h index d3f1d6eef..1dc3448ac 100644 --- a/src/include/netns_ifaddrs.h +++ b/src/include/netns_ifaddrs.h @@ -12,8 +12,8 @@ extern "C" { #include #include -#include "compiler.h" -#include "memory_utils.h" +#include "../lxc/compiler.h" +#include "../lxc/memory_utils.h" struct netns_ifaddrs { struct netns_ifaddrs *ifa_next; diff --git a/src/include/openpty.h b/src/include/openpty.h index 8d4699f9a..6302caea3 100644 --- a/src/include/openpty.h +++ b/src/include/openpty.h @@ -6,12 +6,15 @@ #include #include +#include "../lxc/memory_utils.h" + /* * Create pseudo tty ptx pty pair with @__name and set terminal * attributes according to @__termp and @__winp and return handles for both * ends in @__aptx and @__apts. */ -extern int openpty(int *ptx, int *pty, char *name, const struct termios *termp, - const struct winsize *winp); +__hidden extern int openpty(int *ptx, int *pty, char *name, + const struct termios *termp, + const struct winsize *winp); #endif diff --git a/src/include/prlimit.h b/src/include/prlimit.h index 9b91e8b6c..a36b79528 100644 --- a/src/include/prlimit.h +++ b/src/include/prlimit.h @@ -32,10 +32,12 @@ #include #include +#include "../lxc/memory_utils.h" + #define RLIM_SAVED_CUR RLIM_INFINITY #define RLIM_SAVED_MAX RLIM_INFINITY -int prlimit(pid_t, int, const struct rlimit*, struct rlimit*); -int prlimit64(pid_t, int, const struct rlimit64*, struct rlimit64*); +__hidden int prlimit(pid_t, int, const struct rlimit *, struct rlimit *); +__hidden int prlimit64(pid_t, int, const struct rlimit64 *, struct rlimit64 *); #endif diff --git a/src/include/strchrnul.h b/src/include/strchrnul.h index 70a0d9442..94e291700 100644 --- a/src/include/strchrnul.h +++ b/src/include/strchrnul.h @@ -20,6 +20,6 @@ License along with the GNU C Library; if not, see . */ -#include "compiler.h" +#include "../lxc/compiler.h" __hidden extern char *strchrnul(const char *s, int c_in); diff --git a/src/include/strlcat.h b/src/include/strlcat.h index 60f7d8e05..748c3a6c2 100644 --- a/src/include/strlcat.h +++ b/src/include/strlcat.h @@ -22,8 +22,9 @@ #ifndef _STRLCAT_H #define _STRLCAT_H +#include "../lxc/compiler.h" #include -extern size_t strlcat(char *src, const char *append, size_t len); +__hidden extern size_t strlcat(char *src, const char *append, size_t len); #endif diff --git a/src/include/strlcpy.h b/src/include/strlcpy.h index 419cecf38..996e542cf 100644 --- a/src/include/strlcpy.h +++ b/src/include/strlcpy.h @@ -22,8 +22,9 @@ #ifndef _STRLCPY_H #define _STRLCPY_H +#include "../lxc/compiler.h" #include -extern size_t strlcpy(char *, const char *, size_t); +__hidden extern size_t strlcpy(char *, const char *, size_t); #endif From 646b75b5155b5191657567eb4d768705aff28a32 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 2 Sep 2021 16:21:33 +0200 Subject: [PATCH 2/2] tree-wide: fix build Fixes: #3960 Signed-off-by: Christian Brauner --- src/lxc/Makefile.am | 685 ++++++++++++++++++++++++++++++++++++ src/lxc/cgroups/cgfsng.c | 4 +- src/lxc/string_utils.h | 4 + src/lxc/tools/lxc_destroy.c | 8 +- src/tests/Makefile.am | 462 ++++++++++++++++++++++++ 5 files changed, 1157 insertions(+), 6 deletions(-) diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am index 20c32d3df..d13cbc160 100644 --- a/src/lxc/Makefile.am +++ b/src/lxc/Makefile.am @@ -22,6 +22,8 @@ noinst_HEADERS = api_extensions.h \ file_utils.h \ hlist.h \ ../include/strchrnul.h \ + ../include/strlcat.h \ + ../include/strlcpy.h \ ../include/netns_ifaddrs.h \ initutils.h \ list.h \ @@ -400,6 +402,33 @@ endif if !HAVE_STRCHRNUL lxc_attach_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_attach_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_attach_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_attach_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_attach_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_attach_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_attach_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_autostart_SOURCES = tools/lxc_autostart.c \ @@ -461,6 +490,33 @@ endif if !HAVE_STRCHRNUL lxc_autostart_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_autostart_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_autostart_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_autostart_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_autostart_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_autostart_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_autostart_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_cgroup_SOURCES = tools/lxc_cgroup.c \ @@ -522,6 +578,33 @@ endif if !HAVE_STRCHRNUL lxc_cgroup_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_cgroup_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_cgroup_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_cgroup_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_cgroup_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_cgroup_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_cgroup_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_config_SOURCES = tools/lxc_config.c \ @@ -583,6 +666,33 @@ endif if !HAVE_STRCHRNUL lxc_config_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_config_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_config_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_config_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_config_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_config_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_config_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_console_SOURCES = tools/lxc_console.c \ @@ -644,6 +754,33 @@ endif if !HAVE_STRCHRNUL lxc_console_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_console_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_console_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_console_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_console_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_console_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_console_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_destroy_SOURCES = tools/lxc_destroy.c \ @@ -705,6 +842,33 @@ endif if !HAVE_STRCHRNUL lxc_destroy_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_destroy_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_destroy_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_destroy_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_destroy_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_destroy_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_destroy_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_device_SOURCES = tools/lxc_device.c \ @@ -766,6 +930,33 @@ endif if !HAVE_STRCHRNUL lxc_device_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_device_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_device_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_device_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_device_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_device_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_device_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_execute_SOURCES = tools/lxc_execute.c \ @@ -827,6 +1018,33 @@ endif if !HAVE_STRCHRNUL lxc_execute_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_execute_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_execute_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_execute_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_execute_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_execute_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_execute_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_freeze_SOURCES = tools/lxc_freeze.c \ @@ -888,6 +1106,33 @@ endif if !HAVE_STRCHRNUL lxc_freeze_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_freeze_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_freeze_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_freeze_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_freeze_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_freeze_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_freeze_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_info_SOURCES = tools/lxc_info.c \ @@ -949,6 +1194,33 @@ endif if !HAVE_STRCHRNUL lxc_info_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_info_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_info_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_info_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_info_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_info_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_info_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_monitor_SOURCES = tools/lxc_monitor.c \ @@ -1011,6 +1283,33 @@ endif if !HAVE_STRCHRNUL lxc_monitor_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_monitor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_monitor_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_monitor_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_monitor_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_monitor_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_monitor_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_ls_SOURCES = tools/lxc_ls.c \ @@ -1073,6 +1372,33 @@ endif if !HAVE_STRCHRNUL lxc_ls_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_ls_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_ls_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_ls_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_ls_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_ls_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_ls_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_copy_SOURCES = tools/lxc_copy.c \ @@ -1134,6 +1460,33 @@ endif if !HAVE_STRCHRNUL lxc_copy_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_copy_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_copy_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_copy_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_copy_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_copy_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_copy_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_start_SOURCES = tools/lxc_start.c \ @@ -1195,6 +1548,33 @@ endif if !HAVE_STRCHRNUL lxc_start_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_start_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_start_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_start_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_start_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_start_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_start_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_stop_SOURCES = tools/lxc_stop.c \ @@ -1256,6 +1636,33 @@ endif if !HAVE_STRCHRNUL lxc_stop_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_stop_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_stop_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_stop_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_stop_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_stop_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_stop_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_top_SOURCES = tools/lxc_top.c \ @@ -1317,6 +1724,33 @@ endif if !HAVE_STRCHRNUL lxc_top_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_top_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_top_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_top_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_top_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_top_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_top_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_unfreeze_SOURCES = tools/lxc_unfreeze.c \ @@ -1378,6 +1812,33 @@ endif if !HAVE_STRCHRNUL lxc_unfreeze_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_unfreeze_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_unfreeze_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_unfreeze_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_unfreeze_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_unfreeze_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_unfreeze_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_unshare_SOURCES = tools/lxc_unshare.c \ @@ -1441,6 +1902,33 @@ endif if !HAVE_STRCHRNUL lxc_unshare_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_unshare_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_unshare_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_unshare_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_unshare_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_unshare_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_unshare_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_wait_SOURCES = tools/lxc_wait.c \ @@ -1502,6 +1990,33 @@ endif if !HAVE_STRCHRNUL lxc_wait_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_wait_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_wait_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_wait_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_wait_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_wait_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_wait_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_create_SOURCES = tools/lxc_create.c \ @@ -1563,6 +2078,33 @@ endif if !HAVE_STRCHRNUL lxc_create_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_create_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_create_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_create_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_create_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_create_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_create_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_snapshot_SOURCES = tools/lxc_snapshot.c \ @@ -1624,6 +2166,33 @@ endif if !HAVE_STRCHRNUL lxc_snapshot_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_snapshot_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_snapshot_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_snapshot_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_snapshot_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_snapshot_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_snapshot_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_checkpoint_SOURCES = tools/lxc_checkpoint.c \ @@ -1686,6 +2255,32 @@ if !HAVE_STRCHRNUL lxc_checkpoint_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_checkpoint_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_checkpoint_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_checkpoint_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_checkpoint_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_checkpoint_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_checkpoint_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif endif @@ -1702,6 +2297,15 @@ init_lxc_SOURCES = cmd/lxc_init.c \ memory_utils.h \ namespace.c namespace.h \ string_utils.c string_utils.h + +if !HAVE_STRLCPY +init_lxc_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +init_lxc_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + init_lxc_LDFLAGS = -pthread lxc_monitord_SOURCES = cmd/lxc_monitord.c @@ -1763,6 +2367,33 @@ endif if !HAVE_STRCHRNUL lxc_monitord_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_monitord_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_monitord_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_monitord_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_monitord_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_monitord_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_monitord_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_user_nic_SOURCES = cmd/lxc_user_nic.c @@ -1826,6 +2457,33 @@ endif if !HAVE_STRCHRNUL lxc_user_nic_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_user_nic_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_user_nic_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_user_nic_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_user_nic_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_user_nic_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_user_nic_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif lxc_usernsexec_SOURCES = cmd/lxc_usernsexec.c @@ -1891,6 +2549,33 @@ endif if !HAVE_STRCHRNUL lxc_usernsexec_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif + +if !HAVE_STRLCPY +lxc_usernsexec_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_usernsexec_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_usernsexec_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_usernsexec_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_usernsexec_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_usernsexec_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif endif endif diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index d51fd838f..1f8080241 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -12,9 +12,12 @@ * a comma-separated list of controllers. */ +#include "config.h" + #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif + #include #include #include @@ -39,7 +42,6 @@ #include "commands.h" #include "commands_utils.h" #include "conf.h" -#include "config.h" #include "error_utils.h" #include "log.h" #include "macro.h" diff --git a/src/lxc/string_utils.h b/src/lxc/string_utils.h index bc3e3992a..ac916c6b6 100644 --- a/src/lxc/string_utils.h +++ b/src/lxc/string_utils.h @@ -14,6 +14,10 @@ #include "include/strlcat.h" #endif +#ifndef HAVE_STRLCPY +#include "include/strlcpy.h" +#endif + #ifndef HAVE_STRCHRNUL #include "include/strchrnul.h" #endif diff --git a/src/lxc/tools/lxc_destroy.c b/src/lxc/tools/lxc_destroy.c index 692cc6ea3..e2e5f9843 100644 --- a/src/lxc/tools/lxc_destroy.c +++ b/src/lxc/tools/lxc_destroy.c @@ -1,8 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif +#include "config.h" + #include #include #include @@ -14,9 +13,8 @@ #include #include "arguments.h" -#include "config.h" #include "log.h" -#include "utils.h" +#include "file_utils.h" lxc_log_define(lxc_destroy, lxc); diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 75777d11b..ef8330efd 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -79,6 +79,33 @@ if !HAVE_STRCHRNUL lxc_test_api_reboot_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_api_reboot_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_api_reboot_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_api_reboot_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_api_reboot_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_api_reboot_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_api_reboot_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_apparmor_SOURCES = aa.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ @@ -133,6 +160,33 @@ if !HAVE_STRCHRNUL lxc_test_apparmor_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_apparmor_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_apparmor_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_apparmor_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_apparmor_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_apparmor_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_apparmor_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_attach_SOURCES = attach.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ @@ -187,6 +241,33 @@ if !HAVE_STRCHRNUL lxc_test_attach_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_attach_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_attach_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_attach_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_attach_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_attach_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_attach_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_basic_SOURCES = basic.c lxc_test_cgpath_SOURCES = cgpath.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -242,6 +323,33 @@ if !HAVE_STRCHRNUL lxc_test_cgpath_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_cgpath_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_cgpath_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_cgpath_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_cgpath_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_cgpath_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_cgpath_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_clonetest_SOURCES = clonetest.c lxc_test_concurrent_SOURCES = concurrent.c lxc_test_config_jump_table_SOURCES = config_jump_table.c \ @@ -299,6 +407,33 @@ if !HAVE_STRCHRNUL lxc_test_config_jump_table_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_config_jump_table_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_config_jump_table_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_config_jump_table_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_config_jump_table_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_config_jump_table_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_config_jump_table_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_console_SOURCES = console.c lxc_test_console_log_SOURCES = console_log.c lxctest.h lxc_test_containertests_SOURCES = containertests.c @@ -360,6 +495,33 @@ if !HAVE_STRCHRNUL lxc_test_device_add_remove_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_device_add_remove_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_device_add_remove_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_device_add_remove_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_device_add_remove_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_device_add_remove_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_device_add_remove_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_getkeys_SOURCES = getkeys.c lxc_test_get_item_SOURCES = get_item.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -415,6 +577,33 @@ if !HAVE_STRCHRNUL lxc_test_get_item_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_get_item_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_get_item_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_get_item_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_get_item_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_get_item_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_get_item_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_list_SOURCES = list.c lxc_test_locktests_SOURCES = locktests.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -470,6 +659,33 @@ if !HAVE_STRCHRNUL lxc_test_locktests_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_locktests_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_locktests_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_locktests_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_locktests_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_locktests_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_locktests_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_lxcpath_SOURCES = lxcpath.c lxc_test_may_control_SOURCES = may_control.c lxc_test_mount_injection_SOURCES = mount_injection.c \ @@ -527,6 +743,33 @@ if !HAVE_STRCHRNUL lxc_test_mount_injection_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_mount_injection_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_mount_injection_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_mount_injection_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_mount_injection_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_mount_injection_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_mount_injection_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_parse_config_file_SOURCES = parse_config_file.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -582,6 +825,33 @@ if !HAVE_STRCHRNUL lxc_test_parse_config_file_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_parse_config_file_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_parse_config_file_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_parse_config_file_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_parse_config_file_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_parse_config_file_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_parse_config_file_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_raw_clone_SOURCES = lxc_raw_clone.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -637,20 +907,131 @@ if !HAVE_STRCHRNUL lxc_test_raw_clone_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_raw_clone_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_raw_clone_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_raw_clone_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_raw_clone_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_raw_clone_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_raw_clone_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_reboot_SOURCES = reboot.c lxc_test_saveconfig_SOURCES = saveconfig.c lxc_test_share_ns_SOURCES = share_ns.c \ lxctest.h \ ../lxc/compiler.h + +if !HAVE_STRLCPY +lxc_test_share_ns_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_share_ns_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_share_ns_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_share_ns_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_share_ns_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_share_ns_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_shortlived_SOURCES = shortlived.c \ ../lxc/file_utils.c ../lxc/file_utils.h \ ../lxc/string_utils.c ../lxc/string_utils.h + +if !HAVE_STRLCPY +lxc_test_shortlived_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_shortlived_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_shortlived_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_shortlived_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_shortlived_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_shortlived_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_shutdowntest_SOURCES = shutdowntest.c lxc_test_snapshot_SOURCES = snapshot.c lxc_test_startone_SOURCES = startone.c lxc_test_state_server_SOURCES = state_server.c \ lxctest.h \ ../lxc/compiler.h + +if !HAVE_STRLCPY +lxc_test_state_server_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_state_server_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_state_server_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_state_server_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_state_server_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_state_server_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_utils_SOURCES = lxc-test-utils.c \ lxctest.h \ ../lxc/af_unix.c ../lxc/af_unix.h \ @@ -706,6 +1087,33 @@ if !HAVE_STRCHRNUL lxc_test_utils_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_utils_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_utils_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_utils_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_utils_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_utils_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_utils_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_sys_mixed_SOURCES = sys_mixed.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ @@ -760,6 +1168,33 @@ if !HAVE_STRCHRNUL lxc_test_sys_mixed_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_sys_mixed_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_sys_mixed_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_sys_mixed_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_sys_mixed_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_sys_mixed_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_sys_mixed_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + lxc_test_rootfs_options_SOURCES = rootfs_options.c \ ../lxc/af_unix.c ../lxc/af_unix.h \ ../lxc/caps.c ../lxc/caps.h \ @@ -814,6 +1249,33 @@ if !HAVE_STRCHRNUL lxc_test_rootfs_options_SOURCES += ../include/strchrnul.c ../include/strchrnul.h endif +if !HAVE_STRLCPY +lxc_test_rootfs_options_SOURCES += ../include/strlcpy.c ../include/strlcpy.h +endif + +if !HAVE_STRLCAT +lxc_test_rootfs_options_SOURCES += ../include/strlcat.c ../include/strlcat.h +endif + +if !HAVE_OPENPTY +lxc_test_rootfs_options_SOURCES += ../include/openpty.c ../include/openpty.h +endif + +if IS_BIONIC +lxc_test_rootfs_options_SOURCES += ../include/fexecve.c ../include/fexecve.h \ + ../include/lxcmntent.c ../include/lxcmntent.h +endif + +if !HAVE_GETGRGID_R +lxc_test_rootfs_options_SOURCES += ../include/getgrgid_r.c ../include/getgrgid_r.h +endif + +if !HAVE_PRLIMIT +if HAVE_PRLIMIT64 +lxc_test_rootfs_options_SOURCES += ../include/prlimit.c ../include/prlimit.h +endif +endif + AM_CFLAGS += -DLXCROOTFSMOUNT=\"$(LXCROOTFSMOUNT)\" \ -DLXCPATH=\"$(LXCPATH)\" \ -DLXC_GLOBAL_CONF=\"$(LXC_GLOBAL_CONF)\" \