Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-nds/rpcbind/files/, net-nds/rpcbind/
Date: Thu, 06 Oct 2016 21:21:55
Message-Id: 1475788895.69aafed0a8dcbf6c4a108ecd3712f2d36a7bf3c7.blueness@gentoo
1 commit: 69aafed0a8dcbf6c4a108ecd3712f2d36a7bf3c7
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 6 21:21:17 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 6 21:21:35 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69aafed0
7
8 net-nds/rpcbind: remove _P() macro, bug #589666
9
10 Package-Manager: portage-2.2.28
11
12 .../files/rpcbind-0.2.3-remove-P-macro.patch | 246 +++++++++++++++++++++
13 net-nds/rpcbind/rpcbind-0.2.3-r2.ebuild | 58 +++++
14 2 files changed, 304 insertions(+)
15
16 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
17 new file mode 100644
18 index 00000000..8e1b69b
19 --- /dev/null
20 +++ b/net-nds/rpcbind/files/rpcbind-0.2.3-remove-P-macro.patch
21 @@ -0,0 +1,246 @@
22 +From 196e8f3abaa6e8899ba2655c6c2d8751e33a9795 Mon Sep 17 00:00:00 2001
23 +From: "Yann E. MORIN" <yann.morin.1998@××××.fr>
24 +Date: Wed, 17 Aug 2016 10:16:47 -0400
25 +Subject: [PATCH] src: remove use of the __P() macro
26 +
27 +The __P() macro is a legacy compatibility macro aimed making pre-ANSI
28 +(i.e. K&R) compilers that do not support function prototypes happy,
29 +while still allowing such prototypes for ANSI-compliant compilers.
30 +
31 +Since virtually all compilers have been ANSI-compliant for a few decades
32 +now, use of __P() is totally useless.
33 +
34 +Furthermore, __P() is defined in the non-standard sys/cdefs.h header.
35 +This header is present in glibc and uClibc, and both have it included
36 +from many of their headers. So, sys/cdefs.h is automagically included in
37 +most cases and its macros are available.
38 +
39 +However, the musl C library does not provide this sys/cdefs.h header.
40 +Thus, the build breaks on musl.
41 +
42 +For all the above reasons, get rid of __P() wherever it is used; just
43 +always declare real function prototypes.
44 +
45 +Reviewed-by: Chuck Lever <chuck.lever@××××××.com>
46 +Signed-off-by: "Yann E. MORIN" <yann.morin.1998@××××.fr>
47 +Signed-off-by: Steve Dickson <steved@××××××.com>
48 +Cc: Chuck Lever <chuck.lever@××××××.com>
49 +Cc: Steve Dickson <SteveD@××××××.com>
50 +Cc: Mike Frysinger <vapier@g.o>
51 +---
52 + src/check_bound.c | 2 +-
53 + src/pmap_svc.c | 10 +++++-----
54 + src/rpcb_svc.c | 10 +++++-----
55 + src/rpcb_svc_4.c | 14 ++++++--------
56 + src/rpcb_svc_com.c | 46 +++++++++++++++++++++++-----------------------
57 + src/rpcbind.c | 12 ++++++------
58 + src/util.c | 2 +-
59 + src/warmstart.c | 4 ++--
60 + 8 files changed, 49 insertions(+), 51 deletions(-)
61 +
62 +diff --git a/src/check_bound.c b/src/check_bound.c
63 +index c70b845..92bfd36 100644
64 +--- a/src/check_bound.c
65 ++++ b/src/check_bound.c
66 +@@ -70,7 +70,7 @@ static struct fdlist *fdhead; /* Link list of the check fd's */
67 + static struct fdlist *fdtail;
68 + static char *nullstring = "";
69 +
70 +-static bool_t check_bound __P((struct fdlist *, char *uaddr));
71 ++static bool_t check_bound(struct fdlist *, char *uaddr);
72 +
73 + /*
74 + * Returns 1 if the given address is bound for the given addr & transport
75 +diff --git a/src/pmap_svc.c b/src/pmap_svc.c
76 +index ad28b93..4c744fe 100644
77 +--- a/src/pmap_svc.c
78 ++++ b/src/pmap_svc.c
79 +@@ -60,11 +60,11 @@ static char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
80 + #include "rpcbind.h"
81 + #include "xlog.h"
82 + #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
83 +-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
84 +- rpcprot_t));
85 +-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
86 +-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
87 +-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
88 ++static struct pmaplist *find_service_pmap(rpcprog_t, rpcvers_t,
89 ++ rpcprot_t);
90 ++static bool_t pmapproc_change(struct svc_req *, SVCXPRT *, u_long);
91 ++static bool_t pmapproc_getport(struct svc_req *, SVCXPRT *);
92 ++static bool_t pmapproc_dump(struct svc_req *, SVCXPRT *);
93 +
94 + /*
95 + * Called for all the version 2 inquiries.
96 +diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
97 +index bd92201..709e3fb 100644
98 +--- a/src/rpcb_svc.c
99 ++++ b/src/rpcb_svc.c
100 +@@ -53,10 +53,10 @@
101 + #include "rpcbind.h"
102 + #include "xlog.h"
103 +
104 +-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
105 +- rpcvers_t));
106 +-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
107 +- rpcvers_t));
108 ++static void *rpcbproc_getaddr_3_local(void *, struct svc_req *, SVCXPRT *,
109 ++ rpcvers_t);
110 ++static void *rpcbproc_dump_3_local(void *, struct svc_req *, SVCXPRT *,
111 ++ rpcvers_t);
112 +
113 + /*
114 + * Called by svc_getreqset. There is a separate server handle for
115 +@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
116 + } argument;
117 + char *result;
118 + xdrproc_t xdr_argument, xdr_result;
119 +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
120 ++ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
121 + rpcprog_t setprog = 0;
122 +
123 + rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
124 +diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
125 +index b673452..5094879 100644
126 +--- a/src/rpcb_svc_4.c
127 ++++ b/src/rpcb_svc_4.c
128 +@@ -54,13 +54,11 @@
129 + #include "rpcbind.h"
130 + #include "xlog.h"
131 +
132 +-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
133 +- rpcvers_t));
134 +-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
135 +-static void *rpcbproc_getaddrlist_4_local
136 +- __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
137 +-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
138 +-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
139 ++static void *rpcbproc_getaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
140 ++static void *rpcbproc_getversaddr_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
141 ++static void *rpcbproc_getaddrlist_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
142 ++static void free_rpcb_entry_list(rpcb_entry_list_ptr *);
143 ++static void *rpcbproc_dump_4_local(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
144 +
145 + /*
146 + * Called by svc_getreqset. There is a separate server handle for
147 +@@ -78,7 +76,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
148 + } argument;
149 + char *result;
150 + xdrproc_t xdr_argument, xdr_result;
151 +- void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
152 ++ void *(*local)(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
153 + rpcprog_t setprog = 0;
154 +
155 + rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
156 +diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
157 +index 148fe42..5862c26 100644
158 +--- a/src/rpcb_svc_com.c
159 ++++ b/src/rpcb_svc_com.c
160 +@@ -100,29 +100,29 @@ struct finfo {
161 + static struct finfo FINFO[NFORWARD];
162 +
163 +
164 +-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
165 +-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
166 +-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
167 +-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
168 +-static int find_rmtcallfd_by_netid __P((char *));
169 +-static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
170 +-static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
171 +- rpcproc_t, rpcvers_t, u_int32_t *));
172 +-static struct finfo *forward_find __P((u_int32_t));
173 +-static int free_slot_by_xid __P((u_int32_t));
174 +-static int free_slot_by_index __P((int));
175 +-static int netbufcmp __P((struct netbuf *, struct netbuf *));
176 +-static struct netbuf *netbufdup __P((struct netbuf *));
177 +-static void netbuffree __P((struct netbuf *));
178 +-static int check_rmtcalls __P((struct pollfd *, int));
179 +-static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
180 +-static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
181 +-static void handle_reply __P((int, SVCXPRT *));
182 +-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
183 +-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
184 +-static char *getowner __P((SVCXPRT *, char *, size_t));
185 +-static int add_pmaplist __P((RPCB *));
186 +-static int del_pmaplist __P((RPCB *));
187 ++static bool_t xdr_encap_parms(XDR *, struct encap_parms *);
188 ++static bool_t xdr_rmtcall_args(XDR *, struct r_rmtcall_args *);
189 ++static bool_t xdr_rmtcall_result(XDR *, struct r_rmtcall_args *);
190 ++static bool_t xdr_opaque_parms(XDR *, struct r_rmtcall_args *);
191 ++static int find_rmtcallfd_by_netid(char *);
192 ++static SVCXPRT *find_rmtcallxprt_by_fd(int);
193 ++static int forward_register(u_int32_t, struct netbuf *, int, char *,
194 ++ rpcproc_t, rpcvers_t, u_int32_t *);
195 ++static struct finfo *forward_find(u_int32_t);
196 ++static int free_slot_by_xid(u_int32_t);
197 ++static int free_slot_by_index(int);
198 ++static int netbufcmp(struct netbuf *, struct netbuf *);
199 ++static struct netbuf *netbufdup(struct netbuf *);
200 ++static void netbuffree(struct netbuf *);
201 ++static int check_rmtcalls(struct pollfd *, int);
202 ++static void xprt_set_caller(SVCXPRT *, struct finfo *);
203 ++static void send_svcsyserr(SVCXPRT *, struct finfo *);
204 ++static void handle_reply(int, SVCXPRT *);
205 ++static void find_versions(rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
206 ++static rpcblist_ptr find_service(rpcprog_t, rpcvers_t, char *);
207 ++static char *getowner(SVCXPRT *, char *, size_t);
208 ++static int add_pmaplist(RPCB *);
209 ++static int del_pmaplist(RPCB *);
210 +
211 + /*
212 + * Set a mapping of program, version, netid
213 +diff --git a/src/rpcbind.c b/src/rpcbind.c
214 +index c4265cd..87ccdc2 100644
215 +--- a/src/rpcbind.c
216 ++++ b/src/rpcbind.c
217 +@@ -136,13 +136,13 @@ char *tcp_uaddr; /* Universal TCP address */
218 + static char servname[] = "rpcbind";
219 + static char superuser[] = "superuser";
220 +
221 +-int main __P((int, char *[]));
222 ++int main(int, char *[]);
223 +
224 +-static int init_transport __P((struct netconfig *));
225 +-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
226 +- struct netbuf *));
227 +-static void terminate __P((int));
228 +-static void parseargs __P((int, char *[]));
229 ++static int init_transport(struct netconfig *);
230 ++static void rbllist_add(rpcprog_t, rpcvers_t, struct netconfig *,
231 ++ struct netbuf *);
232 ++static void terminate(int);
233 ++static void parseargs(int, char *[]);
234 +
235 + int
236 + main(int argc, char *argv[])
237 +diff --git a/src/util.c b/src/util.c
238 +index a6c835b..74b0284 100644
239 +--- a/src/util.c
240 ++++ b/src/util.c
241 +@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
242 + static struct sockaddr_in6 *local_in6;
243 + #endif
244 +
245 +-static int bitmaskcmp __P((void *, void *, void *, int));
246 ++static int bitmaskcmp(void *, void *, void *, int);
247 +
248 + /*
249 + * For all bits set in "mask", compare the corresponding bits in
250 +diff --git a/src/warmstart.c b/src/warmstart.c
251 +index b6eb73e..122a058 100644
252 +--- a/src/warmstart.c
253 ++++ b/src/warmstart.c
254 +@@ -58,8 +58,8 @@
255 + #define PMAPFILE RPCBIND_STATEDIR "/portmap.xdr"
256 + #endif
257 +
258 +-static bool_t write_struct __P((char *, xdrproc_t, void *));
259 +-static bool_t read_struct __P((char *, xdrproc_t, void *));
260 ++static bool_t write_struct(char *, xdrproc_t, void *);
261 ++static bool_t read_struct(char *, xdrproc_t, void *);
262 +
263 + static bool_t
264 + write_struct(char *filename, xdrproc_t structproc, void *list)
265 +--
266 +1.8.3.1
267 +
268
269 diff --git a/net-nds/rpcbind/rpcbind-0.2.3-r2.ebuild b/net-nds/rpcbind/rpcbind-0.2.3-r2.ebuild
270 new file mode 100644
271 index 00000000..a8bfe3d
272 --- /dev/null
273 +++ b/net-nds/rpcbind/rpcbind-0.2.3-r2.ebuild
274 @@ -0,0 +1,58 @@
275 +# Copyright 1999-2016 Gentoo Foundation
276 +# Distributed under the terms of the GNU General Public License v2
277 +# $Id$
278 +
279 +EAPI="5"
280 +
281 +inherit eutils systemd
282 +
283 +if [[ ${PV} == "9999" ]] ; then
284 + EGIT_REPO_URI="git://linux-nfs.org/~steved/rpcbind.git"
285 + inherit autotools git-r3
286 +else
287 + SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
288 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
289 +fi
290 +
291 +DESCRIPTION="portmap replacement which supports RPC over various protocols"
292 +HOMEPAGE="https://sourceforge.net/projects/rpcbind/"
293 +
294 +LICENSE="BSD"
295 +SLOT="0"
296 +IUSE="debug selinux systemd tcpd warmstarts"
297 +
298 +CDEPEND=">=net-libs/libtirpc-0.2.3:=
299 + systemd? ( sys-apps/systemd:= )
300 + tcpd? ( sys-apps/tcp-wrappers )"
301 +DEPEND="${CDEPEND}
302 + virtual/pkgconfig"
303 +RDEPEND="${CDEPEND}
304 + selinux? ( sec-policy/selinux-rpcbind )"
305 +
306 +src_prepare() {
307 + [[ ${PV} == "9999" ]] && eautoreconf
308 + epatch "${FILESDIR}"/${P}-libtirpc.patch
309 + epatch "${FILESDIR}"/${P}-mem-corrupt.patch #560990
310 + epatch "${FILESDIR}"/${P}-remove-P-macro.patch #589666
311 + epatch_user
312 +}
313 +
314 +src_configure() {
315 + econf \
316 + --bindir="${EPREFIX}"/sbin \
317 + --with-statedir="${EPREFIX}"/run/${PN} \
318 + --with-rpcuser=root \
319 + --with-systemdsystemunitdir=$(usex systemd "$(systemd_get_unitdir)" "no") \
320 + $(use_enable tcpd libwrap) \
321 + $(use_enable debug) \
322 + $(use_enable warmstarts)
323 +}
324 +
325 +src_install() {
326 + default
327 +
328 + newinitd "${FILESDIR}"/${PN}.initd ${PN}
329 + newconfd "${FILESDIR}"/${PN}.confd ${PN}
330 +
331 + systemd_dounit "${FILESDIR}"/${PN}.service
332 +}