From 0cf2370c0cc65d087351180ee7f10fd95fa08e96e1535f0003ebe928173df909 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 2 Sep 2019 05:26:32 +0000 Subject: [PATCH] - 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch Fix a bug that cause NFSv4 service to always be enabled, if the server was enabled at all. OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=203 --- ...-disable-major-NFS-version-4-using-v.patch | 60 +++++++++++++++++++ nfs-utils.changes | 7 +++ nfs-utils.spec | 4 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch diff --git a/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch b/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch new file mode 100644 index 0000000..9664b50 --- /dev/null +++ b/0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch @@ -0,0 +1,60 @@ +From d68be5d6ae5086d6b4ad84507d0d14011df40aa2 Mon Sep 17 00:00:00 2001 +From: Justin Mitchell +Date: Wed, 26 Sep 2018 10:37:17 -0400 +Subject: [PATCH] nfs.conf: fail to disable major NFS version 4 using "vers4=n" + in /etc/nfs.conf + +Setting "vers4=n/off" (disabling the major NFS version 4) in nfs.conf +doesn't work now. + +Refer to rpc.nfsd(8), "vers3/vers4" in the [nfsd] section of the +/etc/nfs.conf file is to enable or disable a major NFS version 3 or 4 +(which are normally enabled by default). + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1625032 + +Signed-off-by: Steve Dickson +--- + utils/nfsd/nfsd.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c +index 6b57e2b0790e..b256bd9f6b40 100644 +--- a/utils/nfsd/nfsd.c ++++ b/utils/nfsd/nfsd.c +@@ -83,6 +83,9 @@ main(int argc, char **argv) + + conf_init_file(NFS_CONFFILE); + xlog_from_conffile("nfsd"); ++ ++ nfssvc_get_minormask(&minormask); ++ + count = conf_get_num("nfsd", "threads", count); + grace = conf_get_num("nfsd", "grace-time", grace); + lease = conf_get_num("nfsd", "lease-time", lease); +@@ -101,13 +104,19 @@ main(int argc, char **argv) + for (i = 2; i <= 4; i++) { + char tag[20]; + sprintf(tag, "vers%d", i); +- if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) ++ if (conf_get_bool("nfsd", tag, NFSCTL_VERISSET(versbits, i))) { + NFSCTL_VERSET(versbits, i); +- else ++ if (i == 4) ++ minorvers = minorversset = minormask; ++ } else { + NFSCTL_VERUNSET(versbits, i); ++ if (i == 4) { ++ minorvers = 0; ++ minorversset = minormask; ++ } ++ } + } + +- nfssvc_get_minormask(&minormask); + /* We assume the kernel will default all minor versions to 'on', + * and allow the config file to disable some. + */ +-- +2.14.0.rc0.dirty + diff --git a/nfs-utils.changes b/nfs-utils.changes index 532275b..2556587 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 2 05:25:07 UTC 2019 - Neil Brown + +- 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch + Fix a bug that cause NFSv4 service to always be enabled, if + the server was enabled at all. + ------------------------------------------------------------------- Wed Jul 24 13:07:41 UTC 2019 - matthias.gerstner@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index e12c570..1c54c96 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -49,6 +49,7 @@ Patch1: 0001-nfs.conf-allow-empty-assignments.patch Patch2: 0002-Let-systemd-know-when-rpc.statd-is-needed.patch Patch3: 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch Patch4: 0004-nfsidmap-honour-with-pluginpath-for-instalation.patch +Patch5: 0005-nfs.conf-fail-to-disable-major-NFS-version-4-using-v.patch BuildRequires: e2fsprogs-devel BuildRequires: fedfs-utils-devel @@ -150,6 +151,7 @@ This package contains additional NFS documentation. %patch2 -p1 %patch3 -p1 %patch4 -p1 +%patch5 -p1 cp %{SOURCE6} .