diff -cNr ../bind-4.9.7/Makefile ./Makefile
*** ../bind-4.9.7/Makefile	Mon May 11 00:19:42 1998
--- ./Makefile	Thu Jun 22 18:39:18 2000
***************
*** 105,126 ****
  #SHCC = cc $(CPPFLAGS)
  #PIC = -fpic
  
! #(Linux - on modern systems, all you need to do is rename or remove
! # compat/include/sys/cdefs.h.  See doc/info/Linux for more information.)
! #CC = gcc $(CPPFLAGS)
! #CDEBUG = -g
! #CPPFLAGS = -DSYSV
! #LEX=flex -8 -I
! #INSTALL_COMPAT = install-compat
! #LIBS = -lfl
! #DESTEXEC = /usr/sbin
! #DESTMAN = /usr/man
! #MANDIR = man
! #MANROFF = cat
! #DESTHELP = /usr/lib
! #CATEXT = $$$$N
! #PS = ps -p
! #IOT = IOT
  #uncomment next line to build a shared library version of libresolv
  #SHRES = shres/linux
  #uncomment next line to build tools and named with shared libresolv
--- 105,125 ----
  #SHCC = cc $(CPPFLAGS)
  #PIC = -fpic
  
! # CYGWIN
! CC = gcc $(CPPFLAGS)
! CDEBUG = -g -O2
! CPPFLAGS = -DSYSV -DUSE_POSIX
! LEX=flex -8 -I
! INSTALL_COMPAT = install-compat
! LIBS = -lfl
! DESTEXEC = /usr/sbin
! DESTMAN = /usr/man
! MANDIR = man
! MANROFF = cat
! DESTHELP = /usr/lib
! CATEXT = $$$$N
! PS = ps -p
! # IOT = IOT
  #uncomment next line to build a shared library version of libresolv
  #SHRES = shres/linux
  #uncomment next line to build tools and named with shared libresolv
diff -cNr ../bind-4.9.7/compat/lib/Makefile ./compat/lib/Makefile
*** ../bind-4.9.7/compat/lib/Makefile	Sun Jun  1 16:34:28 1997
--- ./compat/lib/Makefile	Thu Jun 22 18:40:26 2000
***************
*** 92,98 ****
  
  .c.o:
  	${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
! 	-${LDS} ld -x -r $*.o && ${LDS} mv a.out $*.o
  
  clean: FRC
  	rm -f errs a.out core lib44bsd.a tags
--- 92,98 ----
  
  .c.o:
  	${CC} ${CPPFLAGS} ${CFLAGS} -c $*.c
! 	-${LDS} ld -x -r $*.o && ${LDS} mv a.exe $*.o
  
  clean: FRC
  	rm -f errs a.out core lib44bsd.a tags
diff -cNr ../bind-4.9.7/named/Makefile ./named/Makefile
*** ../bind-4.9.7/named/Makefile	Sat Sep 21 20:13:10 1996
--- ./named/Makefile	Thu Jun 22 19:01:38 2000
***************
*** 119,129 ****
  
  version.o: version.c
  
! version.c: Version.c Makefile ../Makefile ${SRCS} ${HDRS}
  	(u=$${USER-root} d=`pwd` h=`${HOSTNAMECMD}` t=`date`; \
  	sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \
  	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
! 	    < Version.c > version.c)
  
  named.reload: named.reload.sh Makefile
  	sed -e "s|%INDOT%|${INDOT}|" \
--- 119,129 ----
  
  version.o: version.c
  
! version.c: version.c.in Makefile ../Makefile ${SRCS} ${HDRS}
  	(u=$${USER-root} d=`pwd` h=`${HOSTNAMECMD}` t=`date`; \
  	sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \
  	    -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \
! 	    < version.c.in > version.c)
  
  named.reload: named.reload.sh Makefile
  	sed -e "s|%INDOT%|${INDOT}|" \
***************
*** 166,172 ****
  	rm -f ${OBJS} ${XFEROBJ} core named named-xfer version.o version.c
  	rm -f *~ *.BAK *.CKP
  	rm -f tags .depend core named.reload named.restart ndc
! 	rm -f *.orig
  
  depend .depend: ${SRCS} ${XFERSRCS}
  	mkdep ${CPPFLAGS} -I${INCL} -I${COMPINCL} ${SRCS} ${XFERSRCS}
--- 166,172 ----
  	rm -f ${OBJS} ${XFEROBJ} core named named-xfer version.o version.c
  	rm -f *~ *.BAK *.CKP
  	rm -f tags .depend core named.reload named.restart ndc
! 	rm -f *.orig *.exe
  
  depend .depend: ${SRCS} ${XFERSRCS}
  	mkdep ${CPPFLAGS} -I${INCL} -I${COMPINCL} ${SRCS} ${XFERSRCS}
diff -cNr ../bind-4.9.7/named/db_glue.c ./named/db_glue.c
*** ../bind-4.9.7/named/db_glue.c	Sat Sep 21 20:13:12 1996
--- ./named/db_glue.c	Wed Jun 21 22:19:14 2000
***************
*** 122,128 ****
  		syslog(LOG_CRIT, "%s - ABORT", msg);
  	else
  		syslog(LOG_CRIT, "%s: %s - ABORT", msg, strerror(err));
! 	signal(SIGIOT, SIG_DFL);	/* no POSIX needed here. */
  	abort();
  }
  
