summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Hork <dan@danny.cz>2023-04-21 10:08:22 -0400
committerSteve Dickson <steved@redhat.com>2023-04-21 13:59:52 -0400
commit3439b9011ff4e0f11e5cde4e8822248de903f6b6 (patch)
treee53cff1c7e693ed729b96ed81df20d82794359cb
parentf7f0abdf267698de3f74a0285405b1b01f40893b (diff)
downloadti-rpc-master.tar.gz
portmapper: allow TCP-only portmapperHEADlibtirpc-1-3-4-rc1master
Code that works in GLIBC's runrpc implementation fails with libtirpc. libtirpc forces the RPC library to talk to the portmapper via UDP, even when the client specifies TCP. This breaks existing code which expect the protocol specified to be honored, even when talking to portmapper. This is upstreaming of an old patch by Rob Riggs reported in Fedora. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1725329 Signed-off-by: Rob Riggs <rob+redhat@pangalactic.org> Signed-off-by: Dan Hork <dan@danny.cz> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/rpcb_clnt.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/rpcb_clnt.c b/src/rpcb_clnt.c
index 9a9de69..d178d86 100644
--- a/src/rpcb_clnt.c
+++ b/src/rpcb_clnt.c
@@ -496,11 +496,7 @@ getpmaphandle(nconf, hostname, tgtaddr)
CLIENT *client = NULL;
rpcvers_t pmapvers = 2;
- /*
- * Try UDP only - there are some portmappers out
- * there that use UDP only.
- */
- if (nconf == NULL || strcmp(nconf->nc_proto, NC_TCP) == 0) {
+ if (nconf == NULL) {
struct netconfig *newnconf;
if ((newnconf = getnetconfigent("udp")) == NULL) {
@@ -509,7 +505,8 @@ getpmaphandle(nconf, hostname, tgtaddr)
}
client = getclnthandle(hostname, newnconf, tgtaddr);
freenetconfigent(newnconf);
- } else if (strcmp(nconf->nc_proto, NC_UDP) == 0) {
+ } else if (strcmp(nconf->nc_proto, NC_UDP) == 0 ||
+ strcmp(nconf->nc_proto, NC_TCP) == 0) {
if (strcmp(nconf->nc_protofmly, NC_INET) != 0)
return NULL;
client = getclnthandle(hostname, nconf, tgtaddr);