summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Wegener <swegener@gentoo.org>2009-12-08 07:45:34 +0000
committerSven Wegener <swegener@gentoo.org>2009-12-08 07:45:34 +0000
commitfb0cdd2e73b890d6ba763da5736a4271b44891f7 (patch)
treedf91791b4a24ef1a880fab724b20b84c39f56410 /app-emulation/lxc
parentBug #295672 - Override XDG_CONFIG_HOME to avoid sandbox violations. (diff)
downloadgentoo-2-fb0cdd2e73b890d6ba763da5736a4271b44891f7.tar.gz
gentoo-2-fb0cdd2e73b890d6ba763da5736a4271b44891f7.tar.bz2
gentoo-2-fb0cdd2e73b890d6ba763da5736a4271b44891f7.zip
Also include my tty malloc() fix, it prevents memory corruption.
(Portage version: 2.2_rc55/cvs/Linux x86_64)
Diffstat (limited to 'app-emulation/lxc')
-rw-r--r--app-emulation/lxc/ChangeLog8
-rw-r--r--app-emulation/lxc/files/lxc-0.6.4-tty-malloc.patch25
-rw-r--r--app-emulation/lxc/lxc-0.6.4-r2.ebuild78
3 files changed, 110 insertions, 1 deletions
diff --git a/app-emulation/lxc/ChangeLog b/app-emulation/lxc/ChangeLog
index 0785b60e6112..322b986e03d8 100644
--- a/app-emulation/lxc/ChangeLog
+++ b/app-emulation/lxc/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/lxc
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.6 2009/12/07 11:39:11 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.7 2009/12/08 07:45:34 swegener Exp $
+
+*lxc-0.6.4-r2 (08 Dec 2009)
+
+ 08 Dec 2009; Sven Wegener <swegener@gentoo.org> +lxc-0.6.4-r2.ebuild,
+ +files/lxc-0.6.4-tty-malloc.patch:
+ Also include my tty malloc() fix, it prevents memory corruption.
*lxc-0.6.4-r1 (07 Dec 2009)
diff --git a/app-emulation/lxc/files/lxc-0.6.4-tty-malloc.patch b/app-emulation/lxc/files/lxc-0.6.4-tty-malloc.patch
new file mode 100644
index 000000000000..c445f1928c69
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-0.6.4-tty-malloc.patch
@@ -0,0 +1,25 @@
+From e4e7d59db88478186188024c78f76066dad1e733 Mon Sep 17 00:00:00 2001
+From: Sven Wegener <sven.wegener@stealer.net>
+Date: Thu, 26 Nov 2009 16:46:23 +0100
+Subject: [PATCH] use correct number of ttys during setup
+
+commit 985d15b106c8959ff130ba5425c2abbe36dc2cca "fix fdleak and errors
+in lxc_create_tty()" created a zero-sized malloc(), causing memory
+corruption. use config->tty like all the other code does.
+
+Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
+Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
+
+diff --git a/src/lxc/conf.c b/src/lxc/conf.c
+index 0ce51aa..81bc470 100644
+--- a/src/lxc/conf.c
++++ b/src/lxc/conf.c
+@@ -999,7 +999,7 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf)
+ return 0;
+
+ tty_info->pty_info =
+- malloc(sizeof(*tty_info->pty_info)*tty_info->nbtty);
++ malloc(sizeof(*tty_info->pty_info)*conf->tty);
+ if (!tty_info->pty_info) {
+ SYSERROR("failed to allocate pty_info");
+ return -1;
diff --git a/app-emulation/lxc/lxc-0.6.4-r2.ebuild b/app-emulation/lxc/lxc-0.6.4-r2.ebuild
new file mode 100644
index 000000000000..997b1901408f
--- /dev/null
+++ b/app-emulation/lxc/lxc-0.6.4-r2.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/lxc-0.6.4-r2.ebuild,v 1.1 2009/12/08 07:45:34 swegener Exp $
+
+EAPI="2"
+
+inherit eutils linux-info versionator base
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="http://lxc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="+doc examples"
+
+RDEPEND="sys-libs/libcap"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-2.6.29"
+
+CONFIG_CHECK="~CGROUPS
+ ~CGROUP_NS ~CPUSETS ~CGROUP_CPUACCT
+ ~RESOURCE_COUNTERS ~CGROUP_MEM_RES_CTLR
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~SECURITY_FILE_CAPABILITIES
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (inter-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-lxc.network.pair.patch
+ "${FILESDIR}"/${P}-move-rcfile.patch
+ "${FILESDIR}"/${P}-fix-full-system.patch
+ "${FILESDIR}"/${P}-tty-malloc.patch
+)
+
+src_configure() {
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/sbin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/etc/lxc \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ || die "configure failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+
+ dodoc AUTHORS CONTRIBUTING MAINTAINERS \
+ NEWS TODO README doc/FAQ.txt || die "dodoc failed"
+
+ rm -r "${D}"/etc/lxc "${D}"/usr/sbin/lxc-{setcap,ls}
+
+ keepdir /etc/lxc
+
+ find "${D}" -name '*.la' -delete
+}