summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harder <radhermit@gentoo.org>2013-07-26 00:31:38 +0000
committerTim Harder <radhermit@gentoo.org>2013-07-26 00:31:38 +0000
commit15f20350042980f6d579b172a652409f87ad8515 (patch)
tree760e134e3b7f756dee8ec6fc8c7b213251534e5a /net-fs/nfs-utils
parentRemove old. (diff)
downloadgentoo-2-15f20350042980f6d579b172a652409f87ad8515.tar.gz
gentoo-2-15f20350042980f6d579b172a652409f87ad8515.tar.bz2
gentoo-2-15f20350042980f6d579b172a652409f87ad8515.zip
Version bump.
(Portage version: 2.2.0_alpha188/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
Diffstat (limited to 'net-fs/nfs-utils')
-rw-r--r--net-fs/nfs-utils/ChangeLog10
-rw-r--r--net-fs/nfs-utils/files/0001-mountd-Fix-is_subdirectory-again.patch81
-rw-r--r--net-fs/nfs-utils/files/0001-statd-exit-if-a-statd-is-already-running.patch126
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch48
-rw-r--r--net-fs/nfs-utils/nfs-utils-1.2.8.ebuild134
5 files changed, 398 insertions, 1 deletions
diff --git a/net-fs/nfs-utils/ChangeLog b/net-fs/nfs-utils/ChangeLog
index 6aa307922c78..efeb74dc9272 100644
--- a/net-fs/nfs-utils/ChangeLog
+++ b/net-fs/nfs-utils/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for net-fs/nfs-utils
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.216 2013/07/13 12:05:51 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-fs/nfs-utils/ChangeLog,v 1.217 2013/07/26 00:31:37 radhermit Exp $
+
+*nfs-utils-1.2.8 (26 Jul 2013)
+
+ 26 Jul 2013; Tim Harder <radhermit@gentoo.org> +nfs-utils-1.2.8.ebuild,
+ +files/0001-mountd-Fix-is_subdirectory-again.patch,
+ +files/nfs-utils-1.2.8-cross-build.patch,
+ +files/0001-statd-exit-if-a-statd-is-already-running.patch:
+ Version bump.
13 Jul 2013; Pacho Ramos <pacho@gentoo.org> +files/nfsd.service,
+files/rpc-mountd.service, +files/rpc-statd.service, nfs-utils-1.2.7.ebuild:
diff --git a/net-fs/nfs-utils/files/0001-mountd-Fix-is_subdirectory-again.patch b/net-fs/nfs-utils/files/0001-mountd-Fix-is_subdirectory-again.patch
new file mode 100644
index 000000000000..e6f372b75850
--- /dev/null
+++ b/net-fs/nfs-utils/files/0001-mountd-Fix-is_subdirectory-again.patch
@@ -0,0 +1,81 @@
+From 23d3980b6cfea4e9056d9b7b81e48b4fefc645e0 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Tue, 7 May 2013 11:46:18 -0400
+Subject: [PATCH] mountd: Fix is_subdirectory again
+
+The problem was that is_subdirectory() would also succeed if the two
+directories were the same. This is needed for path_matches() which
+needs to see if the child is same-or-descendant.
+
+So this patch rearranges path_matches() to do the "are they the same"
+test itself and only bother with is_subdirectory() if it they are not
+the same.
+
+So now is_subdirectory() can be strict, and so can be usable for
+subexport(), which needs a strong 'in subdirectory - not the same' test.
+
+Acked-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ utils/mountd/cache.c | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
+index 737927c..517aa62 100644
+--- a/utils/mountd/cache.c
++++ b/utils/mountd/cache.c
+@@ -347,20 +347,26 @@ static char *next_mnt(void **v, char *p)
+
+ static int is_subdirectory(char *child, char *parent)
+ {
++ /* Check is child is strictly a subdirectory of
++ * parent or a more distant descendant.
++ */
+ size_t l = strlen(parent);
+
+- if (strcmp(parent, "/") == 0)
++ if (strcmp(parent, "/") == 0 && child[1] != 0)
+ return 1;
+
+- return strcmp(child, parent) == 0
+- || (strncmp(child, parent, l) == 0 && child[l] == '/');
++ return (strncmp(child, parent, l) == 0 && child[l] == '/');
+ }
+
+ static int path_matches(nfs_export *exp, char *path)
+ {
+- if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT)
+- return is_subdirectory(path, exp->m_export.e_path);
+- return strcmp(path, exp->m_export.e_path) == 0;
++ /* Does the path match the export? I.e. is it an
++ * exact match, or does the export have CROSSMOUNT, and path
++ * is a descendant?
++ */
++ return strcmp(path, exp->m_export.e_path) == 0
++ || ((exp->m_export.e_flags & NFSEXP_CROSSMOUNT)
++ && is_subdirectory(path, exp->m_export.e_path));
+ }
+
+ static int
+@@ -369,15 +375,13 @@ export_matches(nfs_export *exp, char *dom, char *path, struct addrinfo *ai)
+ return path_matches(exp, path) && client_matches(exp, dom, ai);
+ }
+
+-/* True iff e1 is a child of e2 and e2 has crossmnt set: */
++/* True iff e1 is a child of e2 (or descendant) and e2 has crossmnt set: */
+ static bool subexport(struct exportent *e1, struct exportent *e2)
+ {
+ char *p1 = e1->e_path, *p2 = e2->e_path;
+- size_t l2 = strlen(p2);
+
+ return e2->e_flags & NFSEXP_CROSSMOUNT
+- && strncmp(p1, p2, l2) == 0
+- && p1[l2] == '/';
++ && is_subdirectory(p1, p2);
+ }
+
+ struct parsed_fsid {
+--
+1.8.3.2
+
diff --git a/net-fs/nfs-utils/files/0001-statd-exit-if-a-statd-is-already-running.patch b/net-fs/nfs-utils/files/0001-statd-exit-if-a-statd-is-already-running.patch
new file mode 100644
index 000000000000..4e8be2fd43eb
--- /dev/null
+++ b/net-fs/nfs-utils/files/0001-statd-exit-if-a-statd-is-already-running.patch
@@ -0,0 +1,126 @@
+From 342446a4a624d4ee8254af859bb7f1de6d268679 Mon Sep 17 00:00:00 2001
+From: Weston Andros Adamson <dros@netapp.com>
+Date: Tue, 7 May 2013 11:25:29 -0400
+Subject: [PATCH] statd: exit if a statd is already running
+
+Moves nfs_probe_statd from mount to nfs support lib to share with statd.
+
+Acked-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Weston Andros Adamson <dros@netapp.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ support/include/nfsrpc.h | 5 +++++
+ support/nfs/getport.c | 22 ++++++++++++++++++++++
+ utils/mount/network.c | 17 -----------------
+ utils/statd/statd.c | 7 +++++++
+ 4 files changed, 34 insertions(+), 17 deletions(-)
+
+diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h
+index a0b80e1..1bfae7a 100644
+--- a/support/include/nfsrpc.h
++++ b/support/include/nfsrpc.h
+@@ -156,6 +156,11 @@ extern unsigned long nfs_pmap_getport(const struct sockaddr_in *,
+ const struct timeval *);
+
+ /*
++ * Use nfs_pmap_getport to see if statd is running locally
++ */
++extern int nfs_probe_statd(void);
++
++/*
+ * Contact a remote RPC service to discover whether it is responding
+ * to requests.
+ */
+diff --git a/support/nfs/getport.c b/support/nfs/getport.c
+index 3331ad4..081594c 100644
+--- a/support/nfs/getport.c
++++ b/support/nfs/getport.c
+@@ -1102,3 +1102,25 @@ unsigned long nfs_pmap_getport(const struct sockaddr_in *sin,
+
+ return port;
+ }
++
++static const char *nfs_ns_pgmtbl[] = {
++ "status",
++ NULL,
++};
++
++/*
++ * nfs_probe_statd - use nfs_pmap_getport to see if statd is running locally
++ *
++ * Returns non-zero if statd is running locally.
++ */
++int nfs_probe_statd(void)
++{
++ struct sockaddr_in addr = {
++ .sin_family = AF_INET,
++ .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
++ };
++ rpcprog_t program = nfs_getrpcbyname(NSMPROG, nfs_ns_pgmtbl);
++
++ return nfs_getport_ping((struct sockaddr *)(char *)&addr, sizeof(addr),
++ program, (rpcvers_t)1, IPPROTO_UDP);
++}
+diff --git a/utils/mount/network.c b/utils/mount/network.c
+index 4be48cd..e2cdcaf 100644
+--- a/utils/mount/network.c
++++ b/utils/mount/network.c
+@@ -65,11 +65,6 @@ extern int nfs_mount_data_version;
+ extern char *progname;
+ extern int verbose;
+
+-static const char *nfs_ns_pgmtbl[] = {
+- "status",
+- NULL,
+-};
+-
+ static const char *nfs_mnt_pgmtbl[] = {
+ "mount",
+ "mountd",
+@@ -761,18 +756,6 @@ int probe_bothports(clnt_addr_t *mnt_server, clnt_addr_t *nfs_server)
+ &nfs_server->pmap);
+ }
+
+-static int nfs_probe_statd(void)
+-{
+- struct sockaddr_in addr = {
+- .sin_family = AF_INET,
+- .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
+- };
+- rpcprog_t program = nfs_getrpcbyname(NSMPROG, nfs_ns_pgmtbl);
+-
+- return nfs_getport_ping(SAFE_SOCKADDR(&addr), sizeof(addr),
+- program, (rpcvers_t)1, IPPROTO_UDP);
+-}
+-
+ /**
+ * start_statd - attempt to start rpc.statd
+ *
+diff --git a/utils/statd/statd.c b/utils/statd/statd.c
+index 652546c..8c51bcc 100644
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -28,6 +28,7 @@
+
+ #include "statd.h"
+ #include "nfslib.h"
++#include "nfsrpc.h"
+ #include "nsm.h"
+
+ /* Socket operations */
+@@ -237,6 +238,12 @@ int main (int argc, char **argv)
+ /* Set hostname */
+ MY_NAME = NULL;
+
++ /* Refuse to start if another statd is running */
++ if (nfs_probe_statd()) {
++ fprintf(stderr, "Statd service already running!\n");
++ exit(1);
++ }
++
+ /* Process command line switches */
+ while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:L", longopts, NULL)) != EOF) {
+ switch (arg) {
+--
+1.8.3.2
+
diff --git a/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch b/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch
new file mode 100644
index 000000000000..7317115a0e18
--- /dev/null
+++ b/net-fs/nfs-utils/files/nfs-utils-1.2.8-cross-build.patch
@@ -0,0 +1,48 @@
+this is kind of hacky, but automake doesn't make this easy
+for us atm, so hack away :(
+
+(recent autotools will always add $(CFLAGS)/etc... to the compile)
+
+--- a/tools/locktest/Makefile.am
++++ b/tools/locktest/Makefile.am
+@@ -1,12 +1,11 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = testlk
+ testlk_SOURCES = testlk.c
+-testlk_CFLAGS=$(CFLAGS_FOR_BUILD)
+-testlk_CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
+-testlk_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ MAINTAINERCLEANFILES = Makefile.in
+--- a/tools/rpcgen/Makefile.am
++++ b/tools/rpcgen/Makefile.am
+@@ -1,7 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+
+ CC=$(CC_FOR_BUILD)
+-LIBTOOL = @LIBTOOL@ --tag=CC
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
+
+ noinst_PROGRAMS = rpcgen
+ rpcgen_SOURCES = rpc_clntout.c rpc_cout.c rpc_hout.c rpc_main.c \
+@@ -9,10 +11,6 @@
+ rpc_util.c rpc_sample.c rpc_output.h rpc_parse.h \
+ rpc_scan.h rpc_util.h
+
+-rpcgen_CFLAGS=$(CFLAGS_FOR_BUILD)
+-rpcgen_CPPLAGS=$(CPPFLAGS_FOR_BUILD)
+-rpcgen_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+-rpcgen_LDADD=$(LIBTIRPC)
+
+ MAINTAINERCLEANFILES = Makefile.in
+
+ EXTRA_DIST = rpcgen.new.1
diff --git a/net-fs/nfs-utils/nfs-utils-1.2.8.ebuild b/net-fs/nfs-utils/nfs-utils-1.2.8.ebuild
new file mode 100644
index 000000000000..592bcc4f0315
--- /dev/null
+++ b/net-fs/nfs-utils/nfs-utils-1.2.8.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2013 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.2.8.ebuild,v 1.1 2013/07/26 00:31:37 radhermit 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 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="caps ipv6 kerberos nfsdcld +nfsidmap +nfsv4 nfsv41 selinux tcpd +uuid"
+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
+ net-libs/libtirpc
+ nfsdcld? ( >=dev-db/sqlite-3.3 )
+ nfsv4? (
+ >=dev-libs/libevent-1.0b
+ >=net-libs/libnfsidmap-0.21-r1
+ kerberos? (
+ net-libs/librpcsecgss
+ >=net-libs/libgssglue-0.3
+ net-libs/libtirpc[kerberos]
+ app-crypt/mit-krb5
+ )
+ nfsidmap? (
+ >=net-libs/libnfsidmap-0.24
+ sys-apps/keyutils
+ )
+ )
+ 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}"/0001-statd-exit-if-a-statd-is-already-running.patch
+ epatch "${FILESDIR}"/0001-mountd-Fix-is_subdirectory-again.patch
+ eautoreconf
+}
+
+src_configure() {
+ export libsqlite3_cv_is_recent=yes # Our DEPEND forces this.
+ export ac_cv_header_keyutils_h=$(usex nfsidmap)
+ econf \
+ --with-statedir=/var/lib/nfs \
+ --enable-tirpc \
+ $(use_with tcpd tcp-wrappers) \
+ $(use_enable nfsdcld nfsdcltrack) \
+ $(use_enable nfsv4) \
+ $(use_enable nfsv41) \
+ $(use_enable ipv6) \
+ $(use_enable caps) \
+ $(use_enable uuid) \
+ $(usex nfsv4 "$(use_enable kerberos gss)" "--disable-gss")
+}
+
+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
+
+ 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 "${FILESDIR}"/nfsd.service
+ systemd_dounit "${FILESDIR}"/rpc-statd.service
+ systemd_dounit "${FILESDIR}"/rpc-mountd.service
+}
+
+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 "${ROOT}"/var/lib/nfs #368505
+ for f in "${ROOT}"/usr/$(get_libdir)/nfs/*; do
+ [[ -e ${ROOT}/var/lib/nfs/${f##*/} ]] && continue
+ einfo "Copying default ${f##*/} from /usr/$(get_libdir)/nfs to /var/lib/nfs"
+ cp -pPR "${f}" "${ROOT}"/var/lib/nfs/
+ done
+}