autofs/autofs-5.0.8-fix-portmap-not-trying-proto-v2.patch
2014-02-19 10:18:32 +08:00

60 lines
1.6 KiB
Diff

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