public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Anthony G. Basile" <blueness@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/util-linux/, sys-apps/util-linux/files/
Date: Sun, 18 May 2014 12:42:11 +0000 (UTC)	[thread overview]
Message-ID: <1400417034.6f1a3b2acedb896e4f4bd60581f30550a2a5133f.blueness@gentoo> (raw)

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
+}


             reply	other threads:[~2014-05-18 12:42 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1400417034.6f1a3b2acedb896e4f4bd60581f30550a2a5133f.blueness@gentoo \
    --to=blueness@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox