Fix 'mount -f' adding dups in mtab. Bump rev for security fix to umount (bug #105805).
authorMartin Schlemmer <azarah@gentoo.org>
Wed, 14 Sep 2005 13:45:56 +0000 (13:45 +0000)
committerMartin Schlemmer <azarah@gentoo.org>
Wed, 14 Sep 2005 13:45:56 +0000 (13:45 +0000)
Package-Manager: portage-2.0.52-r1

sys-apps/util-linux/ChangeLog
sys-apps/util-linux/Manifest
sys-apps/util-linux/files/digest-util-linux-2.12q-r3 [new file with mode: 0644]
sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch [new file with mode: 0644]
sys-apps/util-linux/util-linux-2.12q-r3.ebuild [new file with mode: 0644]

index 858b6b92138a6c0019d3be05606d5bf8149c8a4c..6e258190989849e68abbafc34917076a13699d94 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for sys-apps/util-linux
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.114 2005/09/14 13:35:08 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/util-linux/ChangeLog,v 1.115 2005/09/14 13:45:56 azarah Exp $
+
+*util-linux-2.12q-r3 (14 Sep 2005)
+
+  14 Sep 2005; Martin Schlemmer <azarah@gentoo.org>
+  +files/util-linux-2.12q-use-update_mtab-for-fake.patch,
+  +util-linux-2.12q-r3.ebuild:
+  Fix 'mount -f' adding dups in mtab.  Bump rev for security fix to umount
+  (bug #105805).
 
   14 Sep 2005; Martin Schlemmer <azarah@gentoo.org>
   files/util-linux-2.12q-update_mtab-fixes.patch:
index fb32ae03fbda6ec4727e4ea1a08c989f6d80b4e0..90536eb8b1d4b53a0dbc57040f990d4b05574536 100644 (file)
@@ -2,8 +2,9 @@
 Hash: SHA1
 
 MD5 5497e9050dc8cde95a0e015edcd59c81 util-linux-2.12i-r1.ebuild 3960
-MD5 291cd07459b6632241f2d0563827aa07 ChangeLog 19564
+MD5 02317539793f0a59bc0cb3ecb771f183 ChangeLog 19834
 MD5 42a00cdd523f8facea7f10a9f4df86a1 util-linux-2.12q-r2.ebuild 5692
+MD5 e72b31a76aa67a4eeac32f5c609e0143 util-linux-2.12q-r3.ebuild 5816
 MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164
 MD5 40353e338343ed2b6a8f23259c881e49 util-linux-2.12q.ebuild 4785
 MD5 3708f6eda344a2aa0a4d85d49f69dcee files/util-linux-2.12q-update-mtab-when-moving.patch 1036
@@ -16,10 +17,12 @@ MD5 73c0cb6f9aa5fa84e701fc68d0478aac files/util-linux-2.12i-nfsv4.patch 12854
 MD5 7d35ae646b52391076f7a329af8265bc files/util-linux-2.11z-agetty-domainname-option.patch 1810
 MD5 4460875a6ebcf24a7ca5b41ed12f9fe5 files/util-linux-2.12-gcloop.patch 3806
 MD5 33ddd96078cf91030b80f73eb70f5371 files/util-linux-2.12i-swapon-check-symlinks.patch 875
+MD5 a33ff00c09f558d4273360a581880c23 files/digest-util-linux-2.12q-r3 292
 MD5 0be8df03dae23c81a0e929e58a4114e0 files/util-linux-2.11z-01-nfsv4.dif 13442
 MD5 99fa2ff2cb56217b6971e76e275923f9 files/util-linux-2.12q-more-fake-checks-v2.patch 1176
 MD5 d927611f34139a40f1fc9f4162c61f8a files/util-linux-2.12-kernel-2.6.patch 2964
 MD5 a9bc06c292401d6f2d27e8e4ebf7e6ae files/util-linux-2.12i-fat-LABEL-support.patch 2304
+MD5 202b78b99074c7c91faea44d1de6e1bd files/util-linux-2.12q-use-update_mtab-for-fake.patch 546
 MD5 8d4f1146f0699deb1e6872e1c81293e3 files/util-linux-2.12-selinux.diff.bz2 2558
 MD5 bc90959c4718e7dc5d53dcddac1172f5 files/util-linux-2.12q-debian-10cfdisk.patch 1888
 MD5 8a13c61b447c1533df4b919cf2646fea files/util-linux-2.12q-umount-dont-write-mtab-with-remount.patch 467
@@ -40,7 +43,7 @@ MD5 d20405e12353610b3ef8fbc2e1d57f2a files/crypto-loop.initd 1625
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFDKCdm1ZcsMnZjRyIRAjsjAJ4i5o1w/hOLItfLoF1OKqaE9AYNUACfZ3ly
-AgqMOKsD3ZyVt61PXCvCLlU=
-=I0ra
+iD8DBQFDKCnv1ZcsMnZjRyIRAg4iAJ9dUmRNTDLReEL/KkrjZFwny0hJPwCfRzT8
+M4nHn0Z8vU+ZJ6Sibry7bQw=
+=5YrQ
 -----END PGP SIGNATURE-----
diff --git a/sys-apps/util-linux/files/digest-util-linux-2.12q-r3 b/sys-apps/util-linux/files/digest-util-linux-2.12q-r3
new file mode 100644 (file)
index 0000000..408880d
--- /dev/null
@@ -0,0 +1,4 @@
+MD5 004b971441ef89e0b93076c21806cc7d util-linux-2.12q.tar.gz 1992810
+MD5 6e0deccf97db98d2ae751577d019efa4 util-linux-2.12i.tar.gz 1975468
+MD5 dee120b17425e1edf0a0c64f0e249c20 util-linux-2.12i-cryptoapi-losetup.patch.bz2 4800
+MD5 650186003f301362247a7d16f138eb43 loop-AES-v3.0d.tar.bz2 165472
diff --git a/sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch b/sys-apps/util-linux/files/util-linux-2.12q-use-update_mtab-for-fake.patch
new file mode 100644 (file)
index 0000000..5d0b436
--- /dev/null
@@ -0,0 +1,16 @@
+Use update_mtab() to update /etc/mtab on fake mounts (mount -f), else we get
+dup entries in /etc/mtab.
+
+Patch by Mike Frysinger <vapier@gentoo.org>
+
+--- util-linux-2.12q/mount/mount.c     2005-09-14 15:37:43.000000000 +0200
++++ util-linux-2.12q.az/mount/mount.c  2005-09-14 15:27:14.000000000 +0200
+@@ -662,7 +662,7 @@ update_mtab_entry(const char *spec, cons
+               print_one (&mnt);
+ 
+       if (!nomtab && mtab_is_writable()) {
+-              if (flags & MS_REMOUNT)
++              if (fake || (flags & MS_REMOUNT))
+                       update_mtab (mnt.mnt_dir, &mnt);
+               else {
+                       mntFILE *mfp;
diff --git a/sys-apps/util-linux/util-linux-2.12q-r3.ebuild b/sys-apps/util-linux/util-linux-2.12q-r3.ebuild
new file mode 100644 (file)
index 0000000..33bfad9
--- /dev/null
@@ -0,0 +1,179 @@
+# Copyright 1999-2005 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.12q-r3.ebuild,v 1.1 2005/09/14 13:45:56 azarah Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+OLD_CRYPT_VER=2.12i
+LOOP_AES_VER=3.0d
+DESCRIPTION="Various useful Linux utilities"
+HOMEPAGE="http://www.kernel.org/pub/linux/utils/util-linux/"
+SRC_URI="mirror://kernel/linux/utils/${PN}/${P}.tar.gz
+       old-crypt? (
+               mirror://kernel/linux/utils/${PN}/${PN}-${OLD_CRYPT_VER}.tar.gz
+               mirror://gentoo/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch.bz2
+       )
+       crypt? ( http://loop-aes.sourceforge.net/loop-AES/loop-AES-v${LOOP_AES_VER}.tar.bz2 )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="crypt old-crypt nls static pam selinux perl"
+
+RDEPEND=">=sys-libs/ncurses-5.2-r2
+       >=sys-fs/e2fsprogs-1.34
+       selinux? ( sys-libs/libselinux )
+       pam? ( sys-apps/pam-login )
+       crypt? ( app-crypt/hashalot )
+       perl? ( dev-lang/perl )"
+DEPEND="${RDEPEND}
+       nls? ( sys-devel/gettext )
+       virtual/os-headers"
+
+OLD_CRYPT_P=${WORKDIR}/${PN}-${OLD_CRYPT_VER}
+
+yesno() { useq $1 && echo yes || echo no; }
+
+src_unpack() {
+       unpack ${A}
+
+       # Old crypt support
+       if use old-crypt ; then
+               cd "${OLD_CRYPT_P}"
+               ewarn "You should update your system as USE=old-crypt"
+               ewarn "support will be dropped in future versions."
+               epatch "${WORKDIR}"/util-linux-${OLD_CRYPT_VER}-cryptoapi-losetup.patch
+       fi
+
+       cd "${S}"
+
+       # crypto support
+       use crypt && epatch "${WORKDIR}"/loop-AES-v${LOOP_AES_VER}/${P}.diff
+
+       # Fix rare failures with -j4 or higher
+       epatch "${FILESDIR}"/${PN}-2.11z-parallel-make.patch
+
+       # Fix -f usage with -a and in general
+       epatch "${FILESDIR}"/${PN}-2.12q-more-fake-checks-v2.patch
+
+       # Fix mtab updates with `mount --move /foo /bar` #104697
+       epatch "${FILESDIR}"/${PN}-2.12q-update-mtab-when-moving.patch
+
+       # Disable the -r option for non-root users #105805
+       epatch "${FILESDIR}"/${PN}-2.12-only-root-can-remount.patch
+
+       # Respect -n with -r and umount #98675
+       epatch "${FILESDIR}"/${PN}-2.12q-umount-dont-write-mtab-with-remount.patch
+
+       # A few fixes to beat update_mtab() into submission.
+       epatch "${FILESDIR}"/${PN}-2.12q-update_mtab-fixes.patch
+
+       # Use update_mtab() to avoid dups in mtab for 'mount -f'
+       epatch "${FILESDIR}"/${PN}-2.12q-use-update_mtab-for-fake.patch
+
+       # Fix unreadable df output when using devfs ... this check is kind of 
+       # a hack, but whatever, the output isnt critical at all :P
+       [[ -e /dev/.devfsd ]] && epatch "${FILESDIR}"/no-symlink-resolve.patch
+
+       # Add the O option to agetty to display DNS domainname in the issue
+       # file, thanks to Marius Mauch <genone@genone.de>, bug #22275.
+       #
+       # NOTE:  Removing this will break future baselayout, so PLEASE
+       #        consult with me before doing so.
+       epatch "${FILESDIR}"/${PN}-2.11z-agetty-domainname-option.patch
+
+       # Fix french translation typo #75693
+       epatch "${FILESDIR}"/${P}-i18n-update.patch
+
+       # Add NFS4 support (kernel 2.5/2.6)
+       epatch "${FILESDIR}"/${PN}-2.12i-nfsv4.patch
+
+       # ignore managed/kudzu options #70873
+       epatch "${FILESDIR}"/${PN}-2.12i-ignore-managed.patch
+
+       # Allow util-linux to be built with -fPIC
+       # XXX: this needs to be punted as the error is in the
+       #      syscall macro which is part of linux-headers
+       epatch "${FILESDIR}"/${PN}-2.12i-pic.patch
+
+       # swapon gets confused by symlinks in /dev #69162
+       epatch "${FILESDIR}"/${PN}-2.12p-swapon-check-symlinks.patch
+
+       # fix simple buffer overflow (from Debian)
+       epatch "${FILESDIR}"/${PN}-2.12q-debian-10cfdisk.patch
+
+       # don't build fdisk on m68k
+       epatch "${FILESDIR}"/${PN}-2.12q-no-m68k-fdisk.patch
+
+       # don't force umask to 022 #93671
+       epatch "${FILESDIR}"/${PN}-2.12q-dont-umask.patch
+
+       # Enable random features
+       local mconfigs="MCONFIG"
+       use old-crypt && mconfigs="${mconfigs} ${OLD_CRYPT_P}/MCONFIG"
+       sed -i \
+               -e "/^HAVE_PAM=/s:no:$(yesno pam):" \
+               -e "/^HAVE_SELINUX=/s:no:$(yesno selinux):" \
+               -e "/^DISABLE_NLS=/s:no:$(yesno !nls):" \
+               -e "/^HAVE_KILL=/s:no:yes:" \
+               -e "/^HAVE_SLN=/s:no:yes:" \
+               -e "/^HAVE_TSORT/s:no:yes:" \
+               -e "s:-pipe -O2 \$(CPUOPT) -fomit-frame-pointer:${CFLAGS}:" \
+               -e "s:CPU=.*:CPU=${CHOST%%-*}:" \
+               -e "s:SUIDMODE=.*4755:SUIDMODE=4711:" \
+               ${mconfigs} || die "MCONFIG sed"
+}
+
+src_compile() {
+       append-ldflags -Wl,-z,now
+       use static && append-ldflags -static
+       export CC="$(tc-getCC)"
+
+       econf || die "configure failed"
+       emake || die "emake failed"
+
+       cd partx
+       has_version '>=sys-kernel/linux-headers-2.6' && append-flags -include linux/compiler.h
+       emake CFLAGS="${CFLAGS}" || die "make partx failed"
+
+       if use old-crypt ; then
+               cd "${OLD_CRYPT_P}"
+               econf || die "old configure failed"
+               emake -C lib || die "old lib failed"
+               emake -C mount losetup mount || die "old make failed"
+       fi
+}
+
+src_install() {
+       make install DESTDIR="${D}" || die "install failed"
+       dosym ../man8/agetty.8 /usr/share/man/man1/getty.1
+       dosbin partx/{addpart,delpart,partx} || die "dosbin"
+       use perl || rm -f "${D}"/usr/bin/chkdupexe
+
+       newinitd "${FILESDIR}"/crypto-loop.initd crypto-loop
+       newconfd "${FILESDIR}"/crypto-loop.confd crypto-loop
+
+       # man-pages installs renice(1p) but util-linux does renice(8)
+       dosym ../man8/renice.8 /usr/share/man/man1/renice.1
+
+       dodoc HISTORY MAINTAINER README VERSION
+       docinto examples
+       dodoc example.files/*
+
+       if use old-crypt ; then
+               cd "${OLD_CRYPT_P}"/mount
+               into /
+               newsbin mount mount-old-crypt || die
+               newsbin losetup losetup-old-crypt || die
+       fi
+}
+
+pkg_postinst() {
+       if ! use old-crypt ; then
+               ewarn "This version of util-linux includes crypto support"
+               ewarn "for loop-aes instead of the old cryptoapi."
+               ewarn "If you need the older support, please re-emerge"
+               ewarn "util-linux with USE=old-crypt.  This will create"
+               ewarn "/sbin/mount-old-crypt and /sbin/losetup-old-crypt."
+       fi
+}