aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net-fs/nfs-utils/Manifest1
-rw-r--r--net-fs/nfs-utils/files/exports1
-rw-r--r--net-fs/nfs-utils/files/musl-getservbyport.patch18
-rw-r--r--net-fs/nfs-utils/files/musl-svcgssd-sysconf.patch144
-rw-r--r--net-fs/nfs-utils/files/musl-time64.patch51
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch115
-rw-r--r--net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch68
-rw-r--r--net-fs/nfs-utils/files/nfs.confd38
-rw-r--r--net-fs/nfs-utils/files/nfs.initd156
-rw-r--r--net-fs/nfs-utils/files/nfsclient.confd18
-rw-r--r--net-fs/nfs-utils/files/nfsclient.initd33
-rw-r--r--net-fs/nfs-utils/files/nfsmount.initd-1.3.126
-rw-r--r--net-fs/nfs-utils/files/rpc.gssd.initd23
-rw-r--r--net-fs/nfs-utils/files/rpc.idmapd.initd25
-rw-r--r--net-fs/nfs-utils/files/rpc.pipefs.initd32
-rw-r--r--net-fs/nfs-utils/files/rpc.statd.initd32
-rw-r--r--net-fs/nfs-utils/files/rpc.svcgssd.initd23
-rw-r--r--net-fs/nfs-utils/metadata.xml21
-rw-r--r--net-fs/nfs-utils/nfs-utils-2.5.3-r2.ebuild213
19 files changed, 0 insertions, 1038 deletions
diff --git a/net-fs/nfs-utils/Manifest b/net-fs/nfs-utils/Manifest
deleted file mode 100644
index 0ae2ec8e..00000000
--- a/net-fs/nfs-utils/Manifest
+++ /dev/null
@@ -1 +0,0 @@
-DIST nfs-utils-2.5.3.tar.bz2 937544 BLAKE2B 817af2c302cf110519e64353a507645137ffd3b93b46eb94e71d45a1869c9e831e344f0baa33b1b39514962798cca542cf56a2830520c67e96e78995f2bf901f SHA512 3be82f42c5da2bbbca4429459c858c58ae7333725749213c824d0c01b78f0beb7384455f314fc1cc1799968f9f40fd616297c7baf3514ca0e31d4686e9d6e732
diff --git a/net-fs/nfs-utils/files/exports b/net-fs/nfs-utils/files/exports
deleted file mode 100644
index 5102ef27..00000000
--- a/net-fs/nfs-utils/files/exports
+++ /dev/null
@@ -1 +0,0 @@
-# /etc/exports: NFS file systems being exported. See exports(5).
diff --git a/net-fs/nfs-utils/files/musl-getservbyport.patch b/net-fs/nfs-utils/files/musl-getservbyport.patch
deleted file mode 100644
index 6fa589c7..00000000
--- a/net-fs/nfs-utils/files/musl-getservbyport.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Musl will always return something with getservbyport so we cannot skip
-ports that returns non-null.
-
-diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
-index fd576d9..d72a0bf 100644
---- a/utils/statd/rmtcall.c
-+++ b/utils/statd/rmtcall.c
-@@ -93,8 +93,10 @@
- __func__);
- break;
- }
-+#if 0
- se = getservbyport(sin.sin_port, "udp");
- if (se == NULL)
-+#endif
- break;
-
- if (retries == MAX_BRP_RETRIES) {
diff --git a/net-fs/nfs-utils/files/musl-svcgssd-sysconf.patch b/net-fs/nfs-utils/files/musl-svcgssd-sysconf.patch
deleted file mode 100644
index ec280cca..00000000
--- a/net-fs/nfs-utils/files/musl-svcgssd-sysconf.patch
+++ /dev/null
@@ -1,144 +0,0 @@
---- a/support/nfsidmap/libnfsidmap.c
-+++ b/support/nfsidmap/libnfsidmap.c
-@@ -432,11 +432,17 @@ int nfs4_init_name_mapping(char *conffil
-
- nobody_user = conf_get_str("Mapping", "Nobody-User");
- if (nobody_user) {
-- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETPW_R_SIZE_MAX*/
- struct passwd *buf;
- struct passwd *pw = NULL;
- int err;
-
-+ /*sysconf can return -1 when _SC_GETPW_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead
-+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- buf = malloc(sizeof(*buf) + buflen);
- if (buf) {
- err = getpwnam_r(nobody_user, buf, ((char *)buf) + sizeof(*buf), buflen, &pw);
-@@ -453,11 +459,17 @@ int nfs4_init_name_mapping(char *conffil
-
- nobody_group = conf_get_str("Mapping", "Nobody-Group");
- if (nobody_group) {
-- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ size_t buflen = 1024; /*value on my gentoo glibc system that has _SC_GETGR_R_SIZE_MAX*/
- struct group *buf;
- struct group *gr = NULL;
- int err;
-
-+ /*sysconf can return -1 when _SC_GETGR_R_SIZE_MAX is not defined, like on musl systems, if cast to size_t this will lead
-+ to an integer overflow, which leads to a buffer overflow and crashes svcgssd */
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- buf = malloc(sizeof(*buf) + buflen);
- if (buf) {
- err = getgrnam_r(nobody_group, buf, ((char *)buf) + sizeof(*buf), buflen, &gr);
---- a/support/nfsidmap/static.c
-+++ b/support/nfsidmap/static.c
-@@ -98,10 +98,14 @@ static struct passwd *static_getpwnam(co
- {
- struct passwd *pw;
- struct pwbuf *buf;
-- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ size_t buflen = 1024;
- char *localname;
- int err;
-
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- buf = malloc(sizeof(*buf) + buflen);
- if (!buf) {
- err = ENOMEM;
-@@ -149,10 +153,14 @@ static struct group *static_getgrnam(con
- {
- struct group *gr;
- struct grbuf *buf;
-- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ size_t buflen = 1024;
- char *localgroup;
- int err;
-
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- buf = malloc(sizeof(*buf) + buflen);
- if (!buf) {
- err = ENOMEM;
---- a/support/nfsidmap/nss.c
-+++ b/support/nfsidmap/nss.c
-@@ -91,9 +91,13 @@ static int nss_uid_to_name(uid_t uid, ch
- struct passwd *pw = NULL;
- struct passwd pwbuf;
- char *buf;
-- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ size_t buflen = 1024;
- int err = -ENOMEM;
-
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- buf = malloc(buflen);
- if (!buf)
- goto out;
-@@ -119,9 +123,13 @@ static int nss_gid_to_name(gid_t gid, ch
- struct group *gr = NULL;
- struct group grbuf;
- char *buf;
-- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ size_t buflen = 1024;
- int err;
-
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-+
- if (domain == NULL)
- domain = get_default_domain();
-
-@@ -192,12 +200,13 @@ static struct passwd *nss_getpwnam(const
- {
- struct passwd *pw;
- struct pwbuf *buf;
-- size_t buflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETPW_R_SIZE_MAX);
-+ size_t buflen = 1024;
- char *localname;
- int err = ENOMEM;
-
-- if (buflen > UINT_MAX)
-- goto err;
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-
- buf = malloc(sizeof(*buf) + buflen);
- if (buf == NULL)
-@@ -301,7 +310,8 @@ static int _nss_name_to_gid(char *name,
- struct group *gr = NULL;
- struct group grbuf;
- char *buf, *domain;
-- size_t buflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ long scbuflen = sysconf(_SC_GETGR_R_SIZE_MAX);
-+ size_t buflen = 1024;
- int err = -EINVAL;
- char *localname = NULL;
- char *ref_name = NULL;
-@@ -327,8 +337,8 @@ static int _nss_name_to_gid(char *name,
- }
-
- err = -ENOMEM;
-- if (buflen > UINT_MAX)
-- goto out_name;
-+ if (scbuflen > 0)
-+ buflen = (size_t)scbuflen;
-
- do {
- buf = malloc(buflen);
diff --git a/net-fs/nfs-utils/files/musl-time64.patch b/net-fs/nfs-utils/files/musl-time64.patch
deleted file mode 100644
index 62a1d1e1..00000000
--- a/net-fs/nfs-utils/files/musl-time64.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
-index b45a904..6b1049f 100644
---- a/utils/nfsdcltrack/nfsdcltrack.c
-+++ b/utils/nfsdcltrack/nfsdcltrack.c
-@@ -25,9 +25,11 @@
-
- #include <stdio.h>
- #include <stdlib.h>
--#include <ctype.h>
- #include <errno.h>
- #include <stdbool.h>
-+#include <stdint.h>
-+#include <inttypes.h>
-+#include <ctype.h>
- #include <getopt.h>
- #include <string.h>
- #include <sys/stat.h>
-@@ -525,7 +527,8 @@ cltrack_gracedone(const char *timestr)
- if (*tail)
- return -EINVAL;
-
-- xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
-+ xlog(D_GENERAL, "%s: grace done. gracetime=%" PRId64, __func__,
-+ (int64_t)gracetime);
-
- ret = sqlite_remove_unreclaimed(gracetime);
-
-diff --git a/utils/nfsdcltrack/sqlite.c b/utils/nfsdcltrack/sqlite.c
-index 2801201..c4e0cdf 100644
---- a/utils/nfsdcltrack/sqlite.c
-+++ b/utils/nfsdcltrack/sqlite.c
-@@ -42,6 +42,8 @@
- #include <errno.h>
- #include <event.h>
- #include <stdbool.h>
-+#include <stdint.h>
-+#include <inttypes.h>
- #include <string.h>
- #include <sys/stat.h>
- #include <sys/types.h>
-@@ -544,8 +546,8 @@ sqlite_remove_unreclaimed(time_t grace_start)
- int ret;
- char *err = NULL;
-
-- ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld",
-- grace_start);
-+ ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %" PRId64,
-+ (int64_t)grace_start);
- if (ret < 0) {
- return ret;
- } else if ((size_t)ret >= sizeof(buf)) {
diff --git a/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch b/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch
deleted file mode 100644
index 8541a985..00000000
--- a/net-fs/nfs-utils/files/nfs-utils-2.4.2-Ensure-consistent-struct-stat.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 1378280398ef9f5cd45f5542ae2945b9a360b132 Mon Sep 17 00:00:00 2001
-From: Doug Nazar <nazard@nazar.ca>
-Date: Sun, 17 Nov 2019 14:31:33 -0500
-Subject: [PATCH] Ensure consistent struct stat definition
-
-Although 2fbc62e2a13fc ("Fix include order between config.h and stat.h")
-reorganized those files that were already including config.h, not all
-files were including config.h.
-
-Fixes at least stack smashing crashes in mountd on 32-bit systems.
-
-Signed-off-by: Doug Nazar <nazard@nazar.ca>
-Signed-off-by: Steve Dickson <steved@redhat.com>
----
- support/junction/junction.c | 4 ++++
- support/misc/file.c | 4 ++++
- support/misc/mountpoint.c | 4 ++++
- support/nfs/cacheio.c | 4 ++++
- utils/mount/fstab.c | 4 ++++
- utils/nfsdcld/legacy.c | 4 ++++
- 6 files changed, 24 insertions(+)
-
-diff --git a/support/junction/junction.c b/support/junction/junction.c
-index ab6caa6..41cce26 100644
---- a/support/junction/junction.c
-+++ b/support/junction/junction.c
-@@ -27,6 +27,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <sys/types.h>
- #include <sys/stat.h>
-
-diff --git a/support/misc/file.c b/support/misc/file.c
-index e7c3819..06f6bb2 100644
---- a/support/misc/file.c
-+++ b/support/misc/file.c
-@@ -22,6 +22,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <sys/stat.h>
-
- #include <string.h>
-diff --git a/support/misc/mountpoint.c b/support/misc/mountpoint.c
-index c6217f2..14d6731 100644
---- a/support/misc/mountpoint.c
-+++ b/support/misc/mountpoint.c
-@@ -7,6 +7,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <string.h>
- #include "xcommon.h"
- #include <sys/stat.h>
-diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c
-index 9dc4cf1..7c4cf37 100644
---- a/support/nfs/cacheio.c
-+++ b/support/nfs/cacheio.c
-@@ -19,6 +19,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <nfslib.h>
- #include <inttypes.h>
- #include <stdio.h>
-diff --git a/utils/mount/fstab.c b/utils/mount/fstab.c
-index eedbdda..8b0aaf1 100644
---- a/utils/mount/fstab.c
-+++ b/utils/mount/fstab.c
-@@ -11,6 +11,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <errno.h>
- #include <stdio.h>
- #include <fcntl.h>
-diff --git a/utils/nfsdcld/legacy.c b/utils/nfsdcld/legacy.c
-index 07f477a..3c6bea6 100644
---- a/utils/nfsdcld/legacy.c
-+++ b/utils/nfsdcld/legacy.c
-@@ -19,6 +19,10 @@
- #include <config.h>
- #endif
-
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
- #include <stdio.h>
- #include <dirent.h>
- #include <string.h>
---
-1.8.3.1
-
diff --git a/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch b/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch
deleted file mode 100644
index a7226db2..00000000
--- a/net-fs/nfs-utils/files/nfs-utils-2.5.2-no-werror.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From 6ab8c7c186bd4a547a0ca435ecabe10ee50039c5 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Thu, 22 Oct 2020 19:44:34 +0200
-Subject: [PATCH] Don't build with -Werror flags
-
-https://bugs.gentoo.org/656984
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- configure.ac | 34 +---------------------------------
- 1 file changed, 1 insertion(+), 33 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 50847d8a..6bc18e93 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -631,47 +631,15 @@ AC_SUBST(CPPFLAGS_FOR_BUILD)
- AC_SUBST(LDFLAGS_FOR_BUILD)
-
- my_am_cflags="\
-- -pipe \
- -Wall \
- -Wextra \
- $rpcgen_cflags \
-- -Werror=missing-prototypes \
-- -Werror=missing-declarations \
-- -Werror=format=2 \
-- -Werror=undef \
-- -Werror=missing-include-dirs \
-- -Werror=strict-aliasing=2 \
-- -Werror=init-self \
-- -Werror=implicit-function-declaration \
-- -Werror=return-type \
-- -Werror=switch \
-- -Werror=overflow \
-- -Werror=parentheses \
-- -Werror=aggregate-return \
-- -Werror=unused-result \
- -fno-strict-aliasing \
- "
-
--AC_DEFUN([CHECK_CCSUPPORT], [
-- my_save_cflags="$CFLAGS"
-- CFLAGS="-Werror $1"
-- AC_MSG_CHECKING([whether CC supports $1])
-- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
-- [AC_MSG_RESULT([yes])]
-- [$2+=$1],
-- [AC_MSG_RESULT([no])]
-- )
-- CFLAGS="$my_save_cflags"
--])
--
--CHECK_CCSUPPORT([-Werror=format-overflow=2], [flg1])
--CHECK_CCSUPPORT([-Werror=int-conversion], [flg2])
--CHECK_CCSUPPORT([-Werror=incompatible-pointer-types], [flg3])
--CHECK_CCSUPPORT([-Werror=misleading-indentation], [flg4])
--CHECK_CCSUPPORT([-Wno-cast-function-type], [flg5])
- AX_GCC_FUNC_ATTRIBUTE([format])
-
--AC_SUBST([AM_CFLAGS], ["$my_am_cflags $flg1 $flg2 $flg3 $flg4 $flg5"])
-+AC_SUBST([AM_CFLAGS], ["$my_am_cflags"])
-
- # Make sure that $ACLOCAL_FLAGS are used during a rebuild
- AC_SUBST([ACLOCAL_AMFLAGS], ["-I $ac_macro_dir \$(ACLOCAL_FLAGS)"])
---
-2.29.0
-
diff --git a/net-fs/nfs-utils/files/nfs.confd b/net-fs/nfs-utils/files/nfs.confd
deleted file mode 100644
index 9dc14058..00000000
--- a/net-fs/nfs-utils/files/nfs.confd
+++ /dev/null
@@ -1,38 +0,0 @@
-# /etc/conf.d/nfs
-
-# If you wish to set the port numbers for lockd,
-# please see /etc/sysctl.conf
-
-# Optional services to include in default `/etc/init.d/nfs start`
-# For NFSv4 users, you'll want to add "rpc.idmapd" here.
-NFS_NEEDED_SERVICES=""
-
-# Options to pass to rpc.nfsd
-OPTS_RPC_NFSD="8"
-
-# Options to pass to rpc.mountd
-# ex. OPTS_RPC_MOUNTD="-p 32767"
-OPTS_RPC_MOUNTD=""
-
-# Options to pass to rpc.statd
-# ex. OPTS_RPC_STATD="-p 32765 -o 32766"
-OPTS_RPC_STATD=""
-
-# Options to pass to rpc.idmapd
-OPTS_RPC_IDMAPD=""
-
-# Options to pass to rpc.gssd
-OPTS_RPC_GSSD=""
-
-# Options to pass to rpc.svcgssd
-OPTS_RPC_SVCGSSD=""
-
-# Options to pass to rpc.rquotad (requires sys-fs/quota)
-OPTS_RPC_RQUOTAD=""
-
-# Timeout (in seconds) for exportfs
-EXPORTFS_TIMEOUT=30
-
-# Options to set in the nfsd filesystem (/proc/fs/nfsd/).
-# Format is <option>=<value>. Multiple options are allowed.
-#OPTS_NFSD="nfsv4leasetime=30 max_block_size=4096"
diff --git a/net-fs/nfs-utils/files/nfs.initd b/net-fs/nfs-utils/files/nfs.initd
deleted file mode 100644
index 9b4f8a47..00000000
--- a/net-fs/nfs-utils/files/nfs.initd
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-extra_started_commands="reload"
-
-# The binary locations
-exportfs=/usr/sbin/exportfs
- mountd=/usr/sbin/rpc.mountd
- nfsd=/usr/sbin/rpc.nfsd
-smnotify=/usr/sbin/sm-notify
-
-depend() {
- local myneed=""
- # XXX: no way to detect NFSv4 is desired and so need rpc.idmapd
- myneed="${myneed} $(
- awk '!/^[[:space:]]*#/ {
- # clear the path to avoid spurious matches
- $1 = "";
- if ($0 ~ /[(][^)]*sec=(krb|spkm)[^)]*[)]/) {
- print "rpc.svcgssd"
- exit 0
- }
- }' /etc/exports /etc/exports.d/*.exports 2>/dev/null
- )"
- config /etc/exports /etc/exports.d/*.exports
- need portmap rpc.statd ${myneed} ${NFS_NEEDED_SERVICES}
- use ypbind net dns rpc.rquotad rpc.idmapd rpc.svcgssd
- after quota
-}
-
-mkdir_nfsdirs() {
- local d
- for d in v4recovery v4root ; do
- d="/var/lib/nfs/${d}"
- [ ! -d "${d}" ] && mkdir -p "${d}"
- done
-}
-
-waitfor_exportfs() {
- local pid=$1
- ( sleep ${EXPORTFS_TIMEOUT:-30}; kill -9 ${pid} 2>/dev/null ) &
- wait $1
-}
-
-mount_nfsd() {
- if [ -e /proc/modules ] ; then
- # Make sure nfs support is loaded in the kernel #64709
- if ! grep -qs nfsd /proc/filesystems ; then
- modprobe -q nfsd
- fi
- # Restart idmapd if needed #220747
- if grep -qs nfsd /proc/modules ; then
- killall -q -HUP rpc.idmapd
- fi
- fi
-
- # This is the new "kernel 2.6 way" to handle the exports file
- if grep -qs nfsd /proc/filesystems ; then
- if ! mountinfo -q /proc/fs/nfsd ; then
- ebegin "Mounting nfsd filesystem in /proc"
- mount -t nfsd -o nodev,noexec,nosuid nfsd /proc/fs/nfsd
- eend $?
- fi
-
- local o
- for o in ${OPTS_NFSD} ; do
- echo "${o#*=}" > "/proc/fs/nfsd/${o%%=*}"
- done
- fi
-}
-
-start_it() {
- ebegin "Starting NFS $1"
- shift
- "$@"
- eend $?
- ret=$((ret + $?))
-}
-start() {
- mount_nfsd
- mkdir_nfsdirs
-
- # Exportfs likes to hang if networking isn't working.
- # If that's the case, then try to kill it so the
- # bootup process can continue.
- if grep -qs '^[[:space:]]*"\?/' /etc/exports /etc/exports.d/*.exports ; then
- ebegin "Exporting NFS directories"
- ${exportfs} -r &
- waitfor_exportfs $!
- eend $?
- fi
-
- local ret=0
- start_it mountd ${mountd} ${OPTS_RPC_MOUNTD}
- start_it daemon ${nfsd} ${OPTS_RPC_NFSD}
- [ -x "${smnotify}" ] && start_it smnotify ${smnotify} ${OPTS_SMNOTIFY}
- return ${ret}
-}
-
-stop() {
- local ret=0
-
- ebegin "Stopping NFS mountd"
- start-stop-daemon --stop --exec ${mountd}
- eend $?
- ret=$((ret + $?))
-
- # nfsd sets its process name to [nfsd] so don't look for $nfsd
- ebegin "Stopping NFS daemon"
- start-stop-daemon --stop --name nfsd --user root --signal 2
- eend $?
- ret=$((ret + $?))
- # in case things don't work out ... #228127
- rpc.nfsd 0
-
- # When restarting the NFS server, running "exportfs -ua" probably
- # isn't what the user wants. Running it causes all entries listed
- # in xtab to be removed from the kernel export tables, and the
- # xtab file is cleared. This effectively shuts down all NFS
- # activity, leaving all clients holding stale NFS filehandles,
- # *even* when the NFS server has restarted.
- #
- # That's what you would want if you were shutting down the NFS
- # server for good, or for a long period of time, but not when the
- # NFS server will be running again in short order. In this case,
- # then "exportfs -r" will reread the xtab, and all the current
- # clients will be able to resume NFS activity, *without* needing
- # to umount/(re)mount the filesystem.
- if [ "${RC_CMD}" != "restart" ] ; then
- ebegin "Unexporting NFS directories"
- # Exportfs likes to hang if networking isn't working.
- # If that's the case, then try to kill it so the
- # shutdown process can continue.
- ${exportfs} -ua &
- waitfor_exportfs $!
- eend $?
- fi
-
- return ${ret}
-}
-
-reload() {
- # Exportfs likes to hang if networking isn't working.
- # If that's the case, then try to kill it so the
- # bootup process can continue.
- ebegin "Reloading /etc/exports"
- ${exportfs} -r 1>&2 &
- waitfor_exportfs $!
- eend $?
-}
-
-restart() {
- svc_stop
- svc_start
-}
diff --git a/net-fs/nfs-utils/files/nfsclient.confd b/net-fs/nfs-utils/files/nfsclient.confd
deleted file mode 100644
index 8a995571..00000000
--- a/net-fs/nfs-utils/files/nfsclient.confd
+++ /dev/null
@@ -1,18 +0,0 @@
-# You need to decide which nfs protocol version you want to use.
-# If you are unsure, leave these alone.
-#
-# If you are using only nfsv4, uncomment this line:
-#
-#rc_need="!rpc.statd"
-#
-# If you are using only nfsv3, uncomment this line:
-#
-#rc_need="!rpc.idmapd"
-#
-# You will need to set the dependencies in the nfsclient script to match
-# the network configuration tools you are using. This should be done in
-# this file by following the examples below, and not by changing the
-# service script itself. See /etc/conf.d/netmount for more examples.
-#
-# This is a safe default.
-rc_after="net"
diff --git a/net-fs/nfs-utils/files/nfsclient.initd b/net-fs/nfs-utils/files/nfsclient.initd
deleted file mode 100644
index 6724e913..00000000
--- a/net-fs/nfs-utils/files/nfsclient.initd
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
-
-depend() {
- local opts myneed=""
- if [ -e /etc/fstab ] ; then
- for opts in $(fstabinfo -o -t nfs,nfs4) ; do
- case $opts in
- *sec=krb*|*sec=spkm*) myneed="$myneed rpc.gssd" ;;
- esac
- done
- fi
- config /etc/fstab
- need portmap rpc.statd rpc.idmapd ${myneed}
- use ypbind dns
-}
-
-start() {
- if [ -x /usr/sbin/sm-notify ] ; then
- ebegin "Starting NFS sm-notify"
- /usr/sbin/sm-notify ${OPTS_SMNOTIFY}
- eend $?
- fi
-
- # Make sure nfs support is loaded in the kernel #64709
- if [ -e /proc/modules ] && ! grep -qs 'nfs$' /proc/filesystems ; then
- modprobe -q nfs
- fi
- return 0
-}
diff --git a/net-fs/nfs-utils/files/nfsmount.initd-1.3.1 b/net-fs/nfs-utils/files/nfsmount.initd-1.3.1
deleted file mode 100644
index 68007ca1..00000000
--- a/net-fs/nfs-utils/files/nfsmount.initd-1.3.1
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-# This is mostly as a fix for bug #537996, to avoid breaking existing users
-# with nfsmount in their runlevels.
-# If neither nfsclient nor netmount are in your runlevels, and you manually
-# start netmount before nfsclient, then this will break. A real solution is
-# forthcoming, but requires feature development, see bug #406021 for soft
-# dependencies
-depend() {
- need nfsclient netmount
-}
-
-msg() {
- ewarn "nfsmount is deprecated, please migrate as described in the news item: 2015-02-02-nfs-service-changes"
- ewarn "This migration script will be removed after 01 Aug 2015."
-}
-
-start() {
- msg
-}
-
-stop() {
- msg
-}
diff --git a/net-fs/nfs-utils/files/rpc.gssd.initd b/net-fs/nfs-utils/files/rpc.gssd.initd
deleted file mode 100644
index 445d44c4..00000000
--- a/net-fs/nfs-utils/files/rpc.gssd.initd
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
-
-depend() {
- use ypbind net
- need portmap rpc.pipefs
- after quota
-}
-
-start() {
- ebegin "Starting gssd"
- start-stop-daemon --start --exec /usr/sbin/rpc.gssd -- ${OPTS_RPC_GSSD}
- eend $?
-}
-
-stop() {
- ebegin "Stopping gssd"
- start-stop-daemon --stop --exec /usr/sbin/rpc.gssd
- eend $?
-}
diff --git a/net-fs/nfs-utils/files/rpc.idmapd.initd b/net-fs/nfs-utils/files/rpc.idmapd.initd
deleted file mode 100644
index 61cfd4de..00000000
--- a/net-fs/nfs-utils/files/rpc.idmapd.initd
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
-
-rpc_bin=/usr/sbin/rpc.idmapd
-
-depend() {
- use ypbind net
- need portmap rpc.pipefs
- after quota
-}
-
-start() {
- ebegin "Starting idmapd"
- ${rpc_bin} ${OPTS_RPC_IDMAPD}
- eend $? "make sure DNOTIFY support is enabled ..."
-}
-
-stop() {
- ebegin "Stopping idmapd"
- start-stop-daemon --stop --exec ${rpc_bin}
- eend $?
-}
diff --git a/net-fs/nfs-utils/files/rpc.pipefs.initd b/net-fs/nfs-utils/files/rpc.pipefs.initd
deleted file mode 100644
index f971a49b..00000000
--- a/net-fs/nfs-utils/files/rpc.pipefs.initd
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2014 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-MNT="/var/lib/nfs/rpc_pipefs"
-
-mount_pipefs() {
- local fstype=rpc_pipefs
-
- # if things are already mounted, nothing to do
- mountinfo -q ${MNT} && return 0
-
- # if rpc_pipefs is not available, try to load sunrpc for it #219566
- grep -qs ${fstype} /proc/filesystems || modprobe -q sunrpc
- # if still not available, the `mount` will issue an error for the user
-
- # now just do it for kicks
- mkdir -p ${MNT}
- mount -t ${fstype} ${fstype} ${MNT}
-}
-
-start() {
- ebegin "Setting up RPC pipefs"
- mount_pipefs
- eend $? "make sure you have NFS/SUNRPC enabled in your kernel"
-}
-
-stop() {
- ebegin "Unmounting RPC pipefs"
- umount ${MNT}
- eend $?
-}
diff --git a/net-fs/nfs-utils/files/rpc.statd.initd b/net-fs/nfs-utils/files/rpc.statd.initd
deleted file mode 100644
index ea78b9ae..00000000
--- a/net-fs/nfs-utils/files/rpc.statd.initd
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
-
-rpc_bin=/sbin/rpc.statd
-rpc_pid=/var/run/rpc.statd.pid
-
-depend() {
- use ypbind net
- need portmap
- after quota
-}
-
-start() {
- # Don't start rpc.statd if already started by someone else ...
- # Don't try and kill it if it's already dead ...
- if killall -q -0 ${rpc_bin} ; then
- return 0
- fi
-
- ebegin "Starting NFS statd"
- start-stop-daemon --start --exec ${rpc_bin} -- --no-notify ${OPTS_RPC_STATD}
- eend $?
-}
-
-stop() {
- ebegin "Stopping NFS statd"
- start-stop-daemon --stop --exec ${rpc_bin} --pidfile /var/run/rpc.statd.pid
- eend $?
-}
diff --git a/net-fs/nfs-utils/files/rpc.svcgssd.initd b/net-fs/nfs-utils/files/rpc.svcgssd.initd
deleted file mode 100644
index c714e360..00000000
--- a/net-fs/nfs-utils/files/rpc.svcgssd.initd
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-[ -e /etc/conf.d/nfs ] && . /etc/conf.d/nfs
-
-depend() {
- use ypbind net
- need portmap rpc.pipefs
- after quota
-}
-
-start() {
- ebegin "Starting svcgssd"
- start-stop-daemon --start --exec /usr/sbin/rpc.svcgssd -- ${OPTS_RPC_SVCGSSD}
- eend $?
-}
-
-stop() {
- ebegin "Stopping svcgssd"
- start-stop-daemon --stop --exec /usr/sbin/rpc.svcgssd
- eend $?
-}
diff --git a/net-fs/nfs-utils/metadata.xml b/net-fs/nfs-utils/metadata.xml
deleted file mode 100644
index f6029331..00000000
--- a/net-fs/nfs-utils/metadata.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
- <maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
- </maintainer>
- <use>
- <flag name="junction">Enable NFS junction support in nfsref</flag>
- <flag name="ldap">Add ldap support</flag>
- <flag name="libmount">Link mount.nfs with libmount</flag>
- <flag name="nfsdcld">Enable nfsdcld NFSv4 clientid tracking daemon</flag>
- <flag name="nfsidmap">Enable support for newer nfsidmap helper</flag>
- <flag name="nfsv4">Enable support for NFSv4</flag>
- <flag name="nfsv41">Enable support for NFSv4.1</flag>
- <flag name="uuid">Support UUID lookups in rpc.mountd</flag>
- </use>
- <upstream>
- <remote-id type="sourceforge">nfs</remote-id>
- </upstream>
-</pkgmetadata>
diff --git a/net-fs/nfs-utils/nfs-utils-2.5.3-r2.ebuild b/net-fs/nfs-utils/nfs-utils-2.5.3-r2.ebuild
deleted file mode 100644
index 56d781fb..00000000
--- a/net-fs/nfs-utils/nfs-utils-2.5.3-r2.ebuild
+++ /dev/null
@@ -1,213 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools linux-info systemd
-
-DESCRIPTION="NFS client and server daemons"
-HOMEPAGE="http://linux-nfs.org/"
-
-if [[ "${PV}" = *_rc* ]] ; then
- MY_PV="$(ver_rs 1- -)"
- SRC_URI="http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=snapshot;h=refs/tags/${PN}-${MY_PV};sf=tgz -> ${P}.tar.gz"
- S="${WORKDIR}/${PN}-${PN}-${MY_PV}"
-else
- SRC_URI="mirror://sourceforge/nfs/${P}.tar.bz2"
- KEYWORDS="~alpha amd64 arm arm64 ~hppa ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-fi
-
-LICENSE="GPL-2"
-SLOT="0"
-IUSE="caps ipv6 junction kerberos ldap +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="
- >=dev-db/sqlite-3.3
- dev-libs/libxml2
- net-libs/libtirpc:=
- >=net-nds/rpcbind-0.2.4
- sys-fs/e2fsprogs
- caps? ( sys-libs/libcap )
- ldap? ( net-nds/openldap )
- libmount? ( sys-apps/util-linux )
- nfsv4? (
- dev-libs/libevent:=
- >=sys-apps/keyutils-1.5.9:=
- kerberos? (
- >=net-libs/libtirpc-0.2.4-r1[kerberos]
- app-crypt/mit-krb5
- )
- )
- nfsv41? (
- sys-fs/lvm2
- )
- tcpd? ( sys-apps/tcp-wrappers )
- uuid? ( sys-apps/util-linux )"
-RDEPEND="${DEPEND}
- !net-libs/libnfsidmap
- !net-nds/portmap
- !<sys-apps/openrc-0.13.9
- selinux? (
- sec-policy/selinux-rpc
- sec-policy/selinux-rpcbind
- )
-"
-BDEPEND="
- net-libs/rpcsvc-proto
- virtual/pkgconfig
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-2.5.2-no-werror.patch
- "${FILESDIR}"/${PN}-2.4.2-Ensure-consistent-struct-stat.patch
-)
-
-pkg_setup() {
- linux-info_pkg_setup
- if use nfsv4 && ! use nfsdcld && linux_config_exists && ! linux_chkconfig_present CRYPTO_MD5 ; then
- ewarn "Your NFS server will be unable to track clients across server restarts!"
- ewarn "Please enable the \"${HILITE}nfsdcld${NORMAL}\" USE flag to install the nfsdcltrack usermode"
- ewarn "helper upcall program, or enable ${HILITE}CONFIG_CRYPTO_MD5${NORMAL} in your kernel to"
- ewarn "support the legacy, in-kernel client tracker."
- fi
-}
-
-src_prepare() {
- default
-
- if use elibc_musl; then
- eapply "${FILESDIR}/musl-time64.patch"
- eapply "${FILESDIR}/musl-getservbyport.patch"
- eapply "${FILESDIR}/musl-svcgssd-sysconf.patch"
- fi
-
- 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)
- local myeconfargs=(
- --disable-static
- --with-statedir="${EPREFIX}"/var/lib/nfs
- --enable-tirpc
- --with-tirpcinclude="${ESYSROOT}"/usr/include/tirpc/
- --with-pluginpath="${EPREFIX}"/usr/$(get_libdir)/libnfsidmap
- --with-rpcgen
- --with-systemd="$(systemd_get_systemunitdir)"
- --without-gssglue
- $(use_enable caps)
- $(use_enable ipv6)
- $(use_enable junction)
- $(use_enable kerberos gss)
- $(use_enable kerberos svcgss)
- $(use_enable ldap)
- $(use_enable libmount libmount-mount)
- $(use_enable nfsdcld nfsdcltrack)
- $(use_enable nfsv4)
- $(use_enable nfsv41)
- $(use_enable uuid)
- $(use_with tcpd tcp-wrappers)
- )
- econf "${myeconfargs[@]}"
-}
-
-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/nfs "${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
- insinto /etc
- doins support/nfsidmap/idmapd.conf
-
- # 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 nfsclient rpc.statd "${list[@]}" ; do
- newinitd "${FILESDIR}"/${f}.initd ${f}
- done
- newinitd "${FILESDIR}"/nfsmount.initd-1.3.1 nfsmount # Nuke after 2015/08/01
- for f in nfs nfsclient ; do
- newconfd "${FILESDIR}"/${f}.confd ${f}
- done
- sed -i \
- -e "/^NFS_NEEDED_SERVICES=/s:=.*:=\"${opt_need}\":" \
- "${ED}"/etc/conf.d/nfs || die #234132
-
- local systemd_systemunitdir="$(systemd_get_systemunitdir)"
- sed -i \
- -e 's:/usr/sbin/rpc.statd:/sbin/rpc.statd:' \
- "${ED}${systemd_systemunitdir}"/* || die
-
- keepdir /var/lib/nfs #368505
- keepdir /var/lib/nfs/v4recovery #603628
-
- # no static archives
- find "${ED}" -name '*.la' -delete || 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
- 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
-
- if systemd_is_booted; then
- for v in ${REPLACING_VERSIONS}; do
- if ver_test "${v}" -lt 1.3.0; then
- ewarn "We have switched to upstream systemd unit files. Since"
- ewarn "they got renamed, you should probably enable the new ones."
- ewarn "You can run 'equery files nfs-utils | grep systemd'"
- ewarn "to know what services you need to enable now."
- fi
- done
- else
- ewarn "If you use OpenRC, the nfsmount service has been replaced with nfsclient."
- ewarn "If you were using nfsmount, please add nfsclient and netmount to the"
- ewarn "same runlevel as nfsmount."
- fi
-}