- nfs-utils-1.3.4.tar.xz

New upstream release.  Lots of bugfixes, no significant
  functionality changes
- delete 0001-Fix-protocol-minor-version-fall-back.patch
  delete 0001-close-the-syslog-fd-in-daemon_init.patch
  delete 0001-mount-run-START_STATD-fully-as-root.patch
  delete 0001-mount.nfs-hide-EBUSY-errors.patch
  delete 0001-mount.nfs-trust-the-exit-status-of-start_statd.patch
  delete 0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch
  delete 0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch
  delete nfs-utils-no-svcgss.service
  delete nfs-utils-uninit-mem.patch
  All patches are included in 1.3.4

OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=167
This commit is contained in:
Neil Brown 2016-08-10 03:00:21 +00:00 committed by Git OBS Bridge
parent 4c2fe78df1
commit 80d063fbaf
13 changed files with 23 additions and 490 deletions

View File

@ -1,49 +0,0 @@
From 78bb645a42c216b37b8d930c7c849a3fa89babf8 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.com>
Date: Sat, 16 Jan 2016 12:02:30 -0500
Subject: [PATCH] Fix protocol minor version fall-back
mount.nfs currently expects mount(2) to fail with EPROTONOSUPPORT if
the kernel doesn't understand the requested NFS version.
Unfortunately if the requested minor is not known to the kernel
it returns -EINVAL.
In kernels since 3.11 this can happen in nfs4_alloc_client(), if
compiled without NFS_V4_2.
More generally it can happen in in nfs_validate_text_mount_data()
when nfs_parse_mount_options() returns 0 because
nfs_parse_version_string()
didn't recognise the version.
EPROTONOSUPPORT is only returned if NFSv4 support is completely compiled
out.
So nfs_autonegotiate needs to check for EINVAL as well as
EPROTONOSUPPORT.
URL: https://bugzilla.opensuse.org/show_bug.cgi?id=959211
Reported-by: Takashi Iwai <tiwai@suse.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/stropts.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index c8f5a6d223e7..86829a902bfd 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -841,6 +841,9 @@ check_result:
case EPROTONOSUPPORT:
/* A clear indication that the server or our
* client does not support NFS version 4 and minor */
+ case EINVAL:
+ /* A less clear indication that our client
+ * does not support NFSv4 minor version. */
if (mi->version.v_mode == V_GENERAL &&
mi->version.minor == 0)
return result;
--
2.7.1

View File

@ -1,41 +0,0 @@
From 273b46473594b8aa4e55f682577d1dd94d44ad50 Mon Sep 17 00:00:00 2001
From: Scott Mayhew <smayhew@redhat.com>
Date: Mon, 2 Nov 2015 08:07:11 -0500
Subject: [PATCH] close the syslog fd in daemon_init()
Commit 7addf9d (cleanup daemonization code) added the following line to
mydaemon_init():
dup2(pipefds[1], 3);
If we've already called vsyslog() before the fork(), then chances are fd
3 was being used for the syslog socket. In that case the next vsyslog()
call will cause the data to appear on the read end of the pipe, causing
the parent to exit with a nonzero status. If systemd is running, it
will see the parent's nonzero exit status and will terminate the child
as well.
So just call closelog() to close the fd. The next call to vsyslog()
will open a new one if need be.
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
support/nfs/mydaemon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/support/nfs/mydaemon.c b/support/nfs/mydaemon.c
index 3391eff39008..701cfd914179 100644
--- a/support/nfs/mydaemon.c
+++ b/support/nfs/mydaemon.c
@@ -122,6 +122,7 @@ daemon_init(bool fg)
dup2(tempfd, 0);
dup2(tempfd, 1);
dup2(tempfd, 2);
+ closelog();
dup2(pipefds[1], 3);
pipefds[1] = 3;
closeall(4);
--
2.8.1

View File

