]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tree-wide: fix build 3962/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 2 Sep 2021 14:21:33 +0000 (16:21 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 2 Sep 2021 17:10:07 +0000 (19:10 +0200)
Fixes: #3960
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/Makefile.am
src/lxc/cgroups/cgfsng.c
src/lxc/string_utils.h
src/lxc/tools/lxc_destroy.c
src/tests/Makefile.am

index 20c32d3df4f4730c9bc2b10018acb6c814542723..d13cbc160a7ee5b4c684988bd0796337a0a40571 100644 (file)
@@ -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
 
index d51fd838fcbb9fe67c5e8595fb2950cbd6e53275..1f80802418d00dacabddd3b1a0a77a72d8b13d42 100644 (file)
  * a comma-separated list of controllers.
  */
 
+#include "config.h"
+
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE 1
 #endif
+
 #include <ctype.h>
 #include <dirent.h>
 #include <errno.h>
@@ -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"
index bc3e3992a965c37636c1c945f6d6ccdbe7ca9807..ac916c6b683269343796a21d901fc26bb4a5164c 100644 (file)
 #include "include/strlcat.h"
 #endif
 
+#ifndef HAVE_STRLCPY
+#include "include/strlcpy.h"
+#endif
+
 #ifndef HAVE_STRCHRNUL
 #include "include/strchrnul.h"
 #endif
index 692cc6ea3ccd8749e8e7442816d73ace659e93b3..e2e5f9843639b2a83362321439ffb1ea76a5e10e 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE 1
-#endif
+#include "config.h"
+
 #include <fcntl.h>
 #include <libgen.h>
 #include <stdio.h>
@@ -14,9 +13,8 @@
 #include <lxc/lxccontainer.h>
 
 #include "arguments.h"
-#include "config.h"
 #include "log.h"
-#include "utils.h"
+#include "file_utils.h"
 
 lxc_log_define(lxc_destroy, lxc);
 
index 75777d11b7a65e18cda5f660d6c579bb093d9b53..ef8330efd733dba27c27da6ad3151853274222ee 100644 (file)
@@ -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)\" \