- nfsserver.init / sysconfig.nfs: allow NFSv3 service
to be disabled so only NFSv4 can be used. bnc#598671 - nfs-v2-disable.patch: mountd support for above - nfs.init: unmount bind mounts with '-l' to ensure they really unmount. bnc#598681 OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=18
This commit is contained in:
parent
812efd18cf
commit
ce3ce09113
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun May 9 23:07:24 UTC 2010 - nfbrown@novell.com
|
||||||
|
|
||||||
|
- nfsserver.init / sysconfig.nfs: allow NFSv3 service
|
||||||
|
to be disabled so only NFSv4 can be used. bnc#598671
|
||||||
|
- nfs-v2-disable.patch: mountd support for above
|
||||||
|
- nfs.init: unmount bind mounts with '-l' to ensure they
|
||||||
|
really unmount. bnc#598681
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Apr 19 23:43:45 UTC 2010 - nfbrown@novell.com
|
Mon Apr 19 23:43:45 UTC 2010 - nfbrown@novell.com
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ BuildRequires: libevent
|
|||||||
Url: http://nfs.sourceforge.net
|
Url: http://nfs.sourceforge.net
|
||||||
Summary: Support Utilities for Kernel nfsd
|
Summary: Support Utilities for Kernel nfsd
|
||||||
Version: 1.2.1
|
Version: 1.2.1
|
||||||
Release: 4
|
Release: 5
|
||||||
Group: Productivity/Networking/NFS
|
Group: Productivity/Networking/NFS
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
@ -50,6 +50,7 @@ Source12: start-statd
|
|||||||
Patch0: nfs-utils-1.0.7-bind-syntax.patch
|
Patch0: nfs-utils-1.0.7-bind-syntax.patch
|
||||||
Patch1: warn-nfs-udp.patch
|
Patch1: warn-nfs-udp.patch
|
||||||
Patch2: nfs-utils-eperm-fallback.patch
|
Patch2: nfs-utils-eperm-fallback.patch
|
||||||
|
Patch3: nfs-v2-disable.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains the NFS utilities. You can tune the number of
|
This package contains the NFS utilities. You can tune the number of
|
||||||
@ -129,6 +130,7 @@ Authors:
|
|||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
cp %{S:6} .
|
cp %{S:6} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
66
nfs-v2-disable.patch
Normal file
66
nfs-v2-disable.patch
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
Subject: Allow mountd to not listen for RPC calls when v2/v3 disabled
|
||||||
|
References: 598671
|
||||||
|
|
||||||
|
Mountd listens on 2 different versions for NFSv2 (MOUNTv1 and MOUNTv2)
|
||||||
|
and one for NFSv3 (MOUNTv3)
|
||||||
|
|
||||||
|
When --no-nfs-version requests an NFS version to be disabled, the
|
||||||
|
code actually disabled the MOUNT version. This works is several cases,
|
||||||
|
but requires --no-nfs-version 1 to completely disable NFSv2, which
|
||||||
|
is wrong.
|
||||||
|
|
||||||
|
So if we do disable 1, 2, and 3. mountd complain and won't run, it
|
||||||
|
is not possible to run just v4 - i.e. not listening for MOUNT requests
|
||||||
|
at all (as v4 doesn't need them).
|
||||||
|
|
||||||
|
So change the handling of "--no-nfs-version 2" it disable MOUNTv1 as well as
|
||||||
|
MOUNTv2, and allow mountd to continue running as long as one of
|
||||||
|
NFSv2 NFSv3 NFSv4 is enabled.
|
||||||
|
|
||||||
|
Signed-off-by: NeilBrown <neilb@suse.de>
|
||||||
|
|
||||||
|
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
|
||||||
|
index a0a1f2d..5373d81 100644
|
||||||
|
--- a/utils/mountd/mountd.c
|
||||||
|
+++ b/utils/mountd/mountd.c
|
||||||
|
@@ -80,10 +80,10 @@ static int nfs_version = -1;
|
||||||
|
static void
|
||||||
|
unregister_services (void)
|
||||||
|
{
|
||||||
|
- if (nfs_version & 0x1)
|
||||||
|
+ if (nfs_version & (0x1 << 1)) {
|
||||||
|
pmap_unset (MOUNTPROG, MOUNTVERS);
|
||||||
|
- if (nfs_version & (0x1 << 1))
|
||||||
|
pmap_unset (MOUNTPROG, MOUNTVERS_POSIX);
|
||||||
|
+ }
|
||||||
|
if (nfs_version & (0x1 << 2))
|
||||||
|
pmap_unset (MOUNTPROG, MOUNTVERS_NFSV3);
|
||||||
|
}
|
||||||
|
@@ -712,8 +712,10 @@ main(int argc, char **argv)
|
||||||
|
usage(argv [0], 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* No more arguments allowed. */
|
||||||
|
- if (optind != argc || !(nfs_version & 0x7))
|
||||||
|
+ /* No more arguments allowed.
|
||||||
|
+ * Require at least one valid version (2, 3, or 4)
|
||||||
|
+ */
|
||||||
|
+ if (optind != argc || !(nfs_version & 0xE))
|
||||||
|
usage(argv [0], 1);
|
||||||
|
|
||||||
|
if (chdir(state_dir)) {
|
||||||
|
@@ -761,12 +763,12 @@ main(int argc, char **argv)
|
||||||
|
if (new_cache)
|
||||||
|
cache_open();
|
||||||
|
|
||||||
|
- if (nfs_version & 0x1)
|
||||||
|
+ if (nfs_version & (0x1 << 1)) {
|
||||||
|
rpc_init("mountd", MOUNTPROG, MOUNTVERS,
|
||||||
|
mount_dispatch, port);
|
||||||
|
- if (nfs_version & (0x1 << 1))
|
||||||
|
rpc_init("mountd", MOUNTPROG, MOUNTVERS_POSIX,
|
||||||
|
mount_dispatch, port);
|
||||||
|
+ }
|
||||||
|
if (nfs_version & (0x1 << 2))
|
||||||
|
rpc_init("mountd", MOUNTPROG, MOUNTVERS_NFSV3,
|
||||||
|
mount_dispatch, port);
|
@ -95,11 +95,11 @@ nfs4_bind_mounts() {
|
|||||||
sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' |
|
sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' |
|
||||||
sort |
|
sort |
|
||||||
while read export dir; do
|
while read export dir; do
|
||||||
test -d $export || mkdir -p $export
|
test -d "$export" || mkdir -p "$export"
|
||||||
# Fortunately, mount ignores unknown
|
# Fortunately, mount ignores unknown
|
||||||
# options, so we have an easy way to
|
# options, so we have an easy way to
|
||||||
# tag our "magic" bind mounts
|
# tag our "magic" bind mounts
|
||||||
mount -o bind,nfsexp $dir $export
|
mount -o bind,nfsexp "$dir" "$export"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ nfs4_unbind_mounts() {
|
|||||||
grep '\<nfsexp\>' |
|
grep '\<nfsexp\>' |
|
||||||
sort -r -k2 |
|
sort -r -k2 |
|
||||||
while read src mountpoint crap; do
|
while read src mountpoint crap; do
|
||||||
umount $mountpoint
|
umount -l "$mountpoint"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,11 +171,17 @@ case "$1" in
|
|||||||
mount -t nfsd nfsd /proc/fs/nfsd
|
mount -t nfsd nfsd /proc/fs/nfsd
|
||||||
rc_status
|
rc_status
|
||||||
fi
|
fi
|
||||||
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
VERSION_PARAMS=
|
||||||
VERSION_LIST="+2 +3 +4"
|
if [ "$NFS3_SERVER_SUPPORT" != "no" ]; then
|
||||||
VERSION_PARAMS=""
|
VERSION_LIST="+2 +3 "
|
||||||
else
|
else
|
||||||
VERSION_LIST="+2 +3 -4"
|
VERSION_LIST="-2 -3"
|
||||||
|
VERSION_PARAMS="--no-nfs-version 2 --no-nfs-version 3"
|
||||||
|
fi
|
||||||
|
if [ "$NFS4_SUPPORT" = "yes" ]; then
|
||||||
|
VERSION_LIST="$VERSION_LIST +4"
|
||||||
|
else
|
||||||
|
VERSION_LIST="$VERSION_LIST -4"
|
||||||
VERSION_PARAMS="--no-nfs-version 4"
|
VERSION_PARAMS="--no-nfs-version 4"
|
||||||
fi
|
fi
|
||||||
if [ " `cat /proc/fs/nfsd/threads`" = " 0" ]; then
|
if [ " `cat /proc/fs/nfsd/threads`" = " 0" ]; then
|
||||||
@ -211,11 +217,13 @@ case "$1" in
|
|||||||
rc_exit
|
rc_exit
|
||||||
}
|
}
|
||||||
# rpc.statd
|
# rpc.statd
|
||||||
echo -n " statd"
|
if [ "$NFS3_SERVER_SUPPORT" != "no" ]; then
|
||||||
startproc /usr/sbin/rpc.statd --no-notify $STATD_OPTIONS || {
|
echo -n " statd"
|
||||||
|
startproc /usr/sbin/rpc.statd --no-notify $STATD_OPTIONS || {
|
||||||
rc_status -v
|
rc_status -v
|
||||||
rc_exit
|
rc_exit
|
||||||
}
|
}
|
||||||
|
fi
|
||||||
# rpc.nfsd
|
# rpc.nfsd
|
||||||
echo -n " nfsd"
|
echo -n " nfsd"
|
||||||
$NFSD_BIN $PARAMS $VERSION_PARAMS || {
|
$NFSD_BIN $PARAMS $VERSION_PARAMS || {
|
||||||
|
@ -30,6 +30,19 @@ MOUNTD_PORT=""
|
|||||||
#
|
#
|
||||||
NFS_SECURITY_GSS="no"
|
NFS_SECURITY_GSS="no"
|
||||||
|
|
||||||
|
## Path: Network/File systems/NFS server
|
||||||
|
## Description: NFSv3 server support
|
||||||
|
## Type: yesno
|
||||||
|
## Default: yes
|
||||||
|
## ServiceRestart: nfsserver
|
||||||
|
#
|
||||||
|
# Enable NFSv3 server support (yes/no)
|
||||||
|
# This causes the NFS server to respond to
|
||||||
|
# NFSv2 and NFSv3 requests. Only disable this
|
||||||
|
# if you want to ensure only NFSv4 is used.
|
||||||
|
#
|
||||||
|
NFS3_SERVER_SUPPORT="yes"
|
||||||
|
|
||||||
## Path: Network/File systems/NFS server
|
## Path: Network/File systems/NFS server
|
||||||
## Description: NFSv4 protocol support
|
## Description: NFSv4 protocol support
|
||||||
## Type: yesno
|
## Type: yesno
|
||||||
|
Loading…
Reference in New Issue
Block a user