mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
4.0 KiB

  1. diff -Nur portmap_4.orig/portmap.c portmap_4/portmap.c
  2. --- portmap_4.orig/portmap.c 1996-05-31 15:52:59.000000000 +0200
  3. +++ portmap_4/portmap.c 2005-01-19 20:47:00.000000000 +0100
  4. @@ -80,6 +80,10 @@
  5. * Mountain View, California 94043
  6. */
  7. +#if defined(__GLIBC__)
  8. +#include <rpc/xdr.h>
  9. +#endif /* __GLIBC__ */
  10. +
  11. #include <rpc/rpc.h>
  12. #include <rpc/pmap_prot.h>
  13. #include <stdio.h>
  14. @@ -95,6 +99,9 @@
  15. #include <netinet/in.h>
  16. #endif
  17. +#include <sys/types.h>
  18. +#include <unistd.h>
  19. +
  20. extern char *strerror();
  21. #include <stdlib.h>
  22. @@ -290,7 +298,7 @@
  23. */
  24. /* remote host authorization check */
  25. check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
  26. - if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) {
  27. + if (!svc_sendreply(xprt, (xdrproc_t)xdr_void, (caddr_t)0) && debugging) {
  28. abort();
  29. }
  30. break;
  31. @@ -299,7 +307,7 @@
  32. /*
  33. * Set a program,version to port mapping
  34. */
  35. - if (!svc_getargs(xprt, xdr_pmap, &reg))
  36. + if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg))
  37. svcerr_decode(xprt);
  38. else {
  39. /* reject non-local requests, protect priv. ports */
  40. @@ -341,7 +349,7 @@
  41. ans = 1;
  42. }
  43. done:
  44. - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
  45. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
  46. debugging) {
  47. (void) fprintf(stderr, "svc_sendreply\n");
  48. abort();
  49. @@ -353,7 +361,7 @@
  50. /*
  51. * Remove a program,version to port mapping.
  52. */
  53. - if (!svc_getargs(xprt, xdr_pmap, &reg))
  54. + if (!svc_getargs(xprt, (xdrproc_t) xdr_pmap, (char *)&reg))
  55. svcerr_decode(xprt);
  56. else {
  57. ans = 0;
  58. @@ -387,7 +395,7 @@
  59. prevpml->pml_next = pml;
  60. free(t);
  61. }
  62. - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
  63. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
  64. debugging) {
  65. (void) fprintf(stderr, "svc_sendreply\n");
  66. abort();
  67. @@ -399,7 +407,7 @@
  68. /*
  69. * Lookup the mapping for a program,version and return its port
  70. */
  71. - if (!svc_getargs(xprt, xdr_pmap, &reg))
  72. + if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (char *)&reg))
  73. svcerr_decode(xprt);
  74. else {
  75. /* remote host authorization check */
  76. @@ -414,7 +422,7 @@
  77. port = fnd->pml_map.pm_port;
  78. else
  79. port = 0;
  80. - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&port)) &&
  81. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&port)) &&
  82. debugging) {
  83. (void) fprintf(stderr, "svc_sendreply\n");
  84. abort();
  85. @@ -426,7 +434,7 @@
  86. /*
  87. * Return the current set of mapped program,version
  88. */
  89. - if (!svc_getargs(xprt, xdr_void, NULL))
  90. + if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL))
  91. svcerr_decode(xprt);
  92. else {
  93. /* remote host authorization check */
  94. @@ -437,7 +445,7 @@
  95. } else {
  96. p = pmaplist;
  97. }
  98. - if ((!svc_sendreply(xprt, xdr_pmaplist,
  99. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_pmaplist,
  100. (caddr_t)&p)) && debugging) {
  101. (void) fprintf(stderr, "svc_sendreply\n");
  102. abort();
  103. @@ -481,7 +489,7 @@
  104. struct encap_parms *epp;
  105. {
  106. - return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE));
  107. + return (xdr_bytes(xdrs, &(epp->args), (u_int *)&(epp->arglen), ARGSIZE));
  108. }
  109. struct rmtcallargs {
  110. @@ -585,7 +593,7 @@
  111. timeout.tv_sec = 5;
  112. timeout.tv_usec = 0;
  113. a.rmt_args.args = buf;
  114. - if (!svc_getargs(xprt, xdr_rmtcall_args, &a))
  115. + if (!svc_getargs(xprt, (xdrproc_t)xdr_rmtcall_args, (char *)&a))
  116. return;
  117. /* host and service access control */
  118. if (!check_callit(svc_getcaller(xprt),
  119. @@ -614,9 +622,9 @@
  120. au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids);
  121. }
  122. a.rmt_port = (u_long)port;
  123. - if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a,
  124. - xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) {
  125. - svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a);
  126. + if (clnt_call(client, (u_long)a.rmt_proc, (xdrproc_t)xdr_opaque_parms, (char *)&a,
  127. + (xdrproc_t)xdr_len_opaque_parms, (char *)&a, timeout) == RPC_SUCCESS) {
  128. + svc_sendreply(xprt, (xdrproc_t)xdr_rmtcall_result, (caddr_t)&a);
  129. }
  130. AUTH_DESTROY(client->cl_auth);
  131. clnt_destroy(client);