lxc: update to 3.0.3.

This commit is contained in:
prspkt 2018-11-26 20:24:40 +02:00 committed by maxice8
parent 89efe17b63
commit 164e325736
5 changed files with 14 additions and 164 deletions

View File

@ -1,48 +0,0 @@
diff --git config/apparmor/Makefile.am config/apparmor/Makefile.am
index 71dbe158..858f58dd 100644
--- config/apparmor/Makefile.am
+++ config/apparmor/Makefile.am
@@ -19,7 +19,7 @@ install-apparmor:
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/lxc/
$(MKDIR_P) $(DESTDIR)$(sysconfdir)/apparmor.d/lxc/
$(INSTALL_DATA) $(srcdir)/abstractions/container-base $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/lxc/
- $(INSTALL_DATA) $(srcdir)/abstractions/start-container $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/lxc/
+ $(INSTALL_DATA) abstractions/start-container $(DESTDIR)$(sysconfdir)/apparmor.d/abstractions/lxc/
$(INSTALL_DATA) $(srcdir)/profiles/lxc-default $(DESTDIR)$(sysconfdir)/apparmor.d/lxc/
$(INSTALL_DATA) $(srcdir)/profiles/lxc-default-cgns $(DESTDIR)$(sysconfdir)/apparmor.d/lxc/
$(INSTALL_DATA) $(srcdir)/profiles/lxc-default-with-mounting $(DESTDIR)$(sysconfdir)/apparmor.d/lxc/
diff --git config/apparmor/abstractions/start-container config/apparmor/abstractions/start-container.in
similarity index 95%
rename from config/apparmor/abstractions/start-container
rename to config/apparmor/abstractions/start-container.in
index 3df9883e..f2b48235 100644
--- config/apparmor/abstractions/start-container
+++ config/apparmor/abstractions/start-container.in
@@ -11,6 +11,7 @@
# currently blocked by apparmor bug
mount -> /usr/lib*/*/lxc/{**,},
mount -> /usr/lib*/lxc/{**,},
+ mount -> @LXCROOTFSMOUNT@/{,**},
mount fstype=devpts -> /dev/pts/,
mount options=bind /dev/pts/ptmx/ -> /dev/ptmx/,
mount options=bind /dev/pts/** -> /dev/**,
@@ -38,6 +39,7 @@
pivot_root /usr/lib*/*/lxc/,
pivot_root /usr/lib*/lxc/**,
pivot_root /usr/lib*/*/lxc/**,
+ pivot_root @LXCROOTFSMOUNT@/{,**},
change_profile -> lxc-*,
change_profile -> lxc-**,
diff --git configure.ac configure.ac
index 92d6601d..a54bc332 100644
--- configure.ac
+++ configure.ac
@@ -714,6 +714,7 @@ AC_CONFIG_FILES([
config/Makefile
config/apparmor/Makefile
+ config/apparmor/abstractions/start-container
config/selinux/Makefile
config/bash/Makefile
config/bash/lxc

View File

@ -0,0 +1,10 @@
--- src/lxc/compiler.h 2018-11-23 01:08:27.000000000 +0200
+++ src/lxc/compiler.h 2018-11-26 21:24:49.629537630 +0200
@@ -23,7 +23,6 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE 1
#endif
-#include <sys/cdefs.h>
#include "config.h"

View File

@ -1,97 +0,0 @@
diff --git configure.ac configure.ac
index 19d9ea22..b2b2f71c 100644
--- configure.ac
+++ configure.ac
@@ -619,6 +619,12 @@ AC_HEADER_MAJOR
# Check for some syscalls functions
AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid memfd_create])
+# Check for strerror_r() support. Defines:
+# - HAVE_STRERROR_R if available
+# - HAVE_DECL_STRERROR_R if defined
+# - STRERROR_R_CHAR_P if it returns char *
+AC_FUNC_STRERROR_R
+
# Check for some functions
AC_CHECK_LIB(pthread, main)
AC_CHECK_FUNCS(statvfs)
@@ -676,6 +682,11 @@ if test "x$enable_werror" = "xyes"; then
CFLAGS="$CFLAGS -Werror -Wvla -std=gnu11"
fi
+AC_ARG_ENABLE([thread-safety],
+ [AC_HELP_STRING([--enable-thread-safety], [enforce thread-safety otherwise fail the build [default=yes]])],
+ [], [enable_thread_safety=yes])
+AM_CONDITIONAL([ENFORCE_THREAD_SAFETY], [test "x$enable_thread_safety" = "xyes"])
+
# Files requiring some variable expansion
AC_CONFIG_FILES([
Makefile
@@ -919,4 +930,7 @@ Debugging:
Paths:
- Logs in configpath: $enable_configpath_log
+
+Thread-safety:
+ - enforce: $enable_thread_safety
EOF
diff --git src/lxc/log.h src/lxc/log.h
index 4654fd91..a7f72b4c 100644
--- src/lxc/log.h
+++ src/lxc/log.h
@@ -327,22 +327,40 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
/*
* Helper macro to define errno string.
*/
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE) || IS_BIONIC
-#define lxc_log_strerror_r \
- char errno_buf[MAXPATHLEN / 2] = {"Failed to get errno string"}; \
- char *ptr = errno_buf; \
- { \
- (void)strerror_r(errno, errno_buf, sizeof(errno_buf)); \
- }
+#if HAVE_STRERROR_R
+ #ifndef HAVE_DECL_STRERROR_R
+ #ifdef STRERROR_R_CHAR_P
+ char *strerror_r(int errnum, char *buf, size_t buflen);
+ #else
+ int strerror_r(int errnum, char *buf, size_t buflen);
+ #endif
+ #endif
+
+ #ifdef STRERROR_R_CHAR_P
+ #define lxc_log_strerror_r \
+ char errno_buf[MAXPATHLEN / 2] = {"Failed to get errno string"}; \
+ char *ptr = NULL; \
+ { \
+ ptr = strerror_r(errno, errno_buf, sizeof(errno_buf)); \
+ if (!ptr) \
+ ptr = errno_buf; \
+ }
+ #else
+ #define lxc_log_strerror_r \
+ char errno_buf[MAXPATHLEN / 2] = {"Failed to get errno string"}; \
+ char *ptr = errno_buf; \
+ { \
+ (void)strerror_r(errno, errno_buf, sizeof(errno_buf)); \
+ }
+ #endif
+#elif ENFORCE_THREAD_SAFETY
+ #error ENFORCE_THREAD_SAFETY was set but cannot be guaranteed
#else
-#define lxc_log_strerror_r \
- char errno_buf[MAXPATHLEN / 2] = {"Failed to get errno string"}; \
- char *ptr; \
- { \
- ptr = strerror_r(errno, errno_buf, sizeof(errno_buf)); \
- if (!ptr) \
- ptr = errno_buf; \
- }
+ #define lxc_log_strerror_r \
+ char *ptr = NULL; \
+ { \
+ ptr = strerror(errno); \
+ }
#endif
/*

View File

@ -1,15 +0,0 @@
--- src/lxc/parse.c 2018-03-28 04:48:26.000000000 +0300
+++ src/lxc/parse.c 2018-05-07 21:07:45.737722549 +0300
@@ -23,11 +23,11 @@
#define _GNU_SOURCE
#include <stdio.h>
+#include <string.h>
#undef _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/mman.h>
#include "parse.h"

View File

@ -2,8 +2,8 @@
_desc="Linux Containers"
pkgname=lxc
version=3.0.2
revision=3
version=3.0.3
revision=1
build_style=gnu-configure
configure_args="--enable-doc --enable-seccomp
--enable-capabilities --enable-apparmor --with-distro=none
@ -14,9 +14,9 @@ depends="xz gnupg"
short_desc="${_desc} - utilities"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="https://linuxcontainers.org"
license="LGPL-2.1"
license="LGPL-2.1-or-later"
distfiles="https://linuxcontainers.org/downloads/lxc-${version}.tar.gz"
checksum=6ab7117b17066220da450c55ed77953998cf2336d415143b879554364af12f5c
checksum=620cb832cc02c63bf4d330657bf6176544e145da281ee384a34d689635a19841
conf_files="/etc/lxc/default.conf"
make_dirs="