--- 122,128 ----
  		syslog(LOG_CRIT, "%s - ABORT", msg);
  	else
  		syslog(LOG_CRIT, "%s: %s - ABORT", msg, strerror(err));
! 	signal(SIGABRT, SIG_DFL);	/* no POSIX needed here. */
  	abort();
  }
  
diff -cNr ../bind-4.9.7/named/named-xfer.c ./named/named-xfer.c
*** ../bind-4.9.7/named/named-xfer.c	Tue Apr  7 00:59:46 1998
--- ./named/named-xfer.c	Wed Jun 21 22:19:26 2000
***************
*** 372,378 ****
  		(void) signal(SIGINT, SIG_IGN);
  		(void) signal(SIGQUIT, SIG_IGN);
  	}
! 	(void) signal(SIGIOT, SIG_IGN);
  
  #if defined(SIGUSR1) && defined(SIGUSR2)
  	(void) signal(SIGUSR1, SIG_IGN);
--- 372,378 ----
  		(void) signal(SIGINT, SIG_IGN);
  		(void) signal(SIGQUIT, SIG_IGN);
  	}
! 	(void) signal(SIGABRT, SIG_IGN);
  
  #if defined(SIGUSR1) && defined(SIGUSR2)
  	(void) signal(SIGUSR1, SIG_IGN);
diff -cNr ../bind-4.9.7/named/ns_main.c ./named/ns_main.c
*** ../bind-4.9.7/named/ns_main.c	Mon May 11 00:19:46 1998
--- ./named/ns_main.c	Thu Jun 22 00:18:54 2000
***************
*** 158,164 ****
  }
  
  /*ARGSUSED*/
! void
  main(argc, argv, envp)
  	int argc;
  	char *argv[], *envp[];
--- 158,164 ----
  }
  
  /*ARGSUSED*/
! int
  main(argc, argv, envp)
  	int argc;
  	char *argv[], *envp[];
***************
*** 410,416 ****
  	 */
  	setsignal(SIGINT, -1, setdumpflg);
  	setsignal(SIGQUIT, -1, setchkptflg);
! 	setsignal(SIGIOT, -1, setstatsflg);
  	setsignal(SIGUSR1, -1, setIncrDbgFlg);
  	setsignal(SIGUSR2, -1, setNoDbgFlg);
  	setsignal(SIGHUP, -1, onhup);
