diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-06-20 06:24:27 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2014-06-20 06:24:27 +0000 |
commit | 2a039f9f261d2876e3247d4c154f51bfd9299b45 (patch) | |
tree | 149b3efb6083946ebbcad3de85e43788b81e61ff | |
parent | Drop rpc_pipefs creation as the rpc.pipefs.initd takes care of it. Switch to ... (diff) | |
download | gentoo-2-2a039f9f261d2876e3247d4c154f51bfd9299b45.tar.gz gentoo-2-2a039f9f261d2876e3247d4c154f51bfd9299b45.tar.bz2 gentoo-2-2a039f9f261d2876e3247d4c154f51bfd9299b45.zip |
Version bump #506760 by Nenad Peric. Run keepdir on /etc/exports.d #470102 by Alon Bar-Lev.
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
-rw-r--r-- | net-fs/nfs-utils/ChangeLog | 9 | ||||
-rw-r--r-- | net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch | 62 | ||||
-rw-r--r-- | net-fs/nfs-utils/nfs-utils-1.3.0.ebuild | 153 |
3 files changed, 223 insertions, 1 deletions
diff --git a/net-fs/nfs-utils/ChangeLog b/net-fs/nfs-utils/ChangeLog index 57b1f2c22dea..e9fb5fbb3dc1 100644 --- a/net-fs/nfs-utils/ChangeLog +++ b/net-fs/nfs-utils/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-fs/nfs-utils # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.246 2014/06/20 06:21:22 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.247 2014/06/20 06:24:27 vapier Exp $ + +*nfs-utils-1.3.0 (20 Jun 2014) + + 20 Jun 2014; Mike Frysinger <vapier@gentoo.org> + +files/nfs-utils-1.3.0-gcc-4.9.patch, +nfs-utils-1.3.0.ebuild: + Version bump #506760 by Nenad Peric. Run keepdir on /etc/exports.d #470102 by + Alon Bar-Lev. 20 Jun 2014; Mike Frysinger <vapier@gentoo.org> files/nfs.initd: Drop rpc_pipefs creation as the rpc.pipefs.initd takes care of it. diff --git a/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch b/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch new file mode 100644 index 000000000000..e2d98b517e32 --- /dev/null +++ b/net-fs/nfs-utils/files/nfs-utils-1.3.0-gcc-4.9.patch @@ -0,0 +1,62 @@ +From 25e83c2270b2d2966c992885faed0b79be09f474 Mon Sep 17 00:00:00 2001 +From: Jeff Layton <jlayton@poochiereds.net> +Date: Thu, 1 May 2014 11:15:16 -0400 +Subject: [PATCH [nfs-utils]] mountd: fix segfault in add_name with newer gcc + compilers + +I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some +NULL pointer checks got reordered such that a pointer was dereferenced +before checking to see whether it was NULL. The problem was due to +nfs-utils relying on undefined behavior, which tricked gcc into assuming +that the pointer would never be NULL. + +At first I assumed that this was a compiler bug, but Jakub Jelinek and +Jeff Law pointed out: + +"If old is NULL, then: + + strncpy(new, old, cp-old); + +is undefined behavior (even when cp == old == NULL in that case), +therefore gcc assumes that old is never NULL, as otherwise it would be +invalid. + +Just guard + strncpy(new, old, cp-old); + new[cp-old] = 0; +with if (old) { ... }." + +This patch does that. If old is NULL though, then we still need to +ensure that new is NULL terminated, lest the subsequent strcats walk off +the end of it. + +Cc: Jeff Law <law@redhat.com> +Cc: Jakub Jelinek <jakub@redhat.com> +Signed-off-by: Jeff Layton <jlayton@poochiereds.net> +Signed-off-by: Steve Dickson <steved@redhat.com> +--- + support/export/client.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/support/export/client.c b/support/export/client.c +index dbf47b9..f85e11c 100644 +--- a/support/export/client.c ++++ b/support/export/client.c +@@ -482,8 +482,12 @@ add_name(char *old, const char *add) + else + cp = cp + strlen(cp); + } +- strncpy(new, old, cp-old); +- new[cp-old] = 0; ++ if (old) { ++ strncpy(new, old, cp-old); ++ new[cp-old] = 0; ++ } else { ++ new[0] = 0; ++ } + if (cp != old && !*cp) + strcat(new, ","); + strcat(new, add); +-- +2.0.0 + diff --git a/net-fs/nfs-utils/nfs-utils-1.3.0.ebuild b/net-fs/nfs-utils/nfs-utils-1.3.0.ebuild new file mode 100644 index 000000000000..836d676ade2c --- /dev/null +++ b/net-fs/nfs-utils/nfs-utils-1.3.0.ebuild @@ -0,0 +1,153 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/nfs-utils-1.3.0.ebuild,v 1.1 2014/06/20 06:24:27 vapier Exp $ + +EAPI="4" + +inherit eutils flag-o-matic multilib autotools systemd + +DESCRIPTION="NFS client and server daemons" +HOMEPAGE="http://linux-nfs.org/" +SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="caps ipv6 kerberos +libmount nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid" +REQUIRED_USE="kerberos? ( nfsv4 )" +RESTRICT="test" #315573 + +# kth-krb doesn't provide the right include +# files, and nfs-utils doesn't build against heimdal either, +# so don't depend on virtual/krb. +# (04 Feb 2005 agriffis) +DEPEND_COMMON="tcpd? ( sys-apps/tcp-wrappers ) + caps? ( sys-libs/libcap ) + sys-libs/e2fsprogs-libs + >=net-nds/rpcbind-0.2.0-r1 + net-libs/libtirpc + libmount? ( sys-apps/util-linux ) + nfsdcld? ( >=dev-db/sqlite-3.3 ) + nfsv4? ( + >=dev-libs/libevent-1.0b + >=net-libs/libnfsidmap-0.21-r1 + kerberos? ( + >=net-libs/libtirpc-0.2.4-r1[kerberos] + app-crypt/mit-krb5 + ) + nfsidmap? ( + >=net-libs/libnfsidmap-0.24 + >=sys-apps/keyutils-1.5.9 + ) + ) + nfsv41? ( + sys-fs/lvm2 + ) + selinux? ( + sec-policy/selinux-rpc + sec-policy/selinux-rpcbind + ) + uuid? ( sys-apps/util-linux )" +RDEPEND="${DEPEND_COMMON} !net-nds/portmap" +DEPEND="${DEPEND_COMMON} + virtual/pkgconfig" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-1.1.4-mtab-sym.patch + epatch "${FILESDIR}"/${PN}-1.2.8-cross-build.patch + epatch "${FILESDIR}"/${PN}-1.3.0-gcc-4.9.patch + + sed \ + -e "/^sbindir/s:= := \"${EPREFIX}\":g" \ + -i utils/*/Makefile.am || die + + eautoreconf +} + +src_configure() { + export libsqlite3_cv_is_recent=yes # Our DEPEND forces this. + export ac_cv_header_keyutils_h=$(usex nfsidmap) + econf \ + --with-statedir="${EPREFIX}"/var/lib/nfs \ + --enable-tirpc \ + --with-tirpcinclude="${EPREFIX}"/usr/include/tirpc/ \ + $(use_enable libmount libmount-mount) \ + $(use_with tcpd tcp-wrappers) \ + $(use_enable nfsdcld nfsdcltrack) \ + $(use_enable nfsv4) \ + $(use_enable nfsv41) \ + $(use_enable ipv6) \ + $(use_enable caps) \ + $(use_enable uuid) \ + $(use_enable kerberos gss) \ + --without-gssglue +} + +src_compile(){ + # remove compiled files bundled in the tarball + emake clean + default +} + +src_install() { + default + rm linux-nfs/Makefile* || die + dodoc -r linux-nfs README + + # Don't overwrite existing xtab/etab, install the original + # versions somewhere safe... more info in pkg_postinst + keepdir /var/lib/nfs/{,sm,sm.bak} + mv "${ED}"/var/lib "${ED}"/usr/$(get_libdir) || die + + # Install some client-side binaries in /sbin + dodir /sbin + mv "${ED}"/usr/sbin/rpc.statd "${ED}"/sbin/ || die + + if use nfsv4 && use nfsidmap ; then + # Install a config file for idmappers in newer kernels. #415625 + insinto /etc/request-key.d + echo 'create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d' > id_resolver.conf + doins id_resolver.conf + fi + + insinto /etc + doins "${FILESDIR}"/exports + keepdir /etc/exports.d + + local f list=() opt_need="" + if use nfsv4 ; then + opt_need="rpc.idmapd" + list+=( rpc.idmapd rpc.pipefs ) + use kerberos && list+=( rpc.gssd rpc.svcgssd ) + fi + for f in nfs nfsmount rpc.statd "${list[@]}" ; do + newinitd "${FILESDIR}"/${f}.initd ${f} + done + for f in nfs nfsmount ; do + newconfd "${FILESDIR}"/${f}.confd ${f} + done + sed -i \ + -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \ + "${ED}"/etc/conf.d/nfs || die #234132 + + systemd_dounit systemd/*.{mount,service,target} + if ! use nfsv4 || ! use kerberos ; then + rm "${D}$(systemd_get_unitdir)"/rpc-{gssd,svcgssd}.service || die + fi + sed -i \ + -e "/^EnvironmentFile=/s:=.*:=${EPREFIX}/etc/conf.d/nfs:" \ + "${D}$(systemd_get_unitdir)"/* || die +} + +pkg_postinst() { + # Install default xtab and friends if there's none existing. In + # src_install we put them in /usr/lib/nfs for safe-keeping, but + # the daemons actually use the files in /var/lib/nfs. #30486 + local f + mkdir -p "${EROOT}"/var/lib/nfs #368505 + for f in "${EROOT}"/usr/$(get_libdir)/nfs/*; do + [[ -e ${EROOT}/var/lib/nfs/${f##*/} ]] && continue + einfo "Copying default ${f##*/} from ${EPREFIX}/usr/$(get_libdir)/nfs to ${EPREFIX}/var/lib/nfs" + cp -pPR "${f}" "${EROOT}"/var/lib/nfs/ + done +} |