From 0a22fd5a87c1a951fc662e820bb0a1998ebc88b8 Mon Sep 17 00:00:00 2001 From: Sebastian Jaenicke Date: Wed, 16 Feb 2005 15:33:41 +0000 Subject: [PATCH] tsa: fixes various small bugs in portmap [2005011920520126394] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@5570 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/portmap/misc.patch | 136 ++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 package/base/portmap/misc.patch diff --git a/package/base/portmap/misc.patch b/package/base/portmap/misc.patch new file mode 100644 index 000000000..4ee526650 --- /dev/null +++ b/package/base/portmap/misc.patch @@ -0,0 +1,136 @@ +diff -Nur portmap_4.orig/portmap.c portmap_4/portmap.c +--- portmap_4.orig/portmap.c 1996-05-31 15:52:59.000000000 +0200 ++++ portmap_4/portmap.c 2005-01-19 20:47:00.000000000 +0100 +@@ -80,6 +80,10 @@ + * Mountain View, California 94043 + */ + ++#if defined(__GLIBC__) ++#include ++#endif /* __GLIBC__ */ ++ + #include + #include + #include +@@ -95,6 +99,9 @@ + #include + #endif + ++#include ++#include ++ + extern char *strerror(); + #include + +@@ -290,7 +298,7 @@ + */ + /* remote host authorization check */ + check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0); +- if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) { ++ if (!svc_sendreply(xprt, (xdrproc_t)xdr_void, (caddr_t)0) && debugging) { + abort(); + } + break; +@@ -299,7 +307,7 @@ + /* + * Set a program,version to port mapping + */ +- if (!svc_getargs(xprt, xdr_pmap, ®)) ++ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) + svcerr_decode(xprt); + else { + /* reject non-local requests, protect priv. ports */ +@@ -341,7 +349,7 @@ + ans = 1; + } + done: +- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) && ++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) && + debugging) { + (void) fprintf(stderr, "svc_sendreply\n"); + abort(); +@@ -353,7 +361,7 @@ + /* + * Remove a program,version to port mapping. + */ +- if (!svc_getargs(xprt, xdr_pmap, ®)) ++ if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)®)) + svcerr_decode(xprt); + else { + ans = 0; +@@ -387,7 +395,7 @@ + prevpml->pml_next = pml; + free(t); + } +- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) && ++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) && + debugging) { + (void) fprintf(stderr, "svc_sendreply\n"); + abort(); +@@ -399,7 +407,7 @@ + /* + * Lookup the mapping for a program,version and return its port + */ +- if (!svc_getargs(xprt, xdr_pmap, ®)) ++ if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (char *)®)) + svcerr_decode(xprt); + else { + /* remote host authorization check */ +@@ -414,7 +422,7 @@ + port = fnd->pml_map.pm_port; + else + port = 0; +- if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&port)) && ++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&port)) && + debugging) { + (void) fprintf(stderr, "svc_sendreply\n"); + abort(); +@@ -426,7 +434,7 @@ + /* + * Return the current set of mapped program,version + */ +- if (!svc_getargs(xprt, xdr_void, NULL)) ++ if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL)) + svcerr_decode(xprt); + else { + /* remote host authorization check */ +@@ -437,7 +445,7 @@ + } else { + p = pmaplist; + } +- if ((!svc_sendreply(xprt, xdr_pmaplist, ++ if ((!svc_sendreply(xprt, (xdrproc_t)xdr_pmaplist, + (caddr_t)&p)) && debugging) { + (void) fprintf(stderr, "svc_sendreply\n"); + abort(); +@@ -481,7 +489,7 @@ + struct encap_parms *epp; + { + +- return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE)); ++ return (xdr_bytes(xdrs, &(epp->args), (u_int *)&(epp->arglen), ARGSIZE)); + } + + struct rmtcallargs { +@@ -585,7 +593,7 @@ + timeout.tv_sec = 5; + timeout.tv_usec = 0; + a.rmt_args.args = buf; +- if (!svc_getargs(xprt, xdr_rmtcall_args, &a)) ++ if (!svc_getargs(xprt, (xdrproc_t)xdr_rmtcall_args, (char *)&a)) + return; + /* host and service access control */ + if (!check_callit(svc_getcaller(xprt), +@@ -614,9 +622,9 @@ + au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids); + } + a.rmt_port = (u_long)port; +- if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a, +- xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) { +- svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a); ++ if (clnt_call(client, (u_long)a.rmt_proc, (xdrproc_t)xdr_opaque_parms, (char *)&a, ++ (xdrproc_t)xdr_len_opaque_parms, (char *)&a, timeout) == RPC_SUCCESS) { ++ svc_sendreply(xprt, (xdrproc_t)xdr_rmtcall_result, (caddr_t)&a); + } + AUTH_DESTROY(client->cl_auth); + clnt_destroy(client);