--- 410,416 ----
  	 */
  	setsignal(SIGINT, -1, setdumpflg);
  	setsignal(SIGQUIT, -1, setchkptflg);
! 	setsignal(SIGABRT, -1, setstatsflg);
  	setsignal(SIGUSR1, -1, setIncrDbgFlg);
  	setsignal(SIGUSR2, -1, setNoDbgFlg);
  	setsignal(SIGHUP, -1, onhup);
***************
*** 1086,1099 ****
  					    (u_long)netloop.my_addr.s_addr));
  			}
  			continue;
! 		} else if ((ifreq.ifr_flags & IFF_POINTOPOINT)) {
  			if (ioctl(vs, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
  				syslog(LOG_NOTICE, "get dst addr: %m");
  				continue;
  			}
  			ntp->mask = 0xffffffff;
  			ntp->addr = ((struct sockaddr_in *)
! 				     &ifreq.ifr_addr)->sin_addr.s_addr;
  		} else {
  			ntp->addr = ntp->mask & ntp->my_addr.s_addr;
  		}
--- 1086,1099 ----
  					    (u_long)netloop.my_addr.s_addr));
  			}
  			continue;
! 		/* } else if ((ifreq.ifr_flags & IFF_POINTOPOINT)) {
  			if (ioctl(vs, SIOCGIFDSTADDR, (char *)&ifreq) < 0) {
  				syslog(LOG_NOTICE, "get dst addr: %m");
  				continue;
  			}
  			ntp->mask = 0xffffffff;
  			ntp->addr = ((struct sockaddr_in *)
! 				     &ifreq.ifr_addr)->sin_addr.s_addr; */
  		} else {
  			ntp->addr = ntp->mask & ntp->my_addr.s_addr;
  		}
***************
*** 1431,1437 ****
  {
  	int save_errno = errno;
  
! 	resignal(SIGIOT, -1, setstatsflg);
  	needStatsDump = 1;
  	errno = save_errno;
  }
--- 1431,1437 ----
  {
  	int save_errno = errno;
  
! 	resignal(SIGABRT , -1, setstatsflg);
  	needStatsDump = 1;
  	errno = save_errno;
  }
diff -cNr ../bind-4.9.7/named/ns_udp.c ./named/ns_udp.c
*** ../bind-4.9.7/named/ns_udp.c	Tue Aug 27 04:33:28 1996
--- ./named/ns_udp.c	Wed Jun 21 22:42:46 2000
***************
*** 34,40 ****
  #include <stdio.h>
  #include <syslog.h>
  #include <netdb.h>
! #include <nlist.h>
  #include <resolv.h>
  
  #include "named.h"
--- 34,40 ----
  #include <stdio.h>
  #include <syslog.h>
  #include <netdb.h>
! /* #include <nlist.h> */
  #include <resolv.h>
  
  #include "named.h"
