public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
@ 2014-05-18 12:42 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-05-18 12:42 UTC (permalink / raw
  To: gentoo-commits

commit:     6f1a3b2acedb896e4f4bd60581f30550a2a5133f
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Sat May 17 06:45:01 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sun May 18 12:43:54 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=6f1a3b2a

sys-apps/util-linux: bump to 2.24.1

update previous patch and add a patch to make hexdump work

---
 .../files/util-linux-2.24-last-tests.patch         |  86 ++++++++++++
 .../files/util-linux-2.24-skip-last-tests.patch    |  41 ++++++
 .../util-linux/files/util-linux-2.24.1-musl.patch  |  30 +++++
 .../files/util-linux-2.24.2-hexdump.patch          |  40 ++++++
 sys-apps/util-linux/util-linux-2.24.1-r99.ebuild   | 147 +++++++++++++++++++++
 5 files changed, 344 insertions(+)

diff --git a/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch b/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch
new file mode 100644
index 0000000..77cf478
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24-last-tests.patch
@@ -0,0 +1,86 @@
+https://bugs.gentoo.org/501408
+
+From 3c76515abd2e80dc1da03041eb868b8c1e596fb1 Mon Sep 17 00:00:00 2001
+From: Sami Kerola <kerolasa@iki.fi>
+Date: Sun, 16 Feb 2014 23:54:18 +0000
+Subject: [PATCH] tests: align last.1 with recent phantom detection
+
+None existing account is not still-logged-in but gone mysteriously,
+assuming wtmp logout markup is missing.
+
+Signed-off-by: Sami Kerola <kerolasa@iki.fi>
+---
+ tests/expected/last/last | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/expected/last/last b/tests/expected/last/last
+index 2ff5cc1..dfb140b 100644
+--- a/tests/expected/last/last
++++ b/tests/expected/last/last
+@@ -1,6 +1,6 @@
+ ~~~ basic output ~~~
+ rick     long         never-gonna-logo Thu Jan  1 00:00 - 03:14 (24855+03:14)
+-torvalds linux        hobby            Mon Aug 26 00:57   still logged in
++torvalds linux        hobby            Mon Aug 26 00:57    gone - no logout
+ reboot   system boot  system-name      Wed Aug 28 18:00   still running
+ reboot   system boot  system-name      Wed Aug 28 16:00 - 17:00  (01:00)
+ IPv4     root         dns-server       Wed Aug 28 13:00 - 14:00  (01:00)
+@@ -17,7 +17,7 @@ accounti foo          nine             Wed Aug 28 03:00 - 04:00  (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ include system ~~~
+ rick     long         never-gonna-logo Thu Jan  1 00:00 - 03:14 (24855+03:14)
+-torvalds linux        hobby            Mon Aug 26 00:57   still logged in
++torvalds linux        hobby            Mon Aug 26 00:57    gone - no logout
+ reboot   system boot  system-name      Wed Aug 28 18:00   still running
+ shutdown system down  system-name      Wed Aug 28 17:00 - 18:00  (01:00)
+ reboot   system boot  system-name      Wed Aug 28 16:00 - 17:00  (01:00)
+@@ -47,16 +47,16 @@ IPv4     root         Wed Aug 28 13:00 - 14:00  (01:00)     a.root-servers.net
+ 
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ show ip ~~~
+-torvalds linux        128.214.205.14   Mon Aug 26 00:57   still logged in
++torvalds linux        128.214.205.14   Mon Aug 26 00:57    gone - no logout
+ 
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ no host ~~~
+-torvalds linux        Mon Aug 26 00:57   still logged in
++torvalds linux        Mon Aug 26 00:57    gone - no logout
+ 
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ full times ~~~
+ rick     long         never-gonna-logo Thu Jan  1 00:00:00 1970 - Tue Jan 19 03:14:07 2038 (24855+03:14)
+-torvalds linux        hobby            Mon Aug 26 00:57:08 1991   still logged in
++torvalds linux        hobby            Mon Aug 26 00:57:08 1991   gone - no logout
+ reboot   system boot  system-name      Wed Aug 28 18:00:00 2013   still running
+ reboot   system boot  system-name      Wed Aug 28 16:00:00 2013 - Wed Aug 28 17:00:00 2013  (01:00)
+ IPv4     root         dns-server       Wed Aug 28 13:00:00 2013 - Wed Aug 28 14:00:00 2013  (01:00)
+@@ -73,7 +73,7 @@ accounti foo          nine             Wed Aug 28 03:00:00 2013 - Wed Aug 28 04:
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ no time ~~~
+ rick     long         never-gonna-logo   (24855+03:14)
+-torvalds linux        hobby              logged in
++torvalds linux        hobby              - no logout
+ reboot   system boot  system-name        running
+ reboot   system boot  system-name         (01:00)
+ IPv4     root         dns-server          (01:00)
+@@ -90,7 +90,7 @@ accounti foo          nine                (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ iso-8601 time ~~~
+ rick     long         never-gonna-logout 1970-01-01T00:00:00+0000 - 2038-01-19T03:14:07+0000 (24855+03:14)
+-torvalds linux        hobby            1991-08-26T00:57:08+0000   still logged in
++torvalds linux        hobby            1991-08-26T00:57:08+0000   gone - no logout
+ reboot   system boot  system-name      2013-08-28T18:00:00+0000   still running
+ reboot   system boot  system-name      2013-08-28T16:00:00+0000 - 2013-08-28T17:00:00+0000  (01:00)
+ IPv4     root         dns-server       2013-08-28T13:00:00+0000 - 2013-08-28T14:00:00+0000  (01:00)
+@@ -115,7 +115,7 @@ accounti foo          nine             Wed Aug 28 03:00 - 04:00  (01:00)
+ wtmp begins Wed Aug 28 03:00:00 2013
+ ~~~ present ~~~
+ rick     long         never-gonna-logo Thu Jan  1 00:00 - 03:14 (24855+03:14)
+-torvalds linux        hobby            Mon Aug 26 00:57   still logged in
++torvalds linux        hobby            Mon Aug 26 00:57    gone - no logout
+ runlevel foo          one              Wed Aug 28 11:00 - 12:00  (01:00)
+ 
+ wtmp begins Wed Aug 28 03:00:00 2013
+-- 
+1.8.5.5
+

diff --git a/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch b/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch
new file mode 100644
index 0000000..5148053
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24-skip-last-tests.patch
@@ -0,0 +1,41 @@
+From 6b55612b9ad1193a042f3c3a1d9216e63b0d2907 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 22 Dec 2013 18:17:15 -0500
+Subject: [PATCH] tests: last: skip when last is not enabled
+
+References: https://bugs.gentoo.org/489794
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ tests/ts/last/ipv6 | 2 ++
+ tests/ts/last/last | 2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tests/ts/last/ipv6 b/tests/ts/last/ipv6
+index 8e2b01e..60b72bd 100755
+--- a/tests/ts/last/ipv6
++++ b/tests/ts/last/ipv6
+@@ -18,6 +18,8 @@ TS_DESC="last ipv6"
+ . $TS_TOPDIR/functions.sh
+ ts_init "$*"
+ 
++[ -x $TS_CMD_LAST ] || ts_skip "last not enabled"
++
+ export LANG=C
+ export TZ=GMT
+ 
+diff --git a/tests/ts/last/last b/tests/ts/last/last
+index 4ad38cb..83b7f8d 100755
+--- a/tests/ts/last/last
++++ b/tests/ts/last/last
+@@ -18,6 +18,8 @@ TS_DESC="last"
+ . $TS_TOPDIR/functions.sh
+ ts_init "$*"
+ 
++[ -x $TS_CMD_LAST ] || ts_skip "last not enabled"
++
+ export LANG=C
+ export TZ=GMT
+ 
+-- 
+1.8.4.3
+

diff --git a/sys-apps/util-linux/files/util-linux-2.24.1-musl.patch b/sys-apps/util-linux/files/util-linux-2.24.1-musl.patch
new file mode 100644
index 0000000..3d9efcf
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24.1-musl.patch
@@ -0,0 +1,30 @@
+adapted from a patch from sabotage linux
+diff -ru a/util-linux-2.24.1/libfdisk/src/sun.c b/util-linux-2.24.1/libfdisk/src/sun.c
+--- a/util-linux-2.24.1/libfdisk/src/sun.c
++++ b/util-linux-2.24.1/libfdisk/src/sun.c
+@@ -361,9 +361,11 @@
+ 	}
+ }
+ 
+-static int verify_sun_cmp(int *a, int *b, void *data)
++static void* cmp_data;
++static int verify_sun_cmp(const void *pa, const void *pb)
+ {
+-    unsigned int *verify_sun_starts = (unsigned int *) data;
++    const int *a = pa, *b = pb;
++    unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
+ 
+     if (*a == -1)
+ 	    return 1;
+@@ -427,9 +429,8 @@
+         else
+             array[i] = -1;
+     }
+-    qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+-	  (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+-	  verify_sun_starts);
++    cmp_data = verify_sun_starts;
++    qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
+ 
+     if (array[0] == -1) {
+ 	fdisk_info(cxt, _("No partitions defined."));

diff --git a/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch b/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch
new file mode 100644
index 0000000..716ea53
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.24.2-hexdump.patch
@@ -0,0 +1,40 @@
+from alpine linux
+--- ./text-utils/parse.c.orig
++++ ./text-utils/parse.c
+@@ -208,7 +208,7 @@
+ 	PR *pr, **nextpr;
+ 	FU *fu;
+ 	char *p1, *p2;
+-	char savech, *fmtp, cs[3];
++	char savech, *fmtp, cs[4];
+ 	int nconv, prec;
+ 
+ 	nextpr = NULL;
+@@ -282,9 +282,10 @@
+ 				goto isint;
+ 			case 'o': case 'u': case 'x': case 'X':
+ 				pr->flags = F_UINT;
+-isint:				cs[2] = '\0';
+-				cs[1] = cs[0];
+-				cs[0] = 'q';
++isint:				cs[3] = '\0';
++				cs[2] = cs[0];
++				cs[1] = 'l';
++				cs[0] = 'l';
+ 				switch(fu->bcnt) {
+ 				case 0: case 4:
+ 					pr->bcnt = 4;
+@@ -342,9 +343,10 @@
+ 					++p2;
+ 					switch(p1[2]) {
+ 					case 'd': case 'o': case'x':
+-						cs[0] = 'q';
+-						cs[1] = p1[2];
+-						cs[2] = '\0';
++						cs[0] = 'l';
++						cs[1] = 'l';
++						cs[2] = p1[2];
++						cs[3] = '\0';
+ 						break;
+ 					default:
+ 						p1[3] = '\0';

diff --git a/sys-apps/util-linux/util-linux-2.24.1-r99.ebuild b/sys-apps/util-linux/util-linux-2.24.1-r99.ebuild
new file mode 100644
index 0000000..2858002
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.24.1-r99.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.24.1-r2.ebuild,v 1.8 2014/05/14 18:13:29 ssuominen Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 python-single-r1
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-2 autotools
+	EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+	KEYWORDS="amd64 arm ~mips x86"
+	SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="bash-completion caps +cramfs cytune fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+	!sys-apps/setarch
+	!<sys-apps/sysvinit-2.88-r7
+	!sys-block/eject
+	!<sys-libs/e2fsprogs-libs-1.41.8
+	!<sys-fs/e2fsprogs-1.41.8
+	!<app-shells/bash-completion-1.3-r2
+	caps? ( sys-libs/libcap-ng )
+	cramfs? ( sys-libs/zlib )
+	ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+	pam? ( sys-libs/pam )
+	python? ( ${PYTHON_DEPS} )
+	selinux? ( sys-libs/libselinux )
+	slang? ( sys-libs/slang )
+	udev? ( virtual/udev )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	test? ( sys-devel/bc )
+	virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999 ]] ; then
+		po/update-potfiles
+		eautoreconf
+	fi
+	epatch "${FILESDIR}"/${PN}-2.24-skip-last-tests.patch #491742
+	epatch "${FILESDIR}"/${PN}-2.24-last-tests.patch #501408
+	epatch "${FILESDIR}"/${PN}-2.24.1-musl.patch #for musl
+	epatch "${FILESDIR}"/${PN}-2.24.2-hexdump.patch #for musl
+	find tests/ -name bigyear -delete #489794
+	elibtoolize
+}
+
+lfs_fallocate_test() {
+	# Make sure we can use fallocate with LFS #300307
+	cat <<-EOF > "${T}"/fallocate.c
+		#define _GNU_SOURCE
+		#include <fcntl.h>
+		main() { return fallocate(0, 0, 0, 0); }
+	EOF
+	append-lfs-flags
+	$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.c -o /dev/null >/dev/null 2>&1 \
+		|| export ac_cv_func_fallocate=no
+	rm -f "${T}"/fallocate.c
+}
+
+src_configure() {
+	lfs_fallocate_test
+	export ac_cv_header_security_pam_misc_h=$(usex pam) #485486
+	econf \
+		--docdir="/usr/share/doc/${PF}" \
+		--enable-fs-paths-extra=/usr/sbin:/bin:/usr/bin \
+		$(use_enable nls) \
+		--enable-agetty \
+		--with-bashcompletiondir="$(get_bashcompdir)" \
+		$(use_enable bash-completion) \
+		$(use_enable caps setpriv) \
+		$(use_enable cramfs) \
+		$(use_enable cytune) \
+		$(use_enable fdformat) \
+		--with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \
+		--disable-kill \
+		--disable-login \
+		$(use_enable tty-helpers mesg) \
+		--disable-nologin \
+		--enable-partx \
+		$(use_with python) \
+		--enable-raw \
+		--enable-rename \
+		--disable-reset \
+		--enable-schedutils \
+		--disable-su \
+		$(use_enable tty-helpers wall) \
+		$(use_enable tty-helpers write) \
+		$(use_enable suid makeinstall-chown) \
+		$(use_enable suid makeinstall-setuid) \
+		$(use_with selinux) \
+		$(use_with slang) \
+		$(use_enable static-libs static) \
+		$(use_with udev) \
+		$(tc-has-tls || echo --disable-tls)
+}
+
+src_test() {
+	emake check
+}
+
+src_install() {
+	default
+	dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+	use python && python_optimize
+
+	# need the libs in /
+	gen_usr_ldscript -a blkid mount uuid
+
+	# e2fsprogs-libs didnt install .la files, and .pc work fine
+	prune_libtool_files
+}
+
+pkg_postinst() {
+	if ! use tty-helpers; then
+		elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+	fi
+
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		elog "The agetty util now clears the terminal by default. You"
+		elog "might want to add --noclear to your /etc/inittab lines."
+	fi
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
@ 2014-08-12 15:35 Anthony G. Basile
  2014-08-19 13:59 ` Anthony G. Basile
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-12 15:35 UTC (permalink / raw
  To: gentoo-commits

commit:     b125d8b883eaae5be261fe67ba98f366043e30cd
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 15:37:09 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Aug 12 15:37:09 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=b125d8b8

sys-apps/util-linux: version bump to 2.25

Package-Manager: portage-2.2.8-r1
Manifest-Sign-Key: 0xF52D4BBA

---
 .../files/util-linux-2.25-lscpu-pic.patch          |  81 ++++++++++
 .../util-linux-2.25-missing__SWORD_TYPE.patch      |  28 ++++
 sys-apps/util-linux/util-linux-2.25-r99.ebuild     | 175 +++++++++++++++++++++
 3 files changed, 284 insertions(+)

diff --git a/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
new file mode 100644
index 0000000..f66ffa7
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
@@ -0,0 +1,81 @@
+From f86d649d5f2522c61b791366a96e9f00cd255668 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 Aug 2014 18:58:52 -0400
+Subject: [PATCH] lscpu: clean up vmware inline asm
+
+This code is not PIC clean which means it fails to build on hardened
+32bit x86 systems (i.e. building as PIE).
+
+While here, optimize the existing cpuid logic slightly.
+
+URL: https://bugs.gentoo.org/518936
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ sys-utils/lscpu.c | 36 ++++++++++++++++++++++++++----------
+ 1 file changed, 26 insertions(+), 10 deletions(-)
+
+diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
+index 062dff5..9965eeb 100644
+--- a/sys-utils/lscpu.c
++++ b/sys-utils/lscpu.c
+@@ -546,10 +546,9 @@ cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
+ 	__asm__(
+ #if defined(__PIC__) && defined(__i386__)
+ 		/* x86 PIC cannot clobber ebx -- gcc bitches */
+-		"pushl %%ebx;"
++		"xchg %%ebx, %%esi;"
+ 		"cpuid;"
+-		"movl %%ebx, %%esi;"
+-		"popl %%ebx;"
++		"xchg %%esi, %%ebx;"
+ 		: "=S" (*ebx),
+ #else
+ 		"cpuid;"
+@@ -656,12 +655,29 @@ read_hypervisor_powerpc(struct lscpu_desc *desc)
+ #define VMWARE_BDOOR_PORT           0x5658
+ #define VMWARE_BDOOR_CMD_GETVERSION 10
+ 
+-#define VMWARE_BDOOR(eax, ebx, ecx, edx)                                  \
+-        __asm__("inl (%%dx), %%eax" :                                     \
+-               "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :               \
+-               "0"(VMWARE_BDOOR_MAGIC), "1"(VMWARE_BDOOR_CMD_GETVERSION), \
+-               "2"(VMWARE_BDOOR_PORT), "3"(0) :                           \
+-               "memory");
++static inline
++void vmware_bdoor(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
++{
++	__asm__(
++#if defined(__PIC__) && defined(__i386__)
++		/* x86 PIC cannot clobber ebx -- gcc bitches */
++		"xchg %%ebx, %%esi;"
++		"inl (%%dx), %%eax;"
++		"xchg %%esi, %%ebx;"
++		: "=S" (*ebx),
++#else
++		"inl (%%dx), %%eax;"
++		: "=b" (*ebx),
++#endif
++		  "=a" (*eax),
++		  "=c" (*ecx),
++		  "=d" (*edx)
++		: "0" (VMWARE_BDOOR_MAGIC),
++		  "1" (VMWARE_BDOOR_CMD_GETVERSION),
++		  "2" (VMWARE_BDOOR_PORT),
++		  "3" (0)
++		: "memory");
++}
+ 
+ static jmp_buf segv_handler_env;
+ 
+@@ -697,7 +713,7 @@ is_vmware_platform(void)
+ 	if (sigaction(SIGSEGV, &act, &oact))
+ 		err(EXIT_FAILURE, _("error: can not set signal handler"));
+ 
+-	VMWARE_BDOOR(eax, ebx, ecx, edx);
++	vmware_bdoor(&eax, &ebx, &ecx, &edx);
+ 
+ 	if (sigaction(SIGSEGV, &oact, NULL))
+ 		err(EXIT_FAILURE, _("error: can not restore signal handler"));
+-- 
+2.0.0
+

diff --git a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
new file mode 100644
index 0000000..e471e0f
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
@@ -0,0 +1,28 @@
+diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
+--- util-linux-2.25.orig/sys-utils/switch_root.c	2014-06-25 09:35:44.333812673 +0000
++++ util-linux-2.25/sys-utils/switch_root.c	2014-08-12 14:54:40.752012106 +0000
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <sys/statfs.h>
+ #include <sys/param.h>
++#include <sys/user.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -47,6 +48,16 @@
+ #define MNT_DETACH       0x00000002	/* Just detach from the tree */
+ #endif
+ 
++#ifndef __SWORD_TYPE
++#if __WORDSIZE == 32
++# define __SWORD_TYPE           int
++#elif __WORDSIZE == 64
++# define __SWORD_TYPE           long int
++#else
++# error
++#endif
++#endif
++
+ /* remove all files/directories below dirName -- don't cross mountpoints */
+ static int recursiveRemove(int fd)
+ {

diff --git a/sys-apps/util-linux/util-linux-2.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
new file mode 100644
index 0000000..eb17752
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.25.ebuild,v 1.5 2014/08/05 23:04:39 vapier Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+	python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-2 autotools
+	EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+	KEYWORDS="~amd64 ~arm ~mips ~x86"
+	SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="bash-completion caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+	!sys-apps/setarch
+	!<sys-apps/sysvinit-2.88-r7
+	!sys-block/eject
+	!<sys-libs/e2fsprogs-libs-1.41.8
+	!<sys-fs/e2fsprogs-1.41.8
+	!<app-shells/bash-completion-1.3-r2
+	caps? ( sys-libs/libcap-ng )
+	cramfs? ( sys-libs/zlib )
+	ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+	pam? ( sys-libs/pam )
+	python? ( ${PYTHON_DEPS} )
+	selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+	slang? ( sys-libs/slang )
+	udev? ( virtual/udev )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+	)"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	test? ( sys-devel/bc )
+	virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999 ]] ; then
+		po/update-potfiles
+		eautoreconf
+	fi
+	epatch "${FILESDIR}"/${P}-lscpu-pic.patch #518936
+	epatch "${FILESDIR}"/${PN}-2.25-missing__SWORD_TYPE.patch
+	elibtoolize
+}
+
+lfs_fallocate_test() {
+	# Make sure we can use fallocate with LFS #300307
+	cat <<-EOF > "${T}"/fallocate.${ABI}.c
+		#define _GNU_SOURCE
+		#include <fcntl.h>
+		main() { return fallocate(0, 0, 0, 0); }
+	EOF
+	append-lfs-flags
+	$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+		|| export ac_cv_func_fallocate=no
+	rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+	lfs_fallocate_test
+	export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+	# We manually set --libdir to the default since on prefix, econf will set it to
+	# a value which the configure script does not recognize.  This makes it set the
+	# usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+	ECONF_SOURCE=${S} \
+	econf \
+		--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+		--libdir='${prefix}/'"$(get_libdir)" \
+		$(multilib_native_use_enable nls) \
+		--enable-agetty \
+		--with-bashcompletiondir="$(get_bashcompdir)" \
+		$(multilib_native_use_enable bash-completion) \
+		$(multilib_native_use_enable caps setpriv) \
+		--disable-chfn-chsh \
+		$(multilib_native_use_enable cramfs) \
+		$(multilib_native_use_enable fdformat) \
+		--with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+		--disable-kill \
+		--disable-login \
+		$(multilib_native_use_enable tty-helpers mesg) \
+		--disable-nologin \
+		--enable-partx \
+		$(multilib_native_use_with python) \
+		--enable-raw \
+		--enable-rename \
+		--disable-reset \
+		--enable-schedutils \
+		--disable-su \
+		$(multilib_native_use_enable tty-helpers wall) \
+		$(multilib_native_use_enable tty-helpers write) \
+		$(multilib_native_use_enable suid makeinstall-chown) \
+		$(multilib_native_use_enable suid makeinstall-setuid) \
+		$(use_with selinux) \
+		$(multilib_native_use_with slang) \
+		$(use_enable static-libs static) \
+		$(multilib_native_use_with udev) \
+		$(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		# build libraries only
+		emake -f Makefile -f - mylibs \
+			<<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+			install-pkgconfigDATA install-uuidincHEADERS \
+			install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+			install-nodist_smartcolsincHEADERS
+	fi
+
+	if multilib_is_native_abi; then
+		# need the libs in /
+		gen_usr_ldscript -a blkid mount smartcols uuid
+
+		use python && python_optimize
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+	# e2fsprogs-libs didnt install .la files, and .pc work fine
+	prune_libtool_files
+}
+
+pkg_postinst() {
+	if ! use tty-helpers; then
+		elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+	fi
+
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		elog "The agetty util now clears the terminal by default. You"
+		elog "might want to add --noclear to your /etc/inittab lines."
+	fi
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
  2014-08-19 13:59 [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/ Anthony G. Basile
@ 2014-08-13 15:29 ` Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-13 15:29 UTC (permalink / raw
  To: gentoo-commits

commit:     f543e69201441fdc901ccdda0d7a4d23cc5d829b
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 13 15:31:39 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Aug 13 15:31:39 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=f543e692

sys-apps/util-linux: Don't cast at all, per Rich Felker

Package-Manager: portage-2.2.8-r1
Manifest-Sign-Key: 0xF52D4BBA

---
 .../util-linux-2.25-missing__SWORD_TYPE.patch      | 28 ----------------------
 .../files/util-linux-2.25-remove__SWORD_TYPE.patch | 14 +++++++++++
 sys-apps/util-linux/util-linux-2.25-r99.ebuild     |  2 +-
 3 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
deleted file mode 100644
index e20a63a..0000000
--- a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
---- util-linux-2.25.orig/sys-utils/switch_root.c	2014-06-25 09:35:44.333812673 +0000
-+++ util-linux-2.25/sys-utils/switch_root.c	2014-08-12 14:54:40.752012106 +0000
-@@ -25,6 +25,7 @@
- #include <sys/stat.h>
- #include <sys/statfs.h>
- #include <sys/param.h>
-+#include <sys/reg.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
-@@ -47,6 +48,16 @@
- #define MNT_DETACH       0x00000002	/* Just detach from the tree */
- #endif
- 
-+#ifndef __SWORD_TYPE
-+#if __WORDSIZE == 32
-+# define __SWORD_TYPE           int
-+#elif __WORDSIZE == 64
-+# define __SWORD_TYPE           long int
-+#else
-+# error
-+#endif
-+#endif
-+
- /* remove all files/directories below dirName -- don't cross mountpoints */
- static int recursiveRemove(int fd)
- {

diff --git a/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
new file mode 100644
index 0000000..86edab4
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
@@ -0,0 +1,14 @@
+diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
+--- util-linux-2.25.orig/sys-utils/switch_root.c	2014-08-13 15:08:15.632801343 +0000
++++ util-linux-2.25/sys-utils/switch_root.c	2014-08-13 15:09:19.617801087 +0000
+@@ -181,8 +181,8 @@
+ 		if (pid <= 0) {
+ 			struct statfs stfs;
+ 			if (fstatfs(cfd, &stfs) == 0 &&
+-			    (stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC ||
+-			     stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC))
++			    (stfs.f_type == STATFS_RAMFS_MAGIC ||
++			     stfs.f_type == STATFS_TMPFS_MAGIC))
+ 				recursiveRemove(cfd);
+ 			else
+ 				warn(_("old root filesystem is not an initramfs"));

diff --git a/sys-apps/util-linux/util-linux-2.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
index eb17752..6fc8054 100644
--- a/sys-apps/util-linux/util-linux-2.25-r99.ebuild
+++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
@@ -66,7 +66,7 @@ src_prepare() {
 		eautoreconf
 	fi
 	epatch "${FILESDIR}"/${P}-lscpu-pic.patch #518936
-	epatch "${FILESDIR}"/${PN}-2.25-missing__SWORD_TYPE.patch
+	epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.patch
 	elibtoolize
 }
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
@ 2014-08-19 13:59 Anthony G. Basile
  2014-08-13 15:29 ` Anthony G. Basile
  0 siblings, 1 reply; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-19 13:59 UTC (permalink / raw
  To: gentoo-commits

commit:     f543e69201441fdc901ccdda0d7a4d23cc5d829b
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 13 15:31:39 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Aug 13 15:31:39 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=f543e692

sys-apps/util-linux: Don't cast at all, per Rich Felker

Package-Manager: portage-2.2.8-r1
Manifest-Sign-Key: 0xF52D4BBA

---
 .../util-linux-2.25-missing__SWORD_TYPE.patch      | 28 ----------------------
 .../files/util-linux-2.25-remove__SWORD_TYPE.patch | 14 +++++++++++
 sys-apps/util-linux/util-linux-2.25-r99.ebuild     |  2 +-
 3 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
deleted file mode 100644
index e20a63a..0000000
--- a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
---- util-linux-2.25.orig/sys-utils/switch_root.c	2014-06-25 09:35:44.333812673 +0000
-+++ util-linux-2.25/sys-utils/switch_root.c	2014-08-12 14:54:40.752012106 +0000
-@@ -25,6 +25,7 @@
- #include <sys/stat.h>
- #include <sys/statfs.h>
- #include <sys/param.h>
-+#include <sys/reg.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <stdlib.h>
-@@ -47,6 +48,16 @@
- #define MNT_DETACH       0x00000002	/* Just detach from the tree */
- #endif
- 
-+#ifndef __SWORD_TYPE
-+#if __WORDSIZE == 32
-+# define __SWORD_TYPE           int
-+#elif __WORDSIZE == 64
-+# define __SWORD_TYPE           long int
-+#else
-+# error
-+#endif
-+#endif
-+
- /* remove all files/directories below dirName -- don't cross mountpoints */
- static int recursiveRemove(int fd)
- {

diff --git a/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
new file mode 100644
index 0000000..86edab4
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-remove__SWORD_TYPE.patch
@@ -0,0 +1,14 @@
+diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
+--- util-linux-2.25.orig/sys-utils/switch_root.c	2014-08-13 15:08:15.632801343 +0000
++++ util-linux-2.25/sys-utils/switch_root.c	2014-08-13 15:09:19.617801087 +0000
+@@ -181,8 +181,8 @@
+ 		if (pid <= 0) {
+ 			struct statfs stfs;
+ 			if (fstatfs(cfd, &stfs) == 0 &&
+-			    (stfs.f_type == (__SWORD_TYPE)STATFS_RAMFS_MAGIC ||
+-			     stfs.f_type == (__SWORD_TYPE)STATFS_TMPFS_MAGIC))
++			    (stfs.f_type == STATFS_RAMFS_MAGIC ||
++			     stfs.f_type == STATFS_TMPFS_MAGIC))
+ 				recursiveRemove(cfd);
+ 			else
+ 				warn(_("old root filesystem is not an initramfs"));

diff --git a/sys-apps/util-linux/util-linux-2.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
index eb17752..6fc8054 100644
--- a/sys-apps/util-linux/util-linux-2.25-r99.ebuild
+++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
@@ -66,7 +66,7 @@ src_prepare() {
 		eautoreconf
 	fi
 	epatch "${FILESDIR}"/${P}-lscpu-pic.patch #518936
-	epatch "${FILESDIR}"/${PN}-2.25-missing__SWORD_TYPE.patch
+	epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.patch
 	elibtoolize
 }
 


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
  2014-08-12 15:35 Anthony G. Basile
@ 2014-08-19 13:59 ` Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-08-19 13:59 UTC (permalink / raw
  To: gentoo-commits

commit:     b125d8b883eaae5be261fe67ba98f366043e30cd
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 12 15:37:09 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Aug 12 15:37:09 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=b125d8b8

sys-apps/util-linux: version bump to 2.25

Package-Manager: portage-2.2.8-r1
Manifest-Sign-Key: 0xF52D4BBA

---
 .../files/util-linux-2.25-lscpu-pic.patch          |  81 ++++++++++
 .../util-linux-2.25-missing__SWORD_TYPE.patch      |  28 ++++
 sys-apps/util-linux/util-linux-2.25-r99.ebuild     | 175 +++++++++++++++++++++
 3 files changed, 284 insertions(+)

diff --git a/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
new file mode 100644
index 0000000..f66ffa7
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-lscpu-pic.patch
@@ -0,0 +1,81 @@
+From f86d649d5f2522c61b791366a96e9f00cd255668 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 Aug 2014 18:58:52 -0400
+Subject: [PATCH] lscpu: clean up vmware inline asm
+
+This code is not PIC clean which means it fails to build on hardened
+32bit x86 systems (i.e. building as PIE).
+
+While here, optimize the existing cpuid logic slightly.
+
+URL: https://bugs.gentoo.org/518936
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ sys-utils/lscpu.c | 36 ++++++++++++++++++++++++++----------
+ 1 file changed, 26 insertions(+), 10 deletions(-)
+
+diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
+index 062dff5..9965eeb 100644
+--- a/sys-utils/lscpu.c
++++ b/sys-utils/lscpu.c
+@@ -546,10 +546,9 @@ cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
+ 	__asm__(
+ #if defined(__PIC__) && defined(__i386__)
+ 		/* x86 PIC cannot clobber ebx -- gcc bitches */
+-		"pushl %%ebx;"
++		"xchg %%ebx, %%esi;"
+ 		"cpuid;"
+-		"movl %%ebx, %%esi;"
+-		"popl %%ebx;"
++		"xchg %%esi, %%ebx;"
+ 		: "=S" (*ebx),
+ #else
+ 		"cpuid;"
+@@ -656,12 +655,29 @@ read_hypervisor_powerpc(struct lscpu_desc *desc)
+ #define VMWARE_BDOOR_PORT           0x5658
+ #define VMWARE_BDOOR_CMD_GETVERSION 10
+ 
+-#define VMWARE_BDOOR(eax, ebx, ecx, edx)                                  \
+-        __asm__("inl (%%dx), %%eax" :                                     \
+-               "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) :               \
+-               "0"(VMWARE_BDOOR_MAGIC), "1"(VMWARE_BDOOR_CMD_GETVERSION), \
+-               "2"(VMWARE_BDOOR_PORT), "3"(0) :                           \
+-               "memory");
++static inline
++void vmware_bdoor(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
++{
++	__asm__(
++#if defined(__PIC__) && defined(__i386__)
++		/* x86 PIC cannot clobber ebx -- gcc bitches */
++		"xchg %%ebx, %%esi;"
++		"inl (%%dx), %%eax;"
++		"xchg %%esi, %%ebx;"
++		: "=S" (*ebx),
++#else
++		"inl (%%dx), %%eax;"
++		: "=b" (*ebx),
++#endif
++		  "=a" (*eax),
++		  "=c" (*ecx),
++		  "=d" (*edx)
++		: "0" (VMWARE_BDOOR_MAGIC),
++		  "1" (VMWARE_BDOOR_CMD_GETVERSION),
++		  "2" (VMWARE_BDOOR_PORT),
++		  "3" (0)
++		: "memory");
++}
+ 
+ static jmp_buf segv_handler_env;
+ 
+@@ -697,7 +713,7 @@ is_vmware_platform(void)
+ 	if (sigaction(SIGSEGV, &act, &oact))
+ 		err(EXIT_FAILURE, _("error: can not set signal handler"));
+ 
+-	VMWARE_BDOOR(eax, ebx, ecx, edx);
++	vmware_bdoor(&eax, &ebx, &ecx, &edx);
+ 
+ 	if (sigaction(SIGSEGV, &oact, NULL))
+ 		err(EXIT_FAILURE, _("error: can not restore signal handler"));
+-- 
+2.0.0
+

diff --git a/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
new file mode 100644
index 0000000..e471e0f
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25-missing__SWORD_TYPE.patch
@@ -0,0 +1,28 @@
+diff -Naur util-linux-2.25.orig/sys-utils/switch_root.c util-linux-2.25/sys-utils/switch_root.c
+--- util-linux-2.25.orig/sys-utils/switch_root.c	2014-06-25 09:35:44.333812673 +0000
++++ util-linux-2.25/sys-utils/switch_root.c	2014-08-12 14:54:40.752012106 +0000
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <sys/statfs.h>
+ #include <sys/param.h>
++#include <sys/user.h>
+ #include <fcntl.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -47,6 +48,16 @@
+ #define MNT_DETACH       0x00000002	/* Just detach from the tree */
+ #endif
+ 
++#ifndef __SWORD_TYPE
++#if __WORDSIZE == 32
++# define __SWORD_TYPE           int
++#elif __WORDSIZE == 64
++# define __SWORD_TYPE           long int
++#else
++# error
++#endif
++#endif
++
+ /* remove all files/directories below dirName -- don't cross mountpoints */
+ static int recursiveRemove(int fd)
+ {

diff --git a/sys-apps/util-linux/util-linux-2.25-r99.ebuild b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
new file mode 100644
index 0000000..eb17752
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25-r99.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.25.ebuild,v 1.5 2014/08/05 23:04:39 vapier Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+	python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-2 autotools
+	EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+	KEYWORDS="~amd64 ~arm ~mips ~x86"
+	SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="bash-completion caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+	!sys-apps/setarch
+	!<sys-apps/sysvinit-2.88-r7
+	!sys-block/eject
+	!<sys-libs/e2fsprogs-libs-1.41.8
+	!<sys-fs/e2fsprogs-1.41.8
+	!<app-shells/bash-completion-1.3-r2
+	caps? ( sys-libs/libcap-ng )
+	cramfs? ( sys-libs/zlib )
+	ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+	pam? ( sys-libs/pam )
+	python? ( ${PYTHON_DEPS} )
+	selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+	slang? ( sys-libs/slang )
+	udev? ( virtual/udev )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+	)"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	test? ( sys-devel/bc )
+	virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	if [[ ${PV} == 9999 ]] ; then
+		po/update-potfiles
+		eautoreconf
+	fi
+	epatch "${FILESDIR}"/${P}-lscpu-pic.patch #518936
+	epatch "${FILESDIR}"/${PN}-2.25-missing__SWORD_TYPE.patch
+	elibtoolize
+}
+
+lfs_fallocate_test() {
+	# Make sure we can use fallocate with LFS #300307
+	cat <<-EOF > "${T}"/fallocate.${ABI}.c
+		#define _GNU_SOURCE
+		#include <fcntl.h>
+		main() { return fallocate(0, 0, 0, 0); }
+	EOF
+	append-lfs-flags
+	$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+		|| export ac_cv_func_fallocate=no
+	rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+	lfs_fallocate_test
+	export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+	# We manually set --libdir to the default since on prefix, econf will set it to
+	# a value which the configure script does not recognize.  This makes it set the
+	# usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+	ECONF_SOURCE=${S} \
+	econf \
+		--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+		--libdir='${prefix}/'"$(get_libdir)" \
+		$(multilib_native_use_enable nls) \
+		--enable-agetty \
+		--with-bashcompletiondir="$(get_bashcompdir)" \
+		$(multilib_native_use_enable bash-completion) \
+		$(multilib_native_use_enable caps setpriv) \
+		--disable-chfn-chsh \
+		$(multilib_native_use_enable cramfs) \
+		$(multilib_native_use_enable fdformat) \
+		--with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+		--disable-kill \
+		--disable-login \
+		$(multilib_native_use_enable tty-helpers mesg) \
+		--disable-nologin \
+		--enable-partx \
+		$(multilib_native_use_with python) \
+		--enable-raw \
+		--enable-rename \
+		--disable-reset \
+		--enable-schedutils \
+		--disable-su \
+		$(multilib_native_use_enable tty-helpers wall) \
+		$(multilib_native_use_enable tty-helpers write) \
+		$(multilib_native_use_enable suid makeinstall-chown) \
+		$(multilib_native_use_enable suid makeinstall-setuid) \
+		$(use_with selinux) \
+		$(multilib_native_use_with slang) \
+		$(use_enable static-libs static) \
+		$(multilib_native_use_with udev) \
+		$(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		# build libraries only
+		emake -f Makefile -f - mylibs \
+			<<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+			install-pkgconfigDATA install-uuidincHEADERS \
+			install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+			install-nodist_smartcolsincHEADERS
+	fi
+
+	if multilib_is_native_abi; then
+		# need the libs in /
+		gen_usr_ldscript -a blkid mount smartcols uuid
+
+		use python && python_optimize
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+	# e2fsprogs-libs didnt install .la files, and .pc work fine
+	prune_libtool_files
+}
+
+pkg_postinst() {
+	if ! use tty-helpers; then
+		elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+	fi
+
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		elog "The agetty util now clears the terminal by default. You"
+		elog "might want to add --noclear to your /etc/inittab lines."
+	fi
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
@ 2014-12-09 14:22 Anthony G. Basile
  0 siblings, 0 replies; 6+ messages in thread
From: Anthony G. Basile @ 2014-12-09 14:22 UTC (permalink / raw
  To: gentoo-commits

commit:     ad4002d078a04968876a4340cc9056e6af096f82
Author:     Felix Janda <felix.janda <AT> posteo <DOT> de>
AuthorDate: Sat Dec  6 12:51:15 2014 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Tue Dec  9 14:23:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=ad4002d0

sys-apps/util-linux: bump to 2.25.2

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

---
 ...util-linux-2.25.2-runuser-bash-completion.patch |  33 ++++
 sys-apps/util-linux/util-linux-2.25.2-r99.ebuild   | 175 +++++++++++++++++++++
 2 files changed, 208 insertions(+)

diff --git a/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch b/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch
new file mode 100644
index 0000000..85c4811
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.25.2-runuser-bash-completion.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/522288
+
+From a95987423c4d7781a14ffda34f082086cd51f4f7 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Fri, 24 Oct 2014 12:08:22 -0400
+Subject: [PATCH] bash-completion: fix runuser install
+
+The runuser symlink used to depend on su being enabled, but a refactoring
+broke that.  So if you build with runuser enabled but not su, you end up
+with a broken symlink.  Rework the logic so it works in both cases.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ bash-completion/Makemodule.am | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am
+index 271a6db..045c2d5 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -11071,7 +10823,8 @@
+ @BUILD_MOUNT_TRUE@@MAKEINSTALL_DO_SETUID_TRUE@	chmod 4755 $(DESTDIR)$(bindir)/umount
+ 
+ @BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@install-data-hook-bashcomp-runuser::
+-@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@	ln -sf su $(DESTDIR)$(bashcompletiondir)/runuser
++@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@@BUILD_SU_TRUE@	ln -sf su $(DESTDIR)$(bashcompletiondir)/runuser
++@BUILD_BASH_COMPLETION_TRUE@@BUILD_RUNUSER_TRUE@@BUILD_SU_FALSE@	cp $(top_srcdir)/bash-completion/su $(DESTDIR)$(bashcompletiondir)/runuser
+ 
+ clean-local-tests:
+ 	rm -rf $(top_builddir)/tests/output $(top_builddir)/tests/diff
+-- 
+2.1.2
+

diff --git a/sys-apps/util-linux/util-linux-2.25.2-r99.ebuild b/sys-apps/util-linux/util-linux-2.25.2-r99.ebuild
new file mode 100644
index 0000000..3cb9e56
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.25.2-r99.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/util-linux-2.25.2.ebuild,v 1.1 2014/10/24 16:27:07 vapier Exp $
+
+EAPI="4"
+
+PYTHON_COMPAT=( python2_7 python3_{2,3,4} )
+
+inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
+	python-single-r1 multilib-minimal
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+
+if [[ ${PV} == 9999 ]] ; then
+	inherit git-2 autotools
+	EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+else
+	KEYWORDS="~amd64 ~arm ~mips ~ppc ~x86"
+	SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="caps +cramfs fdformat ncurses nls pam python selinux slang static-libs +suid test tty-helpers udev unicode"
+
+RDEPEND="!sys-process/schedutils
+	!sys-apps/setarch
+	!<sys-apps/sysvinit-2.88-r7
+	!sys-block/eject
+	!<sys-libs/e2fsprogs-libs-1.41.8
+	!<sys-fs/e2fsprogs-1.41.8
+	!<app-shells/bash-completion-1.3-r2
+	caps? ( sys-libs/libcap-ng )
+	cramfs? ( sys-libs/zlib )
+	ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+	pam? ( sys-libs/pam )
+	python? ( ${PYTHON_DEPS} )
+	selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
+	slang? ( sys-libs/slang )
+	udev? ( virtual/udev )
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20140406-r2
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+	)"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	nls? ( sys-devel/gettext )
+	test? ( sys-devel/bc )
+	virtual/os-headers"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+	use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+	epatch "${FILESDIR}"/${P}-runuser-bash-completion.patch #522288
+	epatch "${FILESDIR}"/${PN}-2.25-remove__SWORD_TYPE.patch
+	if [[ ${PV} == 9999 ]] ; then
+		po/update-potfiles
+		eautoreconf
+	fi
+	elibtoolize
+}
+
+lfs_fallocate_test() {
+	# Make sure we can use fallocate with LFS #300307
+	cat <<-EOF > "${T}"/fallocate.${ABI}.c
+		#define _GNU_SOURCE
+		#include <fcntl.h>
+		main() { return fallocate(0, 0, 0, 0); }
+	EOF
+	append-lfs-flags
+	$(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
+		|| export ac_cv_func_fallocate=no
+	rm -f "${T}"/fallocate.${ABI}.c
+}
+
+multilib_src_configure() {
+	lfs_fallocate_test
+	export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
+	# We manually set --libdir to the default since on prefix, econf will set it to
+	# a value which the configure script does not recognize.  This makes it set the
+	# usrlib_execdir to a bad value. bug #518898#c2, fixed upstream for >2.25
+	ECONF_SOURCE=${S} \
+	econf \
+		--enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin" \
+		--libdir='${prefix}/'"$(get_libdir)" \
+		$(multilib_native_use_enable nls) \
+		--enable-agetty \
+		--with-bashcompletiondir="$(get_bashcompdir)" \
+		--enable-bash-completion \
+		$(multilib_native_use_enable caps setpriv) \
+		--disable-chfn-chsh \
+		$(multilib_native_use_enable cramfs) \
+		$(multilib_native_use_enable fdformat) \
+		--with-ncurses=$(multilib_native_usex ncurses $(usex unicode auto yes) no) \
+		--disable-kill \
+		--disable-login \
+		$(multilib_native_use_enable tty-helpers mesg) \
+		--disable-nologin \
+		--enable-partx \
+		$(multilib_native_use_with python) \
+		--enable-raw \
+		--enable-rename \
+		--disable-reset \
+		--enable-schedutils \
+		--disable-su \
+		$(multilib_native_use_enable tty-helpers wall) \
+		$(multilib_native_use_enable tty-helpers write) \
+		$(multilib_native_use_enable suid makeinstall-chown) \
+		$(multilib_native_use_enable suid makeinstall-setuid) \
+		$(use_with selinux) \
+		$(multilib_native_use_with slang) \
+		$(use_enable static-libs static) \
+		$(multilib_native_use_with udev) \
+		$(tc-has-tls || echo --disable-tls)
+}
+
+multilib_src_compile() {
+	if multilib_is_native_abi; then
+		default
+	else
+		# build libraries only
+		emake -f Makefile -f - mylibs \
+			<<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
+	fi
+}
+
+multilib_src_test() {
+	multilib_is_native_abi && emake check
+}
+
+multilib_src_install() {
+	if multilib_is_native_abi; then
+		default
+	else
+		emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
+			install-pkgconfigDATA install-uuidincHEADERS \
+			install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
+			install-nodist_smartcolsincHEADERS
+	fi
+
+	if multilib_is_native_abi; then
+		# need the libs in /
+		gen_usr_ldscript -a blkid mount smartcols uuid
+
+		use python && python_optimize
+	fi
+}
+
+multilib_src_install_all() {
+	dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
+
+	# e2fsprogs-libs didnt install .la files, and .pc work fine
+	prune_libtool_files
+}
+
+pkg_postinst() {
+	if ! use tty-helpers; then
+		elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
+	fi
+
+	if [[ -z ${REPLACING_VERSIONS} ]]; then
+		elog "The agetty util now clears the terminal by default. You"
+		elog "might want to add --noclear to your /etc/inittab lines."
+	fi
+}


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-09 14:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19 13:59 [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/ Anthony G. Basile
2014-08-13 15:29 ` Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2014-12-09 14:22 Anthony G. Basile
2014-08-12 15:35 Anthony G. Basile
2014-08-19 13:59 ` Anthony G. Basile
2014-05-18 12:42 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox