autofs-5.0.8 - fix portmap not trying proto v2 From: Ian Kent 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(-) diff --git a/CHANGELOG b/CHANGELOG index 5d134bc..a9263c8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ - fix fix ipv6 libtirpc getport. - get_nfs_info() should query portmapper if port is not given. - fix rpc_portmap_getport() proto not set. +- fix protmap not trying proto v2. 17/10/2013 autofs-5.0.8 ======================= diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c index 7c99ea8..daa7c5b 100644 --- a/lib/rpc_subs.c +++ b/lib/rpc_subs.c @@ -524,10 +524,15 @@ static enum clnt_stat rpc_rpcb_getport(CLIENT *client, 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 conn_info *info, 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