]>
Commit | Line | Data |
---|---|---|
7bd93c35 JR |
1 | diff -urN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile |
2 | --- tcp_wrappers_7.6.orig/Makefile Mon Dec 13 13:58:15 1999 | |
3 | +++ tcp_wrappers_7.6/Makefile Mon Dec 13 14:07:48 1999 | |
4 | @@ -152,7 +152,7 @@ | |
5 | linux: | |
6 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | |
7 | LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \ | |
8 | - NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all | |
9 | + NETGROUP= TLI= EXTRA_CFLAGS="-DHAVE_WEAKSYMS -DBROKEN_SO_LINGER -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all | |
10 | ||
11 | linux-old: | |
12 | @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \ | |
13 | @@ -373,6 +374,10 @@ | |
14 | NETGROUP= TLI= all | |
15 | ||
16 | ############################################################### | |
17 | +LIBTOOL = libtool | |
18 | +PREFIX = /usr/local | |
19 | +LIBDIR = $(PREFIX)/lib | |
20 | +############################################################### | |
21 | # System dependencies: TLI (transport-level interface) support. | |
22 | # | |
23 | # Uncomment the following macro if your system has System V.4-style TLI | |
304e1cb2 | 24 | @@ -670,7 +674,9 @@ |
7bd93c35 JR |
25 | # Protection against weird shells or weird make programs. |
26 | ||
27 | SHELL = /bin/sh | |
28 | -.c.o:; $(CC) $(CFLAGS) -c $*.c | |
91c8897c | 29 | +.c.o:; $(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) -c $*.c |
7bd93c35 | 30 | + |
91c8897c | 31 | +%.lo:; $(LIBTOOL) --tag=CC --mode=compile $(CC) $(CFLAGS) -c $*.c |
7bd93c35 | 32 | |
304e1cb2 | 33 | CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \ |
7bd93c35 | 34 | $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \ |
7bd93c35 JR |
35 | @@ -679,12 +685,12 @@ |
36 | $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \ | |
37 | $(VSYSLOG) $(HOSTNAME) | |
38 | ||
39 | -LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \ | |
40 | - hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \ | |
41 | - $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \ | |
42 | - update.o misc.o diag.o percent_m.o myvsyslog.o | |
43 | +LIB_OBJ= hosts_access.lo options.lo shell_cmd.lo rfc931.lo eval.lo \ | |
44 | + hosts_ctl.lo refuse.lo percent_x.lo clean_exit.lo $(AUX_OBJ) \ | |
45 | + $(FROM_OBJ) fix_options.lo socket.lo tli.lo workarounds.lo \ | |
46 | + update.lo misc.lo diag.lo percent_m.lo myvsyslog.lo weak_symbols.lo | |
47 | ||
48 | -FROM_OBJ= fromhost.o | |
49 | +FROM_OBJ= fromhost.lo | |
50 | ||
51 | KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \ | |
52 | tcpd.h tcpdmatch.c Makefile hosts_access.5 strcasecmp.c BLURB rfc931.c \ | |
53 | @@ -697,7 +703,7 @@ | |
54 | refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \ | |
55 | scaffold.h tcpdmatch.8 README.NIS | |
56 | ||
57 | -LIB = libwrap.a | |
58 | +LIB = libwrap.la | |
59 | ||
60 | all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk | |
61 | ||
62 | @@ -713,30 +719,29 @@ | |
63 | ||
64 | $(LIB): $(LIB_OBJ) | |
65 | rm -f $(LIB) | |
66 | - $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ) | |
67 | - -$(RANLIB) $(LIB) | |
91c8897c | 68 | + $(LIBTOOL) --tag=CC --mode=link $(CC) -o $(LIB) $(LIB_OBJ) $(LDFLAGS) $(LIBS) -rpath $(LIBDIR) |
7bd93c35 JR |
69 | |
70 | tcpd: tcpd.o $(LIB) | |
71 | - $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS) | |
91c8897c | 72 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ tcpd.o $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
73 | |
74 | miscd: miscd.o $(LIB) | |
75 | - $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS) | |
91c8897c | 76 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ miscd.o $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
77 | |
78 | safe_finger: safe_finger.o $(LIB) | |
79 | - $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS) | |
91c8897c | 80 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ safe_finger.o $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
81 | |
82 | TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o | |
83 | ||
84 | tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) | |
85 | - $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS) | |
91c8897c | 86 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
87 | |
88 | try-from: try-from.o fakelog.o $(LIB) | |
89 | - $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS) | |
91c8897c | 90 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
91 | |
92 | TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o | |
93 | ||
94 | tcpdchk: $(TCPDCHK_OBJ) $(LIB) | |
95 | - $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS) | |
91c8897c | 96 | + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LDFLAGS) $(LIB) $(LIBS) |
7bd93c35 JR |
97 | |
98 | shar: $(KIT) | |
99 | @shar $(KIT) | |
100 | @@ -757,6 +762,14 @@ | |
101 | tidy: clean | |
102 | chmod -R a+r . | |
103 | chmod 755 . | |
104 | + | |
105 | +install: | |
106 | + -install -d $(PREFIX)/{sbin,include} | |
107 | + $(LIBTOOL) --mode=install install -c $(LIB) $(LIBDIR)/$(LIB) | |
108 | + $(LIBTOOL) --mode=finish $(LIBDIR) | |
109 | + for PROG in safe_finger tcpdchk try-from tcpd tcpdmatch ; do \ | |
110 | + $(LIBTOOL) --mode=install install -c $$PROG $(PREFIX)/sbin/$$PROG ; done | |
91c8897c | 111 | + install -p tcpd.h $(PREFIX)/include/ |
7bd93c35 JR |
112 | |
113 | # Enable all bells and whistles for linting. | |
114 | ||
115 | @@ -906,5 +913,6 @@ | |
116 | update.o: mystdarg.h | |
117 | update.o: tcpd.h | |
118 | vfprintf.o: cflags | |
119 | +weak_symbols.o: tcpd.h | |
120 | workarounds.o: cflags | |
121 | workarounds.o: tcpd.h | |
122 | --- tcp_wrappers_7.6/tcpd.h.shared 2003-02-10 20:12:26.000000000 +0100 | |
123 | +++ tcp_wrappers_7.6/tcpd.h 2003-02-10 20:12:26.000000000 +0100 | |
124 | @@ -4,6 +4,25 @@ | |
125 | * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands. | |
126 | */ | |
127 | ||
128 | +#ifndef _TCPWRAPPERS_TCPD_H | |
129 | +#define _TCPWRAPPERS_TCPD_H | |
130 | + | |
131 | +/* someone else may have defined this */ | |
132 | +#undef __P | |
133 | + | |
134 | +/* use prototypes if we have an ANSI C compiler or are using C++ */ | |
135 | +#if defined(__STDC__) || defined(__cplusplus) | |
136 | +#define __P(args) args | |
137 | +#else | |
138 | +#define __P(args) () | |
139 | +#endif | |
140 | + | |
141 | +/* Need definitions of struct sockaddr_in and FILE. */ | |
142 | +#include <netinet/in.h> | |
143 | +#include <stdio.h> | |
144 | + | |
145 | +__BEGIN_DECLS | |
146 | + | |
147 | /* Structure to describe one communications endpoint. */ | |
148 | ||
149 | #define STRING_LENGTH 128 /* hosts, users, processes */ | |
150 | @@ -29,10 +48,10 @@ | |
151 | char pid[10]; /* access via eval_pid(request) */ | |
152 | struct host_info client[1]; /* client endpoint info */ | |
153 | struct host_info server[1]; /* server endpoint info */ | |
154 | - void (*sink) (); /* datagram sink function or 0 */ | |
155 | - void (*hostname) (); /* address to printable hostname */ | |
156 | - void (*hostaddr) (); /* address to printable address */ | |
157 | - void (*cleanup) (); /* cleanup function or 0 */ | |
158 | + void (*sink) __P((int)); /* datagram sink function or 0 */ | |
159 | + void (*hostname) __P((struct host_info *)); /* address to printable hostname */ | |
160 | + void (*hostaddr) __P((struct host_info *)); /* address to printable address */ | |
161 | + void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */ | |
162 | struct netconfig *config; /* netdir handle */ | |
163 | }; | |
164 | ||
165 | @@ -65,25 +84,34 @@ | |
166 | /* Global functions. */ | |
167 | ||
168 | #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) | |
169 | -extern void fromhost(); /* get/validate client host info */ | |
170 | +extern void fromhost __P((struct request_info *)); /* get/validate client host info */ | |
171 | #else | |
172 | #define fromhost sock_host /* no TLI support needed */ | |
173 | #endif | |
174 | ||
175 | -extern int hosts_access(); /* access control */ | |
176 | -extern void shell_cmd(); /* execute shell command */ | |
177 | -extern char *percent_x(); /* do %<char> expansion */ | |
178 | -extern void rfc931(); /* client name from RFC 931 daemon */ | |
179 | -extern void clean_exit(); /* clean up and exit */ | |
180 | -extern void refuse(); /* clean up and exit */ | |
181 | -extern char *xgets(); /* fgets() on steroids */ | |
182 | -extern char *split_at(); /* strchr() and split */ | |
183 | -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */ | |
184 | +extern void shell_cmd __P((char *)); /* execute shell command */ | |
185 | +extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */ | |
186 | +#ifdef INET6 | |
187 | +extern void rfc931 __P((struct sockaddr *, struct sockaddr *, char *)); /* client name from RFC 931 daemon */ | |
188 | +#else | |
189 | +extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */ | |
190 | +#endif | |
191 | +extern void clean_exit __P((struct request_info *)); /* clean up and exit */ | |
192 | +extern void refuse __P((struct request_info *)); /* clean up and exit */ | |
193 | +extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */ | |
194 | +extern char *split_at __P((char *, int)); /* strchr() and split */ | |
195 | +extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */ | |
196 | ||
197 | /* Global variables. */ | |
198 | ||
199 | +#ifdef HAVE_WEAKSYMS | |
200 | +extern int allow_severity __attribute__ ((weak)); /* for connection logging */ | |
201 | +extern int deny_severity __attribute__ ((weak)); /* for connection logging */ | |
202 | +#else | |
203 | extern int allow_severity; /* for connection logging */ | |
204 | extern int deny_severity; /* for connection logging */ | |
205 | +#endif | |
206 | + | |
207 | extern char *hosts_allow_table; /* for verification mode redirection */ | |
208 | extern char *hosts_deny_table; /* for verification mode redirection */ | |
209 | extern int hosts_access_verbose; /* for verbose matching mode */ | |
210 | @@ -96,9 +124,14 @@ | |
211 | */ | |
212 | ||
213 | #ifdef __STDC__ | |
214 | +extern int hosts_access(struct request_info *request); | |
215 | +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, | |
216 | + char *client_user); | |
217 | extern struct request_info *request_init(struct request_info *,...); | |
218 | extern struct request_info *request_set(struct request_info *,...); | |
219 | #else | |
220 | +extern int hosts_access(); | |
221 | +extern int hosts_ctl(); | |
222 | extern struct request_info *request_init(); /* initialize request */ | |
223 | extern struct request_info *request_set(); /* update request structure */ | |
224 | #endif | |
225 | @@ -121,27 +154,31 @@ | |
226 | * host_info structures serve as caches for the lookup results. | |
227 | */ | |
228 | ||
229 | -extern char *eval_user(); /* client user */ | |
230 | -extern char *eval_hostname(); /* printable hostname */ | |
231 | -extern char *eval_hostaddr(); /* printable host address */ | |
232 | -extern char *eval_hostinfo(); /* host name or address */ | |
233 | -extern char *eval_client(); /* whatever is available */ | |
234 | -extern char *eval_server(); /* whatever is available */ | |
235 | +extern char *eval_user __P((struct request_info *)); /* client user */ | |
236 | +extern char *eval_hostname __P((struct host_info *)); /* printable hostname */ | |
237 | +extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */ | |
238 | +extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */ | |
239 | +extern char *eval_client __P((struct request_info *)); /* whatever is available */ | |
240 | +extern char *eval_server __P((struct request_info *)); /* whatever is available */ | |
241 | #define eval_daemon(r) ((r)->daemon) /* daemon process name */ | |
242 | #define eval_pid(r) ((r)->pid) /* process id */ | |
243 | ||
244 | /* Socket-specific methods, including DNS hostname lookups. */ | |
245 | ||
246 | -extern void sock_host(); /* look up endpoint addresses */ | |
247 | -extern void sock_hostname(); /* translate address to hostname */ | |
248 | -extern void sock_hostaddr(); /* address to printable address */ | |
249 | +/* look up endpoint addresses */ | |
250 | +extern void sock_host __P((struct request_info *)); | |
251 | +/* translate address to hostname */ | |
252 | +extern void sock_hostname __P((struct host_info *)); | |
253 | +/* address to printable address */ | |
254 | +extern void sock_hostaddr __P((struct host_info *)); | |
255 | + | |
256 | #define sock_methods(r) \ | |
257 | { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; } | |
258 | ||
259 | /* The System V Transport-Level Interface (TLI) interface. */ | |
260 | ||
261 | #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT) | |
262 | -extern void tli_host(); /* look up endpoint addresses etc. */ | |
263 | +extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */ | |
264 | #endif | |
265 | ||
266 | /* | |
267 | @@ -182,7 +219,7 @@ | |
268 | * behavior. | |
269 | */ | |
270 | ||
271 | -extern void process_options(); /* execute options */ | |
272 | +extern void process_options __P((char *, struct request_info *)); /* execute options */ | |
273 | extern int dry_run; /* verification flag */ | |
274 | ||
275 | /* Bug workarounds. */ | |
276 | @@ -221,3 +258,7 @@ | |
277 | #define strtok my_strtok | |
278 | extern char *my_strtok(); | |
279 | #endif | |
280 | + | |
281 | +__END_DECLS | |
282 | + | |
283 | +#endif /* tcpd.h */ | |
284 | --- tcp_wrappers_7.6/scaffold.c.shared 2003-02-10 20:12:26.000000000 +0100 | |
285 | +++ tcp_wrappers_7.6/scaffold.c 2003-02-10 20:12:26.000000000 +0100 | |
286 | @@ -237,10 +237,17 @@ | |
287 | ||
288 | /* ARGSUSED */ | |
289 | ||
290 | -void rfc931(request) | |
291 | -struct request_info *request; | |
292 | +void rfc931(rmt_sin, our_sin, dest) | |
293 | +#ifndef INET6 | |
294 | +struct sockaddr_in *rmt_sin; | |
295 | +struct sockaddr_in *our_sin; | |
296 | +#else | |
297 | +struct sockaddr *rmt_sin; | |
298 | +struct sockaddr *our_sin; | |
299 | +#endif | |
300 | +char *dest; | |
301 | { | |
302 | - strcpy(request->user, unknown); | |
303 | + strcpy(dest, unknown); | |
304 | } | |
305 | ||
306 | /* check_path - examine accessibility */ | |
307 | diff -Nur tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c | |
308 | --- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100 | |
309 | +++ tcp_wrappers_7.6/weak_symbols.c 2003-08-23 07:40:03.717139736 +0200 | |
310 | @@ -0,0 +1,11 @@ | |
311 | +/* | |
312 | + * @(#) weak_symbols.h 1.5 99/12/29 23:50 | |
313 | + * | |
314 | + * Author: Anthony Towns <ajt@debian.org> | |
315 | + */ | |
316 | + | |
317 | +#ifdef HAVE_WEAKSYMS | |
318 | +#include <syslog.h> | |
319 | +int deny_severity __attribute__((weak)) = LOG_WARNING; | |
320 | +int allow_severity __attribute__((weak)) = SEVERITY; | |
321 | +#endif |