Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (6445652e6e56645b0a5f3b2d4c8294711fc4c03d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Pavel Vinogradov <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (6445652e6e56645b0a5f3b2d4c8294711fc4c03d)
  • Date: Fri, 7 Apr 2017 23:12:58 +0000

GIT changes to master grimoire by Pavel Vinogradov <public AT sourcemage.org>:

utils/lxc/DEPENDS | 7 +
utils/lxc/DETAILS | 4
utils/lxc/HISTORY | 6 +
utils/lxc/PRE_BUILD | 6 +
utils/lxc/patches/001-sysmacros.patch | 32 ++++++
utils/lxc/patches/002-sysmacros.patch | 55 +++++++++++
utils/lxc/patches/003-capabilities.patch | 30 ++++++
utils/lxc/patches/004-capabilities.patch | 153
+++++++++++++++++++++++++++++++
8 files changed, 291 insertions(+), 2 deletions(-)

New commits:
commit 6445652e6e56645b0a5f3b2d4c8294711fc4c03d
Author: Pavel Vinogradov <public AT sourcemage.org>
Commit: Pavel Vinogradov <public AT sourcemage.org>

utils/lxc: version 2.0.7

diff --git a/utils/lxc/DEPENDS b/utils/lxc/DEPENDS
new file mode 100755
index 0000000..6742a27
--- /dev/null
+++ b/utils/lxc/DEPENDS
@@ -0,0 +1,7 @@
+depends autoconf &&
+depends automake &&
+
+optional_depends libcap \
+ "--enable-capabilities" \
+ "--disable-capabilities" \
+ "for more system capabilities"
diff --git a/utils/lxc/DETAILS b/utils/lxc/DETAILS
index ce6f737..a2db1e9 100755
--- a/utils/lxc/DETAILS
+++ b/utils/lxc/DETAILS
@@ -1,8 +1,8 @@
SPELL=lxc
- VERSION=2.0.6
+ VERSION=2.0.7
SOURCE="${SPELL}-${VERSION}.tar.gz"
SOURCE_URL[0]=https://linuxcontainers.org/downloads/${SOURCE}
-
SOURCE_HASH=sha512:48f4ebaa503e7bd5b608a35b1f60e708c4f62c8e3327ccf8d5371004323c721446e8ad7d0054c5a8f1c94d96169369caee4cc378638b34cd4961652c1d2a48af
+
SOURCE_HASH=sha512:51aedd32ae108f31dac5e8e1e71c93fa5da7813a3569f4aeee79dc254fe4a8c27221de83f645e6b334048c44953a7a7dbcde64439b9161d0cb55d8207944bb7b
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
WEB_SITE="https://linuxcontainers.org/";
LICENSE[0]="LGPLv2.1+"
diff --git a/utils/lxc/HISTORY b/utils/lxc/HISTORY
index a4ff55b..1dd3855 100644
--- a/utils/lxc/HISTORY
+++ b/utils/lxc/HISTORY
@@ -1,3 +1,9 @@
+2017-04-07 Pavel Vinogradov <public AT sourcemage.org>
+ * DETAILS: version 2.0.7
+ * DEPENDS: added autotools and optional libcap
+ * PRE_BUILD, patches/00[1-4]-{sysmacros,capabilities}.patch: added
+ patches from GitHub to fix building errors and make libcap optional
+
2016-12-05 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 2.0.6

diff --git a/utils/lxc/PRE_BUILD b/utils/lxc/PRE_BUILD
new file mode 100755
index 0000000..81b5a62
--- /dev/null
+++ b/utils/lxc/PRE_BUILD
@@ -0,0 +1,6 @@
+default_pre_build &&
+cd "${SOURCE_DIRECTORY}" &&
+
+apply_patch_dir patches &&
+
+autoreconf -v -i
diff --git a/utils/lxc/patches/001-sysmacros.patch
b/utils/lxc/patches/001-sysmacros.patch
new file mode 100644
index 0000000..dbccead
--- /dev/null
+++ b/utils/lxc/patches/001-sysmacros.patch
@@ -0,0 +1,32 @@
+From 66c1f8c270f748286643f4368a0e7ad57a2344c0 Mon Sep 17 00:00:00 2001
+From: Christian Brauner <christian.brauner AT ubuntu.com>
+Date: Tue, 21 Mar 2017 12:03:16 +0100
+Subject: [PATCH] tree-wide: include <sys/sysmacros.h> directly
+
+Signed-off-by: Christian Brauner <christian.brauner AT ubuntu.com>
+---
+ src/lxc/lxccontainer.c | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
+index 0dbbf2c..4786908 100644
+--- a/src/lxc/lxccontainer.c
++++ b/src/lxc/lxccontainer.c
+@@ -31,6 +31,7 @@
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <arpa/inet.h>
++#include <sys/sysmacros.h>
+ #include <sys/mman.h>
+ #include <sys/mount.h>
+ #include <sys/syscall.h>
+@@ -64,9 +65,6 @@
+ #ifdef MAJOR_IN_MKDEV
+ # include <sys/mkdev.h>
+ #endif
+-#ifdef MAJOR_IN_SYSMACROS
+-# include <sys/sysmacros.h>
+-#endif
+
+ #if HAVE_IFADDRS_H
+ #include <ifaddrs.h>
diff --git a/utils/lxc/patches/002-sysmacros.patch
b/utils/lxc/patches/002-sysmacros.patch
new file mode 100644
index 0000000..94bbf40
--- /dev/null
+++ b/utils/lxc/patches/002-sysmacros.patch
@@ -0,0 +1,55 @@
+From ce831b3b8887b0c1dfea637bdb16d38d1cd277fd Mon Sep 17 00:00:00 2001
+From: Christian Brauner <christian.brauner AT ubuntu.com>
+Date: Mon, 20 Mar 2017 15:42:50 +0100
+Subject: [PATCH] tree-wide: include <sys/sysmacros.h> directly
+
+Signed-off-by: Christian Brauner <christian.brauner AT ubuntu.com>
+---
+ src/lxc/bdev/lxclvm.c | 4 +---
+ src/lxc/conf.c | 4 +---
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/src/lxc/bdev/lxclvm.c b/src/lxc/bdev/lxclvm.c
+index 75de17f..bcd8be8 100644
+--- a/src/lxc/bdev/lxclvm.c
++++ b/src/lxc/bdev/lxclvm.c
+@@ -29,6 +29,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <sys/sysmacros.h>
+ #include <sys/wait.h>
+
+ #include "bdev.h"
+@@ -41,9 +42,6 @@
+ #ifdef MAJOR_IN_MKDEV
+ # include <sys/mkdev.h>
+ #endif
+-#ifdef MAJOR_IN_SYSMACROS
+-# include <sys/sysmacros.h>
+-#endif
+
+ lxc_log_define(lxclvm, lxc);
+
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index edad28f..55de873 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -47,6 +47,7 @@
+ #include <sys/prctl.h>
+ #include <sys/stat.h>
+ #include <sys/socket.h>
++#include <sys/sysmacros.h>
+ #include <sys/syscall.h>
+ #include <sys/types.h>
+ #include <sys/utsname.h>
+@@ -56,9 +57,6 @@
+ #ifdef MAJOR_IN_MKDEV
+ # include <sys/mkdev.h>
+ #endif
+-#ifdef MAJOR_IN_SYSMACROS
+-# include <sys/sysmacros.h>
+-#endif
+
+ #ifdef HAVE_STATVFS
+ #include <sys/statvfs.h>
diff --git a/utils/lxc/patches/003-capabilities.patch
b/utils/lxc/patches/003-capabilities.patch
new file mode 100644
index 0000000..042cfe6
--- /dev/null
+++ b/utils/lxc/patches/003-capabilities.patch
@@ -0,0 +1,30 @@
+From df11e022a50d458c4fe3e97f643293cfc9fd30ff Mon Sep 17 00:00:00 2001
+From: Brett Neumeier <brett AT neumeier.us>
+Date: Sun, 29 Jan 2017 08:29:53 -0600
+Subject: [PATCH] Allow build without sys/capability.h
+
+There is no guard clause around a reference to CAP_EFFECTIVE and
+CAP_SETGID, causing compilation to fail if sys/capability.h is not
+available.
+
+Signed-off-by: Brett Neumeier <brett AT neumeier.us>
+---
+ src/lxc/start.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/lxc/start.c b/src/lxc/start.c
+index 09dc1ff..2929514 100644
+--- a/src/lxc/start.c
++++ b/src/lxc/start.c
+@@ -898,7 +898,11 @@ static int do_start(void *data)
+ * further above. Only drop groups if we can, so ensure that
we
+ * have necessary privilege.
+ */
++ #if HAVE_SYS_CAPABILITY_H
+ have_cap_setgid = lxc_cap_is_set(CAP_SETGID, CAP_EFFECTIVE);
++ #else
++ have_cap_setgid = false;
++ #endif
+ if (lxc_list_empty(&handler->conf->id_map) &&
have_cap_setgid) {
+ if (lxc_setgroups(0, NULL) < 0)
+ goto out_warn_father;
diff --git a/utils/lxc/patches/004-capabilities.patch
b/utils/lxc/patches/004-capabilities.patch
new file mode 100644
index 0000000..fa62faa
--- /dev/null
+++ b/utils/lxc/patches/004-capabilities.patch
@@ -0,0 +1,153 @@
+From e37dda715615d09543b9e15c181f9e0a422646da Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice AT gmail.com>
+Date: Sat, 11 Feb 2017 22:40:19 +0100
+Subject: [PATCH] Add HAVE_LIBCAP
+
+Currently it is impossible to build lxc with --disable-capabilities if
+the user has libcap-dev installed on his system as:
+ - calls to cap_xxx functions are not protected by HAVE_LIBCAP defines.
+ The whole file is only protected by HAVE_SYS_CAPABILITY_H.
+ - AC_CHECK_LIB default action-if-found is overriden by [true] so
+ HAVE_LIBCAP is never written to config.h
+
+This patch replaces all HAVE_SYS_CAPABILITY_H checks by HAVE_LIBCAP
+checks (fix #1361)
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice AT gmail.com>
+---
+ configure.ac | 5 +++--
+ src/lxc/caps.c | 2 +-
+ src/lxc/caps.h | 2 +-
+ src/lxc/conf.c | 6 +++---
+ src/lxc/start.c | 10 +++++-----
+ 5 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 612ca46..d5767e1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -370,7 +370,8 @@ fi
+ AM_CONDITIONAL([ENABLE_CAP], [test "x$enable_capabilities" = "xyes"])
+
+ AM_COND_IF([ENABLE_CAP],
+- [AC_CHECK_LIB(cap,cap_set_proc,[true],[AC_MSG_ERROR([You are missing
libcap support.])])
++ [AC_CHECK_HEADER([sys/capability.h],[],[AC_MSG_ERROR([You must
install the libcap development package in order to compile lxc])])
++ AC_CHECK_LIB(cap,cap_set_proc,[],[AC_MSG_ERROR([You must install the
libcap development package in order to compile lxc])])
+ AC_SUBST([CAP_LIBS], [-lcap])])
+
+ # HAVE_SCMP_FILTER_CTX=1 will tell us we have libseccomp api >= 1.0.0
+@@ -638,7 +639,7 @@ AC_CHECK_DECLS([PR_SET_NO_NEW_PRIVS], [], [], [#include
<sys/prctl.h>])
+ AC_CHECK_DECLS([PR_GET_NO_NEW_PRIVS], [], [], [#include <sys/prctl.h>])
+
+ # Check for some headers
+-AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h
sys/memfd.h sys/personality.h utmpx.h sys/timerfd.h])
++AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/memfd.h
sys/personality.h utmpx.h sys/timerfd.h])
+
+ # lookup major()/minor()/makedev()
+ AC_HEADER_MAJOR
+diff --git a/src/lxc/caps.c b/src/lxc/caps.c
+index 73b5516..1d46c45 100644
+--- a/src/lxc/caps.c
++++ b/src/lxc/caps.c
+@@ -36,7 +36,7 @@
+
+ lxc_log_define(lxc_caps, lxc);
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+
+ #ifndef PR_CAPBSET_READ
+ #define PR_CAPBSET_READ 23
+diff --git a/src/lxc/caps.h b/src/lxc/caps.h
+index 390dbdd..8d60fdc 100644
+--- a/src/lxc/caps.h
++++ b/src/lxc/caps.h
+@@ -27,7 +27,7 @@
+ #ifndef __LXC_CAPS_H
+ #define __LXC_CAPS_H
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+ #include <sys/capability.h>
+
+ extern int lxc_caps_down(void);
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 6f31d33..b94fbbb 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -91,7 +91,7 @@
+ #include "utils.h"
+ #include "lsm/lsm.h"
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+ #include <sys/capability.h>
+ #endif
+
+@@ -107,7 +107,7 @@
+
+ lxc_log_define(lxc_conf, lxc);
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+ #ifndef CAP_SETFCAP
+ #define CAP_SETFCAP 31
+ #endif
+@@ -316,7 +316,7 @@ static struct mount_opt mount_opt[] = {
+ { NULL, 0, 0 },
+ };
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+ static struct caps_opt caps_opt[] = {
+ { "chown", CAP_CHOWN },
+ { "dac_override", CAP_DAC_OVERRIDE },
+diff --git a/src/lxc/start.c b/src/lxc/start.c
+index 2929514..ab5f5ad 100644
+--- a/src/lxc/start.c
++++ b/src/lxc/start.c
+@@ -46,7 +46,7 @@
+ #include <sys/un.h>
+ #include <sys/wait.h>
+
+-#if HAVE_SYS_CAPABILITY_H
++#if HAVE_LIBCAP
+ #include <sys/capability.h>
+ #endif
+
+@@ -375,7 +375,7 @@ int lxc_poll(const char *name, struct lxc_handler
*handler)
+ }
+
+ if (handler->conf->need_utmp_watch) {
+- #if HAVE_SYS_CAPABILITY_H
++ #if HAVE_LIBCAP
+ if (lxc_utmp_mainloop_add(&descr, handler)) {
+ ERROR("Failed to add utmp handler to LXC mainloop.");
+ goto out_mainloop_open;
+@@ -787,7 +787,7 @@ static int do_start(void *data)
+ goto out_warn_father;
+ }
+
+- #if HAVE_SYS_CAPABILITY_H
++ #if HAVE_LIBCAP
+ if (handler->conf->need_utmp_watch) {
+ if (prctl(PR_CAPBSET_DROP, CAP_SYS_BOOT, 0, 0, 0)) {
+ SYSERROR("Failed to remove the CAP_SYS_BOOT
capability.");
+@@ -898,7 +898,7 @@ static int do_start(void *data)
+ * further above. Only drop groups if we can, so ensure that
we
+ * have necessary privilege.
+ */
+- #if HAVE_SYS_CAPABILITY_H
++ #if HAVE_LIBCAP
+ have_cap_setgid = lxc_cap_is_set(CAP_SETGID, CAP_EFFECTIVE);
+ #else
+ have_cap_setgid = false;
+@@ -1337,7 +1337,7 @@ int __lxc_start(const char *name, struct lxc_conf
*conf,
+ handler->netnsfd = -1;
+
+ if (must_drop_cap_sys_boot(handler->conf)) {
+- #if HAVE_SYS_CAPABILITY_H
++ #if HAVE_LIBCAP
+ DEBUG("Dropping CAP_SYS_BOOT capability.");
+ #else
+ DEBUG("Not dropping CAP_SYS_BOOT capability as capabilities
aren't supported.");



  • [SM-Commit] GIT changes to master grimoire by Pavel Vinogradov (6445652e6e56645b0a5f3b2d4c8294711fc4c03d), Pavel Vinogradov, 04/07/2017

Archive powered by MHonArc 2.6.24.

Top of Page