Fixed a whole where '-o v4' was not overriding the version in the conf

file.
This commit is contained in:
Steve Dickson 2009-10-06 10:50:48 +00:00
parent 172d6d19bb
commit cb3fa4ca36
2 changed files with 14 additions and 9 deletions

View File

@ -1,7 +1,7 @@
diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mount/configfile.c 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.orig 2009-10-02 11:10:01.000000000 -0400
+++ nfs-utils-1.2.0/utils/mount/configfile.c 2009-09-30 13:49:38.480625000 -0400 +++ nfs-utils-1.2.0/utils/mount/configfile.c 2009-10-02 11:14:30.000000000 -0400
@@ -185,6 +185,19 @@ void free_all(void) @@ -185,6 +185,20 @@ void free_all(void)
free(entry); free(entry);
} }
} }
@ -10,10 +10,11 @@ diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mou
+{ +{
+ int i; + int i;
+ +
+ if (strcasecmp(field, "nfsvers") == 0 || + if (strncmp("mountvers", field, strlen("mountvers") != 0 &&
+ strcasecmp(field, "vers") == 0) { + (strcasecmp(field, "nfsvers") == 0 ||
+ for (i=0; versions[i]; i++) + strcasecmp(field, "vers") == 0))) {
+ if (strncasecmp(mopt, versions[i], strlen(versions[i])) == 0) + for (i=0; versions[i]; i++)
+ if (strcasestr(mopt, versions[i]) != NULL)
+ return 1; + return 1;
+ } + }
+ return 0; + return 0;
@ -21,7 +22,7 @@ diff -up nfs-utils-1.2.0/utils/mount/configfile.c.orig nfs-utils-1.2.0/utils/mou
/* /*
* Parse the given section of the configuration * Parse the given section of the configuration
* file to if there are any mount options set. * file to if there are any mount options set.
@@ -207,6 +220,12 @@ conf_parse_mntopts(char *section, char * @@ -207,6 +221,12 @@ conf_parse_mntopts(char *section, char *
snprintf(buf, BUFSIZ, "%s=", node->field); snprintf(buf, BUFSIZ, "%s=", node->field);
if (opts && strcasestr(opts, buf) != NULL) if (opts && strcasestr(opts, buf) != NULL)
continue; continue;

View File

@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
Name: nfs-utils Name: nfs-utils
URL: http://sourceforge.net/projects/nfs URL: http://sourceforge.net/projects/nfs
Version: 1.2.0 Version: 1.2.0
Release: 15%{?dist} Release: 16%{?dist}
Epoch: 1 Epoch: 1
# group all 32bit related archs # group all 32bit related archs
@ -268,6 +268,10 @@ fi
%attr(4755,root,root) /sbin/umount.nfs4 %attr(4755,root,root) /sbin/umount.nfs4
%changelog %changelog
* Mon Oct 5 2009 Steve Dickson <steved@redhat.com> 1.2.0-16
- Fixed a whole where '-o v4' was not overriding the
version in the conf file.
* Wed Sep 30 2009 Steve Dickson <steved@redhat.com> 1.2.0-15 * Wed Sep 30 2009 Steve Dickson <steved@redhat.com> 1.2.0-15
- Change the nfsmount.conf file to define v3 as the default - Change the nfsmount.conf file to define v3 as the default
protocol version. protocol version.