Blame SOURCES/autofs-5.0.8-fix-portmap-not-trying-proto-v2.patch

304803
autofs-5.0.8 - fix portmap not trying proto v2
304803
304803
From: Ian Kent <raven@themaw.net>
304803
304803
The latest change to fix a problem with getting an exports list
304803
from a server doesn't try portmap version 2 when trying to get
304803
a service port number. This causes servers that offer only
304803
version 2 to not be able to provide a service port number.
304803
---
304803
 CHANGELOG      |    1 +
304803
 lib/rpc_subs.c |   17 ++++++++++++++++-
304803
 2 files changed, 17 insertions(+), 1 deletion(-)
304803
304803
--- autofs-5.0.7.orig/CHANGELOG
304803
+++ autofs-5.0.7/CHANGELOG
304803
@@ -69,6 +69,7 @@
304803
 - fix fix ipv6 libtirpc getport.
304803
 - get_nfs_info() should query portmapper if port is not given.
304803
 - fix rpc_portmap_getport() proto not set.
304803
+- fix protmap not trying proto v2.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
--- autofs-5.0.7.orig/lib/rpc_subs.c
304803
+++ autofs-5.0.7/lib/rpc_subs.c
304803
@@ -524,10 +524,15 @@ static enum clnt_stat rpc_rpcb_getport(C
304803
 			if (rpcerr.re_vers.low > RPCBVERS4)
304803
 				return status;
304803
 			continue;
304803
+
304803
 		case RPC_PROGUNAVAIL:
304803
 			continue;
304803
+
304803
+		case RPC_PROGNOTREGISTERED:
304803
+			continue;
304803
+
304803
 		default:
304803
-                        /* Most likely RPC_TIMEDOUT or RPC_CANTRECV */
304803
+			/* Most likely RPC_TIMEDOUT or RPC_CANTRECV */
304803
 			return status;
304803
 		}
304803
 	}
304803
@@ -575,6 +580,16 @@ static enum clnt_stat rpc_getport(struct
304803
 	free(netid);
304803
 	free(raddr);
304803
 
304803
+	if (status == RPC_PROGNOTREGISTERED) {
304803
+		/* Last chance, version 2 uses a different procedure */
304803
+		rpcvers_t rpcb_version = PMAPVERS;
304803
+		CLNT_CONTROL(client, CLSET_VERS, (void *) &rpcb_version);
304803
+		status = clnt_call(client, PMAPPROC_GETPORT,
304803
+				  (xdrproc_t) xdr_pmap, (caddr_t) parms,
304803
+				  (xdrproc_t) xdr_u_short, (caddr_t) port,
304803
+				  info->timeout);
304803
+	}
304803
+
304803
 	return status;
304803
 }
304803
 #endif