Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/tcp-wrappers/files: tcp-wrappers-7.6-headers.patch tcp-wrappers-7.6-redhat-bug11881.patch
Date: Sun, 01 Jan 2012 09:18:59
Message-Id: 20120101091848.65BB52004C@flycatcher.gentoo.org
1 vapier 12/01/01 09:18:48
2
3 Added: tcp-wrappers-7.6-headers.patch
4 tcp-wrappers-7.6-redhat-bug11881.patch
5 Log:
6 Migrate to Debian patchset which includes a lot more patches #158036 by Wolfram Schlich and #269833 by Jason. Tweak fix_options func definition #360749 by Alexander Kolesen. Add USE=netgroups so people can optionally enable @netgroups syntax. Add USE=static-libs support #378271 by Agostino Sarubbo.
7
8 (Portage version: 2.2.0_alpha81/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.1 sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch?rev=1.1&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-headers.patch?rev=1.1&content-type=text/plain
15
16 Index: tcp-wrappers-7.6-headers.patch
17 ===================================================================
18 --- a/options.c
19 +++ b/options.c
20 @@ -34,6 +34,8 @@
21
22 /* System libraries. */
23
24 +#include <unistd.h>
25 +#include <stdlib.h>
26 #include <sys/types.h>
27 #include <sys/param.h>
28 #include <sys/socket.h>
29 --- a/safe_finger.c
30 +++ b/safe_finger.c
31 @@ -20,6 +20,11 @@
32
33 /* System libraries */
34
35 +#include <unistd.h>
36 +#include <fcntl.h>
37 +#include <stdlib.h>
38 +#include <sys/wait.h>
39 +#include <grp.h>
40 #include <sys/types.h>
41 #include <sys/stat.h>
42 #include <signal.h>
43 @@ -27,7 +31,7 @@
44 #include <ctype.h>
45 #include <pwd.h>
46
47 -extern void exit();
48 +int pipe_stdin(char **argv);
49
50 /* Local stuff */
51
52 --- a/scaffold.c
53 +++ b/scaffold.c
54 @@ -10,6 +10,7 @@
55
56 /* System libraries. */
57
58 +#include <stdlib.h>
59 #include <sys/types.h>
60 #include <sys/stat.h>
61 #include <sys/socket.h>
62 @@ -27,7 +27,4 @@
63 #endif
64
65 -#ifndef INET6
66 -extern char *malloc();
67 -#endif
68
69 /* Application-specific. */
70 --- a/shell_cmd.c
71 +++ b/shell_cmd.c
72 @@ -14,6 +14,10 @@
73
74 /* System libraries. */
75
76 +#include <unistd.h>
77 +#include <stdlib.h>
78 +#include <fcntl.h>
79 +#include <sys/wait.h>
80 #include <sys/types.h>
81 #include <sys/param.h>
82 #include <signal.h>
83 @@ -25,8 +25,6 @@
84 #include <syslog.h>
85 #include <string.h>
86
87 -extern void exit();
88 -
89 /* Local stuff. */
90
91 #include "tcpd.h"
92 --- a/tcpdchk.c
93 +++ b/tcpdchk.c
94 @@ -20,6 +20,8 @@
95
96 /* System libraries. */
97
98 +#include <unistd.h>
99 +#include <stdlib.h>
100 #include <sys/types.h>
101 #include <sys/stat.h>
102 #ifdef INET6
103 @@ -35,10 +36,7 @@
104 #include <netdb.h>
105 #include <string.h>
106
107 -extern int errno;
108 -extern void exit();
109 -extern int optind;
110 -extern char *optarg;
111 +int cidr_mask_addr(char *str);
112
113 #ifndef INADDR_NONE
114 #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
115 --- a/clean_exit.c
116 +++ b/clean_exit.c
117 @@ -13,8 +13,8 @@
118 #endif
119
120 #include <stdio.h>
121 -
122 -extern void exit();
123 +#include <unistd.h>
124 +#include <stdlib.h>
125
126 #include "tcpd.h"
127
128 --- a/hosts_access.c
129 +++ b/hosts_access.c
130 @@ -23,6 +23,7 @@
131
132 /* System libraries. */
133
134 +#include <stdlib.h>
135 #include <sys/types.h>
136 #ifdef INT32_T
137 typedef uint32_t u_int32_t;
138 @@ -43,8 +44,8 @@
139 #include <netdb.h>
140 #endif
141
142 -extern char *fgets();
143 -extern int errno;
144 +static int match_pattern_ylo(const char *s, const char *pattern);
145 +int cidr_mask_addr(char *str);
146
147 #ifndef INADDR_NONE
148 #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
149 --- a/inetcf.c
150 +++ b/inetcf.c
151 @@ -9,15 +9,14 @@
152 static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:13:23";
153 #endif
154
155 +#include <stdlib.h>
156 #include <sys/types.h>
157 #include <sys/stat.h>
158 #include <stdio.h>
159 #include <errno.h>
160 #include <string.h>
161
162 -extern int errno;
163 -extern void exit();
164 -
165 +#include "scaffold.h"
166 #include "tcpd.h"
167 #include "inetcf.h"
168
169 --- a/percent_x.c
170 +++ b/percent_x.c
171 @@ -16,12 +16,12 @@
172
173 /* System libraries. */
174
175 +#include <unistd.h>
176 +#include <stdlib.h>
177 #include <stdio.h>
178 #include <syslog.h>
179 #include <string.h>
180
181 -extern void exit();
182 -
183 /* Local stuff. */
184
185 #include "tcpd.h"
186 --- a/rfc931.c
187 +++ b/rfc931.c
188 @@ -15,6 +15,7 @@
189
190 /* System libraries. */
191
192 +#include <unistd.h>
193 #include <stdio.h>
194 #include <syslog.h>
195 #include <sys/types.h>
196 --- a/tcpd.c
197 +++ b/tcpd.c
198 @@ -16,6 +16,7 @@
199
200 /* System libraries. */
201
202 +#include <unistd.h>
203 #include <sys/types.h>
204 #include <sys/param.h>
205 #include <sys/stat.h>
206 @@ -39,6 +39,8 @@
207 #include "patchlevel.h"
208 #include "tcpd.h"
209
210 +void fix_options(struct request_info *request);
211 +
212 int allow_severity = SEVERITY; /* run-time adjustable */
213 int deny_severity = LOG_WARNING; /* ditto */
214
215 --- a/tcpdmatch.c
216 +++ b/tcpdmatch.c
217 @@ -19,6 +19,8 @@
218
219 /* System libraries. */
220
221 +#include <unistd.h>
222 +#include <stdlib.h>
223 #include <sys/types.h>
224 #include <sys/stat.h>
225 #include <sys/socket.h>
226 @@ -30,9 +32,6 @@
227 #include <setjmp.h>
228 #include <string.h>
229
230 -extern void exit();
231 -extern int optind;
232 -extern char *optarg;
233
234 #ifndef INADDR_NONE
235 #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
236 --- a/update.c
237 +++ b/update.c
238 @@ -19,6 +19,7 @@
239
240 /* System libraries */
241
242 +#include <unistd.h>
243 #include <stdio.h>
244 #include <syslog.h>
245 #include <string.h>
246 --- a/misc.c
247 +++ b/misc.c
248 @@ -14,11 +14,10 @@
249 #include <arpa/inet.h>
250 #include <stdio.h>
251 #include <string.h>
252 +#include <stdlib.h>
253
254 #include "tcpd.h"
255
256 -extern char *fgets();
257 -
258 #ifndef INADDR_NONE
259 #define INADDR_NONE (-1) /* XXX should be 0xffffffff */
260 #endif
261 --- a/fix_options.c
262 +++ b/fix_options.c
263 @@ -32,6 +32,7 @@
264
265 /* fix_options - get rid of IP-level socket options */
266
267 +void
268 fix_options(request)
269 struct request_info *request;
270 {
271 @@ -38,11 +38,8 @@
272 #ifdef IP_OPTIONS
273 unsigned char optbuf[BUFFER_SIZE / 3], *cp;
274 char lbuf[BUFFER_SIZE], *lp;
275 -#ifdef __GLIBC__
276 - size_t optsize = sizeof(optbuf), ipproto;
277 -#else
278 - int optsize = sizeof(optbuf), ipproto;
279 -#endif
280 + socklen_t optsize = sizeof(optbuf);
281 + int ipproto;
282 struct protoent *ip;
283 int fd = request->fd;
284 unsigned int opt;
285 --- a/socket.c
286 +++ b/socket.c
287 @@ -95,11 +95,7 @@
288 static struct sockaddr_in client;
289 static struct sockaddr_in server;
290 #endif
291 -#ifdef __GLIBC__
292 - size_t len;
293 -#else
294 - int len;
295 -#endif
296 + socklen_t len;
297 char buf[BUFSIZ];
298 int fd = request->fd;
299
300 @@ -430,11 +426,7 @@
301 #else
302 struct sockaddr_in sin;
303 #endif
304 -#ifdef __GLIBC__
305 - size_t size = sizeof(sin);
306 -#else
307 - int size = sizeof(sin);
308 -#endif
309 + socklen_t size;
310
311 /*
312 * Eat up the not-yet received datagram. Some systems insist on a
313
314
315
316 1.1 sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch
317
318 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch?rev=1.1&view=markup
319 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/tcp-wrappers/files/tcp-wrappers-7.6-redhat-bug11881.patch?rev=1.1&content-type=text/plain
320
321 Index: tcp-wrappers-7.6-redhat-bug11881.patch
322 ===================================================================
323 --- tcp_wrappers_7.6/tcpd.c.bug11881
324 +++ tcp_wrappers_7.6/tcpd.c
325 @@ -60,10 +60,10 @@
326 */
327
328 if (argv[0][0] == '/') {
329 - strcpy(path, argv[0]);
330 + strncpy(path, argv[0], sizeof(path));
331 argv[0] = strrchr(argv[0], '/') + 1;
332 } else {
333 - sprintf(path, "%s/%s", REAL_DAEMON_DIR, argv[0]);
334 + snprintf(path, sizeof(path), "%s/%s", REAL_DAEMON_DIR, argv[0]);
335 }
336
337 /*
338 --- tcp_wrappers_7.6/eval.c.bug11881
339 +++ tcp_wrappers_7.6/eval.c
340 @@ -111,7 +111,7 @@
341 return (hostinfo);
342 #endif
343 if (STR_NE(eval_user(request), unknown)) {
344 - sprintf(both, "%s@%s", request->user, hostinfo);
345 + snprintf(both, sizeof(both), "%s@%s", request->user, hostinfo);
346 return (both);
347 } else {
348 return (hostinfo);
349 @@ -128,7 +128,7 @@
350 char *daemon = eval_daemon(request);
351
352 if (STR_NE(host, unknown)) {
353 - sprintf(both, "%s@%s", daemon, host);
354 + snprintf(both, sizeof(both), "%s@%s", daemon, host);
355 return (both);
356 } else {
357 return (daemon);