wok rev 286

ADD: libwrap, libwrap-dev
author Eric Joseph-Alexandre <erjo@slitaz.org>
date Wed Feb 27 16:38:56 2008 +0100 (2008-02-27)
parents b19d783ba624
children 4b37234fc0be
files libwrap-dev/receipt libwrap/receipt libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libwrap-dev/receipt	Wed Feb 27 16:38:56 2008 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="libwrap-dev"
     1.7 +VERSION="7.6"
     1.8 +CATEGORY="development"
     1.9 +SHORT_DESC="Wietse Venema's network logger devel files."
    1.10 +MAINTAINER="Erjo <erjo@slitaz.org>"
    1.11 +WANTED="libwrap"
    1.12 +WEB_SITE="ftp://ftp.porcupine.org/pub/security/index.html"
    1.13 +
    1.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.15 +genpkg_rules()
    1.16 +{
    1.17 +	src=$WOK/$WANTED/tcp_wrappers_${VERSION}
    1.18 +	mkdir -p $fs/usr/include $fs/usr/lib
    1.19 +	cp -a $src/tcpd.h $fs/usr/include
    1.20 +	cp -a $src/*.a $fs/usr/lib
    1.21 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/libwrap/receipt	Wed Feb 27 16:38:56 2008 +0100
     2.3 @@ -0,0 +1,36 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="libwrap"
     2.7 +VERSION="7.6"
     2.8 +CATEGORY="system-tools"
     2.9 +SHORT_DESC="Wietse Venema's network logger."
    2.10 +MAINTAINER="Erjo <erjo@slitaz.org>"
    2.11 +SOURCE="tcp_wrappers"
    2.12 +TARBALL="${SOURCE}_${VERSION}.tar.gz"
    2.13 +WEB_SITE="ftp://ftp.porcupine.org/pub/security/index.html"
    2.14 +WGET_URL="ftp://ftp.porcupine.org/pub/security/$TARBALL"
    2.15 +
    2.16 +# Rules to configure and make the package.
    2.17 +compile_rules()
    2.18 +{
    2.19 +	src=$PWD/${SOURCE}_${VERSION}
    2.20 +	cd $src
    2.21 +	# Patch from Linux From Scratch
    2.22 +	patch -p1 -i ../stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
    2.23 +	sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c 
    2.24 +		
    2.25 +	make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux
    2.26 +}
    2.27 +
    2.28 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.29 +genpkg_rules()
    2.30 +{
    2.31 +	src=$PWD/${SOURCE}_${VERSION}
    2.32 +	mkdir -p $fs/usr/lib 
    2.33 +	cp -a $src/shared/*.so* $fs/usr/lib
    2.34 +}
    2.35 +
    2.36 +clean_wok()
    2.37 +{
    2.38 +	rm -rf $PWD/${SOURCE}_${VERSION}
    2.39 +}
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch	Wed Feb 27 16:38:56 2008 +0100
     3.3 @@ -0,0 +1,1035 @@
     3.4 +Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
     3.5 +Date: 2003-10-04
     3.6 +Initial Package Version: 7.6
     3.7 +Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html
     3.8 +Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink.
     3.9 +This patch provides the following improvements:
    3.10 +    * Install libwrap.so along with libwrap.a.
    3.11 +    * Create an install target for tcp_wrappers.
    3.12 +    * Compilation and security fixes.
    3.13 +    * Documentation fixes.
    3.14 +diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile
    3.15 +--- tcp_wrappers_7.6/Makefile	1997-03-21 12:27:21.000000000 -0600
    3.16 ++++ tcp_wrappers_7.6.gimli/Makefile	2002-07-15 16:07:21.000000000 -0500
    3.17 +@@ -1,5 +1,10 @@
    3.18 ++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
    3.19 ++
    3.20 + # @(#) Makefile 1.23 97/03/21 19:27:20
    3.21 + 
    3.22 ++# unset the HOSTNAME environment variable
    3.23 ++HOSTNAME =
    3.24 ++
    3.25 + what:
    3.26 + 	@echo
    3.27 + 	@echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
    3.28 +@@ -19,7 +24,7 @@
    3.29 + 	@echo "	generic (most bsd-ish systems with sys5 compatibility)"
    3.30 + 	@echo "	386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
    3.31 + 	@echo "	dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
    3.32 +-	@echo "	linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
    3.33 ++	@echo "	linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
    3.34 + 	@echo "	ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
    3.35 + 	@echo "	sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
    3.36 + 	@echo "	uts215 uxp"
    3.37 +@@ -43,8 +48,8 @@
    3.38 + # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
    3.39 + #REAL_DAEMON_DIR=/usr/etc
    3.40 + #
    3.41 +-# SysV.4 Solaris 2.x OSF AIX
    3.42 +-#REAL_DAEMON_DIR=/usr/sbin
    3.43 ++# SysV.4 Solaris 2.x OSF AIX Linux
    3.44 ++REAL_DAEMON_DIR=/usr/sbin
    3.45 + #
    3.46 + # BSD 4.4
    3.47 + #REAL_DAEMON_DIR=/usr/libexec
    3.48 +@@ -141,10 +146,21 @@
    3.49 + 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
    3.50 + 	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
    3.51 + 
    3.52 ++ifneq ($(GLIBC),0)
    3.53 ++MYLIB=-lnsl
    3.54 ++endif
    3.55 ++
    3.56 + linux:
    3.57 + 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
    3.58 +-	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
    3.59 +-	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
    3.60 ++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
    3.61 ++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
    3.62 ++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
    3.63 ++
    3.64 ++gnu:
    3.65 ++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
    3.66 ++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
    3.67 ++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
    3.68 ++	EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
    3.69 + 
    3.70 + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
    3.71 + hpux hpux8 hpux9 hpux10:
    3.72 +@@ -391,7 +407,7 @@
    3.73 + # the ones provided with this source distribution. The environ.c module
    3.74 + # implements setenv(), getenv(), and putenv().
    3.75 + 
    3.76 +-AUX_OBJ= setenv.o
    3.77 ++#AUX_OBJ= setenv.o
    3.78 + #AUX_OBJ= environ.o
    3.79 + #AUX_OBJ= environ.o strcasecmp.o
    3.80 + 
    3.81 +@@ -454,7 +470,8 @@
    3.82 + # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
    3.83 + # around this. The workaround does no harm on other Solaris versions.
    3.84 + 
    3.85 +-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
    3.86 ++BUGS =
    3.87 ++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
    3.88 + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
    3.89 + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
    3.90 + 
    3.91 +@@ -464,7 +481,7 @@
    3.92 + # If your system supports NIS or YP-style netgroups, enable the following
    3.93 + # macro definition. Netgroups are used only for host access control.
    3.94 + #
    3.95 +-#NETGROUP= -DNETGROUP
    3.96 ++NETGROUP= -DNETGROUP
    3.97 + 
    3.98 + ###############################################################
    3.99 + # System dependencies: whether or not your system has vsyslog()
   3.100 +@@ -491,7 +508,7 @@
   3.101 + # Uncomment the next definition to turn on the language extensions
   3.102 + # (examples: allow, deny, banners, twist and spawn).
   3.103 + # 
   3.104 +-#STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
   3.105 ++STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
   3.106 + 
   3.107 + ################################################################
   3.108 + # Optional: Changing the default disposition of logfile records
   3.109 +@@ -514,7 +531,7 @@
   3.110 + #
   3.111 + # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
   3.112 + 
   3.113 +-FACILITY= LOG_MAIL	# LOG_MAIL is what most sendmail daemons use
   3.114 ++FACILITY= LOG_DAEMON	# LOG_MAIL is what most sendmail daemons use
   3.115 + 
   3.116 + # The syslog priority at which successful connections are logged.
   3.117 + 
   3.118 +@@ -610,7 +627,7 @@
   3.119 + # Paranoid mode implies hostname lookup. In order to disable hostname
   3.120 + # lookups altogether, see the next section.
   3.121 + 
   3.122 +-PARANOID= -DPARANOID
   3.123 ++#PARANOID= -DPARANOID
   3.124 + 
   3.125 + ########################################
   3.126 + # Optional: turning off hostname lookups
   3.127 +@@ -623,7 +640,7 @@
   3.128 + # In order to perform selective hostname lookups, disable paranoid
   3.129 + # mode (see previous section) and comment out the following definition.
   3.130 + 
   3.131 +-HOSTNAME= -DALWAYS_HOSTNAME
   3.132 ++#HOSTNAME= -DALWAYS_HOSTNAME
   3.133 + 
   3.134 + #############################################
   3.135 + # Optional: Turning on host ADDRESS checking
   3.136 +@@ -649,28 +666,46 @@
   3.137 + # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
   3.138 + # Solaris 2.x, and Linux. See your system documentation for details.
   3.139 + #
   3.140 +-# KILL_OPT= -DKILL_IP_OPTIONS
   3.141 ++KILL_OPT= -DKILL_IP_OPTIONS
   3.142 + 
   3.143 + ## End configuration options
   3.144 + ############################
   3.145 + 
   3.146 + # Protection against weird shells or weird make programs.
   3.147 + 
   3.148 ++CC	= gcc
   3.149 + SHELL	= /bin/sh
   3.150 +-.c.o:;	$(CC) $(CFLAGS) -c $*.c
   3.151 ++.c.o:;	$(CC) $(CFLAGS) -o $*.o -c $*.c
   3.152 ++
   3.153 ++SOMAJOR = 0
   3.154 ++SOMINOR = 7.6
   3.155 ++
   3.156 ++LIB	= libwrap.a
   3.157 ++SHLIB	= shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
   3.158 ++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
   3.159 ++SHLIBSO	= shared/libwrap.so
   3.160 ++SHLIBFLAGS = -Lshared -lwrap
   3.161 + 
   3.162 +-CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
   3.163 ++shared/%.o: %.c
   3.164 ++	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
   3.165 ++
   3.166 ++CFLAGS	= -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
   3.167 + 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
   3.168 + 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
   3.169 + 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
   3.170 + 	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
   3.171 + 	$(VSYSLOG) $(HOSTNAME)
   3.172 + 
   3.173 ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
   3.174 ++SHCFLAGS = -fPIC -shared -D_REENTRANT
   3.175 ++
   3.176 + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
   3.177 + 	hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
   3.178 + 	$(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
   3.179 + 	update.o misc.o diag.o percent_m.o myvsyslog.o
   3.180 + 
   3.181 ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
   3.182 ++
   3.183 + FROM_OBJ= fromhost.o
   3.184 + 
   3.185 + KIT	= README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
   3.186 +@@ -684,46 +719,80 @@
   3.187 + 	refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
   3.188 + 	scaffold.h tcpdmatch.8 README.NIS
   3.189 + 
   3.190 +-LIB	= libwrap.a
   3.191 +-
   3.192 +-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
   3.193 ++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
   3.194 + 
   3.195 + # Invalidate all object files when the compiler options (CFLAGS) have changed.
   3.196 + 
   3.197 + config-check:
   3.198 + 	@set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
   3.199 +-	@set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
   3.200 +-	if cmp cflags /tmp/cflags.$$$$ ; \
   3.201 +-	then rm /tmp/cflags.$$$$ ; \
   3.202 +-	else mv /tmp/cflags.$$$$ cflags ; \
   3.203 ++	@set +e; echo $(CFLAGS) >cflags.new ; \
   3.204 ++	if cmp cflags cflags.new ; \
   3.205 ++	then rm cflags.new ; \
   3.206 ++	else mv cflags.new cflags ; \
   3.207 + 	fi >/dev/null 2>/dev/null
   3.208 ++	@if [ ! -d shared ]; then mkdir shared; fi
   3.209 + 
   3.210 + $(LIB):	$(LIB_OBJ)
   3.211 + 	rm -f $(LIB)
   3.212 + 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
   3.213 + 	-$(RANLIB) $(LIB)
   3.214 + 
   3.215 +-tcpd:	tcpd.o $(LIB)
   3.216 +-	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
   3.217 ++$(SHLIB): $(SHLIB_OBJ)
   3.218 ++	rm -f $(SHLIB)
   3.219 ++	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
   3.220 ++	ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
   3.221 ++	ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
   3.222 ++
   3.223 ++tcpd:	tcpd.o $(SHLIB)
   3.224 ++	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
   3.225 + 
   3.226 +-miscd:	miscd.o $(LIB)
   3.227 +-	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
   3.228 ++miscd:	miscd.o $(SHLIB)
   3.229 ++	$(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
   3.230 + 
   3.231 +-safe_finger: safe_finger.o $(LIB)
   3.232 +-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
   3.233 ++safe_finger: safe_finger.o $(SHLIB)
   3.234 ++	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
   3.235 + 
   3.236 + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
   3.237 + 
   3.238 +-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
   3.239 +-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
   3.240 ++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
   3.241 ++	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
   3.242 + 
   3.243 +-try-from: try-from.o fakelog.o $(LIB)
   3.244 +-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
   3.245 ++try-from: try-from.o fakelog.o $(SHLIB)
   3.246 ++	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
   3.247 + 
   3.248 + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
   3.249 + 
   3.250 +-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
   3.251 +-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
   3.252 ++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
   3.253 ++	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
   3.254 ++
   3.255 ++install: install-lib install-bin install-dev
   3.256 ++
   3.257 ++install-lib:
   3.258 ++	install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
   3.259 ++	ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
   3.260 ++	ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
   3.261 ++
   3.262 ++install-bin:
   3.263 ++	install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
   3.264 ++	install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
   3.265 ++	install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
   3.266 ++	install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
   3.267 ++	install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
   3.268 ++	install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
   3.269 ++	install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
   3.270 ++	install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
   3.271 ++	install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
   3.272 ++	install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
   3.273 ++	install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
   3.274 ++	install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
   3.275 ++
   3.276 ++install-dev:
   3.277 ++	install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
   3.278 ++	install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
   3.279 ++	install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
   3.280 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
   3.281 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
   3.282 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
   3.283 + 
   3.284 + shar:	$(KIT)
   3.285 + 	@shar $(KIT)
   3.286 +@@ -739,7 +808,8 @@
   3.287 + 
   3.288 + clean:
   3.289 + 	rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
   3.290 +-	cflags
   3.291 ++	cflags libwrap*.so*
   3.292 ++	rm -rf shared
   3.293 + 
   3.294 + tidy:	clean
   3.295 + 	chmod -R a+r .
   3.296 +@@ -885,5 +955,6 @@
   3.297 + update.o: mystdarg.h
   3.298 + update.o: tcpd.h
   3.299 + vfprintf.o: cflags
   3.300 ++weak_symbols.o: tcpd.h
   3.301 + workarounds.o: cflags
   3.302 + workarounds.o: tcpd.h
   3.303 +diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c
   3.304 +--- tcp_wrappers_7.6/fix_options.c	1997-04-07 19:29:19.000000000 -0500
   3.305 ++++ tcp_wrappers_7.6.gimli/fix_options.c	2002-01-07 08:50:19.000000000 -0600
   3.306 +@@ -35,7 +35,12 @@
   3.307 + #ifdef IP_OPTIONS
   3.308 +     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
   3.309 +     char    lbuf[BUFFER_SIZE], *lp;
   3.310 ++#if !defined(__GLIBC__)
   3.311 +     int     optsize = sizeof(optbuf), ipproto;
   3.312 ++#else /* __GLIBC__ */
   3.313 ++    size_t  optsize = sizeof(optbuf);
   3.314 ++    int     ipproto;
   3.315 ++#endif /* __GLIBC__ */
   3.316 +     struct protoent *ip;
   3.317 +     int     fd = request->fd;
   3.318 +     unsigned int opt;
   3.319 +diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3
   3.320 +--- tcp_wrappers_7.6/hosts_access.3	1996-02-11 10:01:27.000000000 -0600
   3.321 ++++ tcp_wrappers_7.6.gimli/hosts_access.3	2002-01-07 08:50:19.000000000 -0600
   3.322 +@@ -3,7 +3,7 @@
   3.323 + hosts_access, hosts_ctl, request_init, request_set \- access control library
   3.324 + .SH SYNOPSIS
   3.325 + .nf
   3.326 +-#include "tcpd.h"
   3.327 ++#include <tcpd.h>
   3.328 + 
   3.329 + extern int allow_severity;
   3.330 + extern int deny_severity;
   3.331 +diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5
   3.332 +--- tcp_wrappers_7.6/hosts_access.5	1995-01-30 12:51:47.000000000 -0600
   3.333 ++++ tcp_wrappers_7.6.gimli/hosts_access.5	2002-01-07 08:50:19.000000000 -0600
   3.334 +@@ -8,9 +8,9 @@
   3.335 + impatient reader is encouraged to skip to the EXAMPLES section for a
   3.336 + quick introduction.
   3.337 + .PP
   3.338 +-An extended version of the access control language is described in the
   3.339 +-\fIhosts_options\fR(5) document. The extensions are turned on at
   3.340 +-program build time by building with -DPROCESS_OPTIONS.
   3.341 ++The extended version of the access control language is described in the
   3.342 ++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
   3.343 ++the meaning of \fIshell_command\fB as documented below.\fR
   3.344 + .PP
   3.345 + In the following text, \fIdaemon\fR is the the process name of a
   3.346 + network daemon process, and \fIclient\fR is the name and/or address of
   3.347 +@@ -40,7 +40,7 @@
   3.348 + character. This permits you to break up long lines so that they are
   3.349 + easier to edit.
   3.350 + .IP \(bu
   3.351 +-Blank lines or lines that begin with a `#\' character are ignored.
   3.352 ++Blank lines or lines that begin with a `#' character are ignored.
   3.353 + This permits you to insert comments and whitespace so that the tables
   3.354 + are easier to read.
   3.355 + .IP \(bu
   3.356 +@@ -69,26 +69,33 @@
   3.357 + .SH PATTERNS
   3.358 + The access control language implements the following patterns:
   3.359 + .IP \(bu
   3.360 +-A string that begins with a `.\' character. A host name is matched if
   3.361 ++A string that begins with a `.' character. A host name is matched if
   3.362 + the last components of its name match the specified pattern.  For
   3.363 +-example, the pattern `.tue.nl\' matches the host name
   3.364 +-`wzv.win.tue.nl\'.
   3.365 ++example, the pattern `.tue.nl' matches the host name
   3.366 ++`wzv.win.tue.nl'.
   3.367 + .IP \(bu
   3.368 +-A string that ends with a `.\' character. A host address is matched if
   3.369 ++A string that ends with a `.' character. A host address is matched if
   3.370 + its first numeric fields match the given string.  For example, the
   3.371 +-pattern `131.155.\' matches the address of (almost) every host on the
   3.372 ++pattern `131.155.' matches the address of (almost) every host on the
   3.373 + Eind\%hoven University network (131.155.x.x).
   3.374 + .IP \(bu
   3.375 +-A string that begins with an `@\' character is treated as an NIS
   3.376 ++A string that begins with an `@' character is treated as an NIS
   3.377 + (formerly YP) netgroup name. A host name is matched if it is a host
   3.378 + member of the specified netgroup. Netgroup matches are not supported
   3.379 + for daemon process names or for client user names.
   3.380 + .IP \(bu
   3.381 +-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
   3.382 +-`net/mask\' pair. A host address is matched if `net\' is equal to the
   3.383 +-bitwise AND of the address and the `mask\'. For example, the net/mask
   3.384 +-pattern `131.155.72.0/255.255.254.0\' matches every address in the
   3.385 +-range `131.155.72.0\' through `131.155.73.255\'.
   3.386 ++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
   3.387 ++`net/mask' pair. A host address is matched if `net' is equal to the
   3.388 ++bitwise AND of the address and the `mask'. For example, the net/mask
   3.389 ++pattern `131.155.72.0/255.255.254.0' matches every address in the
   3.390 ++range `131.155.72.0' through `131.155.73.255'.
   3.391 ++.IP \(bu
   3.392 ++A string that begins with a `/' character is treated as a file
   3.393 ++name. A host name or address is matched if it matches any host name
   3.394 ++or address pattern listed in the named file. The file format is
   3.395 ++zero or more lines with zero or more host name or address patterns
   3.396 ++separated by whitespace.  A file name pattern can be used anywhere
   3.397 ++a host name or address pattern can be used.
   3.398 + .SH WILDCARDS
   3.399 + The access control language supports explicit wildcards:
   3.400 + .IP ALL
   3.401 +@@ -115,19 +122,19 @@
   3.402 + .ne 6
   3.403 + .SH OPERATORS
   3.404 + .IP EXCEPT
   3.405 +-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
   3.406 ++Intended use is of the form: `list_1 EXCEPT list_2'; this construct
   3.407 + matches anything that matches \fIlist_1\fR unless it matches
   3.408 + \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
   3.409 + client_lists. The EXCEPT operator can be nested: if the control
   3.410 +-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
   3.411 +-would parse as `(a EXCEPT (b EXCEPT c))\'.
   3.412 ++language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
   3.413 ++would parse as `(a EXCEPT (b EXCEPT c))'.
   3.414 + .br
   3.415 + .ne 6
   3.416 + .SH SHELL COMMANDS
   3.417 + If the first-matched access control rule contains a shell command, that
   3.418 + command is subjected to %<letter> substitutions (see next section).
   3.419 + The result is executed by a \fI/bin/sh\fR child process with standard
   3.420 +-input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
   3.421 ++input, output and error connected to \fI/dev/null\fR.  Specify an `&'
   3.422 + at the end of the command if you do not want to wait until it has
   3.423 + completed.
   3.424 + .PP
   3.425 +@@ -159,7 +166,7 @@
   3.426 + .IP %u
   3.427 + The client user name (or "unknown").
   3.428 + .IP %%
   3.429 +-Expands to a single `%\' character.
   3.430 ++Expands to a single `%' character.
   3.431 + .PP
   3.432 + Characters in % expansions that may confuse the shell are replaced by
   3.433 + underscores.
   3.434 +@@ -243,9 +250,9 @@
   3.435 + less trustworthy. It is possible for an intruder to spoof both the
   3.436 + client connection and the IDENT lookup, although doing so is much
   3.437 + harder than spoofing just a client connection. It may also be that
   3.438 +-the client\'s IDENT server is lying.
   3.439 ++the client's IDENT server is lying.
   3.440 + .PP
   3.441 +-Note: IDENT lookups don\'t work with UDP services. 
   3.442 ++Note: IDENT lookups don't work with UDP services. 
   3.443 + .SH EXAMPLES
   3.444 + The language is flexible enough that different types of access control
   3.445 + policy can be expressed with a minimum of fuss. Although the language
   3.446 +@@ -285,7 +292,7 @@
   3.447 + .br
   3.448 + ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
   3.449 + .PP
   3.450 +-The first rule permits access from hosts in the local domain (no `.\'
   3.451 ++The first rule permits access from hosts in the local domain (no `.'
   3.452 + in the host name) and from members of the \fIsome_netgroup\fP
   3.453 + netgroup.  The second rule permits access from all hosts in the
   3.454 + \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
   3.455 +@@ -322,8 +329,8 @@
   3.456 + /etc/hosts.deny:
   3.457 + .in +3
   3.458 + .nf
   3.459 +-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
   3.460 +-	/usr/ucb/mail -s %d-%h root) &
   3.461 ++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
   3.462 ++	/usr/bin/mail -s %d-%h root) &
   3.463 + .fi
   3.464 + .PP
   3.465 + The safe_finger command comes with the tcpd wrapper and should be
   3.466 +@@ -349,7 +356,7 @@
   3.467 + capacity of an internal buffer; when an access control rule is not
   3.468 + terminated by a newline character; when the result of %<letter>
   3.469 + expansion would overflow an internal buffer; when a system call fails
   3.470 +-that shouldn\'t.  All problems are reported via the syslog daemon.
   3.471 ++that shouldn't.  All problems are reported via the syslog daemon.
   3.472 + .SH FILES
   3.473 + .na
   3.474 + .nf
   3.475 +diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c
   3.476 +--- tcp_wrappers_7.6/hosts_access.c	1997-02-11 19:13:23.000000000 -0600
   3.477 ++++ tcp_wrappers_7.6.gimli/hosts_access.c	2002-01-07 08:50:19.000000000 -0600
   3.478 +@@ -240,6 +240,26 @@
   3.479 +     }
   3.480 + }
   3.481 + 
   3.482 ++/* hostfile_match - look up host patterns from file */
   3.483 ++
   3.484 ++static int hostfile_match(path, host)
   3.485 ++char   *path;
   3.486 ++struct hosts_info *host;
   3.487 ++{
   3.488 ++    char    tok[BUFSIZ];
   3.489 ++    int     match = NO;
   3.490 ++    FILE   *fp;
   3.491 ++
   3.492 ++    if ((fp = fopen(path, "r")) != 0) {
   3.493 ++        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
   3.494 ++            /* void */ ;
   3.495 ++        fclose(fp);
   3.496 ++    } else if (errno != ENOENT) {
   3.497 ++        tcpd_warn("open %s: %m", path);
   3.498 ++    }
   3.499 ++    return (match);
   3.500 ++}
   3.501 ++
   3.502 + /* host_match - match host name and/or address against pattern */
   3.503 + 
   3.504 + static int host_match(tok, host)
   3.505 +@@ -267,6 +287,8 @@
   3.506 + 	tcpd_warn("netgroup support is disabled");	/* not tcpd_jump() */
   3.507 + 	return (NO);
   3.508 + #endif
   3.509 ++    } else if (tok[0] == '/') {                         /* /file hack */
   3.510 ++        return (hostfile_match(tok, host));
   3.511 +     } else if (STR_EQ(tok, "KNOWN")) {		/* check address and name */
   3.512 + 	char   *name = eval_hostname(host);
   3.513 + 	return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
   3.514 +diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5
   3.515 +--- tcp_wrappers_7.6/hosts_options.5	1994-12-28 10:42:29.000000000 -0600
   3.516 ++++ tcp_wrappers_7.6.gimli/hosts_options.5	2002-01-07 08:50:19.000000000 -0600
   3.517 +@@ -58,12 +58,12 @@
   3.518 + Execute, in a child process, the specified shell command, after
   3.519 + performing the %<letter> expansions described in the hosts_access(5)
   3.520 + manual page.  The command is executed with stdin, stdout and stderr
   3.521 +-connected to the null device, so that it won\'t mess up the
   3.522 ++connected to the null device, so that it won't mess up the
   3.523 + conversation with the client host. Example:
   3.524 + .sp
   3.525 + .nf
   3.526 + .ti +3
   3.527 +-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
   3.528 ++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
   3.529 + .fi
   3.530 + .sp
   3.531 + executes, in a background child process, the shell command "safe_finger
   3.532 +diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c
   3.533 +--- tcp_wrappers_7.6/options.c	1996-02-11 10:01:32.000000000 -0600
   3.534 ++++ tcp_wrappers_7.6.gimli/options.c	2002-01-07 08:50:19.000000000 -0600
   3.535 +@@ -473,6 +473,9 @@
   3.536 + #ifdef LOG_CRON
   3.537 +     "cron", LOG_CRON,
   3.538 + #endif
   3.539 ++#ifdef LOG_FTP
   3.540 ++    "ftp", LOG_FTP,
   3.541 ++#endif
   3.542 + #ifdef LOG_LOCAL0
   3.543 +     "local0", LOG_LOCAL0,
   3.544 + #endif
   3.545 +diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c
   3.546 +--- tcp_wrappers_7.6/percent_m.c	1994-12-28 10:42:37.000000000 -0600
   3.547 ++++ tcp_wrappers_7.6.gimli/percent_m.c	2002-01-07 08:50:19.000000000 -0600
   3.548 +@@ -13,7 +13,7 @@
   3.549 + #include <string.h>
   3.550 + 
   3.551 + extern int errno;
   3.552 +-#ifndef SYS_ERRLIST_DEFINED
   3.553 ++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
   3.554 + extern char *sys_errlist[];
   3.555 + extern int sys_nerr;
   3.556 + #endif
   3.557 +@@ -29,11 +29,15 @@
   3.558 + 
   3.559 +     while (*bp = *cp)
   3.560 + 	if (*cp == '%' && cp[1] == 'm') {
   3.561 ++#ifdef HAVE_STRERROR
   3.562 ++            strcpy(bp, strerror(errno));
   3.563 ++#else
   3.564 + 	    if (errno < sys_nerr && errno > 0) {
   3.565 + 		strcpy(bp, sys_errlist[errno]);
   3.566 + 	    } else {
   3.567 + 		sprintf(bp, "Unknown error %d", errno);
   3.568 + 	    }
   3.569 ++#endif
   3.570 + 	    bp += strlen(bp);
   3.571 + 	    cp += 2;
   3.572 + 	} else {
   3.573 +diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c
   3.574 +--- tcp_wrappers_7.6/rfc931.c	1995-01-02 09:11:34.000000000 -0600
   3.575 ++++ tcp_wrappers_7.6.gimli/rfc931.c	2002-01-07 08:50:19.000000000 -0600
   3.576 +@@ -33,7 +33,7 @@
   3.577 + 
   3.578 + int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
   3.579 + 
   3.580 +-static jmp_buf timebuf;
   3.581 ++static sigjmp_buf timebuf;
   3.582 + 
   3.583 + /* fsocket - open stdio stream on top of socket */
   3.584 + 
   3.585 +@@ -62,7 +62,7 @@
   3.586 + static void timeout(sig)
   3.587 + int     sig;
   3.588 + {
   3.589 +-    longjmp(timebuf, sig);
   3.590 ++    siglongjmp(timebuf, sig);
   3.591 + }
   3.592 + 
   3.593 + /* rfc931 - return remote user name, given socket structures */
   3.594 +@@ -99,7 +99,7 @@
   3.595 + 	 * Set up a timer so we won't get stuck while waiting for the server.
   3.596 + 	 */
   3.597 + 
   3.598 +-	if (setjmp(timebuf) == 0) {
   3.599 ++	if (sigsetjmp(timebuf,1) == 0) {
   3.600 + 	    signal(SIGALRM, timeout);
   3.601 + 	    alarm(rfc931_timeout);
   3.602 + 
   3.603 +diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8
   3.604 +--- tcp_wrappers_7.6/safe_finger.8	1969-12-31 18:00:00.000000000 -0600
   3.605 ++++ tcp_wrappers_7.6.gimli/safe_finger.8	2002-01-07 08:50:19.000000000 -0600
   3.606 +@@ -0,0 +1,34 @@
   3.607 ++.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
   3.608 ++.SH NAME
   3.609 ++safe_finger \- finger client wrapper that protects against nasty stuff
   3.610 ++from finger servers
   3.611 ++.SH SYNOPSIS
   3.612 ++.B safe_finger [finger_options]
   3.613 ++.SH DESCRIPTION
   3.614 ++The
   3.615 ++.B safe_finger
   3.616 ++command protects against nasty stuff from finger servers. Use this
   3.617 ++program for automatic reverse finger probes from the
   3.618 ++.B tcp_wrapper
   3.619 ++.B (tcpd)
   3.620 ++, not the raw finger command. The
   3.621 ++.B safe_finger
   3.622 ++command makes sure that the finger client is not run with root
   3.623 ++privileges. It also runs the finger client with a defined PATH
   3.624 ++environment.
   3.625 ++.B safe_finger
   3.626 ++will also protect you from problems caused by the output of some
   3.627 ++finger servers. The problem: some programs may react to stuff in
   3.628 ++the first column. Other programs may get upset by thrash anywhere
   3.629 ++on a line. File systems may fill up as the finger server keeps
   3.630 ++sending data. Text editors may bomb out on extremely long lines.
   3.631 ++The finger server may take forever because it is somehow wedged.
   3.632 ++.B safe_finger
   3.633 ++takes care of all this badness.
   3.634 ++.SH SEE ALSO
   3.635 ++.BR hosts_access (5),
   3.636 ++.BR hosts_options (5),
   3.637 ++.BR tcpd (8)
   3.638 ++.SH AUTHOR
   3.639 ++Wietse Venema, Eindhoven University of Technology, The Netherlands.
   3.640 ++
   3.641 +diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c
   3.642 +--- tcp_wrappers_7.6/safe_finger.c	1994-12-28 10:42:42.000000000 -0600
   3.643 ++++ tcp_wrappers_7.6.gimli/safe_finger.c	2002-01-07 08:50:19.000000000 -0600
   3.644 +@@ -26,21 +26,24 @@
   3.645 + #include <stdio.h>
   3.646 + #include <ctype.h>
   3.647 + #include <pwd.h>
   3.648 ++#include <syslog.h>
   3.649 + 
   3.650 + extern void exit();
   3.651 + 
   3.652 + /* Local stuff */
   3.653 + 
   3.654 +-char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
   3.655 ++char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
   3.656 + 
   3.657 + #define	TIME_LIMIT	60		/* Do not keep listinging forever */
   3.658 + #define	INPUT_LENGTH	100000		/* Do not keep listinging forever */
   3.659 + #define	LINE_LENGTH	128		/* Editors can choke on long lines */
   3.660 + #define	FINGER_PROGRAM	"finger"	/* Most, if not all, UNIX systems */
   3.661 + #define	UNPRIV_NAME	"nobody"	/* Preferred privilege level */
   3.662 +-#define	UNPRIV_UGID	32767		/* Default uid and gid */
   3.663 ++#define	UNPRIV_UGID	65534		/* Default uid and gid */
   3.664 + 
   3.665 + int     finger_pid;
   3.666 ++int	allow_severity = SEVERITY;
   3.667 ++int	deny_severity = LOG_WARNING;
   3.668 + 
   3.669 + void    cleanup(sig)
   3.670 + int     sig;
   3.671 +diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c
   3.672 +--- tcp_wrappers_7.6/scaffold.c	1997-03-21 12:27:24.000000000 -0600
   3.673 ++++ tcp_wrappers_7.6.gimli/scaffold.c	2002-01-07 08:50:19.000000000 -0600
   3.674 +@@ -180,10 +180,12 @@
   3.675 + 
   3.676 + /* ARGSUSED */
   3.677 + 
   3.678 +-void    rfc931(request)
   3.679 +-struct request_info *request;
   3.680 ++void    rfc931(rmt_sin, our_sin, dest)
   3.681 ++struct sockaddr_in *rmt_sin;
   3.682 ++struct sockaddr_in *our_sin;
   3.683 ++char   *dest;
   3.684 + {
   3.685 +-    strcpy(request->user, unknown);
   3.686 ++    strcpy(dest, unknown);
   3.687 + }
   3.688 + 
   3.689 + /* check_path - examine accessibility */
   3.690 +diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c
   3.691 +--- tcp_wrappers_7.6/socket.c	1997-03-21 12:27:25.000000000 -0600
   3.692 ++++ tcp_wrappers_7.6.gimli/socket.c	2002-01-07 08:50:19.000000000 -0600
   3.693 +@@ -76,7 +76,11 @@
   3.694 + {
   3.695 +     static struct sockaddr_in client;
   3.696 +     static struct sockaddr_in server;
   3.697 ++#if !defined (__GLIBC__)
   3.698 +     int     len;
   3.699 ++#else /* __GLIBC__ */
   3.700 ++    size_t  len;
   3.701 ++#endif /* __GLIBC__ */
   3.702 +     char    buf[BUFSIZ];
   3.703 +     int     fd = request->fd;
   3.704 + 
   3.705 +@@ -224,7 +228,11 @@
   3.706 + {
   3.707 +     char    buf[BUFSIZ];
   3.708 +     struct sockaddr_in sin;
   3.709 ++#if !defined(__GLIBC__)
   3.710 +     int     size = sizeof(sin);
   3.711 ++#else /* __GLIBC__ */
   3.712 ++    size_t  size = sizeof(sin);
   3.713 ++#endif /* __GLIBC__ */
   3.714 + 
   3.715 +     /*
   3.716 +      * Eat up the not-yet received datagram. Some systems insist on a
   3.717 +diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8
   3.718 +--- tcp_wrappers_7.6/tcpd.8	1996-02-21 09:39:16.000000000 -0600
   3.719 ++++ tcp_wrappers_7.6.gimli/tcpd.8	2002-01-07 08:50:19.000000000 -0600
   3.720 +@@ -94,7 +94,7 @@
   3.721 + .PP
   3.722 + The example assumes that the network daemons live in /usr/etc. On some
   3.723 + systems, network daemons live in /usr/sbin or in /usr/libexec, or have
   3.724 +-no `in.\' prefix to their name.
   3.725 ++no `in.' prefix to their name.
   3.726 + .SH EXAMPLE 2
   3.727 + This example applies when \fItcpd\fR expects that the network daemons
   3.728 + are left in their original place.
   3.729 +@@ -110,26 +110,26 @@
   3.730 + becomes:
   3.731 + .sp
   3.732 + .ti +5
   3.733 +-finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
   3.734 ++finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
   3.735 + .sp
   3.736 + .fi
   3.737 + .PP
   3.738 + The example assumes that the network daemons live in /usr/etc. On some
   3.739 + systems, network daemons live in /usr/sbin or in /usr/libexec, the
   3.740 +-daemons have no `in.\' prefix to their name, or there is no userid
   3.741 ++daemons have no `in.' prefix to their name, or there is no userid
   3.742 + field in the inetd configuration file.
   3.743 + .PP
   3.744 + Similar changes will be needed for the other services that are to be
   3.745 +-covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
   3.746 ++covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
   3.747 + process to make the changes effective. AIX users may also have to
   3.748 +-execute the `inetimp\' command.
   3.749 ++execute the `inetimp' command.
   3.750 + .SH EXAMPLE 3
   3.751 + In the case of daemons that do not live in a common directory ("secret"
   3.752 + or otherwise), edit the \fIinetd\fR configuration file so that it
   3.753 + specifies an absolute path name for the process name field. For example:
   3.754 + .nf
   3.755 + .sp
   3.756 +-    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
   3.757 ++    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
   3.758 + .sp
   3.759 + .fi
   3.760 + .PP
   3.761 +diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h
   3.762 +--- tcp_wrappers_7.6/tcpd.h	1996-03-19 09:22:25.000000000 -0600
   3.763 ++++ tcp_wrappers_7.6.gimli/tcpd.h	2002-01-07 08:50:19.000000000 -0600
   3.764 +@@ -4,6 +4,25 @@
   3.765 +   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
   3.766 +   */
   3.767 + 
   3.768 ++#ifndef _TCPWRAPPERS_TCPD_H
   3.769 ++#define _TCPWRAPPERS_TCPD_H
   3.770 ++
   3.771 ++/* someone else may have defined this */
   3.772 ++#undef  __P
   3.773 ++
   3.774 ++/* use prototypes if we have an ANSI C compiler or are using C++ */
   3.775 ++#if defined(__STDC__) || defined(__cplusplus)
   3.776 ++#define __P(args)       args
   3.777 ++#else
   3.778 ++#define __P(args)       ()
   3.779 ++#endif
   3.780 ++
   3.781 ++/* Need definitions of struct sockaddr_in and FILE. */
   3.782 ++#include <netinet/in.h>
   3.783 ++#include <stdio.h>
   3.784 ++
   3.785 ++__BEGIN_DECLS
   3.786 ++
   3.787 + /* Structure to describe one communications endpoint. */
   3.788 + 
   3.789 + #define STRING_LENGTH	128		/* hosts, users, processes */
   3.790 +@@ -25,10 +44,10 @@
   3.791 +     char    pid[10];			/* access via eval_pid(request) */
   3.792 +     struct host_info client[1];		/* client endpoint info */
   3.793 +     struct host_info server[1];		/* server endpoint info */
   3.794 +-    void  (*sink) ();			/* datagram sink function or 0 */
   3.795 +-    void  (*hostname) ();		/* address to printable hostname */
   3.796 +-    void  (*hostaddr) ();		/* address to printable address */
   3.797 +-    void  (*cleanup) ();		/* cleanup function or 0 */
   3.798 ++    void  (*sink) __P((int));		/* datagram sink function or 0 */
   3.799 ++    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
   3.800 ++    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
   3.801 ++    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
   3.802 +     struct netconfig *config;		/* netdir handle */
   3.803 + };
   3.804 + 
   3.805 +@@ -61,25 +80,30 @@
   3.806 + /* Global functions. */
   3.807 + 
   3.808 + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
   3.809 +-extern void fromhost();			/* get/validate client host info */
   3.810 ++extern void fromhost __P((struct request_info *));	/* get/validate client host info */
   3.811 + #else
   3.812 + #define fromhost sock_host		/* no TLI support needed */
   3.813 + #endif
   3.814 + 
   3.815 +-extern int hosts_access();		/* access control */
   3.816 +-extern void shell_cmd();		/* execute shell command */
   3.817 +-extern char *percent_x();		/* do %<char> expansion */
   3.818 +-extern void rfc931();			/* client name from RFC 931 daemon */
   3.819 +-extern void clean_exit();		/* clean up and exit */
   3.820 +-extern void refuse();			/* clean up and exit */
   3.821 +-extern char *xgets();			/* fgets() on steroids */
   3.822 +-extern char *split_at();		/* strchr() and split */
   3.823 +-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
   3.824 ++extern void shell_cmd __P((char *));	/* execute shell command */
   3.825 ++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
   3.826 ++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
   3.827 ++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
   3.828 ++extern void refuse __P((struct request_info *));	/* clean up and exit */
   3.829 ++extern char *xgets __P((char *, int, FILE *));	/* fgets() on steroids */
   3.830 ++extern char *split_at __P((char *, int));	/* strchr() and split */
   3.831 ++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
   3.832 + 
   3.833 + /* Global variables. */
   3.834 + 
   3.835 ++#ifdef HAVE_WEAKSYMS
   3.836 ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
   3.837 ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
   3.838 ++#else
   3.839 + extern int allow_severity;		/* for connection logging */
   3.840 + extern int deny_severity;		/* for connection logging */
   3.841 ++#endif
   3.842 ++
   3.843 + extern char *hosts_allow_table;		/* for verification mode redirection */
   3.844 + extern char *hosts_deny_table;		/* for verification mode redirection */
   3.845 + extern int hosts_access_verbose;	/* for verbose matching mode */
   3.846 +@@ -92,9 +116,14 @@
   3.847 +   */
   3.848 + 
   3.849 + #ifdef __STDC__
   3.850 ++extern int hosts_access(struct request_info *request);
   3.851 ++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
   3.852 ++                     char *client_user);
   3.853 + extern struct request_info *request_init(struct request_info *,...);
   3.854 + extern struct request_info *request_set(struct request_info *,...);
   3.855 + #else
   3.856 ++extern int hosts_access();
   3.857 ++extern int hosts_ctl();
   3.858 + extern struct request_info *request_init();	/* initialize request */
   3.859 + extern struct request_info *request_set();	/* update request structure */
   3.860 + #endif
   3.861 +@@ -117,27 +146,31 @@
   3.862 +   * host_info structures serve as caches for the lookup results.
   3.863 +   */
   3.864 + 
   3.865 +-extern char *eval_user();		/* client user */
   3.866 +-extern char *eval_hostname();		/* printable hostname */
   3.867 +-extern char *eval_hostaddr();		/* printable host address */
   3.868 +-extern char *eval_hostinfo();		/* host name or address */
   3.869 +-extern char *eval_client();		/* whatever is available */
   3.870 +-extern char *eval_server();		/* whatever is available */
   3.871 ++extern char *eval_user __P((struct request_info *));	/* client user */
   3.872 ++extern char *eval_hostname __P((struct host_info *));	/* printable hostname */
   3.873 ++extern char *eval_hostaddr __P((struct host_info *));	/* printable host address */
   3.874 ++extern char *eval_hostinfo __P((struct host_info *));	/* host name or address */
   3.875 ++extern char *eval_client __P((struct request_info *));	/* whatever is available */
   3.876 ++extern char *eval_server __P((struct request_info *));	/* whatever is available */
   3.877 + #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
   3.878 + #define eval_pid(r)	((r)->pid)	/* process id */
   3.879 + 
   3.880 + /* Socket-specific methods, including DNS hostname lookups. */
   3.881 + 
   3.882 +-extern void sock_host();		/* look up endpoint addresses */
   3.883 +-extern void sock_hostname();		/* translate address to hostname */
   3.884 +-extern void sock_hostaddr();		/* address to printable address */
   3.885 ++/* look up endpoint addresses */
   3.886 ++extern void sock_host __P((struct request_info *));
   3.887 ++/* translate address to hostname */
   3.888 ++extern void sock_hostname __P((struct host_info *));
   3.889 ++/* address to printable address */
   3.890 ++extern void sock_hostaddr __P((struct host_info *));
   3.891 ++
   3.892 + #define sock_methods(r) \
   3.893 + 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
   3.894 + 
   3.895 + /* The System V Transport-Level Interface (TLI) interface. */
   3.896 + 
   3.897 + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
   3.898 +-extern void tli_host();			/* look up endpoint addresses etc. */
   3.899 ++extern void tli_host __P((struct request_info *));	/* look up endpoint addresses etc. */
   3.900 + #endif
   3.901 + 
   3.902 +  /*
   3.903 +@@ -178,7 +211,7 @@
   3.904 +   * behavior.
   3.905 +   */
   3.906 + 
   3.907 +-extern void process_options();		/* execute options */
   3.908 ++extern void process_options __P((char *, struct request_info *)); /* execute options */
   3.909 + extern int dry_run;			/* verification flag */
   3.910 + 
   3.911 + /* Bug workarounds. */
   3.912 +@@ -217,3 +250,7 @@
   3.913 + #define strtok	my_strtok
   3.914 + extern char *my_strtok();
   3.915 + #endif
   3.916 ++
   3.917 ++__END_DECLS
   3.918 ++
   3.919 ++#endif /* tcpd.h */
   3.920 +diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c
   3.921 +--- tcp_wrappers_7.6/tcpdchk.c	1997-02-11 19:13:25.000000000 -0600
   3.922 ++++ tcp_wrappers_7.6.gimli/tcpdchk.c	2002-01-07 08:50:19.000000000 -0600
   3.923 +@@ -350,6 +350,8 @@
   3.924 + {
   3.925 +     if (pat[0] == '@') {
   3.926 + 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
   3.927 ++    } else if (pat[0] == '/') {
   3.928 ++        tcpd_warn("%s: daemon name begins with \"/\"", pat);
   3.929 +     } else if (pat[0] == '.') {
   3.930 + 	tcpd_warn("%s: daemon name begins with dot", pat);
   3.931 +     } else if (pat[strlen(pat) - 1] == '.') {
   3.932 +@@ -382,6 +384,8 @@
   3.933 + {
   3.934 +     if (pat[0] == '@') {			/* @netgroup */
   3.935 + 	tcpd_warn("%s: user name begins with \"@\"", pat);
   3.936 ++    } else if (pat[0] == '/') {
   3.937 ++        tcpd_warn("%s: user name begins with \"/\"", pat);
   3.938 +     } else if (pat[0] == '.') {
   3.939 + 	tcpd_warn("%s: user name begins with dot", pat);
   3.940 +     } else if (pat[strlen(pat) - 1] == '.') {
   3.941 +@@ -402,8 +406,13 @@
   3.942 + static int check_host(pat)
   3.943 + char   *pat;
   3.944 + {
   3.945 ++    char    buf[BUFSIZ];
   3.946 +     char   *mask;
   3.947 +     int     addr_count = 1;
   3.948 ++    FILE   *fp;
   3.949 ++    struct tcpd_context saved_context;
   3.950 ++    char   *cp;
   3.951 ++    char   *wsp = " \t\r\n";
   3.952 + 
   3.953 +     if (pat[0] == '@') {			/* @netgroup */
   3.954 + #ifdef NO_NETGRENT
   3.955 +@@ -422,6 +431,21 @@
   3.956 + 	tcpd_warn("netgroup support disabled");
   3.957 + #endif
   3.958 + #endif
   3.959 ++    } else if (pat[0] == '/') {                 /* /path/name */
   3.960 ++        if ((fp = fopen(pat, "r")) != 0) {
   3.961 ++            saved_context = tcpd_context;
   3.962 ++            tcpd_context.file = pat;
   3.963 ++            tcpd_context.line = 0;
   3.964 ++            while (fgets(buf, sizeof(buf), fp)) {
   3.965 ++                tcpd_context.line++;
   3.966 ++                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
   3.967 ++                    check_host(cp);
   3.968 ++            }
   3.969 ++            tcpd_context = saved_context;
   3.970 ++            fclose(fp);
   3.971 ++        } else if (errno != ENOENT) {
   3.972 ++            tcpd_warn("open %s: %m", pat);
   3.973 ++        }
   3.974 +     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
   3.975 + 	if (dot_quad_addr(pat) == INADDR_NONE
   3.976 + 	    || dot_quad_addr(mask) == INADDR_NONE)
   3.977 +diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8
   3.978 +--- tcp_wrappers_7.6/try-from.8	1969-12-31 18:00:00.000000000 -0600
   3.979 ++++ tcp_wrappers_7.6.gimli/try-from.8	2002-01-07 08:50:19.000000000 -0600
   3.980 +@@ -0,0 +1,28 @@
   3.981 ++.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
   3.982 ++.SH NAME
   3.983 ++try-from \- test program for the tcp_wrapper
   3.984 ++.SH SYNOPSIS
   3.985 ++.B try-from
   3.986 ++.SH DESCRIPTION
   3.987 ++The
   3.988 ++.B try-from
   3.989 ++command can be called via a remote shell command to find out
   3.990 ++if the hostname and address are properly recognized
   3.991 ++by the
   3.992 ++.B tcp_wrapper
   3.993 ++library, if username lookup works, and (SysV only) if the TLI
   3.994 ++on top of IP heuristics work. Diagnostics are reported through
   3.995 ++.BR syslog (3)
   3.996 ++and redirected to stderr.
   3.997 ++
   3.998 ++Example:
   3.999 ++
  3.1000 ++rsh host /some/where/try-from
  3.1001 ++
  3.1002 ++.SH SEE ALSO
  3.1003 ++.BR hosts_access (5),
  3.1004 ++.BR hosts_options (5),
  3.1005 ++.BR tcpd (8)
  3.1006 ++.SH AUTHOR
  3.1007 ++Wietse Venema, Eindhoven University of Technology, The Netherlands.
  3.1008 ++
  3.1009 +diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c
  3.1010 +--- tcp_wrappers_7.6/weak_symbols.c	1969-12-31 18:00:00.000000000 -0600
  3.1011 ++++ tcp_wrappers_7.6.gimli/weak_symbols.c	2002-01-07 08:50:19.000000000 -0600
  3.1012 +@@ -0,0 +1,11 @@
  3.1013 ++ /*
  3.1014 ++  * @(#) weak_symbols.h 1.5 99/12/29 23:50
  3.1015 ++  * 
  3.1016 ++  * Author: Anthony Towns <ajt@debian.org>
  3.1017 ++  */
  3.1018 ++
  3.1019 ++#ifdef HAVE_WEAKSYMS
  3.1020 ++#include <syslog.h>
  3.1021 ++int deny_severity = LOG_WARNING;
  3.1022 ++int allow_severity = SEVERITY; 
  3.1023 ++#endif
  3.1024 +diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c
  3.1025 +--- tcp_wrappers_7.6/workarounds.c	1996-03-19 09:22:26.000000000 -0600
  3.1026 ++++ tcp_wrappers_7.6.gimli/workarounds.c	2002-01-07 08:50:19.000000000 -0600
  3.1027 +@@ -163,7 +163,11 @@
  3.1028 + int     fix_getpeername(sock, sa, len)
  3.1029 + int     sock;
  3.1030 + struct sockaddr *sa;
  3.1031 ++#if !defined(__GLIBC__)
  3.1032 + int    *len;
  3.1033 ++#else /* __GLIBC__ */
  3.1034 ++size_t *len;
  3.1035 ++#endif /* __GLIBC__ */
  3.1036 + {
  3.1037 +     int     ret;
  3.1038 +     struct sockaddr_in *sin = (struct sockaddr_in *) sa;