rpms/autofs/F-7 autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch, NONE, 1.1 autofs.spec, 1.211, 1.212

Ian Kent (iankent) fedora-extras-commits at redhat.com
Fri Jul 27 08:25:10 UTC 2007


Author: iankent

Update of /cvs/pkgs/rpms/autofs/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv3904

Modified Files:
	autofs.spec 
Added Files:
	autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch 
Log Message:
* Fri Jul 27 2007 Ian Kent <ikent at redhat.com> - 5.0.1-22
- fix version passed to get_supported_ver_and_cost (bz 249574).


autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch:

--- NEW FILE autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch ---
diff --git a/modules/replicated.c b/modules/replicated.c
index de1b40c..0764d4a 100644
--- a/modules/replicated.c
+++ b/modules/replicated.c
@@ -607,12 +607,31 @@ static int get_supported_ver_and_cost(struct host *host, unsigned int version, c
 
 	parms.pm_prog = NFS_PROGRAM;
 
+	/*
+	 *  The version passed in is the version as defined in
+	 *  include/replicated.h.  However, the version we want to send
+	 *  off to the rpc calls should match the program version of NFS.
+	 *  So, we do the conversion here.
+	 */
 	if (version & UDP_SELECTED_MASK) {
 		proto = "udp";
-		vers = (version << 8);
-	} else {
+		version >>= 8;
+	} else
 		proto = "tcp";
-		vers = version;
+
+	switch (version) {
+	case NFS2_SUPPORTED:
+		vers = NFS2_VERSION;
+		break;
+	case NFS3_SUPPORTED:
+		vers = NFS3_VERSION;
+		break;
+	case NFS4_SUPPORTED:
+		vers = NFS4_VERSION;
+		break;
+	default:
+		crit(LOGOPT_ANY, "called with invalid version: 0x%x\n", version);
+		return 0;
 	}
 
 	rpc_info.proto = getprotobyname(proto);


Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/F-7/autofs.spec,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- autofs.spec	24 Jul 2007 15:00:07 -0000	1.211
+++ autofs.spec	27 Jul 2007 08:24:37 -0000	1.212
@@ -4,7 +4,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.1
-Release: 21
+Release: 22
 Epoch: 1
 License: GPL
 Group: System Environment/Daemons
@@ -35,6 +35,7 @@
 Patch23: autofs-5.0.1-hi-res-time.patch
 Patch24: autofs-5.0.2-quoted-slash-alone.patch
 Patch25: autofs-5.0.2-fix-dnattr-parse.patch
+Patch26: autofs-5.0.2-fix-nfs-version-in-get-supported-ver-and-cost.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel
 Conflicts: kernel < 2.6.17
@@ -101,6 +102,7 @@
 %patch23 -p1
 %patch24 -p1
 %patch25 -p1
+%patch26 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -153,6 +155,9 @@
 %{_libdir}/autofs/
 
 %changelog
+* Fri Jul 27 2007 Ian Kent <ikent at redhat.com> - 5.0.1-22
+- fix version passed to get_supported_ver_and_cost (bz 249574).
+
 * Tue Jul 24 2007 Ian Kent <ikent at redhat.com> - 5.0.1-21
 - fix parse confusion between attribute and attribute value.
 




More information about the scm-commits mailing list