summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHinnerk van Bruinehsen <h.v.bruinehsen@fu-berlin.de>2015-05-19 01:53:17 +0200
committerAnthony G. Basile <blueness@gentoo.org>2015-05-19 17:44:46 -0400
commit4d631c77987ca3619e81c2f7311a33f2e252d030 (patch)
tree08c28e0eb7136c339f682e800d1768373eae1b20
parent36fb89758109b0507ae735d1925b9633f843f0c8 (diff)
downloadhardened-dev-4d631c77987ca3619e81c2f7311a33f2e252d030.tar.gz
hardened-dev-4d631c77987ca3619e81c2f7311a33f2e252d030.tar.bz2
hardened-dev-4d631c77987ca3619e81c2f7311a33f2e252d030.tar.xz
hardened-dev-4d631c77987ca3619e81c2f7311a33f2e252d030.zip
=sys-apps/iproute2-4.0.0: fix build with musl
-rw-r--r--sys-apps/iproute2/Manifest4
-rw-r--r--sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch24
-rw-r--r--sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch62
-rw-r--r--sys-apps/iproute2/iproute2-4.0.0-r99.ebuild126
4 files changed, 216 insertions, 0 deletions
diff --git a/sys-apps/iproute2/Manifest b/sys-apps/iproute2/Manifest
index cf9d1b5..d837489 100644
--- a/sys-apps/iproute2/Manifest
+++ b/sys-apps/iproute2/Manifest
@@ -4,8 +4,12 @@ AUX iproute2-3.10.0-no-ipv6.patch 1390 SHA256 7fd8cce977876c7815990912965d056396
AUX iproute2-3.19.0-musl.patch 794 SHA256 f15ef3d2455f8dbddc1e1060bdfe63e91d768a5678f230bf0dd8fba5d4032834 SHA512 43bf34904f504f87c6e9acdc1824cc9aa8d16c04d8a88923553a121c06d67f48784b62d4e27923d0b2803eb98f1fc2bcae66cc5232aced6ba929e0b93cff1de5 WHIRLPOOL 3a355863a898714c8754d5ebfd506fbfd1102d25e09c020f9267e187e4117e5f004ef8b227bedfce9fb59234914adfdb57590305cc6c6c8921e55bdafd24a333
AUX iproute2-3.8.0-musl-headers.patch 2701 SHA256 3d6c6ff432f68ab76bc818aee6228eb6272c52679c86e3e49c556fec3de4d03d SHA512 bee8782ad8f2c3fcfc000f26e3d358a189f1518e45c2a2992356653e60381f31b2209c40b14b72ed11f925c330ca052f12a409b9575aa384274e91c47cbb3d8b WHIRLPOOL 9a1fa59e12bac76ea06e33481e10808d165d4a95eabb63eff69f5258df5c84dca5403c1096557e9fc595ec5acac4a306ff29feb8f3645b2af6d2cc8c3ba0ebd2
AUX iproute2-3.8.0-old-mount-libc.patch 871 SHA256 dc9fc407b09763f79663dbad627961f8a3446881737cc666f0cb67235f160d51 SHA512 cda73ce07c21d18c68fcff08e282e87a2d4b53cf7779e8a1ef669d7275974c8f3638ca530031aafcfc7eb4885264ceb7abb308b9da6f5568889a84cb4c7df1f9 WHIRLPOOL d2057e6bad82dce7844886d551d70af9207e111494b9cc23abc433857741afa48f30671091c8821a60aaa07ca621f243fbeee10322da11ac44d02f4f588b88bf
+AUX iproute2-4.0.0-fix-build-with-musl.patch 586 SHA256 e617316ce2803b6ad0dca43426a7a6c8762809f8e1e984da8c935bcff4db8e34 SHA512 2473432adbc02f0085be7b689af00527bc87f3ee89e313425dbc3a02e1a4569b1c397fc7160a2b26907c5edff3fdd5bd38d7e27043a9bebfbc36d714c8281953 WHIRLPOOL a6b451b38bb977a0b52fa904905c599922693c425537d5173c981dc2082d6c55f9a0d01514405e57c5719c376357f4759333ea3ad5dea849f4cef9df76d12181
+AUX iproute2-4.0.0-tc-show-buffer-overflow.patch 1717 SHA256 2ddb5ea744185f5ebff79961a054570b166ad1a5f3df0b91b59927d1b86c7aa3 SHA512 f5b507ce9d9a2cf4b86c0c2e2a18c5295226707df707eb229ec2f880b0fee64740a039fe5aa334c1dfc2d04faec4200cdb27dfaf631119a8705dd698f2767a77 WHIRLPOOL 801e25b3f6984b59d95eb494dfa63502e2c32551c8f5376ab6109a6bf5b9401f1b7bf6a0e0456dc68abb207d9505b5dbade675ea39e709e27a839357a431c444
DIST iproute2-3.19.0.tar.xz 455004 SHA256 e2f9f8c36e166f2ba6c0e1e7a9ad84cdf7c1615b93df49dac44563d7b57fd7b0 SHA512 fc533b6a526cfda234f043ac25302a3206a81ab2a740640b997b6bfb22e6f94ddc21b704191a358ea8721a327ba785e0224a4b4129111ef5008b4003379c3706 WHIRLPOOL 6a0aa1a948286d7dcb3663d787167c27760d756385295bf0ca631920aed50fbd984c19204247097116ef0d4e293c3c8dbe13b0b44c6ec83e7815a7461293c89f
DIST iproute2-3.8.0.tar.xz 407608 SHA256 579145749f1aaf60e7c7a5de24b7f00fa2200a961094733c792b4ff139181e4f SHA512 0d93070044f573055a7cc58bd006e476f5b0fcb75cb5d49a37417aa7583e637a92e460947434cef9b9449267e4529c655a23b5ed3d549a2aba128148cb8d4ade WHIRLPOOL bfb29c34953f205f7c801a86a38f58d9352b716504649e61665ced6dd48557291412de5fd8987dbab44fbd397dab4a6b55d6c371c7cbaaea3d6e29269df115df
+DIST iproute2-4.0.0.tar.xz 459364 SHA256 5cd06eb1050b858b308b65705725042bb566fd261135e35a73dafb48cd632618 SHA512 8e0587ed484a9697af99b4f37b460fddd28136b3c19898a11809b1e8ca9a75a18dcc83bc512f5b74361e6128732e69a3e66b3a62c38a5ae5f13c3e18af186be4 WHIRLPOOL 6abdf2b4587abd7a73d2b7692a4bb478ac379dc3a27f564ad78e34f25f06ae5dd9e0e4873c6510d30767a398375dcdcd2da777412c725885e0c3d4bd89c71a9b
EBUILD iproute2-3.19.0-r99.ebuild 3640 SHA256 d4a3386126f63119604d2454ebbee5691613ad8459d6a0cadef91c69be209c99 SHA512 7dc59656420423696e422f2596d06a430707e7af9737aa8a9e88b9b41c5115f9f38a9eb19c409dd88c59c9af3ced3f30571e9ef996fea55d03ea6d7a626dbd63 WHIRLPOOL 59c5ede720f331687295ef034cff272eaa76cac685d276117abb0074cf1c8648ea1dc8c36a7ff42dd570e894562f7fa46f70a33c3d68b346cf3fff502419a30c
EBUILD iproute2-3.8.0-r99.ebuild 3492 SHA256 c301203fe02eca67fb1a7cd4a7ad2d76eca17e2a2f0bfc8e877bf75260a253fb SHA512 aaa8305610842a4f87aee1512c5185a44d1fcf572a7cb21e3a6e4e1dd36c1d55efac7126a126f982e404c495a74934e9ca0048a707d9ed685719b467094ea5ab WHIRLPOOL 09b2e6783302c4fb2f61cd5641dd6dcbf9281adc13b3f13d414117beadf763ce9922bb86517ebdf47b79a82cdd42f0762b34ae486d3f0471644672a1ceb42248
+EBUILD iproute2-4.0.0-r99.ebuild 3721 SHA256 18ffc16f8a5f098e272e8b0f2de34c92530c5c49b6b8b5b6f98a6869f7578174 SHA512 f817612e5c529f2a39c14c424225d18597dc5065391a9b920ba605fe08ca81ba2b984e931aacf855a9b3aad448f7ec8d1834b6d90242ed93c223c1036488a54c WHIRLPOOL d3e536fd168a7ffb381b4d24bfcbea2771f114778f9a626e979810e754ecc4d0f04210859f6871038ce4938d01de29c709bf9c64a62ba0053d87080feabeeea7
MISC metadata.xml 317 SHA256 45312a0c8b9363b8eaa97110513ca39053ffcd967af978900ee0a01aa81c00aa SHA512 2e6ed50522276dd0b09a61ba0c68ccc226ff33b64da2af87e92e349354f379cae040eb753961aeedc2a894eb65415fba7763541efe21bf328fe0a69706aeb872 WHIRLPOOL 73003e9201c29cba545b3245b53da9c36dc4b3c209ece693a9401b954896f6db5d29b209318fb7dd1c33db8920d01e097feaa88ef4ec0cb07590e850803bce09
diff --git a/sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch b/sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch
new file mode 100644
index 0000000..5281be3
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-4.0.0-fix-build-with-musl.patch
@@ -0,0 +1,24 @@
+diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
+index 913bd8e..260d1e0 100644
+--- a/include/linux/if_bridge.h
++++ b/include/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+
+ #define SYSFS_BRIDGE_ATTR "bridge"
+ #define SYSFS_BRIDGE_FDB "brforward"
+diff --git a/lib/namespace.c b/lib/namespace.c
+index c03a103..f121eaa 100644
+--- a/lib/namespace.c
++++ b/lib/namespace.c
+@@ -9,6 +9,7 @@
+
+ #include <fcntl.h>
+ #include <dirent.h>
++#include <sys/param.h>
+
+ #include "utils.h"
+ #include "namespace.h"
diff --git a/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch b/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch
new file mode 100644
index 0000000..6c6c9a5
--- /dev/null
+++ b/sys-apps/iproute2/files/iproute2-4.0.0-tc-show-buffer-overflow.patch
@@ -0,0 +1,62 @@
+https://bugs.gentoo.org/546928
+
+From 46679bbbe89699016d31486de7599590d02a5054 Mon Sep 17 00:00:00 2001
+From: Vadim Kochan <vadim4j@gmail.com>
+Date: Mon, 20 Apr 2015 08:33:32 +0300
+Subject: [PATCH] tc util: Fix possible buffer overflow when print class id
+
+Use correct handle buffer length.
+
+Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
+---
+ tc/tc_util.c | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/tc/tc_util.c b/tc/tc_util.c
+index 1d3153d..dc2b70f 100644
+--- a/tc/tc_util.c
++++ b/tc/tc_util.c
+@@ -128,30 +128,31 @@ ok:
+ return 0;
+ }
+
+-int print_tc_classid(char *buf, int len, __u32 h)
++int print_tc_classid(char *buf, int blen, __u32 h)
+ {
+- char handle[40] = {};
++ SPRINT_BUF(handle) = {};
++ int hlen = SPRINT_BSIZE - 1;
+
+ if (h == TC_H_ROOT)
+ sprintf(handle, "root");
+ else if (h == TC_H_UNSPEC)
+- snprintf(handle, len, "none");
++ snprintf(handle, hlen, "none");
+ else if (TC_H_MAJ(h) == 0)
+- snprintf(handle, len, ":%x", TC_H_MIN(h));
++ snprintf(handle, hlen, ":%x", TC_H_MIN(h));
+ else if (TC_H_MIN(h) == 0)
+- snprintf(handle, len, "%x:", TC_H_MAJ(h) >> 16);
++ snprintf(handle, hlen, "%x:", TC_H_MAJ(h) >> 16);
+ else
+- snprintf(handle, len, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
++ snprintf(handle, hlen, "%x:%x", TC_H_MAJ(h) >> 16, TC_H_MIN(h));
+
+ if (use_names) {
+ char clname[IDNAME_MAX] = {};
+
+ if (id_to_name(cls_names, h, clname))
+- snprintf(buf, len, "%s#%s", clname, handle);
++ snprintf(buf, blen, "%s#%s", clname, handle);
+ else
+- snprintf(buf, len, "%s", handle);
++ snprintf(buf, blen, "%s", handle);
+ } else {
+- snprintf(buf, len, "%s", handle);
++ snprintf(buf, blen, "%s", handle);
+ }
+
+ return 0;
+--
+2.3.5
+
diff --git a/sys-apps/iproute2/iproute2-4.0.0-r99.ebuild b/sys-apps/iproute2/iproute2-4.0.0-r99.ebuild
new file mode 100644
index 0000000..0ee21b5
--- /dev/null
+++ b/sys-apps/iproute2/iproute2-4.0.0-r99.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/iproute2/iproute2-4.0.0-r1.ebuild,v 1.1 2015/04/20 20:51:18 vapier Exp $
+
+EAPI="5"
+
+inherit eutils toolchain-funcs flag-o-matic multilib
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git"
+ inherit git-2
+else
+ SRC_URI="mirror://kernel/linux/utils/net/${PN}/${P}.tar.xz"
+ KEYWORDS="amd64 ~arm ~mips ~ppc x86"
+fi
+
+DESCRIPTION="kernel routing and traffic control utilities"
+HOMEPAGE="http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="atm berkdb +iptables ipv6 minimal selinux"
+
+RDEPEND="!net-misc/arpd
+ iptables? ( >=net-firewall/iptables-1.4.20:= )
+ !minimal? ( berkdb? ( sys-libs/db:= ) )
+ atm? ( net-dialup/linux-atm )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ app-arch/xz-utils
+ iptables? ( virtual/pkgconfig )
+ sys-devel/bison
+ sys-devel/flex
+ >=sys-kernel/linux-headers-2.6.27
+ elibc_glibc? ( >=sys-libs/glibc-2.7 )"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-3.1.0-mtu.patch #291907
+ epatch "${FILESDIR}"/${P}-tc-show-buffer-overflow.patch #546928
+ use ipv6 || epatch "${FILESDIR}"/${PN}-3.10.0-no-ipv6.patch #326849
+ epatch "${FILESDIR}"/${PN}-4.0.0-fix-build-with-musl.patch
+
+ sed -i \
+ -e '/^CC =/d' \
+ -e "/^LIBDIR/s:=.*:=/$(get_libdir):" \
+ -e "s:-O2:${CFLAGS} ${CPPFLAGS}:" \
+ -e "/^HOSTCC/s:=.*:= $(tc-getBUILD_CC):" \
+ -e "/^WFLAGS/s:-Werror::" \
+ -e "/^DBM_INCLUDE/s:=.*:=${T}:" \
+ Makefile || die
+
+ # Use /run instead of /var/run.
+ sed -i \
+ -e 's:/var/run:/run:g' \
+ ip/ipnetns.c \
+ man/man8/ip-netns.8 || die
+
+ # build against system headers
+ rm -r include/netinet #include/linux include/ip{,6}tables{,_common}.h include/libiptc
+ sed -i 's:TCPI_OPT_ECN_SEEN:16:' misc/ss.c || die
+
+ # don't build arpd if USE=-berkdb #81660
+ use berkdb || sed -i '/^TARGETS=/s: arpd : :' misc/Makefile
+
+ use minimal && sed -i -e '/^SUBDIRS=/s:=.*:=lib tc:' Makefile
+}
+
+src_configure() {
+ tc-export AR CC PKG_CONFIG
+
+ # This sure is ugly. Should probably move into toolchain-funcs at some point.
+ local setns
+ pushd "${T}" >/dev/null
+ echo 'main(){return setns();};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c >&/dev/null && setns=y || setns=n
+ echo 'main(){};' > test.c
+ ${CC} ${CFLAGS} ${LDFLAGS} test.c -lresolv >&/dev/null || sed -i '/^LDLIBS/s:-lresolv::' "${S}"/Makefile
+ popd >/dev/null
+
+ cat <<-EOF > Config
+ TC_CONFIG_ATM := $(usex atm y n)
+ TC_CONFIG_XT := $(usex iptables y n)
+ HAVE_SELINUX := $(usex selinux y n)
+ IP_CONFIG_SETNS := ${setns}
+ # Use correct iptables dir, #144265 #293709
+ IPT_LIB_DIR := $(use iptables && ${PKG_CONFIG} xtables --variable=xtlibdir)
+ EOF
+}
+
+src_install() {
+ if use minimal ; then
+ into /
+ dosbin tc/tc
+ return 0
+ fi
+
+ emake \
+ DESTDIR="${D}" \
+ LIBDIR="${EPREFIX}"/$(get_libdir) \
+ SBINDIR="${EPREFIX}"/sbin \
+ CONFDIR="${EPREFIX}"/etc/iproute2 \
+ DOCDIR="${EPREFIX}"/usr/share/doc/${PF} \
+ MANDIR="${EPREFIX}"/usr/share/man \
+ ARPDDIR="${EPREFIX}"/var/lib/arpd \
+ install
+
+ rm "${ED}"/usr/share/doc/${PF}/*.{sgml,tex} || die #455988
+
+ dodir /bin
+ mv "${ED}"/{s,}bin/ip || die #330115
+
+ dolib.a lib/libnetlink.a
+ insinto /usr/include
+ doins include/libnetlink.h
+ # This local header pulls in a lot of linux headers it
+ # doesn't directly need. Delete this header that requires
+ # linux-headers-3.8 until that goes stable. #467716
+ sed -i '/linux\/netconf.h/d' "${ED}"/usr/include/libnetlink.h || die
+
+ if use berkdb ; then
+ dodir /var/lib/arpd
+ # bug 47482, arpd doesn't need to be in /sbin
+ dodir /usr/bin
+ mv "${ED}"/sbin/arpd "${ED}"/usr/bin/ || die
+ fi
+}