@ -1,52 +0,0 @@
From 8714f14c1966612d073d922d86a394c424eda724 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Fri, 22 Apr 2016 09:13:31 +1000
Subject: [PATCH] mount: run START_STATD fully as root
If a "user" mount is the first NFSv3 mount, mount.nfs will be running
setuid to root (with non-root as the real-uid) when it executes START_STATD.
start-statd is a shell script and many shells refuse to run setuid,
dropping privileges immediately. This results in start-statd running
as an unprivileged user and so statd fails to start.
To fix this, call "setuid(0)" to set real uid to zero. Also call "setgid(0)"
for consistency.
The behaviour of a shell can often be affected by the environment,
such as the "shell functions" that bash includes from the environment.
To avoid the user being able to pass such environment to the shell,
explicitly pass an empty environment. The start-statd script explicitly
sets the PATH which is all it really needs.
Signed-off-by: NeilBrown <neilb@suse.com>
---
utils/mount/network.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 7240ca7bcdc4..0d12613e86a4 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -795,6 +795,7 @@ int start_statd(void)
if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) {
int cnt = STATD_TIMEOUT * 10;
int status = 0;
+ char * const envp[1] = { NULL };
const struct timespec ts = {
.tv_sec = 0,
.tv_nsec = 100000000,
@@ -802,7 +803,9 @@ int start_statd(void)
pid_t pid = fork();
switch (pid) {
case 0: /* child */
- execl(START_STATD, START_STATD, NULL);
+ setgid(0);
+ setuid(0);
+ execle(START_STATD, START_STATD, NULL, envp);
exit(1);
case -1: /* error */
nfs_error(_("%s: fork failed: %s"),
--
2.8.1

View File

@ -1,48 +0,0 @@
From f0dc907b52892c18ccad2e573850583c0ee01157 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Wed, 21 Oct 2015 14:07:52 +1100
Subject: [PATCH] mount.nfs - hide EBUSY errors.
Linux only returns EBUSY for a non-remount mount if the exact
requested filesystem is already mounted. Arguably this is not an
error.
"mount -a" tries to see if each request filesystem is already mounted.
Sometimes it gets it wrong - e.g. hostname aliases can confuse it.
So "mount -a" will report a failure "already mounted", which is
wrong because it should filter those out.
An easy fix it just to be silent about EBUSY. As the requested
result (a given filesystem being mounted at a given location) is in
effect after the EBUSY return, we can just treat it as success.
This removed the confusing "already mounted" errors.
Signed-off-by: NeilBrown <neilb@suse.com>
---
utils/mount/stropts.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 86829a902bfd..320dde2fab92 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -960,6 +960,15 @@ static int nfsmount_fg(struct nfsmount_info *mi)
if (nfs_try_mount(mi))
return EX_SUCCESS;
+ if (errno == EBUSY)
+ /* The only cause of EBUSY is if exactly the desired
+ * filesystem is already mounted. That can arguably
+ * be seen as success. "mount -a" tries to optimise
+ * out this case but sometimes fails. Help it out
+ * by pretending everything is rosy
+ */
+ return EX_SUCCESS;
+
if (nfs_is_permanent_error(errno))
break;
--
2.7.2

View File

@ -1,63 +0,0 @@
From 37cd45cb913403b9f3b0c2aaa705e06cd70cc1d7 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Sat, 16 Jan 2016 12:06:32 -0500
Subject: [PATCH] mount.nfs: trust the exit status of "start_statd".
If DNS service is particularly slow, nfs_probe_statd() can fail even
though rpc.statd is actually running. This happens because rpc.statd
is single threaded and could be waiting longer for DNS than
nfs_probe_statd() will wait for it.
This causes problems when mount.nfs uses nfs_probe_statd() to see if
statd is running, as is needed for NFSv3.
Currently in these circumstances there are two possible outcomes.
1/ if systemd is in use, it will be told to start rpc-statd, which
is already running so no change.
mount.nfs will try pinging rpc.statd a few more times and could
eventually give up and fail the mount.
While slow DNS may well result in slow service, it shouldn't cause
a mount attempt to fail.
2/ if systemd is not in use, a new rpc.statd will be started. This
can (and has) lead to a large number of rpc.statd processes running
on the one machine.
This patch addresses the first scenario. If START_STATD is run and
exits with a success status, mount.nfs assumes statd is running and
allows the mount to succeed. A separate patch will address the other
scenario.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/network.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 8a9bf1476d51..7240ca7bcdc4 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -794,6 +794,7 @@ int start_statd(void)
if (stat(START_STATD, &stb) == 0) {
if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) {
int cnt = STATD_TIMEOUT * 10;
+ int status = 0;
const struct timespec ts = {
.tv_sec = 0,
.tv_nsec = 100000000,
@@ -808,7 +809,10 @@ int start_statd(void)
progname, strerror(errno));
break;
default: /* parent */
- waitpid(pid, NULL,0);
+ if (waitpid(pid, &status,0) == pid &&
+ status == 0)
+ /* assume it worked */
+ return 1;
break;
}
while (1) {
--
2.8.1

View File

@ -1,49 +0,0 @@
From 4fabfcd082069a16ea8769b9ea9344fc15011366 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Mon, 9 Nov 2015 11:28:30 -0500
Subject: [PATCH] systemd: Decouple the starting and stopping of
rpcbind/nfs-server
Commit b98f2af15 introduced a regression that cause the
starting and stop of rpcbind and the nfs-server to
be depended on each other
The starting of the NFS server should start rpcbind
but bring rpcbind down should not bring the NFS
server down.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
systemd/nfs-server.service | 2 +-
systemd/rpc-statd.service | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 12b02f26f9ce..317e5d689767 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -1,7 +1,7 @@
[Unit]
Description=NFS server and services
DefaultDependencies=no
-Requires= network.target proc-fs-nfsd.mount rpcbind.service
+Requires= network.target proc-fs-nfsd.mount rpcbind.target
Requires= nfs-mountd.service
Wants=rpc-statd.service nfs-idmapd.service
Wants=rpc-statd-notify.service
diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
index 14604d783ddf..f16ea425dc77 100644
--- a/systemd/rpc-statd.service
+++ b/systemd/rpc-statd.service
@@ -3,7 +3,7 @@ Description=NFS status monitor for NFSv2/3 locking.
DefaultDependencies=no
Conflicts=umount.target
Requires=nss-lookup.target rpcbind.target
-After=network.target nss-lookup.target rpcbind.target
+After=network.target nss-lookup.target rpcbind.service
PartOf=nfs-utils.service
--
2.8.2

View File

@ -1,131 +0,0 @@
From 91da135f243d6f87fcea8b8a3ce28a589917b0e4 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Mon, 2 May 2016 08:54:13 -0400
Subject: [PATCH] systemd unit files: fix up dependencies on rpcbind.
The dependencies on rpcbind have been changed a few times and I think
they are still wrong. So I'll go into some detail to justify this
change.
Firstly: rpcbind.target rpcbind.socket or rpcbind.service?
The systemd documentation talks about targets as "synchronization
points" and likens them to SysV init run levels. Run levels are about
ordering but not dependencies.
The systemd.special man page describes rpcbind.target as intended
explicitly for ordering sysvinit scripts, with "After=" dependencies.
So while I think it is valid to use rpcbind.target for ordering
(before/after) it shouldn't be used for dependencies (Wants/Requires).
The rpcbind.target file included in systemd does not "Require" the
actual service, so requiring rpcbind.target itself is pointless.
I think we shouldn't use rpcbind.target at all. Leave it for sysvinit
synchronization.
So: .socket or .service?
I think nfs only needs the socket to be active. On first connection
the service will be started. But nfs does not need to wait for the
service to start, only the socket. So I think we should exclusively
use rpcbind.socket.
Next: Wants or Requires.
rpc.statd definitely Requires rpcbind. It needs to register to be
useful, and without rpcbind it cannot register.
nfs-server does not necesarily require rpcbind. Specifically if
configured for NFSv4 only, nfs-server will work quite happily without
rpcbind.
Someone with an NFSv4 only setup who wants rpcbind to not run can use
systemctl mask rpcbind.socket
to ensure it never runs.
So nfs-server should only "Wants: rpcbind.socket".
I think
Commit: 4fabfcd08206 ("systemd: Decouple the starting and stopping of
rpcbind/nfs-server")
should have changed "Requires" to "Wants" rather than "server" to
"target"
to fix the dependency problem.
Finally: After?
It only makes sense to declare an ordering relation as "After:"
something that will actually be started. If "foo.service" is not part
of the systemd transaction, then "After: foo.service" has no effect.
So having:
Requires: rpcbind.target
After: rpcbind.socket
doesn't make much sense unless there is some relationship between
rpcbind.target and rpcbind.socket, and there is no general guarantee
of that (though what individual distros do, I don't know).
So the "After" should match the "Wants" or "Requires".
It might make sense to
Requires: rpcbind.socket
After: rpcbind.target
as it is reasonable to assume that rpcbind.target will be ordered with
rpcbind.socket, but as we can use rpcbind.socket explictly, that is
clearer.
So my conclusion is that nfs-server should:
Wants: rpcbind.socket
After: rpcbind.socket
and rpc-statd should
Requires: rpcbind.socket
After: rpcbind.socket
which is what this patch puts into effect.
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
---
systemd/nfs-server.service | 5 +++--
systemd/rpc-statd.service | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
index 317e5d689767..2ccdc6344cd5 100644
--- a/systemd/nfs-server.service
+++ b/systemd/nfs-server.service
@@ -1,13 +1,14 @@
[Unit]
Description=NFS server and services
DefaultDependencies=no
-Requires= network.target proc-fs-nfsd.mount rpcbind.target
+Requires= network.target proc-fs-nfsd.mount
Requires= nfs-mountd.service
+Wants=rpcbind.socket
Wants=rpc-statd.service nfs-idmapd.service
Wants=rpc-statd-notify.service
After= local-fs.target
-After= network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service
+After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service
After= nfs-idmapd.service rpc-statd.service
Before= rpc-statd-notify.service
diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
index f16ea425dc77..a02f5c41a424 100644
--- a/systemd/rpc-statd.service
+++ b/systemd/rpc-statd.service
@@ -2,8 +2,8 @@
Description=NFS status monitor for NFSv2/3 locking.
DefaultDependencies=no
Conflicts=umount.target
-Requires=nss-lookup.target rpcbind.target
-After=network.target nss-lookup.target rpcbind.service
+Requires=nss-lookup.target rpcbind.socket
+After=network.target nss-lookup.target rpcbind.socket
PartOf=nfs-utils.service
--
2.8.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d
size 588468

3
nfs-utils-1.3.4.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b42a5bc0a8d80d04650030ceb9a11f08f4acfbcb1ee297f657fb94e339c45975
size 602240

View File

@ -1,19 +0,0 @@
diff --git a/systemd/Makefile.am b/systemd/Makefile.am
index 0331926dcc03..03f96e93dccf 100644
--- a/systemd/Makefile.am
+++ b/systemd/Makefile.am
@@ -28,9 +28,13 @@ endif
if CONFIG_GSS
unit_files += \
auth-rpcgss-module.service \
- rpc-gssd.service \
+ rpc-gssd.service
+
+if CONFIG_SVCGSS
+unit_files += \
rpc-svcgssd.service
endif
+endif
EXTRA_DIST = $(unit_files)

View File

@ -1,16 +0,0 @@
Index: nfs-utils-1.3.3/utils/mount/network.c
===================================================================
--- nfs-utils-1.3.3.orig/utils/mount/network.c
+++ nfs-utils-1.3.3/utils/mount/network.c
@@ -1626,7 +1626,10 @@ int nfs_options2pmap(struct mount_option
return 0;
if (!nfs_nfs_version(options, &version))
return 0;
- nfs_pmap->pm_vers = version.major;
+ if (version.v_mode == V_DEFAULT)
+ nfs_pmap->pm_vers = 0;
+ else
+ nfs_pmap->pm_vers = version.major;
if (!nfs_nfs_protocol(options, &nfs_pmap->pm_prot))
return 0;
if (!nfs_nfs_port(options, &nfs_pmap->pm_port))

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Wed Aug 10 02:57:57 UTC 2016 - nfbrown@suse.com
- nfs-utils-1.3.4.tar.xz
New upstream release. Lots of bugfixes, no significant
functionality changes
- delete 0001-Fix-protocol-minor-version-fall-back.patch
delete 0001-close-the-syslog-fd-in-daemon_init.patch
delete 0001-mount-run-START_STATD-fully-as-root.patch
delete 0001-mount.nfs-hide-EBUSY-errors.patch
delete 0001-mount.nfs-trust-the-exit-status-of-start_statd.patch
delete 0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch
delete 0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch
delete nfs-utils-no-svcgss.service
delete nfs-utils-uninit-mem.patch
All patches are included in 1.3.4
-------------------------------------------------------------------
Tue Aug 9 23:32:10 UTC 2016 - nfbrown@suse.com

View File

@ -17,7 +17,7 @@
Name: nfs-utils
Version: 1.3.3
Version: 1.3.4
Release: 0
Summary: Support Utilities for Kernel nfsd
License: GPL-2.0+
@ -40,15 +40,6 @@ Source16: nfs.service
Source17: nfs-server.nfsserver.conf
Source18: nfs-client.nfs.conf
Patch0: nfs-utils-1.0.7-bind-syntax.patch
Patch1: nfs-utils-no-svcgss.service
Patch2: nfs-utils-uninit-mem.patch
Patch3: 0001-Fix-protocol-minor-version-fall-back.patch
Patch4: 0001-mount.nfs-hide-EBUSY-errors.patch
Patch5: 0001-close-the-syslog-fd-in-daemon_init.patch
Patch6: 0001-mount.nfs-trust-the-exit-status-of-start_statd.patch
Patch7: 0001-mount-run-START_STATD-fully-as-root.patch
Patch8: 0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch
Patch9: 0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch
BuildRequires: e2fsprogs-devel
BuildRequires: fedfs-utils-devel
BuildRequires: gcc-c++
@ -115,15 +106,6 @@ This package contains additional NFS documentation.
%prep
%setup -q -a 1
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
cp %{SOURCE6} .