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
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
12 @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
16 ###############################################################
19 +LIBDIR = $(PREFIX)/lib
20 +###############################################################
21 # System dependencies: TLI (transport-level interface) support.
23 # Uncomment the following macro if your system has System V.4-style TLI
25 # Protection against weird shells or weird make programs.
28 -.c.o:; $(CC) $(CFLAGS) -c $*.c
29 +.c.o:; $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $*.c
31 +%.lo:; $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c $*.c
33 -CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
34 +CFLAGS = -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
35 $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
36 -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
37 -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
39 $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
40 $(VSYSLOG) $(HOSTNAME)
42 -LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
43 - hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
44 - $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
45 - update.o misc.o diag.o percent_m.o myvsyslog.o
46 +LIB_OBJ= hosts_access.lo options.lo shell_cmd.lo rfc931.lo eval.lo \
47 + hosts_ctl.lo refuse.lo percent_x.lo clean_exit.lo $(AUX_OBJ) \
48 + $(FROM_OBJ) fix_options.lo socket.lo tli.lo workarounds.lo \
49 + update.lo misc.lo diag.lo percent_m.lo myvsyslog.lo weak_symbols.lo
52 +FROM_OBJ= fromhost.lo
54 KIT = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
55 tcpd.h tcpdmatch.c Makefile hosts_access.5 strcasecmp.c BLURB rfc931.c \
57 refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
58 scaffold.h tcpdmatch.8 README.NIS
63 all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
69 - $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
71 + $(LIBTOOL) --mode=link $(CC) -o $(LDFLAGS) $(LIB) $(LIB_OBJ) -rpath $(LIBDIR)
74 - $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
75 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ tcpd.o $(LDFLAGS) $(LIB) $(LIBS)
78 - $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
79 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ miscd.o $(LDFLAGS) $(LIB) $(LIBS)
81 safe_finger: safe_finger.o $(LIB)
82 - $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
83 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ safe_finger.o $(LDFLAGS) $(LIB) $(LIBS)
85 TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
87 tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
88 - $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
89 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
91 try-from: try-from.o fakelog.o $(LIB)
92 - $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
93 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LDFLAGS) $(LIB) $(LIBS)
95 TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
97 tcpdchk: $(TCPDCHK_OBJ) $(LIB)
98 - $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
99 + $(LIBTOOL) --mode=link $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LDFLAGS) $(LIB) $(LIBS)
109 + -install -d $(PREFIX)/{sbin,include}
110 + $(LIBTOOL) --mode=install install -c $(LIB) $(LIBDIR)/$(LIB)
111 + $(LIBTOOL) --mode=finish $(LIBDIR)
112 + for PROG in safe_finger tcpdchk try-from tcpd tcpdmatch ; do \
113 + $(LIBTOOL) --mode=install install -c $$PROG $(PREFIX)/sbin/$$PROG ; done
114 + install tcpd.h $(PREFIX)/include/
116 # Enable all bells and whistles for linting.
122 +weak_symbols.o: tcpd.h
123 workarounds.o: cflags
124 workarounds.o: tcpd.h
125 --- tcp_wrappers_7.6/tcpd.h.shared 2003-02-10 20:12:26.000000000 +0100
126 +++ tcp_wrappers_7.6/tcpd.h 2003-02-10 20:12:26.000000000 +0100
128 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
131 +#ifndef _TCPWRAPPERS_TCPD_H
132 +#define _TCPWRAPPERS_TCPD_H
134 +/* someone else may have defined this */
137 +/* use prototypes if we have an ANSI C compiler or are using C++ */
138 +#if defined(__STDC__) || defined(__cplusplus)
139 +#define __P(args) args
141 +#define __P(args) ()
144 +/* Need definitions of struct sockaddr_in and FILE. */
145 +#include <netinet/in.h>
150 /* Structure to describe one communications endpoint. */
152 #define STRING_LENGTH 128 /* hosts, users, processes */
154 char pid[10]; /* access via eval_pid(request) */
155 struct host_info client[1]; /* client endpoint info */
156 struct host_info server[1]; /* server endpoint info */
157 - void (*sink) (); /* datagram sink function or 0 */
158 - void (*hostname) (); /* address to printable hostname */
159 - void (*hostaddr) (); /* address to printable address */
160 - void (*cleanup) (); /* cleanup function or 0 */
161 + void (*sink) __P((int)); /* datagram sink function or 0 */
162 + void (*hostname) __P((struct host_info *)); /* address to printable hostname */
163 + void (*hostaddr) __P((struct host_info *)); /* address to printable address */
164 + void (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
165 struct netconfig *config; /* netdir handle */
169 /* Global functions. */
171 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
172 -extern void fromhost(); /* get/validate client host info */
173 +extern void fromhost __P((struct request_info *)); /* get/validate client host info */
175 #define fromhost sock_host /* no TLI support needed */
178 -extern int hosts_access(); /* access control */
179 -extern void shell_cmd(); /* execute shell command */
180 -extern char *percent_x(); /* do %<char> expansion */
181 -extern void rfc931(); /* client name from RFC 931 daemon */
182 -extern void clean_exit(); /* clean up and exit */
183 -extern void refuse(); /* clean up and exit */
184 -extern char *xgets(); /* fgets() on steroids */
185 -extern char *split_at(); /* strchr() and split */
186 -extern unsigned long dot_quad_addr(); /* restricted inet_addr() */
187 +extern void shell_cmd __P((char *)); /* execute shell command */
188 +extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
190 +extern void rfc931 __P((struct sockaddr *, struct sockaddr *, char *)); /* client name from RFC 931 daemon */
192 +extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
194 +extern void clean_exit __P((struct request_info *)); /* clean up and exit */
195 +extern void refuse __P((struct request_info *)); /* clean up and exit */
196 +extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
197 +extern char *split_at __P((char *, int)); /* strchr() and split */
198 +extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
200 /* Global variables. */
202 +#ifdef HAVE_WEAKSYMS
203 +extern int allow_severity __attribute__ ((weak)); /* for connection logging */
204 +extern int deny_severity __attribute__ ((weak)); /* for connection logging */
206 extern int allow_severity; /* for connection logging */
207 extern int deny_severity; /* for connection logging */
210 extern char *hosts_allow_table; /* for verification mode redirection */
211 extern char *hosts_deny_table; /* for verification mode redirection */
212 extern int hosts_access_verbose; /* for verbose matching mode */
217 +extern int hosts_access(struct request_info *request);
218 +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
219 + char *client_user);
220 extern struct request_info *request_init(struct request_info *,...);
221 extern struct request_info *request_set(struct request_info *,...);
223 +extern int hosts_access();
224 +extern int hosts_ctl();
225 extern struct request_info *request_init(); /* initialize request */
226 extern struct request_info *request_set(); /* update request structure */
228 @@ -121,27 +154,31 @@
229 * host_info structures serve as caches for the lookup results.
232 -extern char *eval_user(); /* client user */
233 -extern char *eval_hostname(); /* printable hostname */
234 -extern char *eval_hostaddr(); /* printable host address */
235 -extern char *eval_hostinfo(); /* host name or address */
236 -extern char *eval_client(); /* whatever is available */
237 -extern char *eval_server(); /* whatever is available */
238 +extern char *eval_user __P((struct request_info *)); /* client user */
239 +extern char *eval_hostname __P((struct host_info *)); /* printable hostname */
240 +extern char *eval_hostaddr __P((struct host_info *)); /* printable host address */
241 +extern char *eval_hostinfo __P((struct host_info *)); /* host name or address */
242 +extern char *eval_client __P((struct request_info *)); /* whatever is available */
243 +extern char *eval_server __P((struct request_info *)); /* whatever is available */
244 #define eval_daemon(r) ((r)->daemon) /* daemon process name */
245 #define eval_pid(r) ((r)->pid) /* process id */
247 /* Socket-specific methods, including DNS hostname lookups. */
249 -extern void sock_host(); /* look up endpoint addresses */
250 -extern void sock_hostname(); /* translate address to hostname */
251 -extern void sock_hostaddr(); /* address to printable address */
252 +/* look up endpoint addresses */
253 +extern void sock_host __P((struct request_info *));
254 +/* translate address to hostname */
255 +extern void sock_hostname __P((struct host_info *));
256 +/* address to printable address */
257 +extern void sock_hostaddr __P((struct host_info *));
259 #define sock_methods(r) \
260 { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
262 /* The System V Transport-Level Interface (TLI) interface. */
264 #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
265 -extern void tli_host(); /* look up endpoint addresses etc. */
266 +extern void tli_host __P((struct request_info *)); /* look up endpoint addresses etc. */
274 -extern void process_options(); /* execute options */
275 +extern void process_options __P((char *, struct request_info *)); /* execute options */
276 extern int dry_run; /* verification flag */
278 /* Bug workarounds. */
280 #define strtok my_strtok
281 extern char *my_strtok();
287 --- tcp_wrappers_7.6/scaffold.c.shared 2003-02-10 20:12:26.000000000 +0100
288 +++ tcp_wrappers_7.6/scaffold.c 2003-02-10 20:12:26.000000000 +0100
289 @@ -237,10 +237,17 @@
293 -void rfc931(request)
294 -struct request_info *request;
295 +void rfc931(rmt_sin, our_sin, dest)
297 +struct sockaddr_in *rmt_sin;
298 +struct sockaddr_in *our_sin;
300 +struct sockaddr *rmt_sin;
301 +struct sockaddr *our_sin;
305 - strcpy(request->user, unknown);
306 + strcpy(dest, unknown);
309 /* check_path - examine accessibility */
310 diff -Nur tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
311 --- tcp_wrappers_7.6.orig/weak_symbols.c 1970-01-01 01:00:00.000000000 +0100
312 +++ tcp_wrappers_7.6/weak_symbols.c 2003-08-23 07:40:03.717139736 +0200
315 + * @(#) weak_symbols.h 1.5 99/12/29 23:50
317 + * Author: Anthony Towns <ajt@debian.org>
320 +#ifdef HAVE_WEAKSYMS
322 +int deny_severity __attribute__((weak)) = LOG_WARNING;
323 +int allow_severity __attribute__((weak)) = SEVERITY;