diff -cNr ../bind-4.9.7/named/version.c.in ./named/version.c.in
*** ../bind-4.9.7/named/version.c.in	Wed Dec 31 19:00:00 1969
--- ./named/version.c.in	Wed Jun 21 22:45:44 2000
***************
*** 0 ****
--- 1,89 ----
+ /*
+  *	@(#)Version.c	4.9 (Berkeley) 7/21/90
+  *	$Id: Version.c,v 8.2 1997/06/01 20:34:34 vixie Exp $
+  */
+ 
+ #ifndef lint
+ char sccsid[] = "@(#)named %VERSION% %WHEN% %WHOANDWHERE%";
+ char rcsid[] = "$Id: Version.c,v 8.2 1997/06/01 20:34:34 vixie Exp $";
+ #endif /* not lint */
+ 
+ char Version[] = "named %VERSION% %WHEN%\n\t%WHOANDWHERE%";
+ char ShortVersion[] = "%VERSION%";
+ 
+ #ifdef COMMENT
+ 
+ SCCS/s.Version.c:
+ 
+ D 4.8.3	90/06/27 17:05:21	bloom	37	35	00031/00028/00079
+ Version distributed with 4.3 Reno tape (June 1990)
+ 
+ D 4.8.2	89/09/18 13:57:11	bloom	35	34	00020/00014/00087
+ Interim fixes release
+ 
+ D 4.8.1	89/02/08 17:12:15	karels	34	33	00026/00017/00075
+ branch for 4.8.1
+ 
+ D 4.8	88/07/09 14:27:00       karels  33      28      00043/00031/00049
+ 4.8 is here!
+ 
+ D 4.7	87/11/20 13:15:52	karels	25	24	00000/00000/00062
+ 4.7.3 beta
+ 
+ D 4.6	87/07/21 12:15:52	karels	25	24	00000/00000/00062
+ 4.6 declared stillborn
+ 
+ D 4.5	87/02/10 12:33:25	kjd	24	18	00000/00000/00062
+ February 1987, Network Release. Child (bind) grows up, parent (kevin) leaves home.
+ 
+ D 4.4	86/10/01 10:06:26	kjd	18	12	00020/00017/00042
+ October 1, 1986 Network Distribution
+ 
+ D 4.3	86/06/04 12:12:18	kjd	12	7	00015/00028/00044
+ Version distributed with 4.3BSD
+ 
+ D 4.2	86/04/30 20:57:16	kjd	7	1	00056/00000/00016
+ Network distribution Freeze and one more version until 4.3BSD
+ 
+ D 1.1	86/04/30 19:30:00	kjd	1	0	00016/00000/00000
+ date and time created 86/04/30 19:30:00 by kjd
+ 
+ code versions:
+ 
+ Makefile
+ 	Makefile	4.14 (Berkeley) 2/28/88
+ db.h
+ 	db.h	4.13 (Berkeley) 2/17/88
+ db_dump.c
+ 	db_dump.c	4.20 (Berkeley) 2/17/88
+ db_load.c
+ 	db_load.c	4.26 (Berkeley) 2/28/88
+ db_lookup.c
+ 	db_lookup.c	4.14 (Berkeley) 2/17/88
+ db_reload.c
+ 	db_reload.c	4.15 (Berkeley) 2/28/88
+ db_save.c
+ 	db_save.c	4.13 (Berkeley) 2/17/88
+ db_update.c
+ 	db_update.c	4.16 (Berkeley) 2/28/88
+ ns_forw.c
+ 	ns_forw.c	4.26 (Berkeley) 3/28/88
+ ns_init.c
+ 	ns_init.c	4.23 (Berkeley) 2/28/88
+ ns_main.c
+ 	 Copyright (c) 1986 Regents of the University of California.\n\
+ 	ns_main.c	4.30 (Berkeley) 3/7/88
+ ns_maint.c
+ 	ns_maint.c	4.23 (Berkeley) 2/28/88
+ ns_req.c
+ 	ns_req.c	4.32 (Berkeley) 3/31/88
+ ns_resp.c
+ 	ns_resp.c	4.50 (Berkeley) 4/7/88
+ ns_sort.c
+ 	ns_sort.c	4.3 (Berkeley) 2/17/88
+ ns_stats.c
+ 	ns_stats.c	4.3 (Berkeley) 2/17/88
+ newvers.sh
+ 	newvers.sh	4.4 (Berkeley) 3/28/88
+ 
+ #endif /* COMMENT */
diff -cNr ../bind-4.9.7/res/Makefile ./res/Makefile
*** ../bind-4.9.7/res/Makefile	Tue Apr  7 00:24:06 1998
--- ./res/Makefile	Thu Jun 22 18:38:34 2000
***************
*** 77,89 ****
  	res_comp.c res_init.c res_mkquery.c res_query.c res_send.c \
  	getnetbyaddr.c getnetbyname.c getnetent.c getnetnamadr.c \
  	gethnamaddr.c sethostent.c nsap_addr.c hostnamelen.c inet_addr.c \
