summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-10-10 04:30:42 +0000
committerMike Frysinger <vapier@gentoo.org>2012-10-10 04:30:42 +0000
commit04ef3b51dd891f7832e03c5c5d5efdfb6b209a02 (patch)
treed8107649b6bc78974e758f9e27c3847df74fea51 /sys-apps/util-linux
parentQuiet ping output by default #296921 by Martin Mokrejš. Always accept the -... (diff)
downloadgentoo-2-04ef3b51dd891f7832e03c5c5d5efdfb6b209a02.tar.gz
gentoo-2-04ef3b51dd891f7832e03c5c5d5efdfb6b209a02.tar.bz2
gentoo-2-04ef3b51dd891f7832e03c5c5d5efdfb6b209a02.zip
Add fix from upstream for umount with user= options #437108 by Stefan Reimer.
(Portage version: 2.2.0_alpha131/cvs/Linux x86_64)
Diffstat (limited to 'sys-apps/util-linux')
-rw-r--r--sys-apps/util-linux/ChangeLog10
-rw-r--r--sys-apps/util-linux/files/util-linux-2.22-md5-aliasing.patch36
-rw-r--r--sys-apps/util-linux/files/util-linux-2.22-sfdisk-aliasing.patch38
-rw-r--r--sys-apps/util-linux/files/util-linux-2.22-umount-user.patch63
-rw-r--r--sys-apps/util-linux/util-linux-2.22-r1.ebuild120
5 files changed, 266 insertions, 1 deletions
diff --git a/sys-apps/util-linux/ChangeLog b/sys-apps/util-linux/ChangeLog
index fc44b88b9f84..ecc61bd97f6e 100644
--- a/sys-apps/util-linux/ChangeLog
+++ b/sys-apps/util-linux/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/util-linux
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.403 2012/10/03 18:05:24 ranger Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.404 2012/10/10 04:30:41 vapier Exp $
+
+*util-linux-2.22-r1 (10 Oct 2012)
+
+ 10 Oct 2012; Mike Frysinger <vapier@gentoo.org>
+ +files/util-linux-2.22-md5-aliasing.patch,
+ +files/util-linux-2.22-sfdisk-aliasing.patch,
+ +files/util-linux-2.22-umount-user.patch, +util-linux-2.22-r1.ebuild:
+ Add fix from upstream for umount with user= options #437108 by Stefan Reimer.
03 Oct 2012; Brent Baude <ranger@gentoo.org> util-linux-2.21.2.ebuild:
Marking util-linux-2.21.2 ppc for bug 434334
diff --git a/sys-apps/util-linux/files/util-linux-2.22-md5-aliasing.patch b/sys-apps/util-linux/files/util-linux-2.22-md5-aliasing.patch
new file mode 100644
index 000000000000..bf0bc9dbadb2
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.22-md5-aliasing.patch
@@ -0,0 +1,36 @@
+From 70d1554726de505e476c3a24b6706881e74a0c67 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Oct 2012 00:18:45 -0400
+Subject: [PATCH] md5: fix strict aliasing warnings
+
+This is the same fix as was merged in gcc/binutils where this code
+appears to originate from.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ lib/md5.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/lib/md5.c b/lib/md5.c
+index 26ec4bb..488d16e 100644
+--- a/lib/md5.c
++++ b/lib/md5.c
+@@ -138,9 +138,12 @@ void MD5Final(unsigned char digest[MD5LENGTH], struct MD5Context *ctx)
+ }
+ byteReverse(ctx->in, 14);
+
+- /* Append length in bits and transform */
+- ((uint32_t *) ctx->in)[14] = ctx->bits[0];
+- ((uint32_t *) ctx->in)[15] = ctx->bits[1];
++ /* Append length in bits and transform.
++ * Use memcpy to avoid aliasing problems. On most systems,
++ * this will be optimized away to the same code.
++ */
++ memcpy(&ctx->in[14 * sizeof(uint32_t)], &ctx->bits[0], 4);
++ memcpy(&ctx->in[15 * sizeof(uint32_t)], &ctx->bits[1], 4);
+
+ MD5Transform(ctx->buf, (uint32_t *) ctx->in);
+ byteReverse((unsigned char *) ctx->buf, 4);
+--
+1.7.12
+
diff --git a/sys-apps/util-linux/files/util-linux-2.22-sfdisk-aliasing.patch b/sys-apps/util-linux/files/util-linux-2.22-sfdisk-aliasing.patch
new file mode 100644
index 000000000000..ef2bcca59c89
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.22-sfdisk-aliasing.patch
@@ -0,0 +1,38 @@
+From 24453f0bf4b96c19873f0aed91dbec04f349dd7c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Oct 2012 00:25:11 -0400
+Subject: [PATCH] sfdisk: fix aliasing warnings
+
+Should compile down to the same code.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+---
+ fdisks/sfdisk.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/fdisks/sfdisk.c b/fdisks/sfdisk.c
+index 3450f52..e59d52a 100644
+--- a/fdisks/sfdisk.c
++++ b/fdisks/sfdisk.c
+@@ -1561,12 +1561,14 @@ msdos_partition(char *dev, int fd, unsigned long start, struct disk_desc *z) {
+ return 0;
+ }
+
+- unsigned int sig = *(unsigned short *)(s->data + 2);
+- if (sig <= 0x1ae
+- && *(unsigned short *)(s->data + sig) == 0x55aa
+- && (1 & *(unsigned char *)(s->data + sig + 2))) {
++ unsigned short sig, magic;
++ memcpy(&sig, s->data + 2, sizeof(sig));
++ if (sig <= 0x1ae) {
++ memcpy(&magic, s->data + sig, sizeof(magic));
++ if (magic == 0x55aa && (1 & *(unsigned char *)(s->data + sig + 2))) {
+ warnx(_("DM6 signature found - giving up\n"));
+ return 0;
++ }
+ }
+
+ for (pno = 0; pno < 4; pno++, cp += sizeof(struct partition)) {
+--
+1.7.12
+
diff --git a/sys-apps/util-linux/files/util-linux-2.22-umount-user.patch b/sys-apps/util-linux/files/util-linux-2.22-umount-user.patch
new file mode 100644
index 000000000000..1f61b8cfab0a
--- /dev/null
+++ b/sys-apps/util-linux/files/util-linux-2.22-umount-user.patch
@@ -0,0 +1,63 @@
+https://bugs.gentoo.org/435540
+
+From 4be900c51d371a7a41495e4eca2d29fc77c20c7c Mon Sep 17 00:00:00 2001
+From: Karel Zak <kzak@redhat.com>
+Date: Wed, 12 Sep 2012 14:27:12 +0200
+Subject: [PATCH] libmount: don't remove user= when executed by root
+
+The original mount(8) allows to store arbitrary user= option to mtab
+file if called by root user. For example:
+
+ # mount -f foo /bar -t xxx -o rw,user=kzak
+
+the new mount removes the 'user=' and 'users' options at all for root
+user. This is regression. The original functionality is necessary by
+'sshfs' where fuse writes to mtab file by mount(8).
+
+Reported-by: Juergen Daubert <jue@jue.li> (and 'horrorStruck' on IRC)
+Signed-off-by: Karel Zak <kzak@redhat.com>
+---
+ libmount/src/context_mount.c | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
+index fdb459c..c665a05 100644
+--- a/libmount/src/context_mount.c
++++ b/libmount/src/context_mount.c
+@@ -58,12 +58,10 @@ static int fix_optstr(struct libmnt_context *cxt)
+ * but exception is command line for /sbin/mount.<type> helpers. Let's
+ * save the original user=<name> to call the helpers with unchanged
+ * "user" setting.
+- *
+- * Don't check for MNT_MS_USER in cxt->user_mountflags, the flag maybe
+- * removed by evaluate_permissions().
+ */
+- if (!mnt_optstr_get_option(fs->user_optstr, "user", &val, &valsz)) {
+- if (val) {
++ if (cxt->user_mountflags & MNT_MS_USER) {
++ if (!mnt_optstr_get_option(fs->user_optstr,
++ "user", &val, &valsz) && val) {
+ cxt->orig_user = strndup(val, valsz);
+ if (!cxt->orig_user) {
+ rc = -ENOMEM;
+@@ -157,7 +155,7 @@ static int fix_optstr(struct libmnt_context *cxt)
+ goto done;
+ }
+
+- if (!rc && cxt->user_mountflags & MNT_MS_USER)
++ if (!rc && cxt->restricted && (cxt->user_mountflags & MNT_MS_USER))
+ rc = mnt_optstr_fix_user(&fs->user_optstr);
+
+ /* refresh merged optstr */
+@@ -256,8 +254,6 @@ static int evaluate_permissions(struct libmnt_context *cxt)
+ */
+ cxt->user_mountflags &= ~MNT_MS_OWNER;
+ cxt->user_mountflags &= ~MNT_MS_GROUP;
+- cxt->user_mountflags &= ~MNT_MS_USER;
+- cxt->user_mountflags &= ~MNT_MS_USERS;
+ } else {
+ /*
+ * user mount
+--
+1.7.12
+
diff --git a/sys-apps/util-linux/util-linux-2.22-r1.ebuild b/sys-apps/util-linux/util-linux-2.22-r1.ebuild
new file mode 100644
index 000000000000..9a69c93f29e5
--- /dev/null
+++ b/sys-apps/util-linux/util-linux-2.22-r1.ebuild
@@ -0,0 +1,120 @@
+# Copyright 1999-2012 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.22-r1.ebuild,v 1.1 2012/10/10 04:30:41 vapier Exp $
+
+EAPI="3"
+
+EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
+inherit eutils toolchain-funcs libtool flag-o-matic
+if [[ ${PV} == "9999" ]] ; then
+ inherit git-2 autotools
+ #KEYWORDS=""
+else
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+fi
+
+MY_PV=${PV/_/-}
+MY_P=${PN}-${MY_PV}
+S=${WORKDIR}/${MY_P}
+
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+if [[ ${PV} == "9999" ]] ; then
+ SRC_URI=""
+else
+ SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
+fi
+
+LICENSE="GPL-2 GPL-3 LGPL-2.1 BSD-4 MIT public-domain"
+SLOT="0"
+IUSE="+cramfs crypt ddate ncurses nls old-linux perl selinux slang static-libs udev unicode"
+
+RDEPEND="!sys-process/schedutils
+ !sys-apps/setarch
+ !<sys-apps/sysvinit-2.88-r4
+ !sys-block/eject
+ !<sys-libs/e2fsprogs-libs-1.41.8
+ !<sys-fs/e2fsprogs-1.41.8
+ cramfs? ( sys-libs/zlib )
+ ncurses? ( >=sys-libs/ncurses-5.2-r2 )
+ perl? ( dev-lang/perl )
+ selinux? ( sys-libs/libselinux )
+ slang? ( sys-libs/slang )
+ udev? ( sys-fs/udev )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )
+ virtual/os-headers"
+
+src_prepare() {
+ if [[ ${PV} == "9999" ]] ; then
+ po/update-potfiles
+ eautoreconf
+ fi
+ epatch "${FILESDIR}"/${P}-umount-user.patch #435540
+ epatch "${FILESDIR}"/${P}-md5-aliasing.patch
+ epatch "${FILESDIR}"/${P}-sfdisk-aliasing.patch
+ 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
+ econf \
+ --enable-fs-paths-extra=/usr/sbin \
+ $(use_enable nls) \
+ --enable-agetty \
+ $(use_enable perl chkdupexe) \
+ $(use_enable cramfs) \
+ $(use_enable ddate) \
+ $(use_enable old-linux elvtune) \
+ --with-ncurses=$(usex ncurses $(usex unicode auto yes) no) \
+ --disable-kill \
+ --disable-last \
+ --disable-login \
+ --disable-mesg \
+ --enable-partx \
+ --enable-raw \
+ --enable-rename \
+ --disable-reset \
+ --enable-schedutils \
+ --disable-su \
+ --disable-wall \
+ --enable-write \
+ $(use_with selinux) \
+ $(use_with slang) \
+ $(use_enable static-libs static) \
+ $(use_with udev) \
+ $(tc-has-tls || echo --disable-tls)
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt}
+
+ # need the libs in /
+ gen_usr_ldscript -a blkid mount uuid
+ # e2fsprogs-libs didnt install .la files, and .pc work fine
+ find "${ED}" -name '*.la' -delete
+
+ if use crypt ; then
+ newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop || die
+ newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop || die
+ fi
+}
+
+pkg_postinst() {
+ elog "The agetty util now clears the terminal by default. You"
+ elog "might want to add --noclear to your /etc/inittab lines."
+}