fixed tcp_wrappers
[hdw-linux/hdw-linux.git] / packages / security / tcp_wrappers / config.patch
1 --- tcp_wrappers_7.6/Makefile   1997-03-21 12:27:21.000000000 -0600
2 +++ tcp_wrappers_7.6.gimli/Makefile     2002-07-15 16:07:21.000000000 -0500
3 @@ -1,5 +1,10 @@
4 +GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
5 +
6  # @(#) Makefile 1.23 97/03/21 19:27:20
7  
8 +# unset the HOSTNAME environment variable
9 +HOSTNAME =
10 +
11  what:
12         @echo
13         @echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
14 @@ -19,7 +24,7 @@
15         @echo " generic (most bsd-ish systems with sys5 compatibility)"
16         @echo " 386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
17         @echo " dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
18 -       @echo " linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
19 +       @echo " linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
20         @echo " ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
21         @echo " sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
22         @echo " uts215 uxp"
23 @@ -43,8 +48,8 @@
24  # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
25  #REAL_DAEMON_DIR=/usr/etc
26  #
27 -# SysV.4 Solaris 2.x OSF AIX
28 -#REAL_DAEMON_DIR=/usr/sbin
29 +# SysV.4 Solaris 2.x OSF AIX Linux
30 +REAL_DAEMON_DIR=/usr/sbin
31  #
32  # BSD 4.4
33  #REAL_DAEMON_DIR=/usr/libexec
34 @@ -141,10 +146,21 @@
35         LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
36         EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
37  
38 +ifneq ($(GLIBC),0)
39 +MYLIB=-lnsl
40 +endif
41 +
42  linux:
43         @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
44 -       LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
45 -       NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
46 +       LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
47 +       NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
48 +       EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
49 +
50 +gnu:
51 +       @make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
52 +       LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
53 +       NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
54 +       EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
55  
56  # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
57  hpux hpux8 hpux9 hpux10:
58 @@ -391,7 +407,7 @@
59  # the ones provided with this source distribution. The environ.c module
60  # implements setenv(), getenv(), and putenv().
61  
62 -AUX_OBJ= setenv.o
63 +#AUX_OBJ= setenv.o
64  #AUX_OBJ= environ.o
65  #AUX_OBJ= environ.o strcasecmp.o
66  
67 @@ -454,7 +470,8 @@
68  # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
69  # around this. The workaround does no harm on other Solaris versions.
70  
71 -BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
72 +BUGS =
73 +#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
74  #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
75  #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
76  
77 @@ -464,7 +481,7 @@
78  # If your system supports NIS or YP-style netgroups, enable the following
79  # macro definition. Netgroups are used only for host access control.
80  #
81 -#NETGROUP= -DNETGROUP
82 +NETGROUP= -DNETGROUP
83  
84  ###############################################################
85  # System dependencies: whether or not your system has vsyslog()
86 @@ -491,7 +508,7 @@
87  # Uncomment the next definition to turn on the language extensions
88  # (examples: allow, deny, banners, twist and spawn).
89  # 
90 -#STYLE = -DPROCESS_OPTIONS     # Enable language extensions.
91 +STYLE  = -DPROCESS_OPTIONS     # Enable language extensions.
92  
93  ################################################################
94  # Optional: Changing the default disposition of logfile records
95 @@ -514,7 +531,7 @@
96  #
97  # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
98  
99 -FACILITY= LOG_MAIL     # LOG_MAIL is what most sendmail daemons use
100 +FACILITY= LOG_DAEMON   # LOG_MAIL is what most sendmail daemons use
101  
102  # The syslog priority at which successful connections are logged.
103  
104 @@ -610,7 +627,7 @@
105  # Paranoid mode implies hostname lookup. In order to disable hostname
106  # lookups altogether, see the next section.
107  
108 -PARANOID= -DPARANOID
109 +#PARANOID= -DPARANOID
110  
111  ########################################
112  # Optional: turning off hostname lookups
113 @@ -623,7 +640,7 @@
114  # In order to perform selective hostname lookups, disable paranoid
115  # mode (see previous section) and comment out the following definition.
116  
117 -HOSTNAME= -DALWAYS_HOSTNAME
118 +#HOSTNAME= -DALWAYS_HOSTNAME
119  
120  #############################################
121  # Optional: Turning on host ADDRESS checking
122 @@ -649,28 +666,46 @@
123  # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
124  # Solaris 2.x, and Linux. See your system documentation for details.
125  #
126 -# KILL_OPT= -DKILL_IP_OPTIONS
127 +KILL_OPT= -DKILL_IP_OPTIONS
128  
129  ## End configuration options
130  ############################
131  
132  # Protection against weird shells or weird make programs.
133  
134 +CC     = gcc
135  SHELL  = /bin/sh
136 -.c.o:; $(CC) $(CFLAGS) -c $*.c
137 +.c.o:; $(CC) $(CFLAGS) -o $*.o -c $*.c
138 +
139 +SOMAJOR = 0
140 +SOMINOR = 7.6
141 +
142 +LIB    = libwrap.a
143 +SHLIB  = shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
144 +SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
145 +SHLIBSO        = shared/libwrap.so
146 +SHLIBFLAGS = -Lshared -lwrap
147  
148 -CFLAGS = -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
149 +shared/%.o: %.c
150 +       $(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
151 +
152 +CFLAGS = -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
153         $(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
154         -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
155         -DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
156         $(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
157         $(VSYSLOG) $(HOSTNAME)
158  
159 +SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
160 +SHCFLAGS = -fPIC -shared -D_REENTRANT
161 +
162  LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
163         hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
164         $(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
165         update.o misc.o diag.o percent_m.o myvsyslog.o
166  
167 +SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
168 +
169  FROM_OBJ= fromhost.o
170  
171  KIT    = README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
172 @@ -684,46 +719,80 @@
173         refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
174         scaffold.h tcpdmatch.8 README.NIS
175  
176 -LIB    = libwrap.a
177 -
178 -all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
179 +all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
180  
181  # Invalidate all object files when the compiler options (CFLAGS) have changed.
182  
183  config-check:
184         @set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
185 -       @set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
186 -       if cmp cflags /tmp/cflags.$$$$ ; \
187 -       then rm /tmp/cflags.$$$$ ; \
188 -       else mv /tmp/cflags.$$$$ cflags ; \
189 +       @set +e; echo $(CFLAGS) >cflags.new ; \
190 +       if cmp cflags cflags.new ; \
191 +       then rm cflags.new ; \
192 +       else mv cflags.new cflags ; \
193         fi >/dev/null 2>/dev/null
194 +       @if [ ! -d shared ]; then mkdir shared; fi
195  
196  $(LIB):        $(LIB_OBJ)
197         rm -f $(LIB)
198         $(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
199         -$(RANLIB) $(LIB)
200  
201 -tcpd:  tcpd.o $(LIB)
202 -       $(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
203 +$(SHLIB): $(SHLIB_OBJ)
204 +       rm -f $(SHLIB)
205 +       $(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
206 +       ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
207 +       ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
208 +
209 +tcpd:  tcpd.o $(SHLIB)
210 +       $(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
211  
212 -miscd: miscd.o $(LIB)
213 -       $(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
214 +miscd: miscd.o $(SHLIB)
215 +       $(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
216  
217 -safe_finger: safe_finger.o $(LIB)
218 -       $(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
219 +safe_finger: safe_finger.o $(SHLIB)
220 +       $(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
221  
222  TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
223  
224 -tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
225 -       $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
226 +tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
227 +       $(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
228  
229 -try-from: try-from.o fakelog.o $(LIB)
230 -       $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
231 +try-from: try-from.o fakelog.o $(SHLIB)
232 +       $(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
233  
234  TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
235  
236 -tcpdchk: $(TCPDCHK_OBJ) $(LIB)
237 -       $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
238 +tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
239 +       $(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
240 +
241 +install: install-lib install-bin install-dev
242 +
243 +install-lib:
244 +       install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
245 +       ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
246 +       ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
247 +
248 +install-bin:
249 +       install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
250 +       install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
251 +       install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
252 +       install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
253 +       install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
254 +       install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
255 +       install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
256 +       install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
257 +       install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
258 +       install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
259 +       install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
260 +       install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
261 +
262 +install-dev:
263 +       install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
264 +       install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
265 +       install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
266 +       ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
267 +       ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
268 +       ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
269  
270  shar:  $(KIT)
271         @shar $(KIT)
272 @@ -739,7 +808,8 @@
273  
274  clean:
275         rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
276 -       cflags
277 +       cflags libwrap*.so*
278 +       rm -rf shared
279  
280  tidy:  clean
281         chmod -R a+r .
282 @@ -885,5 +955,6 @@
283  update.o: mystdarg.h
284  update.o: tcpd.h
285  vfprintf.o: cflags
286 +weak_symbols.o: tcpd.h
287  workarounds.o: cflags
288  workarounds.o: tcpd.h
289 --- tcp_wrappers_7.6/fix_options.c      1997-04-07 19:29:19.000000000 -0500
290 +++ tcp_wrappers_7.6.gimli/fix_options.c        2002-01-07 08:50:19.000000000 -0600
291 @@ -35,7 +35,12 @@
292  #ifdef IP_OPTIONS
293      unsigned char optbuf[BUFFER_SIZE / 3], *cp;
294      char    lbuf[BUFFER_SIZE], *lp;
295 +#if !defined(__GLIBC__)
296      int     optsize = sizeof(optbuf), ipproto;
297 +#else /* __GLIBC__ */
298 +    size_t  optsize = sizeof(optbuf);
299 +    int     ipproto;
300 +#endif /* __GLIBC__ */
301      struct protoent *ip;
302      int     fd = request->fd;
303      unsigned int opt;
304 --- tcp_wrappers_7.6/hosts_access.3     1996-02-11 10:01:27.000000000 -0600
305 +++ tcp_wrappers_7.6.gimli/hosts_access.3       2002-01-07 08:50:19.000000000 -0600
306 @@ -3,7 +3,7 @@
307  hosts_access, hosts_ctl, request_init, request_set \- access control library
308  .SH SYNOPSIS
309  .nf
310 -#include "tcpd.h"
311 +#include <tcpd.h>
312  
313  extern int allow_severity;
314  extern int deny_severity;
315 --- tcp_wrappers_7.6/hosts_access.5     1995-01-30 12:51:47.000000000 -0600
316 +++ tcp_wrappers_7.6.gimli/hosts_access.5       2002-01-07 08:50:19.000000000 -0600
317 @@ -8,9 +8,9 @@
318  impatient reader is encouraged to skip to the EXAMPLES section for a
319  quick introduction.
320  .PP
321 -An extended version of the access control language is described in the
322 -\fIhosts_options\fR(5) document. The extensions are turned on at
323 -program build time by building with -DPROCESS_OPTIONS.
324 +The extended version of the access control language is described in the
325 +\fIhosts_options\fR(5) document. \fBNote that this language supersedes
326 +the meaning of \fIshell_command\fB as documented below.\fR
327  .PP
328  In the following text, \fIdaemon\fR is the the process name of a
329  network daemon process, and \fIclient\fR is the name and/or address of
330 @@ -40,7 +40,7 @@
331  character. This permits you to break up long lines so that they are
332  easier to edit.
333  .IP \(bu
334 -Blank lines or lines that begin with a `#\' character are ignored.
335 +Blank lines or lines that begin with a `#' character are ignored.
336  This permits you to insert comments and whitespace so that the tables
337  are easier to read.
338  .IP \(bu
339 @@ -69,26 +69,33 @@
340  .SH PATTERNS
341  The access control language implements the following patterns:
342  .IP \(bu
343 -A string that begins with a `.\' character. A host name is matched if
344 +A string that begins with a `.' character. A host name is matched if
345  the last components of its name match the specified pattern.  For
346 -example, the pattern `.tue.nl\' matches the host name
347 -`wzv.win.tue.nl\'.
348 +example, the pattern `.tue.nl' matches the host name
349 +`wzv.win.tue.nl'.
350  .IP \(bu
351 -A string that ends with a `.\' character. A host address is matched if
352 +A string that ends with a `.' character. A host address is matched if
353  its first numeric fields match the given string.  For example, the
354 -pattern `131.155.\' matches the address of (almost) every host on the
355 +pattern `131.155.' matches the address of (almost) every host on the
356  Eind\%hoven University network (131.155.x.x).
357  .IP \(bu
358 -A string that begins with an `@\' character is treated as an NIS
359 +A string that begins with an `@' character is treated as an NIS
360  (formerly YP) netgroup name. A host name is matched if it is a host
361  member of the specified netgroup. Netgroup matches are not supported
362  for daemon process names or for client user names.
363  .IP \(bu
364 -An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
365 -`net/mask\' pair. A host address is matched if `net\' is equal to the
366 -bitwise AND of the address and the `mask\'. For example, the net/mask
367 -pattern `131.155.72.0/255.255.254.0\' matches every address in the
368 -range `131.155.72.0\' through `131.155.73.255\'.
369 +An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
370 +`net/mask' pair. A host address is matched if `net' is equal to the
371 +bitwise AND of the address and the `mask'. For example, the net/mask
372 +pattern `131.155.72.0/255.255.254.0' matches every address in the
373 +range `131.155.72.0' through `131.155.73.255'.
374 +.IP \(bu
375 +A string that begins with a `/' character is treated as a file
376 +name. A host name or address is matched if it matches any host name
377 +or address pattern listed in the named file. The file format is
378 +zero or more lines with zero or more host name or address patterns
379 +separated by whitespace.  A file name pattern can be used anywhere
380 +a host name or address pattern can be used.
381  .SH WILDCARDS
382  The access control language supports explicit wildcards:
383  .IP ALL
384 @@ -115,19 +122,19 @@
385  .ne 6
386  .SH OPERATORS
387  .IP EXCEPT
388 -Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
389 +Intended use is of the form: `list_1 EXCEPT list_2'; this construct
390  matches anything that matches \fIlist_1\fR unless it matches
391  \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
392  client_lists. The EXCEPT operator can be nested: if the control
393 -language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
394 -would parse as `(a EXCEPT (b EXCEPT c))\'.
395 +language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
396 +would parse as `(a EXCEPT (b EXCEPT c))'.
397  .br
398  .ne 6
399  .SH SHELL COMMANDS
400  If the first-matched access control rule contains a shell command, that
401  command is subjected to %<letter> substitutions (see next section).
402  The result is executed by a \fI/bin/sh\fR child process with standard
403 -input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
404 +input, output and error connected to \fI/dev/null\fR.  Specify an `&'
405  at the end of the command if you do not want to wait until it has
406  completed.
407  .PP
408 @@ -159,7 +166,7 @@
409  .IP %u
410  The client user name (or "unknown").
411  .IP %%
412 -Expands to a single `%\' character.
413 +Expands to a single `%' character.
414  .PP
415  Characters in % expansions that may confuse the shell are replaced by
416  underscores.
417 @@ -243,9 +250,9 @@
418  less trustworthy. It is possible for an intruder to spoof both the
419  client connection and the IDENT lookup, although doing so is much
420  harder than spoofing just a client connection. It may also be that
421 -the client\'s IDENT server is lying.
422 +the client's IDENT server is lying.
423  .PP
424 -Note: IDENT lookups don\'t work with UDP services. 
425 +Note: IDENT lookups don't work with UDP services. 
426  .SH EXAMPLES
427  The language is flexible enough that different types of access control
428  policy can be expressed with a minimum of fuss. Although the language
429 @@ -285,7 +292,7 @@
430  .br
431  ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
432  .PP
433 -The first rule permits access from hosts in the local domain (no `.\'
434 +The first rule permits access from hosts in the local domain (no `.'
435  in the host name) and from members of the \fIsome_netgroup\fP
436  netgroup.  The second rule permits access from all hosts in the
437  \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
438 @@ -322,8 +329,8 @@
439  /etc/hosts.deny:
440  .in +3
441  .nf
442 -in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
443 -       /usr/ucb/mail -s %d-%h root) &
444 +in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
445 +       /usr/bin/mail -s %d-%h root) &
446  .fi
447  .PP
448  The safe_finger command comes with the tcpd wrapper and should be
449 @@ -349,7 +356,7 @@
450  capacity of an internal buffer; when an access control rule is not
451  terminated by a newline character; when the result of %<letter>
452  expansion would overflow an internal buffer; when a system call fails
453 -that shouldn\'t.  All problems are reported via the syslog daemon.
454 +that shouldn't.  All problems are reported via the syslog daemon.
455  .SH FILES
456  .na
457  .nf
458 --- tcp_wrappers_7.6/hosts_access.c     1997-02-11 19:13:23.000000000 -0600
459 +++ tcp_wrappers_7.6.gimli/hosts_access.c       2002-01-07 08:50:19.000000000 -0600
460 @@ -240,6 +240,26 @@
461      }
462  }
463  
464 +/* hostfile_match - look up host patterns from file */
465 +
466 +static int hostfile_match(path, host)
467 +char   *path;
468 +struct hosts_info *host;
469 +{
470 +    char    tok[BUFSIZ];
471 +    int     match = NO;
472 +    FILE   *fp;
473 +
474 +    if ((fp = fopen(path, "r")) != 0) {
475 +        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
476 +            /* void */ ;
477 +        fclose(fp);
478 +    } else if (errno != ENOENT) {
479 +        tcpd_warn("open %s: %m", path);
480 +    }
481 +    return (match);
482 +}
483 +
484  /* host_match - match host name and/or address against pattern */
485  
486  static int host_match(tok, host)
487 @@ -267,6 +287,8 @@
488         tcpd_warn("netgroup support is disabled");      /* not tcpd_jump() */
489         return (NO);
490  #endif
491 +    } else if (tok[0] == '/') {                         /* /file hack */
492 +        return (hostfile_match(tok, host));
493      } else if (STR_EQ(tok, "KNOWN")) {         /* check address and name */
494         char   *name = eval_hostname(host);
495         return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
496 --- tcp_wrappers_7.6/hosts_options.5    1994-12-28 10:42:29.000000000 -0600
497 +++ tcp_wrappers_7.6.gimli/hosts_options.5      2002-01-07 08:50:19.000000000 -0600
498 @@ -58,12 +58,12 @@
499  Execute, in a child process, the specified shell command, after
500  performing the %<letter> expansions described in the hosts_access(5)
501  manual page.  The command is executed with stdin, stdout and stderr
502 -connected to the null device, so that it won\'t mess up the
503 +connected to the null device, so that it won't mess up the
504  conversation with the client host. Example:
505  .sp
506  .nf
507  .ti +3
508 -spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
509 +spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
510  .fi
511  .sp
512  executes, in a background child process, the shell command "safe_finger
513 --- tcp_wrappers_7.6/options.c  1996-02-11 10:01:32.000000000 -0600
514 +++ tcp_wrappers_7.6.gimli/options.c    2002-01-07 08:50:19.000000000 -0600
515 @@ -473,6 +473,9 @@
516  #ifdef LOG_CRON
517      "cron", LOG_CRON,
518  #endif
519 +#ifdef LOG_FTP
520 +    "ftp", LOG_FTP,
521 +#endif
522  #ifdef LOG_LOCAL0
523      "local0", LOG_LOCAL0,
524  #endif
525 --- tcp_wrappers_7.6/percent_m.c        1994-12-28 10:42:37.000000000 -0600
526 +++ tcp_wrappers_7.6.gimli/percent_m.c  2002-01-07 08:50:19.000000000 -0600
527 @@ -13,7 +13,7 @@
528  #include <string.h>
529  
530  extern int errno;
531 -#ifndef SYS_ERRLIST_DEFINED
532 +#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
533  extern char *sys_errlist[];
534  extern int sys_nerr;
535  #endif
536 @@ -29,11 +29,15 @@
537  
538      while (*bp = *cp)
539         if (*cp == '%' && cp[1] == 'm') {
540 +#ifdef HAVE_STRERROR
541 +            strcpy(bp, strerror(errno));
542 +#else
543             if (errno < sys_nerr && errno > 0) {
544                 strcpy(bp, sys_errlist[errno]);
545             } else {
546                 sprintf(bp, "Unknown error %d", errno);
547             }
548 +#endif
549             bp += strlen(bp);
550             cp += 2;
551         } else {
552 --- tcp_wrappers_7.6/rfc931.c   1995-01-02 09:11:34.000000000 -0600
553 +++ tcp_wrappers_7.6.gimli/rfc931.c     2002-01-07 08:50:19.000000000 -0600
554 @@ -33,7 +33,7 @@
555  
556  int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
557  
558 -static jmp_buf timebuf;
559 +static sigjmp_buf timebuf;
560  
561  /* fsocket - open stdio stream on top of socket */
562  
563 @@ -62,7 +62,7 @@
564  static void timeout(sig)
565  int     sig;
566  {
567 -    longjmp(timebuf, sig);
568 +    siglongjmp(timebuf, sig);
569  }
570  
571  /* rfc931 - return remote user name, given socket structures */
572 @@ -99,7 +99,7 @@
573          * Set up a timer so we won't get stuck while waiting for the server.
574          */
575  
576 -       if (setjmp(timebuf) == 0) {
577 +       if (sigsetjmp(timebuf,1) == 0) {
578             signal(SIGALRM, timeout);
579             alarm(rfc931_timeout);
580  
581 --- tcp_wrappers_7.6/safe_finger.8      1969-12-31 18:00:00.000000000 -0600
582 +++ tcp_wrappers_7.6.gimli/safe_finger.8        2002-01-07 08:50:19.000000000 -0600
583 @@ -0,0 +1,34 @@
584 +.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
585 +.SH NAME
586 +safe_finger \- finger client wrapper that protects against nasty stuff
587 +from finger servers
588 +.SH SYNOPSIS
589 +.B safe_finger [finger_options]
590 +.SH DESCRIPTION
591 +The
592 +.B safe_finger
593 +command protects against nasty stuff from finger servers. Use this
594 +program for automatic reverse finger probes from the
595 +.B tcp_wrapper
596 +.B (tcpd)
597 +, not the raw finger command. The
598 +.B safe_finger
599 +command makes sure that the finger client is not run with root
600 +privileges. It also runs the finger client with a defined PATH
601 +environment.
602 +.B safe_finger
603 +will also protect you from problems caused by the output of some
604 +finger servers. The problem: some programs may react to stuff in
605 +the first column. Other programs may get upset by thrash anywhere
606 +on a line. File systems may fill up as the finger server keeps
607 +sending data. Text editors may bomb out on extremely long lines.
608 +The finger server may take forever because it is somehow wedged.
609 +.B safe_finger
610 +takes care of all this badness.
611 +.SH SEE ALSO
612 +.BR hosts_access (5),
613 +.BR hosts_options (5),
614 +.BR tcpd (8)
615 +.SH AUTHOR
616 +Wietse Venema, Eindhoven University of Technology, The Netherlands.
617 +
618 --- tcp_wrappers_7.6/safe_finger.c      1994-12-28 10:42:42.000000000 -0600
619 +++ tcp_wrappers_7.6.gimli/safe_finger.c        2002-01-07 08:50:19.000000000 -0600
620 @@ -26,21 +26,24 @@
621  #include <stdio.h>
622  #include <ctype.h>
623  #include <pwd.h>
624 +#include <syslog.h>
625  
626  extern void exit();
627  
628  /* Local stuff */
629  
630 -char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
631 +char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
632  
633  #define        TIME_LIMIT      60              /* Do not keep listinging forever */
634  #define        INPUT_LENGTH    100000          /* Do not keep listinging forever */
635  #define        LINE_LENGTH     128             /* Editors can choke on long lines */
636  #define        FINGER_PROGRAM  "finger"        /* Most, if not all, UNIX systems */
637  #define        UNPRIV_NAME     "nobody"        /* Preferred privilege level */
638 -#define        UNPRIV_UGID     32767           /* Default uid and gid */
639 +#define        UNPRIV_UGID     65534           /* Default uid and gid */
640  
641  int     finger_pid;
642 +int    allow_severity = SEVERITY;
643 +int    deny_severity = LOG_WARNING;
644  
645  void    cleanup(sig)
646  int     sig;
647 --- tcp_wrappers_7.6/scaffold.c 1997-03-21 12:27:24.000000000 -0600
648 +++ tcp_wrappers_7.6.gimli/scaffold.c   2002-01-07 08:50:19.000000000 -0600
649 @@ -180,10 +180,12 @@
650  
651  /* ARGSUSED */
652  
653 -void    rfc931(request)
654 -struct request_info *request;
655 +void    rfc931(rmt_sin, our_sin, dest)
656 +struct sockaddr_in *rmt_sin;
657 +struct sockaddr_in *our_sin;
658 +char   *dest;
659  {
660 -    strcpy(request->user, unknown);
661 +    strcpy(dest, unknown);
662  }
663  
664  /* check_path - examine accessibility */
665 --- tcp_wrappers_7.6/socket.c   1997-03-21 12:27:25.000000000 -0600
666 +++ tcp_wrappers_7.6.gimli/socket.c     2002-01-07 08:50:19.000000000 -0600
667 @@ -76,7 +76,11 @@
668  {
669      static struct sockaddr_in client;
670      static struct sockaddr_in server;
671 +#if !defined (__GLIBC__)
672      int     len;
673 +#else /* __GLIBC__ */
674 +    size_t  len;
675 +#endif /* __GLIBC__ */
676      char    buf[BUFSIZ];
677      int     fd = request->fd;
678  
679 @@ -224,7 +228,11 @@
680  {
681      char    buf[BUFSIZ];
682      struct sockaddr_in sin;
683 +#if !defined(__GLIBC__)
684      int     size = sizeof(sin);
685 +#else /* __GLIBC__ */
686 +    size_t  size = sizeof(sin);
687 +#endif /* __GLIBC__ */
688  
689      /*
690       * Eat up the not-yet received datagram. Some systems insist on a
691 --- tcp_wrappers_7.6/tcpd.8     1996-02-21 09:39:16.000000000 -0600
692 +++ tcp_wrappers_7.6.gimli/tcpd.8       2002-01-07 08:50:19.000000000 -0600
693 @@ -94,7 +94,7 @@
694  .PP
695  The example assumes that the network daemons live in /usr/etc. On some
696  systems, network daemons live in /usr/sbin or in /usr/libexec, or have
697 -no `in.\' prefix to their name.
698 +no `in.' prefix to their name.
699  .SH EXAMPLE 2
700  This example applies when \fItcpd\fR expects that the network daemons
701  are left in their original place.
702 @@ -110,26 +110,26 @@
703  becomes:
704  .sp
705  .ti +5
706 -finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
707 +finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
708  .sp
709  .fi
710  .PP
711  The example assumes that the network daemons live in /usr/etc. On some
712  systems, network daemons live in /usr/sbin or in /usr/libexec, the
713 -daemons have no `in.\' prefix to their name, or there is no userid
714 +daemons have no `in.' prefix to their name, or there is no userid
715  field in the inetd configuration file.
716  .PP
717  Similar changes will be needed for the other services that are to be
718 -covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
719 +covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
720  process to make the changes effective. AIX users may also have to
721 -execute the `inetimp\' command.
722 +execute the `inetimp' command.
723  .SH EXAMPLE 3
724  In the case of daemons that do not live in a common directory ("secret"
725  or otherwise), edit the \fIinetd\fR configuration file so that it
726  specifies an absolute path name for the process name field. For example:
727  .nf
728  .sp
729 -    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
730 +    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
731  .sp
732  .fi
733  .PP
734 --- tcp_wrappers_7.6/tcpd.h     1996-03-19 09:22:25.000000000 -0600
735 +++ tcp_wrappers_7.6.gimli/tcpd.h       2002-01-07 08:50:19.000000000 -0600
736 @@ -4,6 +4,25 @@
737    * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
738    */
739  
740 +#ifndef _TCPWRAPPERS_TCPD_H
741 +#define _TCPWRAPPERS_TCPD_H
742 +
743 +/* someone else may have defined this */
744 +#undef  __P
745 +
746 +/* use prototypes if we have an ANSI C compiler or are using C++ */
747 +#if defined(__STDC__) || defined(__cplusplus)
748 +#define __P(args)       args
749 +#else
750 +#define __P(args)       ()
751 +#endif
752 +
753 +/* Need definitions of struct sockaddr_in and FILE. */
754 +#include <netinet/in.h>
755 +#include <stdio.h>
756 +
757 +__BEGIN_DECLS
758 +
759  /* Structure to describe one communications endpoint. */
760  
761  #define STRING_LENGTH  128             /* hosts, users, processes */
762 @@ -25,10 +44,10 @@
763      char    pid[10];                   /* access via eval_pid(request) */
764      struct host_info client[1];                /* client endpoint info */
765      struct host_info server[1];                /* server endpoint info */
766 -    void  (*sink) ();                  /* datagram sink function or 0 */
767 -    void  (*hostname) ();              /* address to printable hostname */
768 -    void  (*hostaddr) ();              /* address to printable address */
769 -    void  (*cleanup) ();               /* cleanup function or 0 */
770 +    void  (*sink) __P((int));          /* datagram sink function or 0 */
771 +    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
772 +    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
773 +    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
774      struct netconfig *config;          /* netdir handle */
775  };
776  
777 @@ -61,25 +80,30 @@
778  /* Global functions. */
779  
780  #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
781 -extern void fromhost();                        /* get/validate client host info */
782 +extern void fromhost __P((struct request_info *));     /* get/validate client host info */
783  #else
784  #define fromhost sock_host             /* no TLI support needed */
785  #endif
786  
787 -extern int hosts_access();             /* access control */
788 -extern void shell_cmd();               /* execute shell command */
789 -extern char *percent_x();              /* do %<char> expansion */
790 -extern void rfc931();                  /* client name from RFC 931 daemon */
791 -extern void clean_exit();              /* clean up and exit */
792 -extern void refuse();                  /* clean up and exit */
793 -extern char *xgets();                  /* fgets() on steroids */
794 -extern char *split_at();               /* strchr() and split */
795 -extern unsigned long dot_quad_addr();  /* restricted inet_addr() */
796 +extern void shell_cmd __P((char *));   /* execute shell command */
797 +extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
798 +extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
799 +extern void clean_exit __P((struct request_info *)); /* clean up and exit */
800 +extern void refuse __P((struct request_info *));       /* clean up and exit */
801 +extern char *xgets __P((char *, int, FILE *)); /* fgets() on steroids */
802 +extern char *split_at __P((char *, int));      /* strchr() and split */
803 +extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
804  
805  /* Global variables. */
806  
807 +#ifdef HAVE_WEAKSYMS
808 +extern int allow_severity __attribute__ ((weak)); /* for connection logging */
809 +extern int deny_severity __attribute__ ((weak)); /* for connection logging */
810 +#else
811  extern int allow_severity;             /* for connection logging */
812  extern int deny_severity;              /* for connection logging */
813 +#endif
814 +
815  extern char *hosts_allow_table;                /* for verification mode redirection */
816  extern char *hosts_deny_table;         /* for verification mode redirection */
817  extern int hosts_access_verbose;       /* for verbose matching mode */
818 @@ -92,9 +116,14 @@
819    */
820  
821  #ifdef __STDC__
822 +extern int hosts_access(struct request_info *request);
823 +extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
824 +                     char *client_user);
825  extern struct request_info *request_init(struct request_info *,...);
826  extern struct request_info *request_set(struct request_info *,...);
827  #else
828 +extern int hosts_access();
829 +extern int hosts_ctl();
830  extern struct request_info *request_init();    /* initialize request */
831  extern struct request_info *request_set();     /* update request structure */
832  #endif
833 @@ -117,27 +146,31 @@
834    * host_info structures serve as caches for the lookup results.
835    */
836  
837 -extern char *eval_user();              /* client user */
838 -extern char *eval_hostname();          /* printable hostname */
839 -extern char *eval_hostaddr();          /* printable host address */
840 -extern char *eval_hostinfo();          /* host name or address */
841 -extern char *eval_client();            /* whatever is available */
842 -extern char *eval_server();            /* whatever is available */
843 +extern char *eval_user __P((struct request_info *));   /* client user */
844 +extern char *eval_hostname __P((struct host_info *));  /* printable hostname */
845 +extern char *eval_hostaddr __P((struct host_info *));  /* printable host address */
846 +extern char *eval_hostinfo __P((struct host_info *));  /* host name or address */
847 +extern char *eval_client __P((struct request_info *)); /* whatever is available */
848 +extern char *eval_server __P((struct request_info *)); /* whatever is available */
849  #define eval_daemon(r) ((r)->daemon)   /* daemon process name */
850  #define eval_pid(r)    ((r)->pid)      /* process id */
851  
852  /* Socket-specific methods, including DNS hostname lookups. */
853  
854 -extern void sock_host();               /* look up endpoint addresses */
855 -extern void sock_hostname();           /* translate address to hostname */
856 -extern void sock_hostaddr();           /* address to printable address */
857 +/* look up endpoint addresses */
858 +extern void sock_host __P((struct request_info *));
859 +/* translate address to hostname */
860 +extern void sock_hostname __P((struct host_info *));
861 +/* address to printable address */
862 +extern void sock_hostaddr __P((struct host_info *));
863 +
864  #define sock_methods(r) \
865         { (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
866  
867  /* The System V Transport-Level Interface (TLI) interface. */
868  
869  #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
870 -extern void tli_host();                        /* look up endpoint addresses etc. */
871 +extern void tli_host __P((struct request_info *));     /* look up endpoint addresses etc. */
872  #endif
873  
874   /*
875 @@ -178,7 +211,7 @@
876    * behavior.
877    */
878  
879 -extern void process_options();         /* execute options */
880 +extern void process_options __P((char *, struct request_info *)); /* execute options */
881  extern int dry_run;                    /* verification flag */
882  
883  /* Bug workarounds. */
884 @@ -217,3 +250,7 @@
885  #define strtok my_strtok
886  extern char *my_strtok();
887  #endif
888 +
889 +__END_DECLS
890 +
891 +#endif /* tcpd.h */
892 --- tcp_wrappers_7.6/tcpdchk.c  1997-02-11 19:13:25.000000000 -0600
893 +++ tcp_wrappers_7.6.gimli/tcpdchk.c    2002-01-07 08:50:19.000000000 -0600
894 @@ -350,6 +350,8 @@
895  {
896      if (pat[0] == '@') {
897         tcpd_warn("%s: daemon name begins with \"@\"", pat);
898 +    } else if (pat[0] == '/') {
899 +        tcpd_warn("%s: daemon name begins with \"/\"", pat);
900      } else if (pat[0] == '.') {
901         tcpd_warn("%s: daemon name begins with dot", pat);
902      } else if (pat[strlen(pat) - 1] == '.') {
903 @@ -382,6 +384,8 @@
904  {
905      if (pat[0] == '@') {                       /* @netgroup */
906         tcpd_warn("%s: user name begins with \"@\"", pat);
907 +    } else if (pat[0] == '/') {
908 +        tcpd_warn("%s: user name begins with \"/\"", pat);
909      } else if (pat[0] == '.') {
910         tcpd_warn("%s: user name begins with dot", pat);
911      } else if (pat[strlen(pat) - 1] == '.') {
912 @@ -402,8 +406,13 @@
913  static int check_host(pat)
914  char   *pat;
915  {
916 +    char    buf[BUFSIZ];
917      char   *mask;
918      int     addr_count = 1;
919 +    FILE   *fp;
920 +    struct tcpd_context saved_context;
921 +    char   *cp;
922 +    char   *wsp = " \t\r\n";
923  
924      if (pat[0] == '@') {                       /* @netgroup */
925  #ifdef NO_NETGRENT
926 @@ -422,6 +431,21 @@
927         tcpd_warn("netgroup support disabled");
928  #endif
929  #endif
930 +    } else if (pat[0] == '/') {                 /* /path/name */
931 +        if ((fp = fopen(pat, "r")) != 0) {
932 +            saved_context = tcpd_context;
933 +            tcpd_context.file = pat;
934 +            tcpd_context.line = 0;
935 +            while (fgets(buf, sizeof(buf), fp)) {
936 +                tcpd_context.line++;
937 +                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
938 +                    check_host(cp);
939 +            }
940 +            tcpd_context = saved_context;
941 +            fclose(fp);
942 +        } else if (errno != ENOENT) {
943 +            tcpd_warn("open %s: %m", pat);
944 +        }
945      } else if (mask = split_at(pat, '/')) {    /* network/netmask */
946         if (dot_quad_addr(pat) == INADDR_NONE
947             || dot_quad_addr(mask) == INADDR_NONE)
948 --- tcp_wrappers_7.6/try-from.8 1969-12-31 18:00:00.000000000 -0600
949 +++ tcp_wrappers_7.6.gimli/try-from.8   2002-01-07 08:50:19.000000000 -0600
950 @@ -0,0 +1,28 @@
951 +.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
952 +.SH NAME
953 +try-from \- test program for the tcp_wrapper
954 +.SH SYNOPSIS
955 +.B try-from
956 +.SH DESCRIPTION
957 +The
958 +.B try-from
959 +command can be called via a remote shell command to find out
960 +if the hostname and address are properly recognized
961 +by the
962 +.B tcp_wrapper
963 +library, if username lookup works, and (SysV only) if the TLI
964 +on top of IP heuristics work. Diagnostics are reported through
965 +.BR syslog (3)
966 +and redirected to stderr.
967 +
968 +Example:
969 +
970 +rsh host /some/where/try-from
971 +
972 +.SH SEE ALSO
973 +.BR hosts_access (5),
974 +.BR hosts_options (5),
975 +.BR tcpd (8)
976 +.SH AUTHOR
977 +Wietse Venema, Eindhoven University of Technology, The Netherlands.
978 +
979 --- tcp_wrappers_7.6/weak_symbols.c     1969-12-31 18:00:00.000000000 -0600
980 +++ tcp_wrappers_7.6.gimli/weak_symbols.c       2002-01-07 08:50:19.000000000 -0600
981 @@ -0,0 +1,11 @@
982 + /*
983 +  * @(#) weak_symbols.h 1.5 99/12/29 23:50
984 +  * 
985 +  * Author: Anthony Towns <ajt@debian.org>
986 +  */
987 +
988 +#ifdef HAVE_WEAKSYMS
989 +#include <syslog.h>
990 +int deny_severity = LOG_WARNING;
991 +int allow_severity = SEVERITY; 
992 +#endif
993 --- tcp_wrappers_7.6/workarounds.c      1996-03-19 09:22:26.000000000 -0600
994 +++ tcp_wrappers_7.6.gimli/workarounds.c        2002-01-07 08:50:19.000000000 -0600
995 @@ -163,7 +163,11 @@
996  int     fix_getpeername(sock, sa, len)
997  int     sock;
998  struct sockaddr *sa;
999 +#if !defined(__GLIBC__)
1000  int    *len;
1001 +#else /* __GLIBC__ */
1002 +size_t *len;
1003 +#endif /* __GLIBC__ */
1004  {
1005      int     ret;
1006      struct sockaddr_in *sin = (struct sockaddr_in *) sa;