! 	inet_ntop.c inet_neta.c inet_pton.c inet_net_ntop.c inet_net_pton.c
  
  OBJS=	base64.o herror.o res_debug.o res_data.o \
  	res_comp.o res_init.o res_mkquery.o res_query.o res_send.o \
  	getnetbyaddr.o getnetbyname.o getnetent.o getnetnamadr.o \
  	gethnamaddr.o sethostent.o nsap_addr.o hostnamelen.o inet_addr.o \
! 	inet_ntop.o inet_neta.o inet_pton.o inet_net_ntop.o inet_net_pton.o
  
  all: libresolv.a
  
--- 77,91 ----
  	res_comp.c res_init.c res_mkquery.c res_query.c res_send.c \
  	getnetbyaddr.c getnetbyname.c getnetent.c getnetnamadr.c \
  	gethnamaddr.c sethostent.c nsap_addr.c hostnamelen.c inet_addr.c \
! 	inet_ntop.c inet_neta.c inet_pton.c inet_net_ntop.c inet_net_pton.c \
! 	getprotoent.c getservent.c
  
  OBJS=	base64.o herror.o res_debug.o res_data.o \
  	res_comp.o res_init.o res_mkquery.o res_query.o res_send.o \
  	getnetbyaddr.o getnetbyname.o getnetent.o getnetnamadr.o \
  	gethnamaddr.o sethostent.o nsap_addr.o hostnamelen.o inet_addr.o \
! 	inet_ntop.o inet_neta.o inet_pton.o inet_net_ntop.o inet_net_pton.o \
! 	getprotoent.o getservent.o
  
  all: libresolv.a
  
***************
*** 99,105 ****
  
  .c.o:
  	${CC} ${CFLAGS} -c $*.c
! 	-${LDS} ld -x -r $*.o && ${LDS} mv a.out $*.o
  
  clean: FRC
  	rm -f errs a.out core libresolv.a tags .depend
--- 101,107 ----
  
  .c.o:
  	${CC} ${CFLAGS} -c $*.c
! 	-${LDS} ld -x -r $*.o && ${LDS} mv a.exe $*.o
  
  clean: FRC
  	rm -f errs a.out core libresolv.a tags .depend
