bump version
[buildroot.git] / package / portmap / portmap-02-4.0-malloc.patch
blobdb3bf09eea9384890a39f2076879ac2d861c42f4
1 diff -urN portmap_4/daemon.c portmap_4.new/daemon.c
2 --- portmap_4/daemon.c Thu Jun 11 13:53:12 1992
3 +++ portmap_4.new/daemon.c Mon Nov 29 18:37:28 1999
4 @@ -35,7 +35,9 @@
5 static char sccsid[] = "@(#)daemon.c 5.3 (Berkeley) 12/28/90";
6 #endif /* LIBC_SCCS and not lint */
8 +#include <sys/types.h>
9 #include <fcntl.h>
10 +#include <unistd.h>
12 /* From unistd.h */
13 #define STDIN_FILENO 0
14 @@ -44,7 +46,7 @@
16 /* From paths.h */
17 #define _PATH_DEVNULL "/dev/null"
19 +int
20 daemon(nochdir, noclose)
21 int nochdir, noclose;
23 diff -urN portmap_4/from_local.c portmap_4.new/from_local.c
24 --- portmap_4/from_local.c Fri May 31 06:52:58 1996
25 +++ portmap_4.new/from_local.c Tue Nov 30 01:21:27 1999
26 @@ -46,12 +46,14 @@
27 #include <sys/types.h>
28 #include <sys/socket.h>
29 #include <stdio.h>
30 -#include <stdlib.h>
31 +#include <unistd.h>
32 #include <netdb.h>
33 #include <netinet/in.h>
34 #include <net/if.h>
35 #include <sys/ioctl.h>
36 #include <syslog.h>
37 +#include <stdlib.h>
38 +#include <string.h>
40 #ifndef TRUE
41 #define TRUE 1
42 @@ -95,7 +98,7 @@
45 /* find_local - find all IP addresses for this host */
47 +int
48 find_local()
50 struct ifconf ifc;
51 @@ -153,7 +156,7 @@
54 /* from_local - determine whether request comes from the local system */
56 +int
57 from_local(addr)
58 struct sockaddr_in *addr;
60 diff -urN portmap_4/pmap_check.c portmap_4.new/pmap_check.c
61 --- portmap_4/pmap_check.c Sun Nov 21 11:59:01 1993
62 +++ portmap_4.new/pmap_check.c Tue Nov 30 01:19:37 1999
63 @@ -34,7 +34,7 @@
64 #ifndef lint
65 static char sccsid[] = "@(#) pmap_check.c 1.6 93/11/21 20:58:59";
66 #endif
68 +#include <unistd.h>
69 #include <rpc/rpc.h>
70 #include <rpc/pmap_prot.h>
71 #include <syslog.h>
72 @@ -66,6 +66,9 @@
74 /* A handful of macros for "readability". */
76 +/* coming from libwrap.a (tcp_wrappers) */
77 +extern int hosts_ctl(char *daemon, char *name, char *addr, char *user);
79 #define good_client(a) hosts_ctl("portmap", "", inet_ntoa(a->sin_addr), "")
81 #define legal_port(a,p) \
82 @@ -104,6 +107,7 @@
84 /* check_default - additional checks for NULL, DUMP, GETPORT and unknown */
86 +int
87 check_default(addr, proc, prog)
88 struct sockaddr_in *addr;
89 u_long proc;
90 @@ -121,7 +125,7 @@
93 /* check_privileged_port - additional checks for privileged-port updates */
95 +int
96 check_privileged_port(addr, proc, prog, port)
97 struct sockaddr_in *addr;
98 u_long proc;
99 @@ -147,6 +147,6 @@
101 #ifdef LOOPBACK_SETUNSET
103 +int
104 check_setunset(xprt, ludp_xprt, ltcp_xprt, proc, prog, port)
105 SVCXPRT *xprt;
106 SVCXPRT *ludp_xprt;
107 @@ -173,6 +174,6 @@
109 #else
111 +int
112 check_setunset(addr, proc, prog, port)
113 struct sockaddr_in *addr;
114 u_long proc;
115 @@ -160,7 +164,7 @@
118 /* check_callit - additional checks for forwarded requests */
120 +int
121 check_callit(addr, proc, prog, aproc)
122 struct sockaddr_in *addr;
123 u_long proc;
124 @@ -213,13 +217,13 @@
126 struct proc_map *procp;
127 static struct proc_map procmap[] = {
128 - PMAPPROC_CALLIT, "callit",
129 - PMAPPROC_DUMP, "dump",
130 - PMAPPROC_GETPORT, "getport",
131 - PMAPPROC_NULL, "null",
132 - PMAPPROC_SET, "set",
133 - PMAPPROC_UNSET, "unset",
134 - 0, 0,
135 + { PMAPPROC_CALLIT, "callit"},
136 + { PMAPPROC_DUMP, "dump"},
137 + { PMAPPROC_GETPORT, "getport"},
138 + { PMAPPROC_NULL, "null"},
139 + { PMAPPROC_SET, "set"},
140 + { PMAPPROC_UNSET, "unset"},
141 + { 0, 0},
145 @@ -233,7 +237,7 @@
147 if (prognum == 0) {
148 progname = "";
149 - } else if (rpc = getrpcbynumber((int) prognum)) {
150 + } else if ((rpc = getrpcbynumber((int) prognum))) {
151 progname = rpc->r_name;
152 } else {
153 sprintf(progname = progbuf, "%lu", prognum);
154 diff -urN portmap_4/pmap_dump.c portmap_4.new/pmap_dump.c
155 --- portmap_4/pmap_dump.c Thu Jun 11 13:53:16 1992
156 +++ portmap_4.new/pmap_dump.c Tue Nov 30 01:22:07 1999
157 @@ -22,7 +22,7 @@
158 #include <rpc/pmap_prot.h>
160 static char *protoname();
162 +int
163 main(argc, argv)
164 int argc;
165 char **argv;
166 diff -urN portmap_4/pmap_set.c portmap_4.new/pmap_set.c
167 --- portmap_4/pmap_set.c Thu Jun 11 13:53:17 1992
168 +++ portmap_4.new/pmap_set.c Tue Nov 30 01:23:49 1999
169 @@ -17,6 +17,9 @@
170 #include <rpc/rpc.h>
171 #include <rpc/pmap_clnt.h>
173 +int parse_line(char *buf, u_long *, u_long *, int *, unsigned *);
175 +int
176 main(argc, argv)
177 int argc;
178 char **argv;
179 @@ -42,7 +45,7 @@
182 /* parse_line - convert line to numbers */
184 +int
185 parse_line(buf, prog, vers, prot, port)
186 char *buf;
187 u_long *prog;
188 diff -urN portmap_4/portmap.c portmap_4.new/portmap.c
189 --- portmap_4/portmap.c Fri May 31 06:52:59 1996
190 +++ portmap_4.new/portmap.c Tue Nov 30 01:01:32 1999
191 @@ -83,6 +83,7 @@
192 #include <rpc/rpc.h>
193 #include <rpc/pmap_prot.h>
194 #include <stdio.h>
195 +#include <unistd.h>
196 #include <syslog.h>
197 #include <netdb.h>
198 #include <sys/socket.h>
199 @@ -128,6 +129,7 @@
201 #include "pmap_check.h"
203 +int
204 main(argc, argv)
205 int argc;
206 char **argv;
207 @@ -229,6 +231,7 @@
208 svc_run();
209 syslog(LOG_ERR, "run_svc returned unexpectedly");
210 abort();
211 + /* never reached */
214 #ifndef lint
215 @@ -290,7 +293,7 @@
217 /* remote host authorization check */
218 check_default(svc_getcaller(xprt), rqstp->rq_proc, (u_long) 0);
219 - if (!svc_sendreply(xprt, xdr_void, (caddr_t)0) && debugging) {
220 + if (!svc_sendreply(xprt, (xdrproc_t)xdr_void, (caddr_t)0) && debugging) {
221 abort();
223 break;
224 @@ -299,7 +302,7 @@
226 * Set a program,version to port mapping
228 - if (!svc_getargs(xprt, xdr_pmap, &reg))
229 + if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
230 svcerr_decode(xprt);
231 else {
232 /* reject non-local requests, protect priv. ports */
233 @@ -341,7 +344,7 @@
234 ans = 1;
236 done:
237 - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
238 + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
239 debugging) {
240 (void) fprintf(stderr, "svc_sendreply\n");
241 abort();
242 @@ -353,7 +356,7 @@
244 * Remove a program,version to port mapping.
246 - if (!svc_getargs(xprt, xdr_pmap, &reg))
247 + if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
248 svcerr_decode(xprt);
249 else {
250 ans = 0;
251 @@ -387,7 +390,7 @@
252 prevpml->pml_next = pml;
253 free(t);
255 - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&ans)) &&
256 + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&ans)) &&
257 debugging) {
258 (void) fprintf(stderr, "svc_sendreply\n");
259 abort();
260 @@ -399,7 +402,7 @@
262 * Lookup the mapping for a program,version and return its port
264 - if (!svc_getargs(xprt, xdr_pmap, &reg))
265 + if (!svc_getargs(xprt, (xdrproc_t)xdr_pmap, (caddr_t)&reg))
266 svcerr_decode(xprt);
267 else {
268 /* remote host authorization check */
269 @@ -414,7 +417,7 @@
270 port = fnd->pml_map.pm_port;
271 else
272 port = 0;
273 - if ((!svc_sendreply(xprt, xdr_int, (caddr_t)&port)) &&
274 + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_int, (caddr_t)&port)) &&
275 debugging) {
276 (void) fprintf(stderr, "svc_sendreply\n");
277 abort();
278 @@ -426,7 +429,7 @@
280 * Return the current set of mapped program,version
282 - if (!svc_getargs(xprt, xdr_void, NULL))
283 + if (!svc_getargs(xprt, (xdrproc_t)xdr_void, NULL))
284 svcerr_decode(xprt);
285 else {
286 /* remote host authorization check */
287 @@ -437,7 +440,7 @@
288 } else {
289 p = pmaplist;
291 - if ((!svc_sendreply(xprt, xdr_pmaplist,
292 + if ((!svc_sendreply(xprt, (xdrproc_t)xdr_pmaplist,
293 (caddr_t)&p)) && debugging) {
294 (void) fprintf(stderr, "svc_sendreply\n");
295 abort();
296 @@ -481,7 +484,7 @@
297 struct encap_parms *epp;
300 - return (xdr_bytes(xdrs, &(epp->args), &(epp->arglen), ARGSIZE));
301 + return (xdr_bytes(xdrs, &(epp->args), (u_int *)&(epp->arglen), ARGSIZE));
304 struct rmtcallargs {
305 @@ -585,7 +588,7 @@
306 timeout.tv_sec = 5;
307 timeout.tv_usec = 0;
308 a.rmt_args.args = buf;
309 - if (!svc_getargs(xprt, xdr_rmtcall_args, &a))
310 + if (!svc_getargs(xprt, (xdrproc_t)xdr_rmtcall_args, (caddr_t)&a))
311 return;
312 /* host and service access control */
313 if (!check_callit(svc_getcaller(xprt),
314 @@ -614,9 +617,9 @@
315 au->aup_uid, au->aup_gid, au->aup_len, au->aup_gids);
317 a.rmt_port = (u_long)port;
318 - if (clnt_call(client, a.rmt_proc, xdr_opaque_parms, &a,
319 - xdr_len_opaque_parms, &a, timeout) == RPC_SUCCESS) {
320 - svc_sendreply(xprt, xdr_rmtcall_result, (caddr_t)&a);
321 + if (clnt_call(client, a.rmt_proc, (xdrproc_t)xdr_opaque_parms, (caddr_t)&a,
322 + (xdrproc_t)xdr_len_opaque_parms, (caddr_t)&a, timeout) == RPC_SUCCESS) {
323 + svc_sendreply(xprt, (xdrproc_t)xdr_rmtcall_result, (caddr_t)&a);
325 AUTH_DESTROY(client->cl_auth);
326 clnt_destroy(client);
328 +--------------------------------------------------------------------+
329 | Ste'phane ERANIAN | Email eranian@hpl.hp.com |
330 | Hewlett-Packard Laboratories | |
331 | 1501, Page Mill Road MS 1U-15 | |
332 | Palo Alto, CA 94303-096 | |
333 | USA | |
334 | Tel : (650) 857-7174 | |
335 | Fax : (650) 857-5548 | |
336 +--------------------------------------------------------------------+