Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nds/rpcbind/files/
Date: Wed, 31 Jan 2018 21:38:31
Message-Id: 1517434703.78aebe852d70109b7fe6073026d6a7262ebd94b3.polynomial-c@gentoo
1 commit: 78aebe852d70109b7fe6073026d6a7262ebd94b3
2 Author: Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Wed Jan 31 17:06:28 2018 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 31 21:38:23 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78aebe85
7
8 net-nds/rpcbind: remove unused patches
9
10 Closes: https://github.com/gentoo/gentoo/pull/7010
11
12 net-nds/rpcbind/files/rpcbind-0.2.3-libtirpc.patch | 42 ----
13 .../rpcbind/files/rpcbind-0.2.3-mem-corrupt.patch | 86 -------
14 .../files/rpcbind-0.2.3-remove-P-macro.patch | 246 ---------------------
15 3 files changed, 374 deletions(-)
16
17 diff --git a/net-nds/rpcbind/files/rpcbind-0.2.3-libtirpc.patch b/net-nds/rpcbind/files/rpcbind-0.2.3-libtirpc.patch
18 deleted file mode 100644
19 index 92ea22f0e4c..00000000000
20 --- a/net-nds/rpcbind/files/rpcbind-0.2.3-libtirpc.patch
21 +++ /dev/null
22 @@ -1,42 +0,0 @@
23 -fix from upstream for building w/newer libtirpc
24 -
25 -From 9194122389f2a56b1cd1f935e64307e2e963c2da Mon Sep 17 00:00:00 2001
26 -From: Steve Dickson <steved@××××××.com>
27 -Date: Mon, 2 Nov 2015 17:05:18 -0500
28 -Subject: [PATCH rpcbind] handle_reply: Don't use the xp_auth pointer directly
29 -
30 -In the latest libtirpc version to access the xp_auth
31 -one must use the SVC_XP_AUTH macro. To be backwards
32 -compatible a couple ifdefs were added to use the
33 -macro when it exists.
34 -
35 -Signed-off-by: Steve Dickson <steved@××××××.com>
36 ----
37 - src/rpcb_svc_com.c | 7 +++++++
38 - 1 file changed, 7 insertions(+)
39 -
40 -diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
41 -index 4ae93f1..22d6c84 100644
42 ---- a/src/rpcb_svc_com.c
43 -+++ b/src/rpcb_svc_com.c
44 -@@ -1295,10 +1295,17 @@ handle_reply(int fd, SVCXPRT *xprt)
45 - a.rmt_localvers = fi->versnum;
46 -
47 - xprt_set_caller(xprt, fi);
48 -+#if defined(SVC_XP_AUTH)
49 -+ SVC_XP_AUTH(xprt) = svc_auth_none;
50 -+#else
51 - xprt->xp_auth = &svc_auth_none;
52 -+#endif
53 - svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a);
54 -+#if !defined(SVC_XP_AUTH)
55 - SVCAUTH_DESTROY(xprt->xp_auth);
56 - xprt->xp_auth = NULL;
57 -+#endif
58 -+
59 - done:
60 - if (buffer)
61 - free(buffer);
62 ---
63 -2.5.2
64 -
65
66 diff --git a/net-nds/rpcbind/files/rpcbind-0.2.3-mem-corrupt.patch b/net-nds/rpcbind/files/rpcbind-0.2.3-mem-corrupt.patch
67 deleted file mode 100644
68 index 9c03bda80a0..00000000000
69 --- a/net-nds/rpcbind/files/rpcbind-0.2.3-mem-corrupt.patch
70 +++ /dev/null
71 @@ -1,86 +0,0 @@
72 -https://bugs.gentoo.org/560990
73 -
74 -fix from upstream
75 -
76 -From d5dace219953c45d26ae42db238052b68540649a Mon Sep 17 00:00:00 2001
77 -From: Olaf Kirch <okir@××××.de>
78 -Date: Fri, 30 Oct 2015 10:18:20 -0400
79 -Subject: [PATCH rpcbind] Fix memory corruption in PMAP_CALLIT code
80 -
81 - - A PMAP_CALLIT call comes in on IPv4 UDP
82 - - rpcbind duplicates the caller's address to a netbuf and stores it in
83 - FINFO[0].caller_addr. caller_addr->buf now points to a memory region A
84 - with a size of 16 bytes
85 - - rpcbind forwards the call to the local service, receives a reply
86 - - when processing the reply, it does this in xprt_set_caller:
87 - xprt->xp_rtaddr = *FINFO[0].caller_addr
88 - It sends out the reply, and then frees the netbuf caller_addr and
89 - caller_addr.buf.
90 - However, it does not clear xp_rtaddr, so xp_rtaddr.buf now refers
91 - to memory region A, which is free.
92 - - When the next call comes in on the UDP/IPv4 socket, svc_dg_recv will
93 - be called, which will set xp_rtaddr to the client's address.
94 - It will reuse the buffer inside xp_rtaddr, ie it will write a
95 - sockaddr_in to region A
96 -
97 -Some time down the road, an incoming TCP connection is accepted,
98 -allocating a fresh SVCXPRT. The memory region A is inside the
99 -new SVCXPRT
100 -
101 - - While processing the TCP call, another UDP call comes in, again
102 - overwriting region A with the client's address
103 - - TCP client closes connection. In svc_destroy, we now trip over
104 - the garbage left in region A
105 -
106 -We ran into the case where a commercial scanner was triggering
107 -occasional rpcbind segfaults. The core file that was captured showed
108 -a corrupted xprt->xp_netid pointer that was really a sockaddr_in.
109 -
110 -Signed-off-by: Olaf Kirch <okir@××××.de>
111 -Signed-off-by: Steve Dickson <steved@××××××.com>
112 ----
113 - src/rpcb_svc_com.c | 23 ++++++++++++++++++++++-
114 - 1 file changed, 22 insertions(+), 1 deletion(-)
115 -
116 -diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
117 -index ff9ce6b..4ae93f1 100644
118 ---- a/src/rpcb_svc_com.c
119 -+++ b/src/rpcb_svc_com.c
120 -@@ -1183,12 +1183,33 @@ check_rmtcalls(struct pollfd *pfds, int nfds)
121 - return (ncallbacks_found);
122 - }
123 -
124 -+/*
125 -+ * This is really a helper function defined in libtirpc,
126 -+ * but unfortunately, it hasn't been exported yet.
127 -+ */
128 -+static struct netbuf *
129 -+__rpc_set_netbuf(struct netbuf *nb, const void *ptr, size_t len)
130 -+{
131 -+ if (nb->len != len) {
132 -+ if (nb->len)
133 -+ mem_free(nb->buf, nb->len);
134 -+ nb->buf = mem_alloc(len);
135 -+ if (nb->buf == NULL)
136 -+ return NULL;
137 -+
138 -+ nb->maxlen = nb->len = len;
139 -+ }
140 -+ memcpy(nb->buf, ptr, len);
141 -+ return nb;
142 -+}
143 -+
144 - static void
145 - xprt_set_caller(SVCXPRT *xprt, struct finfo *fi)
146 - {
147 -+ const struct netbuf *caller = fi->caller_addr;
148 - u_int32_t *xidp;
149 -
150 -- *(svc_getrpccaller(xprt)) = *(fi->caller_addr);
151 -+ __rpc_set_netbuf(svc_getrpccaller(xprt), caller->buf, caller->len);
152 - xidp = __rpcb_get_dg_xidp(xprt);
153 - *xidp = fi->caller_xid;
154 - }
155 ---
156 -2.5.2
157 -
158
159 diff --git a/net-nds/rpcbind/files/rpcbind-0.2.3-remove-P-macro.patch b/net-nds/rpcbind/files/rpcbind-0.2.3-remove-P-macro.patch
160 deleted file mode 100644
161 index 8e1b69beb18..00000000000
162 --- a/net-nds/rpcbind/files/rpcbind-0.2.3-remove-P-macro.patch
163 +++ /dev/null
164 @@ -1,246 +0,0 @@
165 -From 196e8f3abaa6e8899ba2655c6c2d8751e33a9795 Mon Sep 17 00:00:00 2001
166 -From: "Yann E. MORIN" <yann.morin.1998@××××.fr>
167 -Date: Wed, 17 Aug 2016 10:16:47 -0400
168 -Subject: [PATCH] src: remove use of the __P() macro
169 -
170 -The __P() macro is a legacy compatibility macro aimed making pre-ANSI
171 -(i.e. K&R) compilers that do not support function prototypes happy,
172 -while still allowing such prototypes for ANSI-compliant compilers.
173 -
174 -Since virtually all compilers have been ANSI-compliant for a few decades
175 -now, use of __P() is totally useless.
176 -
177 -Furthermore, __P() is defined in the non-standard sys/cdefs.h header.
178 -This header is present in glibc and uClibc, and both have it included
179 -from many of their headers. So, sys/cdefs.h is automagically included in
180 -most cases and its macros are available.
181 -
182 -However, the musl C library does not provide this sys/cdefs.h header.
183 -Thus, the build breaks on musl.
184 -
185 -For all the above reasons, get rid of __P() wherever it is used; just
186 -always declare real function prototypes.
187 -
188 -Reviewed-by: Chuck Lever <chuck.lever@××××××.com>
189 -Signed-off-by: "Yann E. MORIN" <yann.morin.1998@××××.fr>
190 -Signed-off-by: Steve Dickson <steved@××××××.com>
191 -Cc: Chuck Lever <chuck.lever@××××××.com>
192 -Cc: Steve Dickson <SteveD@××××××.com>
193 -Cc: Mike Frysinger <vapier@g.o>
194 ----
195 - src/check_bound.c | 2 +-
196 - src/pmap_svc.c | 10 +++++-----
197 - src/rpcb_svc.c | 10 +++++-----
198 - src/rpcb_svc_4.c | 14 ++++++--------
199 - src/rpcb_svc_com.c | 46 +++++++++++++++++++++++-----------------------
200 - src/rpcbind.c | 12 ++++++------
201 - src/util.c | 2 +-
202 - src/warmstart.c | 4 ++--
203 - 8 files changed, 49 insertions(+), 51 deletions(-)
204 -
205 -diff --git a/src/check_bound.c b/src/check_bound.c
206 -index c70b845..92bfd36 100644
207 ---- a/src/check_bound.c
208 -+++ b/src/check_bound.c
209 -@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */
210 - static struct fdlist *fdtail;
211 - static char *nullstring = "";
212 -
213 --static bool_t check_bound __P((struct fdlist *, char *uaddr));
214 -+static bool_t check_bound(struct fdlist *, char *uaddr);
215 -
216 - /*
217 - * Returns 1 if the given address is bound for the given addr & transport
218 -diff --git a/src/pmap_svc.c b/src/pmap_svc.c
219 -index ad28b93..4c744fe 100644
220 ---- a/src/pmap_svc.c
221 -+++ b/src/pmap_svc.c
222 -@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
223 - #include "rpcbind.h"
224 - #include "xlog.h"
225 - #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
226 --static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
227 -- rpcprot_t));
228 --static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
229 --static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
230 --static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
231 -+static struct pmaplist *find_service_pmap(rpcprog_t, rpcvers_t,
232 -+ rpcprot_t);
233 -+static bool_t pmapproc_change(struct svc_req *, SVCXPRT *, u_long);
234 -+static bool_t pmapproc_getport(struct svc_req *, SVCXPRT *);
235 -+static bool_t pmapproc_dump(struct svc_req *, SVCXPRT *);
236 -
237 - /*
238 - * Called for all the version 2 inquiries.
239 -diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
240 -index bd92201..709e3fb 100644
241 ---- a/src/rpcb_svc.c
242 -+++ b/src/rpcb_svc.c
243 -@@ -53,10 +53,10 @@
244 - #include "rpcbind.h"
245 - #include "xlog.h"
246 -
247 --static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
248 -- rpcvers_t));
249 --static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
250 -- rpcvers_t));
251 -+static void *rpcbproc_getaddr_3_local(void *, struct svc_req *, SVCXPRT *,
252 -+ rpcvers_t);
253 -+static void *rpcbproc_dump_3_local(void *, struct svc_req *, SVCXPRT *,
254 -+ rpcvers_t);
255 -
256 - /*
257 - * Called by svc_getreqset. There is a separate server handle for
258 -@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
259 - } argument;
260 - char *result;
261 - xdrproc_t xdr_argument, xdr_result;
262 -- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
263 -+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
264 - rpcprog_t setprog = 0;
265 -
266 - rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
267 -diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
268 -index b673452..5094879 100644
269 ---- a/src/rpcb_svc_4.c
270 -+++ b/src/rpcb_svc_4.c
271 -@@ -54,13 +54,11 @@
272 - #include "rpcbind.h"
273 - #include "xlog.h"
274 -
275 --static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
276 -- rpcvers_t));
277 --static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
278 --static void *rpcbproc_getaddrlist_4_local
279 -- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
280 --static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
281 --static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
282 -+static void *rpcbproc_getaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
283 -+static void *rpcbproc_getversaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
284 -+static void *rpcbproc_getaddrlist_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
285 -+static void free_rpcb_entry_list(rpcb_entry_list_ptr *);
286 -+static void *rpcbproc_dump_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
287 -
288 - /*
289 - * Called by svc_getreqset. There is a separate server handle for
290 -@@ -78,7 +76,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
291 - } argument;
292 - char *result;
293 - xdrproc_t xdr_argument, xdr_result;
294 -- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
295 -+ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
296 - rpcprog_t setprog = 0;
297 -
298 - rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
299 -diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
300 -index 148fe42..5862c26 100644
301 ---- a/src/rpcb_svc_com.c
302 -+++ b/src/rpcb_svc_com.c
303 -@@ -100,29 +100,29 @@ struct finfo {
304 - static struct finfo FINFO[NFORWARD];
305 -
306 -
307 --static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
308 --static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
309 --static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
310 --static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
311 --static int find_rmtcallfd_by_netid __P((char *));
312 --static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
313 --static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
314 -- rpcproc_t, rpcvers_t, u_int32_t *));
315 --static struct finfo *forward_find __P((u_int32_t));
316 --static int free_slot_by_xid __P((u_int32_t));
317 --static int free_slot_by_index __P((int));
318 --static int netbufcmp __P((struct netbuf *, struct netbuf *));
319 --static struct netbuf *netbufdup __P((struct netbuf *));
320 --static void netbuffree __P((struct netbuf *));
321 --static int check_rmtcalls __P((struct pollfd *, int));
322 --static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
323 --static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
324 --static void handle_reply __P((int, SVCXPRT *));
325 --static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
326 --static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
327 --static char *getowner __P((SVCXPRT *, char *, size_t));
328 --static int add_pmaplist __P((RPCB *));
329 --static int del_pmaplist __P((RPCB *));
330 -+static bool_t xdr_encap_parms(XDR *, struct encap_parms *);
331 -+static bool_t xdr_rmtcall_args(XDR *, struct r_rmtcall_args *);
332 -+static bool_t xdr_rmtcall_result(XDR *, struct r_rmtcall_args *);
333 -+static bool_t xdr_opaque_parms(XDR *, struct r_rmtcall_args *);
334 -+static int find_rmtcallfd_by_netid(char *);
335 -+static SVCXPRT *find_rmtcallxprt_by_fd(int);
336 -+static int forward_register(u_int32_t, struct netbuf *, int, char *,
337 -+ rpcproc_t, rpcvers_t, u_int32_t *);
338 -+static struct finfo *forward_find(u_int32_t);
339 -+static int free_slot_by_xid(u_int32_t);
340 -+static int free_slot_by_index(int);
341 -+static int netbufcmp(struct netbuf *, struct netbuf *);
342 -+static struct netbuf *netbufdup(struct netbuf *);
343 -+static void netbuffree(struct netbuf *);
344 -+static int check_rmtcalls(struct pollfd *, int);
345 -+static void xprt_set_caller(SVCXPRT *, struct finfo *);
346 -+static void send_svcsyserr(SVCXPRT *, struct finfo *);
347 -+static void handle_reply(int, SVCXPRT *);
348 -+static void find_versions(rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
349 -+static rpcblist_ptr find_service(rpcprog_t, rpcvers_t, char *);
350 -+static char *getowner(SVCXPRT *, char *, size_t);
351 -+static int add_pmaplist(RPCB *);
352 -+static int del_pmaplist(RPCB *);
353 -
354 - /*
355 - * Set a mapping of program, version, netid
356 -diff --git a/src/rpcbind.c b/src/rpcbind.c
357 -index c4265cd..87ccdc2 100644
358 ---- a/src/rpcbind.c
359 -+++ b/src/rpcbind.c
360 -@@ -136,13 +136,13 @@ char *tcp_uaddr; /* Universal TCP address */
361 - static char servname[] = "rpcbind";
362 - static char superuser[] = "superuser";
363 -
364 --int main __P((int, char *[]));
365 -+int main(int, char *[]);
366 -
367 --static int init_transport __P((struct netconfig *));
368 --static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
369 -- struct netbuf *));
370 --static void terminate __P((int));
371 --static void parseargs __P((int, char *[]));
372 -+static int init_transport(struct netconfig *);
373 -+static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *,
374 -+ struct netbuf *);
375 -+static void terminate(int);
376 -+static void parseargs(int, char *[]);
377 -
378 - int
379 - main(int argc, char *argv[])
380 -diff --git a/src/util.c b/src/util.c
381 -index a6c835b..74b0284 100644
382 ---- a/src/util.c
383 -+++ b/src/util.c
384 -@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
385 - static struct sockaddr_in6 *local_in6;
386 - #endif
387 -
388 --static int bitmaskcmp __P((void *, void *, void *, int));
389 -+static int bitmaskcmp(void *, void *, void *, int);
390 -
391 - /*
392 - * For all bits set in "mask", compare the corresponding bits in
393 -diff --git a/src/warmstart.c b/src/warmstart.c
394 -index b6eb73e..122a058 100644
395 ---- a/src/warmstart.c
396 -+++ b/src/warmstart.c
397 -@@ -58,8 +58,8 @@
398 - #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr"
399 - #endif
400 -
401 --static bool_t write_struct __P((char *, xdrproc_t, void *));
402 --static bool_t read_struct __P((char *, xdrproc_t, void *));
403 -+static bool_t write_struct(char *, xdrproc_t, void *);
404 -+static bool_t read_struct(char *, xdrproc_t, void *);
405 -
406 - static bool_t
407 - write_struct(char *filename, xdrproc_t structproc, void *list)
408 ---
409 -1.8.3.1
410 -