diff -cNr ../bind-4.9.7/res/getprotoent.c ./res/getprotoent.c
*** ../bind-4.9.7/res/getprotoent.c	Wed Dec 31 19:00:00 1969
--- ./res/getprotoent.c	Wed Jun 21 22:13:40 2000
***************
*** 0 ****
--- 1,119 ----
+ /*
+  * Copyright (c) 1983, 1993
+  *	The Regents of the University of California.  All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgement:
+  *	This product includes software developed by the University of
+  *	California, Berkeley and its contributors.
+  * 4. Neither the name of the University nor the names of its contributors
+  *    may be used to endorse or promote products derived from this software
+  *    without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)getprotoent.c	8.1 (Berkeley) 6/4/93";
+ #endif /* LIBC_SCCS and not lint */
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ 
+ #define	MAXALIASES	35
+ 
+ static FILE *protof = NULL;
+ static char line[BUFSIZ+1];
+ static struct protoent proto;
+ static char *proto_aliases[MAXALIASES];
+ int _proto_stayopen;
+ 
+ void
+ setprotoent(f)
+ 	int f;
+ {
+ 	if (protof == NULL)
+ 		protof = fopen(_PATH_PROTOCOLS, "r" );
+ 	else
+ 		rewind(protof);
+ 	_proto_stayopen |= f;
+ }
+ 
+ void
+ endprotoent()
+ {
+ 	if (protof) {
+ 		fclose(protof);
+ 		protof = NULL;
+ 	}
+ 	_proto_stayopen = 0;
+ }
+ 
+ struct protoent *
+ getprotoent()
+ {
+ 	char *p;
+ 	register char *cp, **q;
+ 
+ 	if (protof == NULL && (protof = fopen(_PATH_PROTOCOLS, "r" )) == NULL)
+ 		return (NULL);
+ again:
+ 	if ((p = fgets(line, BUFSIZ, protof)) == NULL)
+ 		return (NULL);
+ 	if (*p == '#')
+ 		goto again;
+ 	cp = strpbrk(p, "#\n");
+ 	if (cp == NULL)
+ 		goto again;
+ 	*cp = '\0';
+ 	proto.p_name = p;
+ 	cp = strpbrk(p, " \t");
+ 	if (cp == NULL)
+ 		goto again;
+ 	*cp++ = '\0';
+ 	while (*cp == ' ' || *cp == '\t')
+ 		cp++;
+ 	p = strpbrk(cp, " \t");
+ 	if (p != NULL)
+ 		*p++ = '\0';
+ 	proto.p_proto = atoi(cp);
+ 	q = proto.p_aliases = proto_aliases;
+ 	if (p != NULL) {
+ 		cp = p;
+ 		while (cp && *cp) {
+ 			if (*cp == ' ' || *cp == '\t') {
+ 				cp++;
+ 				continue;
+ 			}
+ 			if (q < &proto_aliases[MAXALIASES - 1])
+ 				*q++ = cp;
+ 			cp = strpbrk(cp, " \t");
+ 			if (cp != NULL)
+ 				*cp++ = '\0';
+ 		}
+ 	}
+ 	*q = NULL;
+ 	return (&proto);
+ }
diff -cNr ../bind-4.9.7/res/getservent.c ./res/getservent.c
*** ../bind-4.9.7/res/getservent.c	Wed Dec 31 19:00:00 1969
--- ./res/getservent.c	Wed Jun 21 22:16:32 2000
***************
*** 0 ****
--- 1,278 ----
+ /*
+  * Copyright (c) 1983, 1993
+  *	The Regents of the University of California.  All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgement:
+  *	This product includes software developed by the University of
+  *	California, Berkeley and its contributors.
+  * 4. Neither the name of the University nor the names of its contributors
+  *    may be used to endorse or promote products derived from this software
+  *    without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ #if defined(LIBC_SCCS) && !defined(lint)
+ static char sccsid[] = "@(#)getservent.c	8.1 (Berkeley) 6/4/93";
+ #endif /* LIBC_SCCS and not lint */
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #ifdef YP
+ #include <rpc/rpc.h>
+ #include <rpcsvc/yp_prot.h>
+ #include <rpcsvc/ypclnt.h>
+ static int serv_stepping_yp = 0;
+ extern int _yp_check __P(( char ** ));
+ #endif
+ 
+ 
+ #define	MAXALIASES	35
+ 
+ static FILE *servf = NULL;
+ static char line[BUFSIZ+1];
+ static struct servent serv;
+ static char *serv_aliases[MAXALIASES];
+ int _serv_stayopen;
+ 
+ #ifdef YP
+ char *___getservbyname_yp = NULL;
+ char *___getservbyproto_yp = NULL;
+ int ___getservbyport_yp = 0;
+ static char *yp_domain = NULL;
+ 
+ static int
+ _getservbyport_yp(line)
+ 	char *line;
+ {
+ 	char *result;
+ 	int resultlen;
+ 	char buf[YPMAXRECORD + 2];
+ 	int rv;
+ 
+ 	snprintf(buf, sizeof(buf), "%d/%s", ntohs(___getservbyport_yp),
+ 						___getservbyproto_yp);
+ 
+ 	___getservbyport_yp = 0;
+ 	___getservbyproto_yp = NULL;
+ 
+ 	if(!yp_domain) {
+ 		if(yp_get_default_domain(&yp_domain))
+ 			return (0);
+ 	}
+ 
+ 	/*
+ 	 * We have to be a little flexible here. Ideally you're supposed
+ 	 * to have both a services.byname and a services.byport map, but
+ 	 * some systems have only services.byname. FreeBSD cheats a little
+ 	 * by putting the services.byport information in the same map as
+ 	 * services.byname so that either case will work. We allow for both
+ 	 * possibilities here: if there is no services.byport map, we try
+ 	 * services.byname instead.
+ 	 */
+ 	if ((rv = yp_match(yp_domain, "services.byport", buf, strlen(buf),
+ 						&result, &resultlen))) {
+ 		if (rv == YPERR_MAP) {
+ 			if (yp_match(yp_domain, "services.byname", buf,
+ 					strlen(buf), &result, &resultlen))
+ 			return(0);
+ 		} else
+ 			return(0);
+ 	}
+ 		
+ 	/* getservent() expects lines terminated with \n -- make it happy */
+ 	snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
+ 
+ 	free(result);
+ 	return(1);
+ }
+ 
+ static int
+ _getservbyname_yp(line)
+ 	char *line;
+ {
+ 	char *result;
+ 	int resultlen;
+ 	char buf[YPMAXRECORD + 2];
+ 
+ 	if(!yp_domain) {
+ 		if(yp_get_default_domain(&yp_domain))
+ 			return (0);
+ 	}
+ 
+ 	snprintf(buf, sizeof(buf), "%s/%s", ___getservbyname_yp,
+ 						___getservbyproto_yp);
+ 
+ 	___getservbyname_yp = 0;
+ 	___getservbyproto_yp = NULL;
+ 
+ 	if (yp_match(yp_domain, "services.byname", buf, strlen(buf),
+ 						&result, &resultlen)) {
+ 		return(0);
+ 	}
+ 		
+ 	/* getservent() expects lines terminated with \n -- make it happy */
+ 	snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
+ 
+ 	free(result);
+ 	return(1);
+ }
+ 
+ static int
+ _getservent_yp(line)
+ 	char *line;
+ {
+ 	static char *key = NULL;
+ 	static int keylen;
+ 	char *lastkey, *result;
+ 	int resultlen;
+ 	int rv;
+ 
+ 	if(!yp_domain) {
+ 		if(yp_get_default_domain(&yp_domain))
+ 			return (0);
+ 	}
+ 
+ 	if (!serv_stepping_yp) {
+ 		if (key)
+ 			free(key);
+ 		if ((rv = yp_first(yp_domain, "services.byname", &key, &keylen,
+ 			     &result, &resultlen))) {
+ 			serv_stepping_yp = 0;
+ 			return(0);
+ 		}
+ 		serv_stepping_yp = 1;
+ 	} else {
+ 		lastkey = key;
+ 		rv = yp_next(yp_domain, "services.byname", key, keylen, &key,
+ 			     &keylen, &result, &resultlen);
+ 		free(lastkey);
+ 		if (rv) {
+ 			serv_stepping_yp = 0;
+ 			return (0);
+ 		}
+ 	}
+ 
+ 	/* getservent() expects lines terminated with \n -- make it happy */
+ 	snprintf(line, BUFSIZ, "%.*s\n", resultlen, result);
+ 
+ 	free(result);
+ 
+ 	return(1);
+ }
+ #endif
+ 
+ void
+ setservent(f)
+ 	int f;
+ {
+ 	if (servf == NULL)
+ 		servf = fopen(_PATH_SERVICES, "r" );
+ 	else
+ 		rewind(servf);
+ 	_serv_stayopen |= f;
+ }
+ 
+ void
+ endservent()
+ {
+ 	if (servf) {
+ 		fclose(servf);
+ 		servf = NULL;
+ 	}
+ 	_serv_stayopen = 0;
+ }
+ 
+ struct servent *
+ getservent()
+ {
+ 	char *p;
+ 	register char *cp, **q;
+ 
+ #ifdef YP
+ 	if (serv_stepping_yp && _getservent_yp(line)) {
+ 		p = (char *)&line;
+ 		goto unpack;
+ 	}
+ tryagain:
+ #endif
+ 	if (servf == NULL && (servf = fopen(_PATH_SERVICES, "r" )) == NULL)
+ 		return (NULL);
+ again:
+ 	if ((p = fgets(line, BUFSIZ, servf)) == NULL)
+ 		return (NULL);
+ #ifdef YP
+ 	if (*p == '+' && _yp_check(NULL)) {
+ 		if (___getservbyname_yp != NULL) {
+ 			if (!_getservbyname_yp(line))
+ 				goto tryagain;
+ 		} 
+ 		else if (___getservbyport_yp != 0) {
+ 			if (!_getservbyport_yp(line))
+ 				goto tryagain;
+ 		}
+ 		else if (!_getservent_yp(line))
+ 			goto tryagain;
+ 	}
+ unpack:
+ #endif
+ 	if (*p == '#')
+ 		goto again;
+ 	cp = strpbrk(p, "#\n");
+ 	if (cp == NULL)
+ 		goto again;
+ 	*cp = '\0';
+ 	serv.s_name = p;
+ 	p = strpbrk(p, " \t");
+ 	if (p == NULL)
+ 		goto again;
+ 	*p++ = '\0';
+ 	while (*p == ' ' || *p == '\t')
+ 		p++;
+ 	cp = strpbrk(p, ",/");
+ 	if (cp == NULL)
+ 		goto again;
+ 	*cp++ = '\0';
+ 	serv.s_port = htons((u_short)atoi(p));
+ 	serv.s_proto = cp;
+ 	q = serv.s_aliases = serv_aliases;
+ 	cp = strpbrk(cp, " \t");
+ 	if (cp != NULL)
+ 		*cp++ = '\0';
+ 	while (cp && *cp) {
+ 		if (*cp == ' ' || *cp == '\t') {
+ 			cp++;
+ 			continue;
+ 		}
+ 		if (q < &serv_aliases[MAXALIASES - 1])
+ 			*q++ = cp;
+ 		cp = strpbrk(cp, " \t");
+ 		if (cp != NULL)
+ 			*cp++ = '\0';
+ 	}
+ 	*q = NULL;
+ 	return (&serv);
+ }
diff -cNr ../bind-4.9.7/tools/Makefile ./tools/Makefile
*** ../bind-4.9.7/tools/Makefile	Mon May 20 11:10:04 1996
--- ./tools/Makefile	Thu Jun 22 19:02:04 2000
***************
*** 133,139 ****
  		(cd $$x; pwd; ${MAKE} ${MARGS} clean); \
  	done
  	rm -f ${BINARIES} core .depend
