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.

155 lines
4.8 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/base/portmap/misc.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. diff -Nur portmap_4.orig/portmap.c portmap_4/portmap.c
  20. --- portmap_4.orig/portmap.c 1996-05-31 15:52:59.000000000 +0200
  21. +++ portmap_4/portmap.c 2005-01-19 20:47:00.000000000 +0100
  22. @@ -80,6 +80,10 @@
  23. * Mountain View, California 94043
  24. */
  25. +#if defined(__GLIBC__)
  26. +#include <rpc/xdr.h>
  27. +#endif /* __GLIBC__ */
  28. +
  29. #include <rpc/rpc.h>
  30. #include <rpc/pmap_prot.h>
  31. #include <stdio.h>
  32. @@ -95,6 +99,9 @@
  33. #include <netinet/in.h>
  34. #endif
  35. +#include <sys/types.h>
  36. +#include <unistd.h>
  37. +
  38. extern char *strerror();
  39. #include <stdlib.h>
  40. @@ -290,7 +298,7 @@
  41. */
  42. /* remote host authorization check */
  43. check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
  44. - if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) {
  45. + if (!svc_sendreply(xprt, (xdrproc_t)xdr_void, (caddr_t)0) && debugging) {
  46. abort();
  47. }
  48. break;
  49. @@ -299,7 +307,7 @@
  50. /*
  51. * Set 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. /* reject non-local requests, protect priv. ports */
  58. @@ -341,7 +349,7 @@
  59. ans = 1;
  60. }
  61. done:
  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. @@ -353,7 +361,7 @@
  68. /*
  69. * Remove a program,version to port mapping.
  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. ans = 0;
  76. @@ -387,7 +395,7 @@
  77. prevpml->pml_next = pml;
  78. free(t);
  79. }
  80. - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
  81. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
  82. debugging) {
  83. (void) fprintf(stderr, "svc_sendreply\n");
  84. abort();
  85. @@ -399,7 +407,7 @@
  86. /*
  87. * Lookup the mapping for a program,version and return its port
  88. */
  89. - if (!svc_getargs(xprt, xdr_pmap, &reg))
  90. + if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (char *)&reg))
  91. svcerr_decode(xprt);
  92. else {
  93. /* remote host authorization check */
  94. @@ -414,7 +422,7 @@
  95. port = fnd->pml_map.pm_port;
  96. else
  97. port = 0;
  98. - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&port)) &&
  99. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&port)) &&
  100. debugging) {
  101. (void) fprintf(stderr, "svc_sendreply\n");
  102. abort();
  103. @@ -426,7 +434,7 @@
  104. /*
  105. * Return the current set of mapped program,version
  106. */
  107. - if (!svc_getargs(xprt, xdr_void, NULL))
  108. + if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL))
  109. svcerr_decode(xprt);
  110. else {
  111. /* remote host authorization check */
  112. @@ -437,7 +445,7 @@
  113. } else {
  114. p = pmaplist;
  115. }
  116. - if ((!svc_sendreply(xprt, xdr_pmaplist,
  117. + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_pmaplist,
  118. (caddr_t)&p)) && debugging) {
  119. (void) fprintf(stderr, "svc_sendreply\n");
  120. abort();
  121. @@ -481,7 +489,7 @@
  122. struct encap_parms *epp;
  123. {
  124. - return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE));
  125. + return (xdr_bytes(xdrs, &(epp->args), (u_int *)&(epp->arglen), ARGSIZE));
  126. }
  127. struct rmtcallargs {
  128. @@ -585,7 +593,7 @@
  129. timeout.tv_sec = 5;
  130. timeout.tv_usec = 0;
  131. a.rmt_args.args = buf;
  132. - if (!svc_getargs(xprt, xdr_rmtcall_args, &a))
  133. + if (!svc_getargs(xprt, (xdrproc_t)xdr_rmtcall_args, (char *)&a))
  134. return;
  135. /* host and service access control */
  136. if (!check_callit(svc_getcaller(xprt),
  137. @@ -614,9 +622,9 @@
  138. au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids);
  139. }
  140. a.rmt_port = (u_long)port;
  141. - if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a,
  142. - xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) {
  143. - svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a);
  144. + if (clnt_call(client, (u_long)a.rmt_proc, (xdrproc_t)xdr_opaque_parms, (char *)&a,
  145. + (xdrproc_t)xdr_len_opaque_parms, (char *)&a, timeout) == RPC_SUCCESS) {
  146. + svc_sendreply(xprt, (xdrproc_t)xdr_rmtcall_result, (caddr_t)&a);
  147. }
  148. AUTH_DESTROY(client->cl_auth);
  149. clnt_destroy(client);