Index: DO-PKGSRC-DIFF =================================================================== RCS file: DO-PKGSRC-DIFF diff -N DO-PKGSRC-DIFF --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ DO-PKGSRC-DIFF 6 Jan 2006 19:32:04 -0000 @@ -0,0 +1,12 @@ +#! /bin/sh + +# do: cvs -q diff -I .cvsignore -N -u +# +# then do the following edits: +# +# s: doc/: ../doc/: +# s: src/: : +# + +cvs -q diff -I .cvsignore -N -u . | sed -e 's: doc/: ../doc/:' -e 's: src/: :' > /usr/pkgsrc/net/bind8/patches/patch-planix +( cd /usr/pkgsrc/net/bind8; make mps; ) Index: doc/bog/files.me =================================================================== RCS file: /cvs/misc/bind8/doc/bog/files.me,v retrieving revision 1.1.1.1 diff -u -I.cvsignore -u -r1.1.1.1 files.me --- doc/bog/files.me 24 Jun 1997 14:03:39 -0000 1.1.1.1 +++ doc/bog/files.me 8 Jul 2002 18:16:19 -0000 @@ -702,7 +702,7 @@ .pp The origin is a way of changing the origin in a data file. The line starts in column 1, and is followed by a domain origin. This seems like it could -be useful for putting more then one zone into a data file, but that's not +be useful for putting more than one zone into a data file, but that's not how it works. The name server fundamentally requires a given zone to map entirely to some specific file. You should therefore be very careful to use $ORIGIN only once at the top of a file, or, within a file, to change to a Index: doc/man/Makefile =================================================================== RCS file: /cvs/misc/bind8/doc/man/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- doc/man/Makefile 2 Jan 2005 17:06:11 -0000 1.1.1.5 +++ doc/man/Makefile 2 Jan 2005 17:14:48 -0000 @@ -34,12 +34,12 @@ # Target directory for the manual directory tree. Eg., may be used to # specify the path of an NFS-mounted directory for common files. # -DESTDIR= +DESTDIR= ${PREFIX} # # Default location for manual section directories. # -DESTMAN= /usr/share/man +DESTMAN= /share/man # # Install manuals in ${MANDIR}N. For systems that generate catable manual @@ -210,14 +210,12 @@ # # User command manual entries # -CMD_BASE = dig host dnsquery dnskeygen +CMD_BASE = dig dnsquery dnskeygen CMD_SRC_EXT = 1 CMD_SRC = dig.${CMD_SRC_EXT} \ - host.${CMD_SRC_EXT} \ dnsquery.${CMD_SRC_EXT} \ dnskeygen.${CMD_SRC_EXT} CMD_OUT = dig.${CMD_OUT_EXT} \ - host.${CMD_OUT_EXT} \ dnsquery.${CMD_OUT_EXT} \ dnskeygen.${CMD_OUT_EXT} @@ -285,7 +283,8 @@ # # File format manual entries # -FORMAT_BASE = resolver irs.conf named.conf +FORMAT_MAIN_BASE = named.conf +FORMAT_BASE = resolver irs.conf FORMAT_SRC_EXT = 5 FORMAT_SRC = resolver.${FORMAT_SRC_EXT} \ irs.conf.${FORMAT_SRC_EXT} \ @@ -375,6 +374,10 @@ $${f}.${LIB_NETWORK_OUT_EXT} \ ${DESTDIR}${DESTMAN}/${MANDIR}${LIB_NETWORK_EXT_DIR}/$${f}.${CATEXT}; \ done + @set -x; N=${FORMAT_EXT}; for f in ${FORMAT_MAIN_BASE}; do \ + ${INSTALL} -c -m 444 ${MAN_OWNER} ${MAN_GROUP} $${f}.${FORMAT_OUT_EXT} \ + ${DESTDIR}${DESTMAN}/${MANDIR}${FORMAT_EXT_DIR}/$${f}.${CATEXT}; \ + done @set -x; N=${FORMAT_EXT}; for f in ${FORMAT_BASE}; do \ ${INSTALL} -c -m 444 ${MAN_OWNER} ${MAN_GROUP} \ $${f}.${FORMAT_OUT_EXT} \ @@ -391,7 +394,7 @@ ${DESTDIR}${DESTMAN}/${MANDIR}${LIB_NETWORK_EXT_DIR} \ ${DESTDIR}${DESTMAN}/${MANDIR}${FORMAT_EXT_DIR} \ ${DESTDIR}${DESTMAN}/${MANDIR}${DESC_EXT_DIR}: - mkdir $@ + mkdir -p $@ links: FRC @set -ex; ln -s SRC/*.[0-9] . Index: doc/man/dnsquery.1 =================================================================== RCS file: /cvs/misc/bind8/doc/man/dnsquery.1,v retrieving revision 1.1.1.6 diff -u -I.cvsignore -u -r1.1.1.6 dnsquery.1 --- doc/man/dnsquery.1 2 Jan 2005 17:06:11 -0000 1.1.1.6 +++ doc/man/dnsquery.1 2 Jan 2005 17:16:49 -0000 @@ -178,3 +178,10 @@ .Fn inet_addr seems to cause a segmentation fault with some (bad) IP addresses (e.g., 1.2.3.4.5). +.Pp +.Nm +does not support DNS queries/replies over IPv6 transport, and ignores +IPv6 address on +.Dq nameserver +line in +.Xr resolv.conf 5 . Index: doc/man/named-xfer.8 =================================================================== RCS file: /cvs/misc/bind8/doc/man/named-xfer.8,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 named-xfer.8 --- doc/man/named-xfer.8 2 Jan 2005 17:06:11 -0000 1.1.1.5 +++ doc/man/named-xfer.8 2 Jan 2005 17:17:45 -0000 @@ -203,3 +203,6 @@ RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123, RFC 1995 .Dq Name Server Operations Guide for Sy BIND . +.Sh BUGS +.Nm +does not support DNS queries/replies over IPv6 transport. Index: doc/man/named.8 =================================================================== RCS file: /cvs/misc/bind8/doc/man/named.8,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 named.8 --- doc/man/named.8 2 Jan 2005 17:06:11 -0000 1.1.1.8 +++ doc/man/named.8 2 Jan 2005 17:18:25 -0000 @@ -447,3 +447,6 @@ RFC 882, RFC 883, RFC 973, RFC 974, RFC 1033, RFC 1034, RFC 1035, RFC 1123, RFC 2308 .Dq Name Server Operations Guide for Sy BIND +.Sh BUGS +.Nm +does not support DNS queries/replies over IPv6 transport. Index: doc/man/named.conf.5 =================================================================== RCS file: /cvs/misc/bind8/doc/man/named.conf.5,v retrieving revision 1.1.1.9 diff -u -I.cvsignore -u -r1.1.1.9 named.conf.5 --- doc/man/named.conf.5 2 Jan 2005 17:06:11 -0000 1.1.1.9 +++ doc/man/named.conf.5 2 Jan 2005 17:27:18 -0000 @@ -343,8 +343,9 @@ .Ic allow-transfer , .Ic allow-update , .Ic allow-recursion , +.Ic blackhole , and -.Ic blackhole +.Ic deny_address_record all use address match lists like this. Similarly, the .Ic listen-on option will cause the server to not accept queries on any of the @@ -757,6 +758,7 @@ [ allow-recursion { \fIaddress_match_list\fR }; ] [ allow-transfer { \fIaddress_match_list\fR }; ] [ blackhole { \fIaddress_match_list\fR }; ] + [ deny_address_record { \fIaddress_match_list\fR }; ] [ listen-on [ port \fIip_port\fR ] { \fIaddress_match_list\fR }; ] [ listen-on-v6 [ port \fIip_port\fR ] { \fIaddress_match_list\fR }; ] [ query-source [ address ( \fIipv4_addr\fR | * ) ] @@ -1180,7 +1182,6 @@ .Ic options allow-query statement. If not specified, the default is to allow queries from all hosts. -.Bl -tag -width 0n .It Ic allow-recursion Specifies which hosts are allowed to ask recursive questions. If not specified, the default is to allow recursive queries @@ -1199,7 +1200,12 @@ Specifies a list of addresses that the server will not accept queries from or use to resolve a query. Queries from these addresses will not be responded to. -.El +.It Ic deny_address_record +Specifies a list of addresses that the server will use to test A RRs in +responses. If the target address of any A RR matches any address in +this ACL then it will turned into an NXDOMAIN response. This ACL can be +used to avoid the nasty effects of wildcard A RRs in what should really +be delegation-only zones. .El .Ss Interfaces The interfaces and ports that the server will answer queries from may Index: src/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/Makefile,v retrieving revision 1.1.1.6 diff -u -I.cvsignore -u -r1.1.1.6 Makefile --- src/Makefile 6 Jan 2006 17:37:45 -0000 1.1.1.6 +++ src/Makefile 6 Jan 2006 17:51:26 -0000 @@ -18,6 +18,8 @@ TOP= SUBDIRS= include port lib bin +PREFIX?= /usr/local + SH=sh default: all @@ -36,7 +38,7 @@ for x in ${SUBDIRS}; do \ ( cd $$x; pwd; \ eval "${MAKE} $$settings ${MARGS} SYSTYPE=$$systype \ - VER=$$version \ + VER=$$version PREFIX=${PREFIX} \ $@"; \ ) || exit 1; \ done \ Index: src/Version =================================================================== RCS file: /cvs/misc/bind8/src/Version,v retrieving revision 1.1.1.14 diff -u -I.cvsignore -u -r1.1.1.14 Version --- src/Version 6 Jan 2006 17:37:45 -0000 1.1.1.14 +++ src/Version 6 Jan 2006 17:51:39 -0000 @@ -1 +1 @@ -8.4.7-REL +8.4.7-REL-Planix-1 Index: src/bin/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/Makefile,v retrieving revision 1.1.1.6 diff -u -I.cvsignore -u -r1.1.1.6 Makefile --- src/bin/Makefile 2 Jan 2005 17:05:41 -0000 1.1.1.6 +++ src/bin/Makefile 2 Jan 2005 17:32:51 -0000 @@ -42,8 +42,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= - MARGS = "SYSTYPE=${SYSTYPE}" "SHELL=${SHELL}" "A=${A}" "O=${O}" \ "CC=${CC}" "LEX=${LEX}" "YACC=${YACC}" "CDEBUG=${CDEBUG}" \ "SYSLIBS=${SYSLIBS}" "LDFLAGS=${LDFLAGS}" \ @@ -61,7 +59,7 @@ CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} -SUBDIRS = addr nslookup dig dnsquery host named named-xfer ndc nsupdate \ +SUBDIRS = addr nslookup dig dnsquery named named-xfer ndc nsupdate \ mkservdb irpd dnskeygen named-bootconf all: Index: src/bin/addr/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/addr/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/addr/Makefile 2 Jan 2005 17:05:41 -0000 1.1.1.5 +++ src/bin/addr/Makefile 2 Jan 2005 17:33:18 -0000 @@ -41,7 +41,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/dig/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/dig/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/dig/Makefile 2 Jan 2005 17:05:41 -0000 1.1.1.5 +++ src/bin/dig/Makefile 2 Jan 2005 17:33:45 -0000 @@ -41,7 +41,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/dnskeygen/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/dnskeygen/Makefile,v retrieving revision 1.1.1.4 diff -u -I.cvsignore -u -r1.1.1.4 Makefile --- src/bin/dnskeygen/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.4 +++ src/bin/dnskeygen/Makefile 2 Jan 2005 17:34:05 -0000 @@ -43,7 +43,6 @@ INSTALL_LIB=-o bin -g bin PS=ps -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/dnsquery/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/dnsquery/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/dnsquery/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.5 +++ src/bin/dnsquery/Makefile 2 Jan 2005 17:34:27 -0000 @@ -41,7 +41,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/host/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/host/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/host/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.5 +++ src/bin/host/Makefile 2 Jan 2005 17:34:46 -0000 @@ -41,7 +41,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} @@ -49,7 +48,9 @@ SRCS= ${PROG}.c OBJS= ${PROG}.${O} -all: ${PROG}${EXE} +#all: ${PROG}${EXE} +# don't build this -- it's ancient and broken! +all: ${PROG}${EXE}: ${OBJS} ${LIBBIND} Makefile ${CC} ${CDEBUG} ${LDFLAGS} ${BOUNDS} -o ${PROG}${EXE} ${OBJS} \ Index: src/bin/irpd/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/irpd/Makefile,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 Makefile --- src/bin/irpd/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.3 +++ src/bin/irpd/Makefile 2 Jan 2005 17:35:23 -0000 @@ -45,7 +45,6 @@ STRIP=-s PS=ps -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} -I${TOP}/lib/irs ${DEFS} Index: src/bin/mkservdb/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/mkservdb/Makefile,v retrieving revision 1.1.1.4 diff -u -I.cvsignore -u -r1.1.1.4 Makefile --- src/bin/mkservdb/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.4 +++ src/bin/mkservdb/Makefile 2 Jan 2005 17:35:43 -0000 @@ -40,7 +40,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/named/.cvsignore =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/.cvsignore,v retrieving revision 1.1.1.2 diff -u -I.cvsignore -u -r1.1.1.2 .cvsignore --- src/bin/named/.cvsignore 26 Jul 1999 04:41:20 -0000 1.1.1.2 +++ src/bin/named/.cvsignore 8 Sep 2002 19:25:56 -0000 @@ -1,7 +1,8 @@ -tmp_version.c +.depend named -pathnames -pathnames.h +named.map ns_parser.c ns_parser.h -.depend +pathnames +pathnames.h +tmp_version.c Index: src/bin/named/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/named/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.5 +++ src/bin/named/Makefile 2 Jan 2005 17:37:38 -0000 @@ -46,7 +46,6 @@ INSTALL_LIB=-o bin -g bin PS=ps -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} ${DEFS} Index: src/bin/named/db_load.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/db_load.c,v retrieving revision 1.1.1.9 diff -u -I.cvsignore -u -r1.1.1.9 db_load.c --- src/bin/named/db_load.c 6 Jan 2006 17:37:48 -0000 1.1.1.9 +++ src/bin/named/db_load.c 6 Jan 2006 19:20:50 -0000 @@ -1587,6 +1587,7 @@ unsigned int getnum(FILE *fp, const char *src, int opt, int *multiline) { int c; + unsigned int m = 0; unsigned int n; int seendigit = 0; int seendecimal = 0; @@ -1598,7 +1599,6 @@ #define DOTMUL 10000 unsigned int dotcutoff = UINT_MAX / DOTMUL; unsigned int dotcutlim = UINT_MAX % DOTMUL; - unsigned int m = 0; #else #define DOTMUL 1000 unsigned int dotcutoff = UINT_MAX / DOTMUL; Index: src/bin/named/named.h =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/named.h,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 named.h --- src/bin/named/named.h 2 Jan 2005 17:05:43 -0000 1.1.1.8 +++ src/bin/named/named.h 2 Jan 2005 17:38:13 -0000 @@ -36,8 +36,8 @@ #define BIND_UPDATE #define WANT_PIDFILE #define FWD_LOOP -#define DOTTED_SERIAL -#define SENSIBLE_DOTS +#undef DOTTED_SERIAL +#undef SENSIBLE_DOTS #define ROUND_ROBIN #define DNS_SECURITY #undef RSAREF @@ -45,7 +45,7 @@ #define ALLOW_LONG_TXT_RDATA #define STRICT_RFC2308 #undef BIND_ZXFR -#undef LOG_TSIG_BUG +#define LOG_TSIG_BUG #define NOADDITIONAL #undef FORWARD_ALLOWS /* enable allow-query for forward zones. */ Index: src/bin/named/ns_config.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_config.c,v retrieving revision 1.1.1.11 diff -u -I.cvsignore -u -r1.1.1.11 ns_config.c --- src/bin/named/ns_config.c 6 Jan 2006 17:37:49 -0000 1.1.1.11 +++ src/bin/named/ns_config.c 6 Jan 2006 17:53:49 -0000 @@ -1167,6 +1167,7 @@ op->query_acl = NULL; op->transfer_acl = NULL; op->recursion_acl = NULL; + op->address_record_acl = NULL; op->sortlist = NULL; op->topology = NULL; op->data_size = 0UL; /* use system default */ @@ -1230,6 +1231,8 @@ free_ip_match_list(op->recursion_acl); if (op->transfer_acl) free_ip_match_list(op->transfer_acl); + if (op->address_record_acl) + free_ip_match_list(op->address_record_acl); if (op->sortlist) free_ip_match_list(op->sortlist); if (op->ordering) @@ -1523,7 +1526,9 @@ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); if (fd < 0) return (NULL); +#if 0 /* ARGH!!!! Making the pid file writable by user_id is a major security hole!!!! */ (void) fchown(fd, user_id, group_id); +#endif stream = fdopen(fd, "w"); if (stream == NULL) { (void)unlink(filename); @@ -1802,7 +1807,7 @@ */ const char * p_order(int order) { - return (__sym_ntos(order_table, order, (int *)0)); + return (sym_ntos(order_table, order, (int *)0)); } /* Index: src/bin/named/ns_defs.h =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_defs.h,v retrieving revision 1.1.1.11 diff -u -I.cvsignore -u -r1.1.1.11 ns_defs.h --- src/bin/named/ns_defs.h 2 Jan 2005 17:05:44 -0000 1.1.1.11 +++ src/bin/named/ns_defs.h 2 Jan 2005 17:49:00 -0000 @@ -876,6 +876,7 @@ ip_match_list recursion_acl; ip_match_list transfer_acl; ip_match_list blackhole_acl; + ip_match_list address_record_acl; ip_match_list topology; ip_match_list sortlist; enum severity check_names[num_trans]; Index: src/bin/named/ns_glob.h =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_glob.h,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 ns_glob.h --- src/bin/named/ns_glob.h 2 Jan 2005 17:05:44 -0000 1.1.1.8 +++ src/bin/named/ns_glob.h 2 Jan 2005 18:01:16 -0000 @@ -316,14 +316,9 @@ #endif ; -DECL const char panic_msg_no_options[] - INIT("no server_options in NS_OPTION_P"); - -DECL const char panic_msg_insist_failed[] - INIT("%s:%d: insist '%s' failed: %s"); - -DECL const char panic_msg_bad_which[] - INIT("%s:%d: INCRSTATS(%s): bad \"which\""); +#define panic_msg_no_options "no server_options in NS_OPTION_P" +#define panic_msg_insist_failed "%s:%d: insist '%s' failed: %s" +#define panic_msg_bad_which "%s:%d: INCRSTATS(%s): bad \"which\"" DECL u_long globalStats[nssLast]; Index: src/bin/named/ns_ixfr.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_ixfr.c,v retrieving revision 1.1.1.9 diff -u -I.cvsignore -u -r1.1.1.9 ns_ixfr.c --- src/bin/named/ns_ixfr.c 6 Jan 2006 17:37:50 -0000 1.1.1.9 +++ src/bin/named/ns_ixfr.c 6 Jan 2006 17:54:30 -0000 @@ -416,8 +416,8 @@ return (-1); } (void) my_fclose(db_fp); - ns_debug(ns_log_default, 3, "%s, size %ld", - zp->z_source, (long)db_sb.st_size); + ns_debug(ns_log_default, 3, "%s, size %llu", + zp->z_source, (unsigned long long)db_sb.st_size); /* open up the zone ixfr log */ if ((from_fp = fopen(zp->z_ixfr_base, "r")) == NULL) { @@ -564,8 +564,8 @@ /* signal to read for lowest serial number */ zp->z_serial_ixfr_start = 0; - ns_debug(ns_log_default, 3, "%s, size %ld max %ld\n", zp->z_ixfr_base, - (long)sb.st_size, (long)zp->z_max_log_size_ixfr); + ns_debug(ns_log_default, 3, "%s, size %llu max %ld\n", zp->z_ixfr_base, + (unsigned long long)sb.st_size, (long)zp->z_max_log_size_ixfr); if (error) return(-1); Index: src/bin/named/ns_lexer.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_lexer.c,v retrieving revision 1.1.1.9 diff -u -I.cvsignore -u -r1.1.1.9 ns_lexer.c --- src/bin/named/ns_lexer.c 2 Jan 2005 17:05:44 -0000 1.1.1.9 +++ src/bin/named/ns_lexer.c 2 Jan 2005 18:07:43 -0000 @@ -146,7 +146,8 @@ static void parser_complain(int is_warning, int print_last_token, const char *format, - va_list args) ISC_FORMAT_PRINTF(3, 0); + va_list args) + __attribute__((__format__(__printf__, 3, 0))); static void parser_complain(int is_warning, int print_last_token, const char *format, @@ -251,6 +252,7 @@ {"deallocate-on-exit", T_DEALLOC_ON_EXIT}, {"debug", T_DEBUG}, {"default", T_DEFAULT}, + {"deny_address_record", T_DENY_ADDRESS_RECORD}, {"dialup", T_DIALUP}, {"directory", T_DIRECTORY}, {"dump-file", T_DUMP_FILE}, Index: src/bin/named/ns_main.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_main.c,v retrieving revision 1.1.1.12 diff -u -I.cvsignore -u -r1.1.1.12 ns_main.c --- src/bin/named/ns_main.c 6 Jan 2006 17:37:51 -0000 1.1.1.12 +++ src/bin/named/ns_main.c 6 Jan 2006 17:57:42 -0000 @@ -671,7 +671,7 @@ int new; if ((new = fcntl(fd, F_DUPFD, 20)) == -1) ns_notice(ns_log_default, - "ns_socket unable to create TCP stream: fcntl(): %s", + "ns_socket unable to create TCP stream: fcntl(fd, F_DUPFD, 20): %s", strerror(errno)); tmp = errno; close(fd); @@ -760,7 +760,9 @@ return; case EBADF: case ENOTSOCK: +#if 1 /* Note I didn't have this one listed for some reason.... -GAW */ case EFAULT: +#endif /* * If one these happens, we're broken. */ @@ -874,7 +876,7 @@ INSIST(sizeof sp->s_temp >= INT16SZ); iov = evConsIovec(sp->s_temp, INT16SZ); if (evRead(lev, rfd, &iov, 1, stream_getlen, sp, &sp->evID_r) == -1) { - ns_error(ns_log_default, "evRead(fd %d): %s", + ns_error(ns_log_default, "evRead(fd %d): failed: %s", rfd, strerror(errno)); sq_remove(sp); return; Index: src/bin/named/ns_maint.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_maint.c,v retrieving revision 1.1.1.10 diff -u -I.cvsignore -u -r1.1.1.10 ns_maint.c --- src/bin/named/ns_maint.c 6 Jan 2006 17:37:51 -0000 1.1.1.10 +++ src/bin/named/ns_maint.c 6 Jan 2006 17:58:54 -0000 @@ -707,7 +707,9 @@ name); return(-1); } +#if 0 /* ARGH!!! this one's totally unnecessary given the file is guaranteed brand new!!! */ (void) fchown(tsig_fd, user_id, group_id); +#endif } memset(secret_buf, 0, sizeof(secret_buf)); Index: src/bin/named/ns_parser.y =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_parser.y,v retrieving revision 1.1.1.11 diff -u -I.cvsignore -u -r1.1.1.11 ns_parser.y --- src/bin/named/ns_parser.y 2 Jan 2005 17:05:45 -0000 1.1.1.11 +++ src/bin/named/ns_parser.y 2 Jan 2005 20:33:36 -0000 @@ -99,6 +99,8 @@ static void define_channel(const char *, log_channel); static char *canonical_name(char *); +extern const char *p_order(int order); + int yyparse(); %} @@ -220,6 +222,7 @@ %token T_ALLOW_UPDATE T_ALLOW_QUERY T_ALLOW_TRANSFER %token T_ALLOW_RECURSION %token T_BLACKHOLE +%token T_DENY_ADDRESS_RECORD /* Items related to the "key" statement: */ %token T_SEC_KEY T_ALGID T_SECRET @@ -576,6 +579,20 @@ } else current_options->blackhole_acl = $3; } + | T_DENY_ADDRESS_RECORD '{' address_match_list '}' + { + /* + * derived from: + * + * http://sam.zoy.org/writings/internet/verisign/ + */ + if (current_options->address_record_acl) { + parser_warning(0, + "options deny_address_record already set; skipping"); + free_ip_match_list($3); + } else + current_options->address_record_acl = $3; + } | T_TOPOLOGY '{' address_match_list '}' { if (current_options->topology) { @@ -1997,8 +2014,8 @@ { if ($1 < 0 || $1 > 65535) { parser_warning(0, - "invalid IP port number '%d'; setting port to 0", - (int)$1); + "invalid IP port number '%ld'; setting port to 0", + $1); $1 = 0; } else $$ = htons($1); Index: src/bin/named/ns_resp.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_resp.c,v retrieving revision 1.1.1.13 diff -u -I.cvsignore -u -r1.1.1.13 ns_resp.c --- src/bin/named/ns_resp.c 6 Jan 2006 17:37:52 -0000 1.1.1.13 +++ src/bin/named/ns_resp.c 6 Jan 2006 19:35:32 -0000 @@ -1001,6 +1001,31 @@ cachenegative = 0; continue; } + /* + * Check for A records in the address_record_acl. + * + * derived from: + * + * http://sam.zoy.org/writings/internet/verisign/ + */ + if (type == T_A) { + struct sockaddr addr; + + memset(&addr, 0, sizeof(addr)); + addr.sa_family = AF_INET; +#ifdef HAVE_SA_LEN + sa_slen(&addr) = sizeof(struct sockaddr_in); +#endif + satosin(&addr)->sin_addr = ina_get(dp->d_data); + if (server_options->address_record_acl != NULL && + ip_match_address(server_options->address_record_acl, &addr) == 1) { + ns_debug(ns_log_default, 1, + "refused denied A RR answer '%s'", + sa_ntoa(&addr)); + nameserIncr(sstosa(&qp->q_from), nssSentNXD); + goto nxdomain; + } + } if (type == T_CNAME && qtype != T_CNAME && qtype != T_ANY) { strcpy(aname, (char *)dp->d_data); @@ -1116,10 +1141,19 @@ continue; } if (!related_additional(name)) { + /* + * enhanced logging suggested by + * dean gaudet + * on + * 2002/07/20 + */ ns_info(ns_log_resp_checks, - "unrelated additional info '%s' type %s from %s", - name, p_type(type), - sa_ntoa(from)); + "unrelated additional info '%s' type %s from %s for query '%s %s %s'", + name, p_type(type), + sa_ntoa(from), + *(qp->q_name) ? qp->q_name : ".", + p_class(qp->q_class), + p_type(qp->q_type)); db_detach(&dp); validanswer = 0; continue; @@ -1694,6 +1728,20 @@ free_nsp(nsp); return; + nxdomain: + hp = (HEADER *)(qp->q_cmsglen ? qp->q_cmsg : qp->q_msg); + hp->rcode = NXDOMAIN; + hp->qr = 1; + hp->id = qp->q_id; + hp->rd = 1; + hp->ra = (NS_OPTION_P(OPTION_NORECURSE) == 0); + (void) send_msg((u_char *)hp, + (qp->q_cmsglen ? qp->q_cmsglen : qp->q_msglen), + qp); + qremove(qp); + free_nsp(nsp); + return; + servfail: nameserIncr(sstosa(&qp->q_from), nssSentFail); hp = (HEADER *)(qp->q_cmsglen ? qp->q_cmsg : qp->q_msg); @@ -2087,7 +2135,7 @@ timetilexp = exptime - now; if (timetilexp < ttl) { ns_debug(ns_log_default, 3, - "shrinking expiring %s SIG TTL from %d to %d", + "shrinking expiring %s SIG TTL from %d to %ld", p_secstodate (exptime), ttl, timetilexp); ttl = timetilexp; } Index: src/bin/named/ns_stats.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_stats.c,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 ns_stats.c --- src/bin/named/ns_stats.c 2 Jan 2005 17:05:46 -0000 1.1.1.8 +++ src/bin/named/ns_stats.c 2 Jan 2005 18:46:08 -0000 @@ -123,7 +123,9 @@ server_options->stats_filename); return; } +#if 0 /* ARGH!!!! */ (void) fchown(fileno(f), user_id, group_id); +#endif fprintf(f, "+++ Statistics Dump +++ (%ld) %s", (long)timenow, checked_ctime(&timenow)); @@ -154,7 +156,9 @@ server_options->memstats_filename); return; } +#if 0 /* ARGH!!!! */ (void) fchown(fileno(f), user_id, group_id); +#endif fprintf(f, "+++ Memory Statistics Dump +++ (%ld) %s", (long)timenow, checked_ctime(&timenow)); Index: src/bin/named/ns_update.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/named/ns_update.c,v retrieving revision 1.1.1.10 diff -u -I.cvsignore -u -r1.1.1.10 ns_update.c --- src/bin/named/ns_update.c 6 Jan 2006 17:37:53 -0000 1.1.1.10 +++ src/bin/named/ns_update.c 6 Jan 2006 18:06:01 -0000 @@ -146,7 +146,9 @@ strerror(errno)); return (NULL); } +#if 0 /* ARGH!!!! */ (void) fchown(fileno(fp), user_id, group_id); +#endif if (fseek(fp, 0L, SEEK_END) != 0) { ns_error(ns_log_update, "can't fseek(%s, 0, SEEK_END)", zp->z_updatelog); @@ -171,7 +173,9 @@ strerror(errno)); return (NULL); } +#if 0 /* ARGH!!!! */ (void) fchown(fileno(fp), user_id, group_id); +#endif if (fseek(fp, 0L, SEEK_END) != 0) { ns_error(ns_log_update, "can't fseek(%s, 0, SEEK_END)", zp->z_ixfr_base); Index: src/bin/named-bootconf/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/named-bootconf/Makefile,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 Makefile --- src/bin/named-bootconf/Makefile 2 Jan 2005 17:05:47 -0000 1.1.1.3 +++ src/bin/named-bootconf/Makefile 2 Jan 2005 17:36:18 -0000 @@ -40,7 +40,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/named-xfer/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/named-xfer/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/named-xfer/Makefile 2 Jan 2005 17:05:47 -0000 1.1.1.5 +++ src/bin/named-xfer/Makefile 2 Jan 2005 17:36:52 -0000 @@ -44,7 +44,6 @@ INSTALL_LIB=-o bin -g bin PS=ps -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/ndc/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/ndc/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/ndc/Makefile 2 Jan 2005 17:05:42 -0000 1.1.1.5 +++ src/bin/ndc/Makefile 2 Jan 2005 18:49:09 -0000 @@ -43,7 +43,6 @@ INSTALL_LIB=-o bin -g bin PS=ps -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} ${DEFS} Index: src/bin/ndc/ndc.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/ndc/ndc.c,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 ndc.c --- src/bin/ndc/ndc.c 2 Jan 2005 17:05:42 -0000 1.1.1.8 +++ src/bin/ndc/ndc.c 2 Jan 2005 19:01:13 -0000 @@ -106,10 +106,7 @@ vfprintf(stderr, fmt, args); fputc('\n', stderr); va_end(args); - fatal("usage: %s \ -[-l localsock] [-c channel] [-p pidfile] [-n namedpath] \ -[-dqst] [command [args]]\n\ -", + fatal("usage: %s [-l localsock] [-c channel] [-p pidfile] [-n namedpath] [-dqst] [command [cmd-args]]\n", program); } Index: src/bin/nslookup/.cvsignore =================================================================== RCS file: /cvs/misc/bind8/src/bin/nslookup/.cvsignore,v retrieving revision 1.1.1.1 diff -u -I.cvsignore -u -r1.1.1.1 .cvsignore --- src/bin/nslookup/.cvsignore 24 Jun 1997 14:05:22 -0000 1.1.1.1 +++ src/bin/nslookup/.cvsignore 8 Sep 2002 19:26:22 -0000 @@ -1,3 +1,4 @@ -nslookup -commands.c .depend +commands.c +nslookup +nslookup.map Index: src/bin/nslookup/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/nslookup/Makefile,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 Makefile --- src/bin/nslookup/Makefile 2 Jan 2005 17:05:47 -0000 1.1.1.7 +++ src/bin/nslookup/Makefile 2 Jan 2005 19:01:58 -0000 @@ -42,7 +42,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= DEFS= -D_PATH_HELPFILE=\"${DESTHELP}/nslookup.help\" CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} ${DEFS} Index: src/bin/nslookup/list.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/nslookup/list.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 list.c --- src/bin/nslookup/list.c 2 Jan 2005 17:05:47 -0000 1.1.1.7 +++ src/bin/nslookup/list.c 2 Jan 2005 19:02:21 -0000 @@ -93,6 +93,13 @@ #include "res.h" +#ifndef _REENTRANT +# undef _res +# ifndef __BIND_NOSTATIC +extern struct __res_state _res; +# endif +#endif + extern char *pager; typedef union { Index: src/bin/nsupdate/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/bin/nsupdate/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/bin/nsupdate/Makefile 2 Jan 2005 17:05:48 -0000 1.1.1.5 +++ src/bin/nsupdate/Makefile 2 Jan 2005 19:02:48 -0000 @@ -41,7 +41,6 @@ INSTALL_EXEC= INSTALL_LIB=-o bin -g bin -LDFLAGS= CFLAGS= ${CDEBUG} CPPFLAGS= -I${PORTINCL} -I${INCL} Index: src/bin/nsupdate/nsupdate.c =================================================================== RCS file: /cvs/misc/bind8/src/bin/nsupdate/nsupdate.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 nsupdate.c --- src/bin/nsupdate/nsupdate.c 2 Jan 2005 17:05:48 -0000 1.1.1.7 +++ src/bin/nsupdate/nsupdate.c 2 Jan 2005 19:04:21 -0000 @@ -401,7 +401,7 @@ if ((errno == ERANGE && tmp_ttl == ULONG_MAX) || tmp_ttl > 0x7fffffffUL) { fprintf(stderr, "oversized ttl: %s\n", buf2); - exit (1); + exit(1); } r_ttl = tmp_ttl; (void) getword_str(buf2, sizeof buf2, &startp, endp); Index: src/include/netdb.h =================================================================== RCS file: /cvs/misc/bind8/src/include/netdb.h,v retrieving revision 1.1.1.6 diff -u -I.cvsignore -u -r1.1.1.6 netdb.h --- src/include/netdb.h 2 Jan 2005 17:05:57 -0000 1.1.1.6 +++ src/include/netdb.h 2 Jan 2005 19:06:26 -0000 @@ -137,12 +137,12 @@ * use in system calls). */ struct hostent { - char *h_name; /* official name of host */ - char **h_aliases; /* alias list */ + char *h_name; /* first returned name of host */ + char **h_aliases; /* additional hostnames */ int h_addrtype; /* host address type */ int h_length; /* length of address */ char **h_addr_list; /* list of addresses from name server */ -#define h_addr h_addr_list[0] /* address, for backward compatiblity */ +#define h_addr h_addr_list[0] /* first address from h_addr_list, for backward compatiblity */ }; /* @@ -151,21 +151,21 @@ */ struct netent { char *n_name; /* official name of net */ - char **n_aliases; /* alias list */ + char **n_aliases; /* additional names of net */ int n_addrtype; /* net address type */ unsigned long n_net; /* network # */ }; struct servent { char *s_name; /* official service name */ - char **s_aliases; /* alias list */ + char **s_aliases; /* additional service names */ int s_port; /* port # */ char *s_proto; /* protocol to use */ }; struct protoent { char *p_name; /* official protocol name */ - char **p_aliases; /* alias list */ + char **p_aliases; /* additional protocol names */ int p_proto; /* protocol # */ }; Index: src/include/resolv.h =================================================================== RCS file: /cvs/misc/bind8/src/include/resolv.h,v retrieving revision 1.1.1.10 diff -u -I.cvsignore -u -r1.1.1.10 resolv.h --- src/include/resolv.h 6 Jan 2006 17:38:15 -0000 1.1.1.10 +++ src/include/resolv.h 6 Jan 2006 18:06:40 -0000 @@ -77,6 +77,85 @@ #define __RES 20030124 +/* XXX NetBSD: avoid conflicting with the libc (bind4) resolver */ +#define __h_errno_set bind___h_errno_set +#ifndef _REENTRANT +#define _res bind__res +#endif +#define _res_opcodes bind__res_opcodes +#define __res_send_setrhook bind___res_send_setrhook +#define __res_send_setqhook bind___res_send_setqhook +#define _getlong bind__getlong +#define _getshort bind__getshort +#define gethostbyname2 bind_gethostbyname2 /* YUCK -- bin/named pulls in libc's hesiod functions... */ +#if 0 +#define inet_addr bind_inet_addr +#endif +#define __res_state bind___res_state +#define __res_state_ext bind___res_state_ext +#define __fp_nquery bind___fp_nquery +#define __fp_query bind___fp_query +#define __hostalias bind___hostalias +#define __p_query bind___p_query +#define __res_close bind___res_close +#define __res_init bind___res_init +#define __res_isourserver bind___res_isourserver +#define __res_mkquery bind___res_mkquery +#define __res_query bind___res_query +#define __res_querydomain bind___res_querydomain +#define __res_search bind___res_search +#define __res_send bind___res_send +#define __res_sendsigned bind___res_sendsigned +#define __p_key_syms bind___p_key_syms +#define __p_cert_syms bind___p_cert_syms +#define __p_class_syms bind___p_class_syms +#define __p_type_syms bind___p_type_syms +#define __p_rcode_syms bind___p_rcode_syms +#define __b64_ntop bind___b64_ntop +#define __b64_pton bind___b64_pton +#define __dn_comp bind___dn_comp +#define __dn_count_labels bind___dn_count_labels +#define __dn_expand bind___dn_expand +#define __dn_skipname bind___dn_skipname +#define __fp_resstat bind___fp_resstat +#define __loc_aton bind___loc_aton +#define __loc_ntoa bind___loc_ntoa +#define __p_cdname bind___p_cdname +#define __p_cdnname bind___p_cdnname +#define __p_class bind___p_class +#define __p_fqname bind___p_fqname +#define __p_fqnname bind___p_fqnname +#define __p_option bind___p_option +#define __p_secstodate bind___p_secstodate +#define __p_section bind___p_section +#define __p_time bind___p_time +#define __p_type bind___p_type +#define __p_rcode bind___p_rcode +#define __putlong bind___putlong +#define __putshort bind___putshort +#define __res_dnok bind___res_dnok +#define __res_findzonecut bind___res_findzonecut +#define __res_hnok bind___res_hnok +#define __res_hostalias bind___res_hostalias +#define __res_mailok bind___res_mailok +#define __res_nameinquery bind___res_nameinquery +#define __res_nclose bind___res_nclose +#define __res_ninit bind___res_ninit +#define __res_nmkquery bind___res_nmkquery +#define __res_npquery bind___res_npquery +#define __res_nquery bind___res_nquery +#define __res_nquerydomain bind___res_nquerydomain +#define __res_nsearch bind___res_nsearch +#define __res_nsend bind___res_nsend +#define __res_nsendsigned bind___res_nsendsigned +#define __res_nisourserver bind___res_nisourserver +#define __res_ownok bind___res_ownok +#define __res_queriesmatch bind___res_queriesmatch +#define __res_randomid bind___res_randomid +#define __sym_ntop bind___sym_ntop +#define __sym_ntos bind___sym_ntos +#define __sym_ston bind___sym_ston + /* * This used to be defined in res_query.c, now it's in herror.c. * [XXX no it's not. It's in irs/irs_data.c] @@ -99,7 +178,7 @@ #define RES_SET_H_ERRNO(r,x) __h_errno_set(r,x) struct __res_state; /* forward */ __BEGIN_DECLS -void __h_errno_set(struct __res_state *res, int err); +void __h_errno_set __P((struct __res_state *res, int err)); __END_DECLS /* Index: src/include/arpa/inet.h =================================================================== RCS file: /cvs/misc/bind8/src/include/arpa/inet.h,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 inet.h --- src/include/arpa/inet.h 2 Jan 2005 17:05:58 -0000 1.1.1.3 +++ src/include/arpa/inet.h 2 Jan 2005 19:09:13 -0000 @@ -70,6 +70,20 @@ # include #endif #include +#include + +#if !defined(__NetBSD_Version__) || (__NetBSD_Version__ < 105000000) +typedef unsigned int __socklen_t; /* socket-related datum length */ +#else +# include +#endif + +#if !defined(_XOPEN_SOURCE) || (_XOPEN_SOURCE - 0) >= 500 +#ifndef socklen_t +typedef __socklen_t socklen_t; +#define socklen_t __socklen_t +#endif +#endif /* !_XOPEN_SOURCE || (_XOPEN_SOURCE 0) >= 500 */ #define inet_addr __inet_addr #define inet_aton __inet_aton @@ -102,7 +116,7 @@ int inet_cidr_pton __P((int, const char *, void *, int *)); /*const*/ char *inet_ntoa __P((struct in_addr)); int inet_pton __P((int, const char *, void *)); -const char *inet_ntop __P((int, const void *, char *, size_t)); +const char *inet_ntop __P((int, const void *, char *, socklen_t)); u_int inet_nsap_addr __P((const char *, u_char *, int)); char *inet_nsap_ntoa __P((int, const u_char *, char *)); __END_DECLS Index: src/include/isc/tree.h =================================================================== RCS file: /cvs/misc/bind8/src/include/isc/tree.h,v retrieving revision 1.1.1.2 diff -u -I.cvsignore -u -r1.1.1.2 tree.h --- src/include/isc/tree.h 17 Sep 2003 20:30:52 -0000 1.1.1.2 +++ src/include/isc/tree.h 30 Oct 2003 17:55:07 -0000 @@ -48,11 +48,11 @@ void tree_init __P((tree **)); -tree_t tree_srch __P((tree **, int (*)(), tree_t)); -tree_t tree_add __P((tree **, int (*)(), tree_t, void (*)())); -int tree_delete __P((tree **, int (*)(), tree_t, void (*)())); -int tree_trav __P((tree **, int (*)())); -void tree_mung __P((tree **, void (*)())); +tree_t tree_srch __P((tree **, int (*)__P((tree_t, tree_t)), tree_t)); +tree_t tree_add __P((tree **, int (*)__P((tree_t, tree_t)), tree_t, void (*)__P((tree_t)))); +int tree_delete __P((tree **, int (*)__P((tree_t, tree_t)), tree_t, void (*)__P((tree_t)))); +int tree_trav __P((tree **, int (*)__P((tree_t)))); +void tree_mung __P((tree **, void (*)__P((tree_t)))); #endif /* _TREE_H_INCLUDED */ Index: src/lib/bsd/strerror.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/bsd/strerror.c,v retrieving revision 1.1.1.4 diff -u -I.cvsignore -u -r1.1.1.4 strerror.c --- src/lib/bsd/strerror.c 4 Apr 2002 21:07:29 -0000 1.1.1.4 +++ src/lib/bsd/strerror.c 8 Jul 2002 18:27:42 -0000 @@ -49,19 +49,22 @@ int __strerror_unneeded__; #else -#ifdef USE_SYSERROR_LIST +#if defined(USE_SYSERROR_LIST) extern int sys_nerr; extern char *sys_errlist[]; #endif const char * -isc_strerror(int num) { +isc_strerror(int num) +{ #define UPREFIX "Unknown error: " static char ebuf[40] = UPREFIX; /* 64-bit number + slop */ + char tmp[40]; u_int errnum; char *p, *t; +#ifndef USE_SYSERROR_LIST const char *ret; - char tmp[40]; +#endif errnum = num; /* convert to unsigned */ #ifdef USE_SYSERROR_LIST Index: src/lib/inet/Makefile =================================================================== RCS file: /cvs/misc/bind8/src/lib/inet/Makefile,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 Makefile --- src/lib/inet/Makefile 2 Jan 2005 17:05:54 -0000 1.1.1.5 +++ src/lib/inet/Makefile 2 Jan 2005 19:09:54 -0000 @@ -42,13 +42,15 @@ INSTALL_LIB=-o bin -g bin THREADED= threaded +NEED_INET_ADDR= inet_addr.${O} + SRCS= nsap_addr.c inet_addr.c inet_ntop.c inet_pton.c \ inet_ntoa.c inet_neta.c inet_net_ntop.c inet_net_pton.c \ inet_cidr_ntop.c inet_cidr_pton.c \ inet_lnaof.c inet_makeaddr.c inet_netof.c inet_network.c \ inet_data.c -OBJS= nsap_addr.${O} inet_addr.${O} inet_ntop.${O} inet_pton.${O} \ +OBJS= nsap_addr.${O} ${NEED_INET_ADDR} inet_ntop.${O} inet_pton.${O} \ inet_ntoa.${O} inet_neta.${O} inet_net_ntop.${O} inet_net_pton.${O} \ inet_cidr_ntop.${O} inet_cidr_pton.${O} \ inet_lnaof.${O} inet_makeaddr.${O} inet_netof.${O} inet_network.${O} \ Index: src/lib/inet/inet_ntop.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/inet/inet_ntop.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 inet_ntop.c --- src/lib/inet/inet_ntop.c 6 Jan 2006 17:38:10 -0000 1.1.1.7 +++ src/lib/inet/inet_ntop.c 6 Jan 2006 18:06:57 -0000 @@ -46,8 +46,8 @@ * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. */ -static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size)); -static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size)); +static const char *inet_ntop4 __P((const u_char *src, char *dst, socklen_t size)); +static const char *inet_ntop6 __P((const u_char *src, char *dst, socklen_t size)); /* char * * inet_ntop(af, src, dst, size) @@ -62,7 +62,7 @@ int af; const void *src; char *dst; - size_t size; + socklen_t size; { switch (af) { case AF_INET: @@ -91,7 +91,7 @@ inet_ntop4(src, dst, size) const u_char *src; char *dst; - size_t size; + socklen_t size; { static const char fmt[] = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; @@ -114,7 +114,7 @@ inet_ntop6(src, dst, size) const u_char *src; char *dst; - size_t size; + socklen_t size; { /* * Note that int32_t and int16_t need only be "at least" large enough Index: src/lib/irs/dns_ho.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/irs/dns_ho.c,v retrieving revision 1.1.1.10 diff -u -I.cvsignore -u -r1.1.1.10 dns_ho.c --- src/lib/irs/dns_ho.c 6 Jan 2006 17:38:01 -0000 1.1.1.10 +++ src/lib/irs/dns_ho.c 6 Jan 2006 18:07:10 -0000 @@ -92,8 +92,8 @@ /* Definitions. */ -#define MAXALIASES 35 -#define MAXADDRS 35 +#define MAXALIASES 100 /* XXX was just 35! */ +#define MAXADDRS 100 /* XXX was just 35! */ #define MAXPACKET (65535) /* Maximum TCP message size */ @@ -127,7 +127,7 @@ struct hostent host; char * h_addr_ptrs[MAXADDRS + 1]; char * host_aliases[MAXALIASES]; - char hostbuf[8*1024]; + char hostbuf[MAXPACKET]; /* XXX was just 8KB! */ u_char host_addr[16]; /* IPv4 or IPv6 */ struct __res_state *res; void (*free_res)(void *); Index: src/lib/irs/gen.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/irs/gen.c,v retrieving revision 1.1.1.6 diff -u -I.cvsignore -u -r1.1.1.6 gen.c --- src/lib/irs/gen.c 6 Jan 2006 17:38:01 -0000 1.1.1.6 +++ src/lib/irs/gen.c 6 Jan 2006 18:07:27 -0000 @@ -379,7 +379,15 @@ } static void -init_map_rules(struct gen_p *irs, const char *conf_file) { +init_map_rules(struct gen_p *irs, const char *conf_file) +{ +#ifdef __NetBSD__ + /* + * We don't read irs.conf here. It adds too much complexity to + * the complex situation with "BIND4 in libc" + "BIND8 in userland" + */ + default_map_rules(irs); +#else char line[1024], pattern[40], mapname[20], accname[20], options[100]; FILE *conf; @@ -429,4 +437,5 @@ add_rule(irs, map, acc, options); } fclose(conf); +#endif /* !NetBSD */ } Index: src/lib/irs/getnameinfo.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/irs/getnameinfo.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 getnameinfo.c --- src/lib/irs/getnameinfo.c 2 Jan 2005 17:05:51 -0000 1.1.1.7 +++ src/lib/irs/getnameinfo.c 2 Jan 2005 19:14:50 -0000 @@ -53,6 +53,10 @@ #include +#ifdef USE_IFNAMELINKID +# include +#endif + /* * Note that a_off will be dynamically adjusted so that to be consistent * with the definition of sockaddr_in{,6}. Index: src/lib/irs/irs_data.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/irs/irs_data.c,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 irs_data.c --- src/lib/irs/irs_data.c 2 Jan 2005 17:05:51 -0000 1.1.1.8 +++ src/lib/irs/irs_data.c 2 Jan 2005 19:21:19 -0000 @@ -43,7 +43,9 @@ #include "port_after.h" #include "irs_data.h" -#undef _res +#ifdef _REENTRANT /* just in case.... */ +# undef _res +#endif #if !(__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) #undef h_errno extern int h_errno; Index: src/lib/isc/logging.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/isc/logging.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 logging.c --- src/lib/isc/logging.c 2 Jan 2005 17:05:56 -0000 1.1.1.7 +++ src/lib/isc/logging.c 2 Jan 2005 19:22:14 -0000 @@ -157,7 +157,9 @@ chan->flags |= LOG_CHANNEL_BROKEN; return (NULL); } +#if 0 /* ARGH!!! Don't leave the audit trail writable by the attacker!!! */ (void) fchown(fd, chan->out.file.owner, chan->out.file.group); +#endif chan->out.file.stream = stream; return (stream); Index: src/lib/isc/tree.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/isc/tree.c,v retrieving revision 1.1.1.4 diff -u -I.cvsignore -u -r1.1.1.4 tree.c --- src/lib/isc/tree.c 2 Jan 2005 17:05:56 -0000 1.1.1.4 +++ src/lib/isc/tree.c 2 Jan 2005 19:22:49 -0000 @@ -87,9 +87,9 @@ # define FALSE 0 #endif -static tree * sprout(tree **, tree_t, int *, int (*)(), void (*)()); -static int delete(tree **, int (*)(), tree_t, void (*)(), int *, int *); -static void del(tree **, int *, tree **, void (*)(), int *); +static tree * sprout(tree **, tree_t, int *, int (*)(tree_t, tree_t), void (*)(tree_t)); +static int delete(tree **, int (*)(tree_t, tree_t), tree_t, void (*)(tree_t), int *, int *); +static void del(tree **, int *, tree **, void (*)(tree_t), int *); static void bal_L(tree **, int *); static void bal_R(tree **, int *); @@ -129,7 +129,7 @@ tree_t tree_add(tree **ppr_tree, int (*pfi_compare)(tree_t, tree_t), - tree_t p_user, void (*pfv_uar)()) + tree_t p_user, void (*pfv_uar)(tree_t)) { int i_balance = FALSE; @@ -141,7 +141,7 @@ int tree_delete(tree **ppr_p, int (*pfi_compare)(tree_t, tree_t), - tree_t p_user, void (*pfv_uar)()) + tree_t p_user, void (*pfv_uar)(tree_t)) { int i_balance = FALSE, i_uar_called = FALSE; Index: src/lib/resolv/res_data.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/resolv/res_data.c,v retrieving revision 1.1.1.5 diff -u -I.cvsignore -u -r1.1.1.5 res_data.c --- src/lib/resolv/res_data.c 2 Jan 2005 17:05:57 -0000 1.1.1.5 +++ src/lib/resolv/res_data.c 2 Jan 2005 19:24:15 -0000 @@ -40,7 +40,9 @@ #include #include "port_after.h" -#undef _res +#ifdef _REENTRANT +# undef _res +#endif const char *_res_opcodes[] = { "QUERY", Index: src/lib/resolv/res_debug.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/resolv/res_debug.c,v retrieving revision 1.1.1.11 diff -u -I.cvsignore -u -r1.1.1.11 res_debug.c --- src/lib/resolv/res_debug.c 6 Jan 2006 17:38:14 -0000 1.1.1.11 +++ src/lib/resolv/res_debug.c 6 Jan 2006 18:08:29 -0000 @@ -175,12 +175,12 @@ if (errno != ENODEV) fprintf(file, ";; ns_parserr: %s\n", strerror(errno)); - else if (rrnum > 0 && sflag != 0 && - (statp->pfcode & RES_PRF_HEAD1)) + else if (rrnum > 0 && + ((!statp->pfcode) || statp->pfcode & RES_PRF_HEAD1)) putc('\n', file); goto cleanup; } - if (rrnum == 0 && sflag != 0 && (statp->pfcode & RES_PRF_HEAD1)) + if (rrnum == 0 && ((!statp->pfcode) || statp->pfcode & RES_PRF_HEAD1)) fprintf(file, ";; %s SECTION:\n", p_section(section, opcode)); if (section == ns_s_qd) Index: src/lib/resolv/res_query.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/resolv/res_query.c,v retrieving revision 1.1.1.7 diff -u -I.cvsignore -u -r1.1.1.7 res_query.c --- src/lib/resolv/res_query.c 2 Jan 2005 17:05:57 -0000 1.1.1.7 +++ src/lib/resolv/res_query.c 2 Jan 2005 19:27:35 -0000 @@ -91,10 +91,10 @@ /* Options. Leave them on. */ #define DEBUG -#if PACKETSZ > 1024 +#if PACKETSZ > (64*1024) #define MAXPACKET PACKETSZ #else -#define MAXPACKET 1024 +#define MAXPACKET (64*1024) #endif /* Index: src/lib/resolv/res_send.c =================================================================== RCS file: /cvs/misc/bind8/src/lib/resolv/res_send.c,v retrieving revision 1.1.1.10 diff -u -I.cvsignore -u -r1.1.1.10 res_send.c --- src/lib/resolv/res_send.c 6 Jan 2006 17:38:14 -0000 1.1.1.10 +++ src/lib/resolv/res_send.c 6 Jan 2006 18:17:56 -0000 @@ -441,8 +441,8 @@ Dprint(((statp->options & RES_DEBUG) && getnameinfo(nsap, nsaplen, abuf, sizeof(abuf), NULL, 0, niflags) == 0), - (stdout, ";; Querying server (# %d) address = %s\n", - ns + 1, abuf)); + (stdout, ";; Querying server (# %d) address = %s with %s\n", + ns + 1, abuf, v_circuit ? "TCP" : "UDP")); if (v_circuit) { Index: src/port/netbsd/Makefile.set =================================================================== RCS file: /cvs/misc/bind8/src/port/netbsd/Makefile.set,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 Makefile.set --- src/port/netbsd/Makefile.set 28 Jun 2002 18:29:08 -0000 1.1.1.3 +++ src/port/netbsd/Makefile.set 22 Sep 2003 16:36:31 -0000 @@ -1,10 +1,13 @@ 'CC=cc' -'CDEBUG=-O2 -g' -'DESTBIN=/usr/bin' -'DESTSBIN=/usr/sbin' -'DESTEXEC=/usr/libexec' -'DESTMAN=/usr/share/man' -'DESTHELP=/usr/share/misc' +'CDEBUG=-O2 -pipe -g -Wall -Wshadow -Wswitch -Wreturn-type -Wpointer-arith -Wconversion -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' +'LDFLAGS=-g -O2 -pipe -static' +'DESTBIN=${PREFIX}/bin' +'DESTSBIN=${PREFIX}/sbin' +'DESTINC=${PREFIX}/include/bind' +'DESTLIB=${PREFIX}/lib' +'DESTEXEC=${PREFIX}/libexec' +'DESTMAN=${PREFIX}/share/man' +'DESTHELP=${PREFIX}/share/doc/bind8' 'DESTETC=/etc' 'DESTRUN=/var/run' 'LEX=lex -I' Index: src/port/netbsd/bin/probe_ipv6 =================================================================== RCS file: /cvs/misc/bind8/src/port/netbsd/bin/probe_ipv6,v retrieving revision 1.1.1.2 diff -u -I.cvsignore -u -r1.1.1.2 probe_ipv6 --- src/port/netbsd/bin/probe_ipv6 17 Sep 2003 20:31:15 -0000 1.1.1.2 +++ src/port/netbsd/bin/probe_ipv6 17 Sep 2003 20:38:40 -0000 @@ -35,10 +35,10 @@ EOF -if ${CC} -c tmp$$a.c > /dev/null 2>&1 +if ${CC} ${CPPFLAGS} -c tmp$$a.c > /dev/null 2>&1 then echo "#define HAS_INET6_STRUCTS" >> ${new} - if ${CC} -c tmp$$b.c > /dev/null 2>&1 + if ${CC} ${CPPFLAGS} -c tmp$$b.c > /dev/null 2>&1 then : else Index: src/port/netbsd/include/.cvsignore =================================================================== RCS file: src/port/netbsd/include/.cvsignore diff -N src/port/netbsd/include/.cvsignore --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/port/netbsd/include/.cvsignore 15 Nov 1999 00:52:54 -0000 @@ -0,0 +1 @@ +port_ipv6.h Index: src/port/netbsd/include/port_after.h =================================================================== RCS file: /cvs/misc/bind8/src/port/netbsd/include/port_after.h,v retrieving revision 1.1.1.8 diff -u -I.cvsignore -u -r1.1.1.8 port_after.h --- src/port/netbsd/include/port_after.h 17 Sep 2003 20:31:15 -0000 1.1.1.8 +++ src/port/netbsd/include/port_after.h 17 Sep 2003 20:38:40 -0000 @@ -2,6 +2,7 @@ #define PORT_AFTER_H #define USE_POSIX #define POSIX_SIGNALS +#define USE_SYSERROR_LIST #define USE_UTIME #define USE_WAITPID #define HAVE_GETRUSAGE Index: src/port/netbsd/include/port_before.h =================================================================== RCS file: /cvs/misc/bind8/src/port/netbsd/include/port_before.h,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 port_before.h --- src/port/netbsd/include/port_before.h 4 Apr 2002 21:08:00 -0000 1.1.1.3 +++ src/port/netbsd/include/port_before.h 8 Jul 2002 19:02:18 -0000 @@ -1,7 +1,9 @@ +#if 0 /* would cause libc collisions! */ #define WANT_IRS_NIS #define WANT_IRS_PW #define HAVE_PW_CLASS #define WANT_IRS_GR +#endif #define SIG_FN void #define ISC_SOCKLEN_T int #if defined(HAS_PTHREADS) && defined(_REENTRANT) @@ -18,3 +20,6 @@ #else #define ISC_FORMAT_PRINTF(fmt, args) #endif + +#define HAS_INET6_STRUCTS +#define NEED_IN6ADDR_ANY Index: src/port/netbsd/include/prand_conf.h =================================================================== RCS file: /cvs/misc/bind8/src/port/netbsd/include/prand_conf.h,v retrieving revision 1.1.1.3 diff -u -I.cvsignore -u -r1.1.1.3 prand_conf.h --- src/port/netbsd/include/prand_conf.h 17 Sep 2003 20:31:15 -0000 1.1.1.3 +++ src/port/netbsd/include/prand_conf.h 17 Sep 2003 21:05:35 -0000 @@ -12,9 +12,9 @@ "/usr/sbin/arp -an 2>&1", "/usr/bin/netstat -an 2>&1", "/bin/df 2>&1", - "/usr/bin/dig com. soa +ti=1 +retry=0 2>&1", + "/usr/bin/host -dv -t SOA com. 2>&1", "/usr/bin/netstat -an 2>&1", - "/usr/bin/dig . soa +ti=1 +retry=0 2>&1", + "/usr/bin/host -dv -t SOA . 2>&1", "/usr/sbin/iostat 2>&1", "/usr/bin/vmstat 2>&1", "/usr/bin/w 2>&1", .