! 	rm -f *.BAK *.CKP *~ *.o *.orig
  
  depend: ${SRCS}
  	@for x in ${SUBDIRS}; do \
--- 133,139 ----
  		(cd $$x; pwd; ${MAKE} ${MARGS} clean); \
  	done
  	rm -f ${BINARIES} core .depend
! 	rm -f *.BAK *.CKP *~ *.o *.orig *.exe
  
  depend: ${SRCS}
  	@for x in ${SUBDIRS}; do \
diff -cNr ../bind-4.9.7/tools/nslookup/Makefile ./tools/nslookup/Makefile
*** ../bind-4.9.7/tools/nslookup/Makefile	Fri Dec 22 05:20:44 1995
--- ./tools/nslookup/Makefile	Thu Jun 22 19:02:14 2000
***************
*** 103,109 ****
  
  clean:
  	rm -f ${OBJS} core nslookup commands.c lex.yy.c lex.yy.o
! 	rm -f *.BAK *.CKP *~
  
  cleandir: clean
  	rm -f tags .depend
--- 103,109 ----
  
  clean:
  	rm -f ${OBJS} core nslookup commands.c lex.yy.c lex.yy.o
! 	rm -f *.BAK *.CKP *~ *.exe
  
  cleandir: clean
  	rm -f tags .depend
