rpms/nfs-utils/devel nfs-utils-1.2.0-mntconf-negation.patch, NONE, 1.1 nfs-utils-1.2.0-mntconf-vers.patch, NONE, 1.1 nfs-utils-1.2.0-mount-vers4.patch, 1.1, 1.2 nfs-utils.spec, 1.243, 1.244
Steve Dickson
steved at fedoraproject.org
Thu Oct 1 11:50:41 UTC 2009
Author: steved
Update of /cvs/pkgs/rpms/nfs-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16464
Modified Files:
nfs-utils-1.2.0-mount-vers4.patch nfs-utils.spec
Added Files:
nfs-utils-1.2.0-mntconf-negation.patch
nfs-utils-1.2.0-mntconf-vers.patch
Log Message:
- Change the nfsmount.conf file to define v3 as the default
protocol version.
- Make sure versions set on the command line override version
set in nfsmount.conf
- Make version rollbacks still work when versions are set in
nfsmount.conf
nfs-utils-1.2.0-mntconf-negation.patch:
configfile.c | 13 +++++++++++++
stropts.c | 11 ++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
--- NEW FILE nfs-utils-1.2.0-mntconf-negation.patch ---
diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mount/configfile.c
--- nfs-utils-1.2.0/utils/mount/configfile.c.orig 2009-09-30 13:57:48.647286000 -0400
+++ nfs-utils-1.2.0/utils/mount/configfile.c 2009-09-30 14:50:05.365468000 -0400
@@ -198,6 +198,15 @@ int inline check_vers(char *mopt, char *
}
return 0;
}
+int inline vers_is_set(char *mopt)
+{
+ int i;
+
+ for (i=0; versions[i]; i++)
+ if (strncasecmp(mopt, versions[i], strlen(versions[i])) == 0)
+ return 1;
+ return 0;
+}
/*
* Parse the given section of the configuration
* file to if there are any mount options set.
@@ -256,6 +265,8 @@ conf_parse_mntopts(char *section, char *
conf_free_list(list);
}
+int do_version_negation;
+
/*
* Concatenate options from the configuration file with the
* given options by building a link list of options from the
@@ -326,6 +337,8 @@ char *conf_get_mntopts(char *spec, char
strcat(config_opts, ",");
}
SLIST_FOREACH(entry, &head, entries) {
+ if (vers_is_set(entry->opt))
+ do_version_negation = 1;
strcat(config_opts, entry->opt);
strcat(config_opts, ",");
}
diff -up nfs-utils-1.2.0/utils/mount/stropts.c.orig nfs-utils-1.2.0/utils/mount/stropts.c
--- nfs-utils-1.2.0/utils/mount/stropts.c.orig 2009-09-30 13:57:48.613288000 -0400
+++ nfs-utils-1.2.0/utils/mount/stropts.c 2009-09-30 14:59:56.716461000 -0400
@@ -588,6 +588,7 @@ out_fail:
po_destroy(options);
return result;
}
+extern int do_version_negation;
/*
* This is a single pass through the fg/bg loop.
@@ -607,12 +608,20 @@ static int nfs_try_mount(struct nfsmount
if (errno != EPROTONOSUPPORT)
break;
}
- case 2:
case 3:
+ if (do_version_negation)
+ po_remove_all(mi->options, "nfsvers");
+ case 2:
result = nfs_try_mount_v3v2(mi);
break;
case 4:
result = nfs_try_mount_v4(mi);
+ if (do_version_negation && !result) {
+ if (errno == EPROTONOSUPPORT) {
+ po_remove_all(mi->options, "nfsvers");
+ result = nfs_try_mount_v3v2(mi);
+ }
+ }
break;
default:
errno = EIO;
nfs-utils-1.2.0-mntconf-vers.patch:
configfile.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
--- NEW FILE nfs-utils-1.2.0-mntconf-vers.patch ---
diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mount/configfile.c
--- nfs-utils-1.2.0/utils/mount/configfile.c.orig 2009-09-30 11:38:53.745992000 -0400
+++ nfs-utils-1.2.0/utils/mount/configfile.c 2009-09-30 13:49:38.480625000 -0400
@@ -185,6 +185,19 @@ void free_all(void)
free(entry);
}
}
+static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL};
+int inline check_vers(char *mopt, char *field)
+{
+ int i;
+
+ if (strcasecmp(field, "nfsvers") == 0 ||
+ strcasecmp(field, "vers") == 0) {
+ for (i=0; versions[i]; i++)
+ if (strncasecmp(mopt, versions[i], strlen(versions[i])) == 0)
+ return 1;
+ }
+ return 0;
+}
/*
* Parse the given section of the configuration
* file to if there are any mount options set.
@@ -207,6 +220,12 @@ conf_parse_mntopts(char *section, char *
snprintf(buf, BUFSIZ, "%s=", node->field);
if (opts && strcasestr(opts, buf) != NULL)
continue;
+ /*
+ * Protocol verions can be set in a number of ways
+ */
+ if (opts && check_vers(opts, node->field))
+ continue;
+
if (lookup_entry(node->field) != NULL)
continue;
buf[0] = '\0';
nfs-utils-1.2.0-mount-vers4.patch:
nfsmount.conf | 6 +++---
stropts.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
Index: nfs-utils-1.2.0-mount-vers4.patch
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs-utils-1.2.0-mount-vers4.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- nfs-utils-1.2.0-mount-vers4.patch 30 Sep 2009 00:52:00 -0000 1.1
+++ nfs-utils-1.2.0-mount-vers4.patch 1 Oct 2009 11:50:39 -0000 1.2
@@ -1,6 +1,6 @@
diff -up nfs-utils-1.2.0/utils/mount/nfsmount.conf.orig nfs-utils-1.2.0/utils/mount/nfsmount.conf
---- nfs-utils-1.2.0/utils/mount/nfsmount.conf.orig 2009-09-29 18:48:47.000000000 -0400
-+++ nfs-utils-1.2.0/utils/mount/nfsmount.conf 2009-09-29 19:02:06.000000000 -0400
+--- nfs-utils-1.2.0/utils/mount/nfsmount.conf.orig 2009-09-30 11:32:14.148326000 -0400
++++ nfs-utils-1.2.0/utils/mount/nfsmount.conf 2009-09-30 11:35:24.714787000 -0400
@@ -24,12 +24,12 @@
# All reads and writes to the 'nfsserver.foo.com' server
# will be done with 32k (32768 bytes) block sizes.
@@ -13,13 +13,13 @@ diff -up nfs-utils-1.2.0/utils/mount/nfs
-# Protocol Version [2,3]
-# Nfsvers=3
+# Protocol Version [2,3,4]
-+#Nfsvers=3
++Nfsvers=3
# Network Transport [Udp,Tcp,Rdma]
# Proto=Tcp
#
diff -up nfs-utils-1.2.0/utils/mount/stropts.c.orig nfs-utils-1.2.0/utils/mount/stropts.c
---- nfs-utils-1.2.0/utils/mount/stropts.c.orig 2009-09-29 18:48:47.000000000 -0400
-+++ nfs-utils-1.2.0/utils/mount/stropts.c 2009-09-29 19:01:10.000000000 -0400
+--- nfs-utils-1.2.0/utils/mount/stropts.c.orig 2009-09-30 11:32:14.214327000 -0400
++++ nfs-utils-1.2.0/utils/mount/stropts.c 2009-09-30 11:34:35.841020000 -0400
@@ -601,7 +601,7 @@ static int nfs_try_mount(struct nfsmount
switch (mi->version) {
Index: nfs-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nfs-utils/devel/nfs-utils.spec,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -p -r1.243 -r1.244
--- nfs-utils.spec 30 Sep 2009 00:52:00 -0000 1.243
+++ nfs-utils.spec 1 Oct 2009 11:50:39 -0000 1.244
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting cl
Name: nfs-utils
URL: http://sourceforge.net/projects/nfs
Version: 1.2.0
-Release: 13%{?dist}
+Release: 14%{?dist}
Epoch: 1
# group all 32bit related archs
@@ -32,6 +32,9 @@ Patch106: nfs-utils-1.2.0-mount-vers4.pa
Patch200: nfs-utils-1.2.0-v4root-rel6.patch
+Patch300: nfs-utils-1.2.0-mntconf-vers.patch
+Patch301: nfs-utils-1.2.0-mntconf-negation.patch
+
Group: System Environment/Daemons
Provides: exportfs = %{epoch}:%{version}-%{release}
Provides: nfsstat = %{epoch}:%{version}-%{release}
@@ -92,6 +95,9 @@ This package also contains the mount.nfs
%patch200 -p1
+%patch300 -p1
+%patch301 -p1
+
# Remove .orig files
find . -name "*.orig" | xargs rm -f
@@ -262,6 +268,14 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4
%changelog
+* Wed Sep 30 2009 Steve Dickson <steved at redhat.com> 1.2.0-14
+- Change the nfsmount.conf file to define v3 as the default
+ protocol version.
+- Make sure versions set on the command line override version
+ set in nfsmount.conf
+- Make version rollbacks still work when versions are set in
+ nfsmount.conf
+
* Tue Sep 29 2009 Steve Dickson <steved at redhat.com> 1.2.0-13
- Added upstream 1.2.1-rc5 patch
- mount.nfs: Support negotiation between v4, v3, and v2
More information about the fedora-extras-commits
mailing list