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

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