Blame SOURCES/autofs-5.0.8-get_nfs_info-should-query-portmapper-if-port-is-not-given.patch

306fa1
autofs-5.0.8 - get_nfs_info() should query portmapper if port is not given
306fa1
306fa1
From: Scott Mayhew <smayhew@redhat.com>
306fa1
306fa1
It shouldn't just assume it can use port 2049.
306fa1
306fa1
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
306fa1
---
306fa1
 CHANGELOG            |    1 +
306fa1
 modules/replicated.c |    9 ++++++---
306fa1
 2 files changed, 7 insertions(+), 3 deletions(-)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -67,6 +67,7 @@
306fa1
 - fix ipv6 libtirpc getport.
306fa1
 - improve timeout option description.
306fa1
 - fix fix ipv6 libtirpc getport.
306fa1
+- get_nfs_info() should query portmapper if port is not given.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/replicated.c
306fa1
+++ autofs-5.0.7/modules/replicated.c
306fa1
@@ -444,9 +444,12 @@ static unsigned int get_nfs_info(unsigne
306fa1
 		      host->name, proto, version);
306fa1
 
306fa1
 	rpc_info->proto = proto;
306fa1
-	if (port < 0)
306fa1
-		rpc_info->port = NFS_PORT;
306fa1
-	else if (port > 0)
306fa1
+	if (port < 0) {
306fa1
+		if (version & NFS4_REQUESTED)
306fa1
+			rpc_info->port = NFS_PORT;
306fa1
+		else
306fa1
+			port = 0;
306fa1
+	} else if (port > 0)
306fa1
 		rpc_info->port = port;
306fa1
 
306fa1
 	memset(&parms, 0, sizeof(struct pmap));