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

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