diff options
Diffstat (limited to 'usr.sbin/named')
46 files changed, 554 insertions, 1040 deletions
diff --git a/usr.sbin/named/Makefile b/usr.sbin/named/Makefile new file mode 100644 index 0000000..b9abc6b --- /dev/null +++ b/usr.sbin/named/Makefile @@ -0,0 +1,80 @@ +# +# @(#)Makefile 5.8 (Berkeley) 7/28/90 +# + +## ++Copyright++ 1985, 1989 +## - +## Copyright (c) 1985, 1989 +## 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. +## - +## Portions Copyright (c) 1993 by Digital Equipment Corporation. +## +## Permission to use, copy, modify, and distribute this software for any +## purpose with or without fee is hereby granted, provided that the above +## copyright notice and this permission notice appear in all copies, and that +## the name of Digital Equipment Corporation not be used in advertising or +## publicity pertaining to distribution of the document or software without +## specific, written prior permission. +## +## THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL +## WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES +## OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT +## CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +## PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS +## ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +## SOFTWARE. +## - +## --Copyright-- + +PROG= named +MAN8= named.8 +LDADD= -lutil +SRCS= db_dump.c db_load.c db_lookup.c db_reload.c db_save.c db_update.c \ + db_secure.c db_glue.c \ + ns_forw.c ns_init.c ns_main.c ns_maint.c ns_req.c ns_resp.c \ + ns_sort.c ns_stats.c ns_validate.c ns_ncache.c \ + storage.c dmalloc.c tree.c +OBJS+= version.o +CLEANFILES+=version.c version.o +SUBDIR= tools xfer + +VER = 4.9.3-REL + +version.c: ${.CURDIR}/Version.c ${.CURDIR}/Makefile ${SRCS} + (LC_TIME=; export LC_TIME; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \ + h=`hostname` t=`date`; \ + sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + < ${.CURDIR}/Version.c > version.c) + +.include <bsd.prog.mk> + diff --git a/usr.sbin/named/db_defs.h b/usr.sbin/named/db_defs.h index c4c48ed..115615f 100644 --- a/usr.sbin/named/db_defs.h +++ b/usr.sbin/named/db_defs.h @@ -1,6 +1,6 @@ /* * from db.h 4.16 (Berkeley) 6/1/90 - * $Id: db_defs.h,v 8.3 1995/06/19 20:55:40 vixie Exp $ + * $Id: db_defs.h,v 1.2 1995/05/30 03:48:34 rgrimes Exp $ */ /* @@ -8,7 +8,7 @@ * - * Copyright (c) 1985, 1990 * 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: @@ -24,7 +24,7 @@ * 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 @@ -38,14 +38,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/db_dump.c b/usr.sbin/named/db_dump.c index 36fe713..27ffadd 100644 --- a/usr.sbin/named/db_dump.c +++ b/usr.sbin/named/db_dump.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_dump.c 4.33 (Berkeley) 3/3/91"; -static char rcsid[] = "$Id: db_dump.c,v 8.8 1995/12/06 20:34:38 vixie Exp $"; +static char rcsid[] = "$Id: db_dump.c,v 1.4 1995/08/20 21:18:14 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_dump.c,v 8.8 1995/12/06 20:34:38 vixie Exp $"; * - * Copyright (c) 1986, 1988, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_dump.c,v 8.8 1995/12/06 20:34:38 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_dump.c,v 8.8 1995/12/06 20:34:38 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -61,6 +61,7 @@ static char rcsid[] = "$Id: db_dump.c,v 8.8 1995/12/06 20:34:38 vixie Exp $"; #include <sys/param.h> #include <sys/stat.h> #include <netinet/in.h> +#include <netiso/iso.h> #include <arpa/nameser.h> #include <arpa/inet.h> #include <netdb.h> @@ -259,7 +260,7 @@ doadump() } #ifdef ALLOW_UPDATES -/* Create a disk database to back up zones +/* Create a disk database to back up zones */ void zonedump(zp) @@ -359,6 +360,7 @@ db_dump(htp, fp, zone, origin) u_int32_t n; u_int32_t addr; int j, i; + struct iso_addr isoa; register u_char *cp; u_char *end; char *proto, *sep; @@ -555,9 +557,12 @@ db_dump(htp, fp, zone, origin) break; case T_NSAP: - (void) fputs(inet_nsap_ntoa(dp->d_size, - dp->d_data, NULL), - fp); + isoa.isoa_len = dp->d_size; + if (isoa.isoa_len > sizeof(isoa.isoa_genaddr)) + isoa.isoa_len = sizeof(isoa.isoa_genaddr); + bcopy(dp->d_data, isoa.isoa_genaddr, + isoa.isoa_len); + (void) fputs(iso_ntoa(&isoa), fp); break; #ifdef LOC_RR case T_LOC: @@ -579,11 +584,11 @@ db_dump(htp, fp, zone, origin) break; case T_WKS: - GETLONG(addr, cp); - addr = htonl(addr); + GETLONG(addr, cp); + addr = htonl(addr); fputs(inet_ntoa(*(struct in_addr *)&addr), fp); proto = protocolname(*cp); - cp += sizeof(char); + cp += sizeof(char); fprintf(fp, "%s ", proto); i = 0; while(cp < (u_char *)dp->d_data + dp->d_size) { @@ -594,7 +599,7 @@ db_dump(htp, fp, zone, origin) servicename(i, proto)); j <<= 1; } while (++i & 07); - } + } break; case T_MINFO: @@ -713,8 +718,8 @@ static int32_t Ceor, Csum, Crot, word, bcount; #define AddToBuf(bufp, c) **bufp = c; (*bufp)++; #define times85(x) ((((((x<<2)+x)<<2)+x)<<2)+x) -/* Decode ASCII-encoded byte c into binary representation and - * place into *bufp, advancing bufp +/* Decode ASCII-encoded byte c into binary representation and + * place into *bufp, advancing bufp */ static int byte_atob(c, bufp) @@ -842,8 +847,8 @@ byte_btoa(c, bufp) } else { register int tmp = 0; register int32_t tmpword = word; - - if (tmpword < 0) { + + if (tmpword < 0) { /* Because some don't support unsigned long */ tmp = 32; tmpword -= (int32_t)(85 * 85 * 85 * 85 * 32); diff --git a/usr.sbin/named/db_func.h b/usr.sbin/named/db_func.h index e0b2a8f..78327d0 100644 --- a/usr.sbin/named/db_func.h +++ b/usr.sbin/named/db_func.h @@ -1,6 +1,6 @@ /* db_proc.h - prototypes for functions in db_*.c * - * $Id: db_func.h,v 8.7 1995/12/22 10:20:30 vixie Exp $ + * $Id: db_func.h,v 1.3 1995/08/20 21:18:16 peter Exp $ */ /* ++from db_update.c++ */ @@ -85,7 +85,7 @@ extern int getdtablesize __P((void)); extern struct databuf *rm_datum __P((struct databuf *, struct namebuf *, struct databuf *)); -extern struct namebuf *rm_name __P((struct namebuf *, +extern struct namebuf *rm_name __P((struct namebuf *, struct namebuf **, struct namebuf *)); #ifdef INVQ diff --git a/usr.sbin/named/db_glob.h b/usr.sbin/named/db_glob.h index b339b5b..58c514f 100644 --- a/usr.sbin/named/db_glob.h +++ b/usr.sbin/named/db_glob.h @@ -1,6 +1,6 @@ /* * from db.h 4.16 (Berkeley) 6/1/90 - * $Id: db_glob.h,v 8.3 1995/12/06 20:34:38 vixie Exp $ + * $Id: db_glob.h,v 1.2 1995/05/30 03:48:37 rgrimes Exp $ */ /* @@ -8,7 +8,7 @@ * - * Copyright (c) 1985, 1990 * 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: @@ -24,7 +24,7 @@ * 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 @@ -38,14 +38,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/db_glue.c b/usr.sbin/named/db_glue.c index a3a7050..a01184c 100644 --- a/usr.sbin/named/db_glue.c +++ b/usr.sbin/named/db_glue.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_glue.c 4.4 (Berkeley) 6/1/90"; -static char rcsid[] = "$Id: db_glue.c,v 8.10 1995/12/22 10:20:30 vixie Exp $"; +static char rcsid[] = "$Id: db_glue.c,v 1.4 1995/10/23 11:11:42 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_glue.c,v 8.10 1995/12/22 10:20:30 vixie Exp $"; * - * Copyright (c) 1986, 1988 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_glue.c,v 8.10 1995/12/22 10:20:30 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_glue.c,v 8.10 1995/12/22 10:20:30 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -353,7 +353,7 @@ getdtablesize() { #if defined(USE_POSIX) int j = (int) sysconf(_SC_OPEN_MAX); - + if (j >= 0) return (j); #endif /* POSIX */ @@ -975,7 +975,7 @@ loc_aton(ascii, binary) altsign = -1; cp++; } - + if (*cp == '+') cp++; @@ -1004,7 +1004,7 @@ loc_aton(ascii, binary) goto defaults; siz = precsize_aton(&cp); - + while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */ cp++; @@ -1037,7 +1037,7 @@ loc_aton(ascii, binary) PUTLONG(latit,bcp); PUTLONG(longit,bcp); PUTLONG(alt,bcp); - + return (16); /* size of RR in octets */ } @@ -1063,7 +1063,7 @@ loc_ntoa(binary,ascii) int32_t latval, longval, altval; u_int32_t templ; u_int8_t sizeval, hpval, vpval, versionval; - + char *sizestr, *hpstr, *vpstr; rcp = binary; diff --git a/usr.sbin/named/db_load.c b/usr.sbin/named/db_load.c index 357f4f8..fbe8466 100644 --- a/usr.sbin/named/db_load.c +++ b/usr.sbin/named/db_load.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_load.c 4.38 (Berkeley) 3/2/91"; -static char rcsid[] = "$Id: db_load.c,v 8.15 1995/12/31 23:28:17 vixie Exp $"; +static char rcsid[] = "$Id: db_load.c,v 1.4 1995/08/20 21:18:22 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_load.c,v 8.15 1995/12/31 23:28:17 vixie Exp $"; * - * Copyright (c) 1986, 1988, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_load.c,v 8.15 1995/12/31 23:28:17 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_load.c,v 8.15 1995/12/31 23:28:17 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -65,6 +65,7 @@ static char rcsid[] = "$Id: db_load.c,v 8.15 1995/12/31 23:28:17 vixie Exp $"; #include <sys/param.h> #include <sys/stat.h> #include <netinet/in.h> +#include <netiso/iso.h> #include <arpa/nameser.h> #include <arpa/inet.h> #include <stdio.h> @@ -181,6 +182,7 @@ db_load(filename, in_origin, zp, def_domain) int c, class, type, dbflags, dataflags, multiline; u_int32_t ttl; struct databuf *dp; + struct iso_addr *isoa; FILE *fp; int slineno, i, errs, didinclude; register u_int32_t n; @@ -295,7 +297,7 @@ db_load(filename, in_origin, zp, def_domain) n = 0; do { if (n > (INT_MAX - (*cp - '0')) / 10) { - syslog(LOG_INFO, + syslog(LOG_INFO, "%s: line %d: number > %lu\n", filename, lineno, (u_long)INT_MAX); n = INT_MAX; @@ -490,7 +492,7 @@ db_load(filename, in_origin, zp, def_domain) n = (u_int32_t) zp->z_refresh; PUTLONG(n, cp); if (zp->z_type == Z_SECONDARY -#if defined(STUBS) +#if defined(STUBS) || zp->z_type == Z_STUB #endif ) { @@ -680,12 +682,13 @@ db_load(filename, in_origin, zp, def_domain) break; case T_NSAP: - n = inet_nsap_addr(buf, (u_char *)data, - sizeof data); - if (n == 0) - goto err; - endline(fp); - break; + isoa = iso_addr(buf); + if (!isoa) + goto err; + n = isoa->isoa_len; + bcopy(isoa->isoa_genaddr, data, n); + endline(fp); + break; #ifdef LOC_RR case T_LOC: cp = buf + (n = strlen(buf)); @@ -765,7 +768,7 @@ db_load(filename, in_origin, zp, def_domain) != OK) { #ifdef DEBUG if (debug && (c != DATAEXISTS)) - fprintf(ddt, "update failed %s %d\n", + fprintf(ddt, "update failed %s %d\n", domain, type); #endif free((char*) dp); @@ -858,7 +861,7 @@ gettoken(fp, src) return (ORIGIN); } syslog(LOG_NOTICE, - "%s: line %d: Unknown $ option: $%s\n", + "%s: line %d: Unknown $ option: $%s\n", src, lineno, op); return (ERROR); @@ -1104,8 +1107,8 @@ getnum(fp, src, opt) if (getnum_error) return (0); if (m > 9999) { - syslog(LOG_INFO, - "%s:%d: number after the decimal point exceeds 9999", + syslog(LOG_INFO, + "%s:%d: number after the decimal point exceeds 9999", src, lineno); getnum_error = 1; return (0); @@ -1316,7 +1319,7 @@ get_netlist(fp, netlistp, allow, print_tag) if (!inet_aton(buf, &ntp->my_addr)) { syslog(LOG_INFO, "%s contains bogus element (%s)", print_tag, buf); - continue; + continue; } if (maskp) { if (!inet_aton(maskp, &ina)) { @@ -1352,7 +1355,7 @@ get_netlist(fp, netlistp, allow, print_tag) } if (ntp) free((char *)ntp); - + dprintf(1, (ddt, "\n")); #ifdef DEBUG if (debug > 2) diff --git a/usr.sbin/named/db_lookup.c b/usr.sbin/named/db_lookup.c index e46d37c..b425f2b 100644 --- a/usr.sbin/named/db_lookup.c +++ b/usr.sbin/named/db_lookup.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_lookup.c 4.18 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: db_lookup.c,v 8.3 1995/12/06 20:34:38 vixie Exp $"; +static char rcsid[] = "$Id: db_lookup.c,v 1.3 1995/08/20 21:18:24 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_lookup.c,v 8.3 1995/12/06 20:34:38 vixie Exp $"; * - * Copyright (c) 1986 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_lookup.c,v 8.3 1995/12/06 20:34:38 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_lookup.c,v 8.3 1995/12/06 20:34:38 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -72,7 +72,7 @@ static char rcsid[] = "$Id: db_lookup.c,v 8.3 1995/12/06 20:34:38 vixie Exp $"; #include "named.h" -/* +/* * Lookup 'name' and return a pointer to the namebuf; * NULL otherwise. If 'insert', insert name into tables. * Wildcard lookups are handled. @@ -104,7 +104,7 @@ nlookup(name, htpp, fname, insert) return (np); if ((htp = np->n_hash) == NULL) { if (!insert) { - if (np->n_dname[0] == '*' && + if (np->n_dname[0] == '*' && np->n_dname[1] == '\0') *fname = name; return (np); diff --git a/usr.sbin/named/db_reload.c b/usr.sbin/named/db_reload.c index ca42008..1145e4a 100644 --- a/usr.sbin/named/db_reload.c +++ b/usr.sbin/named/db_reload.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_reload.c 4.22 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: db_reload.c,v 8.1 1994/12/15 06:24:14 vixie Exp $"; +static char rcsid[] = "$Id: db_reload.c,v 1.1.1.1 1994/09/22 19:46:14 pst Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_reload.c,v 8.1 1994/12/15 06:24:14 vixie Exp $"; * - * Copyright (c) 1986, 1988 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_reload.c,v 8.1 1994/12/15 06:24:14 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_reload.c,v 8.1 1994/12/15 06:24:14 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/db_save.c b/usr.sbin/named/db_save.c index 868ab1f..61471ce 100644 --- a/usr.sbin/named/db_save.c +++ b/usr.sbin/named/db_save.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_save.c 4.16 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: db_save.c,v 8.2 1995/06/29 09:26:17 vixie Exp $"; +static char rcsid[] = "$Id: db_save.c,v 1.2 1995/05/30 03:48:42 rgrimes Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_save.c,v 8.2 1995/06/29 09:26:17 vixie Exp $"; * - * Copyright (c) 1986 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_save.c,v 8.2 1995/06/29 09:26:17 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_save.c,v 8.2 1995/06/29 09:26:17 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -113,7 +113,7 @@ savedata(class, type, ttl, data, size) register struct databuf *dp; int bytes = (type == T_NS) ? DATASIZE(size)+INT32SZ : DATASIZE(size); - dp = (struct databuf *) + dp = (struct databuf *) #ifdef DMALLOC dmalloc(file, line, bytes) #else diff --git a/usr.sbin/named/db_secure.c b/usr.sbin/named/db_secure.c index 870f8c5..cc48775 100644 --- a/usr.sbin/named/db_secure.c +++ b/usr.sbin/named/db_secure.c @@ -1,5 +1,5 @@ #ifndef LINT -static char rcsid[] = "$Id: db_secure.c,v 8.5 1995/12/06 20:34:38 vixie Exp $"; +static char rcsid[] = "$Id: db_secure.c,v 1.3 1995/08/20 21:18:29 peter Exp $"; #endif /* this file was contributed by Gregory Neil Shapiro of WPI in August 1993 */ @@ -80,10 +80,10 @@ build_secure_netlist(zp) } if (!inet_aton(buf, &ntp->my_addr)) { syslog(LOG_INFO, - "build_secure_netlist (%s): Bad address: %s", + "build_secure_netlist (%s): Bad address: %s", zp->z_origin, buf); errs++; - continue; + continue; } if (maskptr && *maskptr) { if (*maskptr == 'h' || *maskptr == 'H') { @@ -99,13 +99,13 @@ build_secure_netlist(zp) zp->z_origin, maskptr); errs++; continue; - } - } + } + } } else { ntp->mask = net_mask(ntp->my_addr); } if (ntp->my_addr.s_addr & ~(ntp->mask)) { - syslog(LOG_INFO, + syslog(LOG_INFO, "build_secure_netlist (%s): addr (%s) is not in mask (%#lx)", zp->z_origin, inet_ntoa(ntp->my_addr), @@ -117,7 +117,7 @@ build_secure_netlist(zp) /* Check for duplicates */ if (addr_on_netlist(ntp->my_addr, *netlistp)) { - syslog(LOG_INFO, + syslog(LOG_INFO, "build_secure_netlist (%s): duplicate address %s\n", zp->z_origin, inet_ntoa(ntp->my_addr)); errs++; diff --git a/usr.sbin/named/db_update.c b/usr.sbin/named/db_update.c index 523f967..90076c5 100644 --- a/usr.sbin/named/db_update.c +++ b/usr.sbin/named/db_update.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)db_update.c 4.28 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: db_update.c,v 8.7 1995/12/06 20:34:38 vixie Exp $"; +static char rcsid[] = "$Id: db_update.c,v 1.3 1995/08/20 21:18:31 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: db_update.c,v 8.7 1995/12/06 20:34:38 vixie Exp $"; * - * Copyright (c) 1986, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: db_update.c,v 8.7 1995/12/06 20:34:38 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: db_update.c,v 8.7 1995/12/06 20:34:38 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -347,7 +347,7 @@ db_update(name, odp, newdp, flags, htp) * remove any data for this domain with * the same class that isn't as credable */ - if (newdp->d_cred == DB_C_ZONE && + if (newdp->d_cred == DB_C_ZONE && newdp->d_cred > dp->d_cred) /* better credibility and the old datum * was not from a zone file. remove @@ -367,13 +367,13 @@ db_update(name, odp, newdp, flags, htp) /* if the new data is authoritative but * but isn't as credible, reject it. */ - if (newdp->d_cred == DB_C_ZONE && + if (newdp->d_cred == DB_C_ZONE && dp->d_cred == DB_C_ZONE) { /* Both records are from a zone file. * If their credibility levels differ, * we're dealing with a zone cut. The * record with lower clev is from the - * upper zone's file and is therefore + * upper zone's file and is therefore * glue. */ if (newdp->d_clev < dp->d_clev) { @@ -448,7 +448,7 @@ db_update(name, odp, newdp, flags, htp) * If their credibility levels differ, * we're dealing with a zone cut. The * record with lower clev is from the - * upper zone's file and is therefore + * upper zone's file and is therefore * glue. */ @@ -700,7 +700,7 @@ db_cmp(dp1, dp2) cp1 += strlen((char *)cp1) + 1; cp2 += strlen((char *)cp2) + 1; return (bcmp(cp1, cp2, INT32SZ * 5)); - + case T_MX: case T_AFSDB: case T_RT: @@ -720,7 +720,7 @@ db_cmp(dp1, dp2) cp1 += strlen((char *)cp1) + 1; cp2 += strlen((char *)cp2) + 1; return (strcasecmp((char *)cp1, (char *)cp2)); - + case T_TXT: case T_X25: if (dp1->d_size != dp2->d_size) diff --git a/usr.sbin/named/dmalloc.c b/usr.sbin/named/dmalloc.c index 3c42a52..54b23ed 100644 --- a/usr.sbin/named/dmalloc.c +++ b/usr.sbin/named/dmalloc.c @@ -3,7 +3,7 @@ * vix 24mar92 [added size calcs, improved printout] * vix 22mar92 [original work] * - * $Id: dmalloc.c,v 8.2 1995/12/06 20:34:38 vixie Exp $ + * $Id: dmalloc.c,v 1.3 1995/05/30 03:48:45 rgrimes Exp $ */ /* @@ -11,7 +11,7 @@ * - * Copyright (c) 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: @@ -27,7 +27,7 @@ * 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 @@ -41,14 +41,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -63,8 +63,6 @@ #include <stdio.h> #include <signal.h> -#include "../conf/portability.h" -#include "../conf/options.h" #ifdef DMALLOC diff --git a/usr.sbin/named/dmalloc.h b/usr.sbin/named/dmalloc.h index 9d0b44a..6d89ab8 100644 --- a/usr.sbin/named/dmalloc.h +++ b/usr.sbin/named/dmalloc.h @@ -1,15 +1,15 @@ /* dmalloc - debugging layer on top of malloc * vix 22mar92 [written] * - * $Id: dmalloc.h,v 8.1 1994/12/15 06:24:14 vixie Exp $ + * $Id: dmalloc.h,v 1.1.1.1 1994/09/22 19:46:14 pst Exp $ */ /* * ++Copyright++ * - - * Copyright (c) + * Copyright (c) * 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: @@ -25,7 +25,7 @@ * 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 @@ -39,14 +39,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/named.h b/usr.sbin/named/named.h index 0575a5c..e3e795d 100644 --- a/usr.sbin/named/named.h +++ b/usr.sbin/named/named.h @@ -1,11 +1,11 @@ /* named.h - include the local definitions in the right order * vix 28aug93 [original] * - * $Id: named.h,v 8.1 1994/12/15 06:24:14 vixie Exp $ + * $Id: named.h,v 1.1 1993/09/08 04:57:40 vixie Exp $ */ -#include "../conf/portability.h" -#include "../conf/options.h" +#include "options.h" +#include "portability.h" #include "pathnames.h" diff --git a/usr.sbin/named/ns_defs.h b/usr.sbin/named/ns_defs.h index 054ff81..a6615bf 100644 --- a/usr.sbin/named/ns_defs.h +++ b/usr.sbin/named/ns_defs.h @@ -1,6 +1,6 @@ /* * from ns.h 4.33 (Berkeley) 8/23/90 - * $Id: ns_defs.h,v 8.4 1995/12/22 10:20:30 vixie Exp $ + * $Id: ns_defs.h,v 1.3 1995/08/20 21:18:34 peter Exp $ */ /* @@ -8,7 +8,7 @@ * - * Copyright (c) 1986 * 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: @@ -24,7 +24,7 @@ * 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 @@ -38,14 +38,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -67,7 +67,7 @@ * larger land on 32-bit boundaries; smaller structure members have been * deliberately shuffled and smaller integer sizes chosen where possible * to make sure this happens. This is all meant to avoid structure member - * padding which can cost a _lot_ of memory when you have hundreds of + * padding which can cost a _lot_ of memory when you have hundreds of * thousands of entries in your cache. */ @@ -136,7 +136,7 @@ struct zoneinfo { int z_class; /* class of zone */ #ifdef SECURE_ZONES struct netinfo *secure_nets; /* list of secure networks for zone */ -#endif +#endif #ifdef BIND_NOTIFY /* XXX - this will have to move to the name when we do !SOA notify */ struct notify *z_notifylist; /* list of servers we should notify */ @@ -338,11 +338,11 @@ struct nameser { #endif u_int8_t xfers; /* #/xfers running right now */ }; - + #ifdef NCACHE #define NOERROR_NODATA 6 /* only used internally by the server, used for - * -ve $ing non-existence of records. 6 is not + * -ve $ing non-existence of records. 6 is not * a code used as yet anyway. anant@isi.edu */ #define NTTL 600 /* ttl for negative data: 10 minutes? */ diff --git a/usr.sbin/named/ns_forw.c b/usr.sbin/named/ns_forw.c index a756a78..9349a9e 100644 --- a/usr.sbin/named/ns_forw.c +++ b/usr.sbin/named/ns_forw.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_forw.c 4.32 (Berkeley) 3/3/91"; -static char rcsid[] = "$Id: ns_forw.c,v 8.9 1995/12/22 10:20:30 vixie Exp $"; +static char rcsid[] = "$Id: ns_forw.c,v 1.4 1995/10/23 11:11:44 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_forw.c,v 8.9 1995/12/22 10:20:30 vixie Exp $"; * - * Copyright (c) 1986 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_forw.c,v 8.9 1995/12/22 10:20:30 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_forw.c,v 8.9 1995/12/22 10:20:30 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -74,7 +74,7 @@ static char rcsid[] = "$Id: ns_forw.c,v 8.9 1995/12/22 10:20:30 vixie Exp $"; /* * Forward the query to get the answer since its not in the database. * Returns FW_OK if a request struct is allocated and the query sent. - * Returns FW_DUP if this is a duplicate of a pending request. + * Returns FW_DUP if this is a duplicate of a pending request. * Returns FW_NOSERVER if there were no addresses for the nameservers. * Returns FW_SERVFAIL on malloc error or if asked to do something * dangerous, such as fwd to ourselves or fwd to the host that asked us. diff --git a/usr.sbin/named/ns_glob.h b/usr.sbin/named/ns_glob.h index 708d771..5deeb76 100644 --- a/usr.sbin/named/ns_glob.h +++ b/usr.sbin/named/ns_glob.h @@ -1,6 +1,6 @@ /* * from ns.h 4.33 (Berkeley) 8/23/90 - * $Id: ns_glob.h,v 8.6 1995/12/22 10:20:30 vixie Exp $ + * $Id: ns_glob.h,v 1.4 1995/10/23 11:11:45 peter Exp $ */ /* @@ -8,7 +8,7 @@ * - * Copyright (c) 1986 * 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: @@ -24,7 +24,7 @@ * 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 @@ -38,14 +38,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -133,7 +133,7 @@ DECL int needStatsDump INIT(0); DECL int needToExit INIT(0); #endif /* ALLOW_UPDATES */ #ifdef XSTATS - /* need to exit + /* need to exit * set by shutdown signal handler * (onintr) */ diff --git a/usr.sbin/named/ns_init.c b/usr.sbin/named/ns_init.c index f5f4b51..d710080 100644 --- a/usr.sbin/named/ns_init.c +++ b/usr.sbin/named/ns_init.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_init.c 4.38 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: ns_init.c,v 8.12 1995/12/29 07:16:18 vixie Exp $"; +static char rcsid[] = "$Id: ns_init.c,v 1.4 1995/10/23 11:11:46 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_init.c,v 8.12 1995/12/29 07:16:18 vixie Exp $"; * - * Copyright (c) 1986, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_init.c,v 8.12 1995/12/29 07:16:18 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_init.c,v 8.12 1995/12/29 07:16:18 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -457,7 +457,7 @@ boot_read(filename, includefile) */ if (zp->z_source && !strcmp(source, zp->z_source) && - !(zp->z_flags & Z_INCLUDE) && + !(zp->z_flags & Z_INCLUDE) && stat(zp->z_source, &f_time) != -1 && zp->z_ftime == f_time.st_mtime) { dprintf(1, (ddt, "cache is up to date\n")); @@ -514,7 +514,7 @@ boot_read(filename, includefile) */ if (zp->z_source && !strcmp(source, zp->z_source) && - !(zp->z_flags & Z_INCLUDE) && + !(zp->z_flags & Z_INCLUDE) && stat(zp->z_source, &f_time) != -1 && zp->z_ftime == f_time.st_mtime) { dprintf(1, (ddt, "zone is up to date\n")); @@ -608,8 +608,8 @@ boot_read(filename, includefile) zoneinit(zp); #ifdef FORCED_RELOAD else { - /* - ** Force secondary to try transfer right away + /* + ** Force secondary to try transfer right away ** after SIGHUP. */ if (!(zp->z_flags & (Z_QSERIAL|Z_XFER_RUNNING)) @@ -786,7 +786,7 @@ get_forwarders(fp) } else { syslog(LOG_NOTICE, "'%s' (ignored, NOT dotted quad)", buf); - continue; + continue; } #ifdef FWD_LOOP if (aIsUs(ftp->fwdaddr.sin_addr)) { @@ -810,7 +810,7 @@ get_forwarders(fp) } if (ftp) free((char *)ftp); - + #ifdef SLAVE_FORWARD /* ** Set the slave retry time to 60 seconds total divided @@ -849,7 +849,7 @@ free_forwarders() } static struct zoneinfo * -find_zone(name, type, class) +find_zone(name, type, class) char *name; int type, class; { @@ -869,7 +869,7 @@ find_zone(name, type, class) #ifdef DEBUG /* prints out the content of zones */ static void -content_zone(end) +content_zone(end) int end; { int i; diff --git a/usr.sbin/named/ns_main.c b/usr.sbin/named/ns_main.c index add9fe4..13576d7 100644 --- a/usr.sbin/named/ns_main.c +++ b/usr.sbin/named/ns_main.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_main.c 4.55 (Berkeley) 7/1/91"; -static char rcsid[] = "$Id: ns_main.c,v 8.13 1996/01/09 20:23:55 vixie Exp $"; +static char rcsid[] = "$Id: ns_main.c,v 1.5 1996/01/01 08:44:53 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_main.c,v 8.13 1996/01/09 20:23:55 vixie Exp $"; * - * Copyright (c) 1986, 1989, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_main.c,v 8.13 1996/01/09 20:23:55 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_main.c,v 8.13 1996/01/09 20:23:55 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -121,8 +121,10 @@ static struct sockaddr_in nsaddr; static u_int16_t local_ns_port, /* our service port */ nsid_state; static fd_set mask; /* open descriptors */ +#ifdef OLD_SETPROCTITLE static char **Argv = NULL; static char *LastArg = NULL; /* end of argv */ +#endif static struct qstream *sqadd __P((void)); static void sq_query __P((struct qstream *)), @@ -204,6 +206,7 @@ main(argc, argv, envp) gettime(&tt); srand(((unsigned)getpid()) + (unsigned)tt.tv_usec); +#ifdef OLD_SETPROCTITLE /* ** Save start and extent of argv for ns_setproctitle(). */ @@ -212,6 +215,7 @@ main(argc, argv, envp) while (*argp) argp++; LastArg = argp[-1] + strlen(argp[-1]); +#endif (void) umask(022); /* XXX - should use getopt here */ @@ -297,7 +301,7 @@ main(argc, argv, envp) fprintf(ddt, "Debug turned ON, Level %d\n",debug); fprintf(ddt, "Version = %s\n", Version); fprintf(ddt, "bootfile = %s\n", bootfile); - } + } #endif n = 0; @@ -346,7 +350,7 @@ main(argc, argv, envp) if ((vs = socket(AF_INET, SOCK_STREAM, 0)) < 0) { syslog(LOG_ERR, "socket(SOCK_STREAM): %m"); exit(1); - } + } if (setsockopt(vs, SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) != 0) { @@ -619,7 +623,7 @@ main(argc, argv, envp) if (retryqp != NULL) { gettime(&tt); /* - ** The tv_sec field might be unsigned + ** The tv_sec field might be unsigned ** and thus cannot be negative. */ if ((int32_t) retryqp->q_time <= tt.tv_sec) { @@ -652,8 +656,7 @@ main(argc, argv, envp) for (udpcnt = 0; udpcnt < 42; udpcnt++) { /*XXX*/ int from_len = sizeof(from_addr); - if ((n = recvfrom(dqp->dq_dfd, (char *)buf, - MIN(PACKETSZ, sizeof buf), 0, + if ((n = recvfrom(dqp->dq_dfd, (char *)buf, sizeof(buf), 0, (struct sockaddr *)&from_addr, &from_len)) < 0) { #if defined(SPURIOUS_ECONNREFUSED) @@ -851,7 +854,7 @@ main(argc, argv, envp) sp->s_bufsize = sp->s_size; } } - sp->s_bufp = sp->s_buf; + sp->s_bufp = sp->s_buf; } } gettime(&tt); @@ -966,10 +969,10 @@ getnetconf() inet_ntoa(((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr))); /* build datagram queue */ - /* + /* * look for an already existing source interface address. * This happens mostly when reinitializing. Also, if - * the machine has multiple point to point interfaces, then + * the machine has multiple point to point interfaces, then * the local address may appear more than once. */ if (dqp = aIsUs(((struct sockaddr_in *)&ifreq.ifr_addr) @@ -1172,7 +1175,7 @@ opensocket(dqp) if ((dqp->dq_dfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { syslog(LOG_ERR, "socket(SOCK_DGRAM): %m - exiting"); exit(1); - } + } dprintf(1, (ddt, "dqp->dq_addr %s d_dfd %d\n", inet_ntoa(dqp->dq_addr), dqp->dq_dfd)); if (setsockopt(dqp->dq_dfd, SOL_SOCKET, SO_REUSEADDR, @@ -1596,6 +1599,7 @@ sq_done(sp) FD_SET(sp->s_rfd, &mask); } +#ifdef OLD_SETPROCTITLE void ns_setproctitle(a, s) char *a; @@ -1619,6 +1623,26 @@ ns_setproctitle(a, s) while (cp < LastArg) *cp++ = ' '; } +#else +void +ns_setproctitle(a, s) + char *a; + int s; +{ + int size; + struct sockaddr_in sin; + char buf[80]; + + size = sizeof(sin); + if (getpeername(s, (struct sockaddr *)&sin, &size) == 0) + (void) sprintf(buf, "%s [%s]", a, inet_ntoa(sin.sin_addr)); + else { + syslog(LOG_DEBUG, "getpeername: %m"); + (void) sprintf(buf, "%s", a); + } + setproctitle("%s", buf); +} +#endif u_int32_t net_mask(in) diff --git a/usr.sbin/named/ns_maint.c b/usr.sbin/named/ns_maint.c index 9a56097..8072d88 100644 --- a/usr.sbin/named/ns_maint.c +++ b/usr.sbin/named/ns_maint.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_maint.c 4.39 (Berkeley) 3/2/91"; -static char rcsid[] = "$Id: ns_maint.c,v 8.11 1995/12/22 10:20:30 vixie Exp $"; +static char rcsid[] = "$Id: ns_maint.c,v 1.4 1995/10/23 11:11:48 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_maint.c,v 8.11 1995/12/22 10:20:30 vixie Exp $"; * - * Copyright (c) 1986, 1988 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_maint.c,v 8.11 1995/12/22 10:20:30 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_maint.c,v 8.11 1995/12/22 10:20:30 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -450,7 +450,7 @@ startxfer(zp) } } #endif - + if (zp->z_xaddr.s_addr != 0) { /* Address was specified by the qserial logic, use it. */ argv[argc++] = strcpy(argv_ns[argc_ns++], @@ -674,7 +674,7 @@ purge_zone(dname, htp, class) np->n_hash = NULL; } } - + /* remove entry from cache, if required */ if ((np->n_hash == NULL) && (np->n_data == NULL)) { struct namebuf **npp, **nppend; @@ -776,7 +776,7 @@ bottom_of_zone(dp, class) return (0); } #endif - + /* * Handle XFER limit for a nameserver. */ @@ -1014,7 +1014,7 @@ tryxfer() { zp = zones; } lastnzones = nzones; - + if (zp == zones) stopzp = &zones[nzones-1]; else @@ -1029,7 +1029,7 @@ tryxfer() { if (!xfers_deferred || xfers_running >= max_xfers_running) break; - + if ((xfers = nxfers(zp, 0)) != -1 && xfers < max_xfers_per_ns && (zp->z_flags & Z_NEED_XFER)) { diff --git a/usr.sbin/named/ns_ncache.c b/usr.sbin/named/ns_ncache.c index bf63fb8..95f84e5 100644 --- a/usr.sbin/named/ns_ncache.c +++ b/usr.sbin/named/ns_ncache.c @@ -38,7 +38,7 @@ cache_n_resp(msg, msglen) hp = (HEADER *)msg; cp = msg+HFIXEDSZ; - + n = dn_expand(msg, msg + msglen, cp, dname, sizeof dname); if (n < 0) { dprintf(1, (ddt, "Query expand name failed:cache_n_resp\n")); diff --git a/usr.sbin/named/ns_req.c b/usr.sbin/named/ns_req.c index 4d399c6..18c6c77 100644 --- a/usr.sbin/named/ns_req.c +++ b/usr.sbin/named/ns_req.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_req.c 4.47 (Berkeley) 7/1/91"; -static char rcsid[] = "$Id: ns_req.c,v 8.15 1995/12/29 07:16:18 vixie Exp $"; +static char rcsid[] = "$Id: ns_req.c,v 1.4 1995/10/23 11:11:50 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_req.c,v 8.15 1995/12/29 07:16:18 vixie Exp $"; * - * Copyright (c) 1986, 1988, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_req.c,v 8.15 1995/12/29 07:16:18 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_req.c,v 8.15 1995/12/29 07:16:18 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -290,9 +290,9 @@ ns_req(msg, msglen, buflen, qsp, from, dfd) } nameserIncr(from->sin_addr, nssSentAns); #ifdef XSTATS - if (hp->rcode == NXDOMAIN) + if (hp->rcode == NXDOMAIN) nameserIncr(from->sin_addr, nssSentNXD); - if (!hp->aa) + if (!hp->aa) nameserIncr(from->sin_addr, nssSentNaAns); #endif } else { @@ -449,7 +449,7 @@ req_query(hp, cpp, eom, qsp, buflenp, msglenp, msg, dfd, from) struct databuf *dp; nameserIncr(from->sin_addr, nssRcvdQ); - + #ifdef XSTATS /* Statistics for queries coming from port <> 53, suspect some kind of forwarder */ if (from->sin_port != ns_port) @@ -548,8 +548,8 @@ req_query(hp, cpp, eom, qsp, buflenp, msglenp, msg, dfd, from) #ifdef QRYLOG if (qrylog) { syslog(LOG_INFO, "XX /%s/%s/%s", - inet_ntoa(from->sin_addr), - (dname[0] == '\0') ?"." :dname, + inet_ntoa(from->sin_addr), + (dname[0] == '\0') ?"." :dname, p_type(type)); } #endif /*QRYLOG*/ @@ -581,10 +581,10 @@ try_again: #endif /*LOCALDOM*/ #ifdef YPKLUDGE - /* Some braindamaged resolver software will not - recognize internet addresses in dot notation and - send out address queries for "names" such as - 128.93.8.1. This kludge will prevent those + /* Some braindamaged resolver software will not + recognize internet addresses in dot notation and + send out address queries for "names" such as + 128.93.8.1. This kludge will prevent those from flooding higher level servers. We simply claim to be authoritative and that the domain doesn't exist. @@ -807,7 +807,7 @@ fetchns: } *cpp += n; *buflenp -= n; - hp->nscount = + hp->nscount = htons((u_int16_t) count); } @@ -909,15 +909,15 @@ fetchns: case FW_DUP: break; /* Duplicate request dropped */ case FW_NOSERVER: - /* - ** Don't go into an infinite loop if + /* + ** Don't go into an infinite loop if ** the admin gave root NS records in the cache ** file without giving address records ** for the root servers. */ if (np) { if (np->n_dname[0] == '\0') { - syslog(LOG_NOTICE, + syslog(LOG_NOTICE, "ns_req: no address for root server"); hp->rcode = SERVFAIL; #ifdef DATUMREFCNT @@ -1046,7 +1046,7 @@ req_iquery(hp, cpp, eom, buflenp, msg, from) #ifdef QRYLOG if (qrylog) { syslog(LOG_INFO, "XX /%s/%s/-%s", - inet_ntoa(from->sin_addr), + inet_ntoa(from->sin_addr), inet_ntoa(data_inaddr((u_char *)data)), p_type(type)); } @@ -1421,6 +1421,7 @@ addname(dname, rname, rtype, class) if (strcasecmp(ap->a_dname, dname) == 0) return; + /* add domain name to additional section */ if (addcount < NADDRECS) { addcount++; @@ -1654,7 +1655,7 @@ doaxfr(np, rfp, top, class) #ifdef NO_GLUE if ((np != top) || (top->n_dname[0] == '\0')) { #endif /*NO_GLUE*/ - /* Glue the sub domains together by sending + /* Glue the sub domains together by sending * the address records for the sub domain * name servers along if necessary. * Glue is necessary if the server is in any zone diff --git a/usr.sbin/named/ns_resp.c b/usr.sbin/named/ns_resp.c index c4b81b2..0e78db6 100644 --- a/usr.sbin/named/ns_resp.c +++ b/usr.sbin/named/ns_resp.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_resp.c 4.65 (Berkeley) 3/3/91"; -static char rcsid[] = "$Id: ns_resp.c,v 8.19 1996/01/09 20:23:55 vixie Exp $"; +static char rcsid[] = "$Id: ns_resp.c,v 1.4 1995/10/23 11:11:53 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_resp.c,v 8.19 1996/01/09 20:23:55 vixie Exp $"; * - * Copyright (c) 1986, 1988, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_resp.c,v 8.19 1996/01/09 20:23:55 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_resp.c,v 8.19 1996/01/09 20:23:55 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -104,7 +104,7 @@ learntFrom(qp, server) char nsbuf[20]; char abuf[20]; int i; - + if (buf) { free(buf); buf = NULL; @@ -151,7 +151,7 @@ learntFrom(qp, server) if ((a == ns) && (ns == na)) /* all "UNKNOWN" */ return (""); - + #ifdef STATS # define LEARNTFROM " '%s': learnt (A=%s,NS=%s)" #else @@ -377,7 +377,7 @@ ns_resp(msg, msglen) "Response from unexpected source (%s)", sin_ntoa(&from_addr)); } - /* + /* * We don't know who this response came from so it * gets dropped on the floor. */ @@ -415,7 +415,7 @@ ns_resp(msg, msglen) rtrip = ((tt.tv_sec - stp->tv_sec) * 1000 + (tt.tv_usec - stp->tv_usec) / 1000); } - + dprintf(3, (ddt, "stime %lu/%lu now %lu/%lu rtt %ld\n", (u_long)stp->tv_sec, (u_long)stp->tv_usec, (u_long)tt.tv_sec, (u_long)tt.tv_usec, @@ -435,7 +435,7 @@ ns_resp(msg, msglen) ns->d_nstime = (u_int32_t)rtrip; else ns->d_nstime = (u_int32_t) - (ns->d_nstime * ALPHA + (ns->d_nstime * ALPHA + (1-ALPHA) * (u_int32_t)rtrip); /* prevent floating point overflow, @@ -944,10 +944,10 @@ ns_resp(msg, msglen) */ if ((!restart || !cname) && qp->q_cmsglen && ancount) { dprintf(1, (ddt, "Cname second pass\n")); - newmsglen = MIN(PACKETSZ, qp->q_cmsglen); + newmsglen = qp->q_cmsglen; bcopy(qp->q_cmsg, newmsg, newmsglen); } else { - newmsglen = MIN(PACKETSZ, msglen); + newmsglen = msglen; bcopy(msg, newmsg, newmsglen); } hp = (HEADER *) newmsg; @@ -1217,7 +1217,7 @@ ns_resp(msg, msglen) #ifdef XSTATS if (!hp->aa) nameserIncr(qp->q_from.sin_addr, nssSentNaAns); - if (hp->rcode == NXDOMAIN) + if (hp->rcode == NXDOMAIN) nameserIncr(qp->q_from.sin_addr, nssSentNXD); #endif n = doaddinfo(hp, cp, buflen); @@ -1466,7 +1466,7 @@ doupdate(msg, msglen, rrp, zone, savens, flags, cred) return (-1); } } - if ((zonenum = findzone(dname, class)) == 0) { + if ((zonenum = findzone(dname, class)) == 0) { hp->rcode = NXDOMAIN; return (-1); } @@ -1546,7 +1546,7 @@ doupdate(msg, msglen, rrp, zone, savens, flags, cred) hp->rcode = FORMERR; return (-1); } - if ((zonenum = findzone(dname, class)) == 0) { + if ((zonenum = findzone(dname, class)) == 0) { hp->rcode = NXDOMAIN; return (-1); } @@ -2086,7 +2086,7 @@ check_root() check_ns(); } -/* +/* * Check the root to make sure that for each NS record we have a A RR */ static void @@ -2172,7 +2172,7 @@ findns(npp, class, nsp, countp, flag) register struct databuf *dp; register struct databuf **nspp; struct hashbuf *htp; - + #ifdef DATUMREFCNT nsp[0] = NULL; #endif diff --git a/usr.sbin/named/ns_sort.c b/usr.sbin/named/ns_sort.c index 0f53cce..225aabe 100644 --- a/usr.sbin/named/ns_sort.c +++ b/usr.sbin/named/ns_sort.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_sort.c 4.10 (Berkeley) 3/3/91"; -static char rcsid[] = "$Id: ns_sort.c,v 8.3 1995/12/22 10:20:30 vixie Exp $"; +static char rcsid[] = "$Id: ns_sort.c,v 1.3 1995/08/20 21:19:01 peter Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_sort.c,v 8.3 1995/12/22 10:20:30 vixie Exp $"; * - * Copyright (c) 1986, 1990 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_sort.c,v 8.3 1995/12/22 10:20:30 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_sort.c,v 8.3 1995/12/22 10:20:30 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/ns_stats.c b/usr.sbin/named/ns_stats.c index d609edd..b4c8958 100644 --- a/usr.sbin/named/ns_stats.c +++ b/usr.sbin/named/ns_stats.c @@ -1,6 +1,6 @@ #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)ns_stats.c 4.10 (Berkeley) 6/27/90"; -static char rcsid[] = "$Id: ns_stats.c,v 8.4 1995/06/29 09:26:17 vixie Exp $"; +static char rcsid[] = "$Id: ns_stats.c,v 1.2 1995/05/30 03:49:00 rgrimes Exp $"; #endif /* not lint */ /* @@ -8,7 +8,7 @@ static char rcsid[] = "$Id: ns_stats.c,v 8.4 1995/06/29 09:26:17 vixie Exp $"; * - * Copyright (c) 1986,1994 * 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: @@ -24,7 +24,7 @@ static char rcsid[] = "$Id: ns_stats.c,v 8.4 1995/06/29 09:26:17 vixie Exp $"; * 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 @@ -38,14 +38,14 @@ static char rcsid[] = "$Id: ns_stats.c,v 8.4 1995/06/29 09:26:17 vixie Exp $"; * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -104,7 +104,7 @@ static const char *typenames[T_ANY+1] = { /* 240 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 250 */ - 0, 0, "AXFR", "MAILB", "MAILA", "ANY" + 0, 0, "AXFR", "MAILB", "MAILA", "ANY" }; static void nameserStats __P((FILE *)); @@ -217,7 +217,7 @@ nameserCompar(t1, t2) else return (0); } - + struct nameser * nameserFind(addr, flags) struct in_addr addr; diff --git a/usr.sbin/named/ns_validate.c b/usr.sbin/named/ns_validate.c index a0c14d8..8142bdc 100644 --- a/usr.sbin/named/ns_validate.c +++ b/usr.sbin/named/ns_validate.c @@ -43,7 +43,7 @@ static TO_Validate *validateQ, *currentVQ; static int VQcount; /***************************************************************** - * validate() is called from dovalidate(). it takes as parameters, + * validate() is called from dovalidate(). it takes as parameters, * the domain name sought, the class, type etc. of record, the server * that gave us the answer and the data it gave us * @@ -133,7 +133,7 @@ validate(dname, qdomain, server, type, class, data, dlen np = NULL; else np = nlookup(dname, &htp, &fname, 0); - + /* we were able to locate namebufs for this domain, or a parent domain, * or ??? */ @@ -149,7 +149,7 @@ validate(dname, qdomain, server, type, class, data, dlen } switch (findns(&np, class, nsp, &count, 0)) { case NXDOMAIN: - /** we are authoritative for this domain, lookup name + /** we are authoritative for this domain, lookup name * in our zone data, if it matches, return valid. * in either case, do not cache **/ @@ -163,7 +163,7 @@ validate(dname, qdomain, server, type, class, data, dlen #ifdef NCACHE if (rcode == NXDOMAIN) { /* If we had an exactmatch on the name, we found the - * name in our authority database, so this couldn't + * name in our authority database, so this couldn't * have been a bad name. INVALID data, say so */ if (exactmatch) @@ -177,7 +177,7 @@ validate(dname, qdomain, server, type, class, data, dlen } #endif if (!strcasecmp(dname, np->n_dname)) { - + /* if the name we seek is the same as that we have ns * records for, compare the data we have to see if it * matches. if it does, return valid_no_cache, if it @@ -188,7 +188,7 @@ validate(dname, qdomain, server, type, class, data, dlen else return (INVALID); } - + /* we found ns records in a higher level, if we were unable to * locate the exact name earlier, it means we are * authoritative for this domain but do not have records for @@ -196,7 +196,7 @@ validate(dname, qdomain, server, type, class, data, dlen */ if (!exactmatch) return (INVALID); - + /* we found the exact name earlier and we are obviously * authoritative so check for data records and see if any * match. @@ -205,7 +205,7 @@ validate(dname, qdomain, server, type, class, data, dlen return (VALID_NO_CACHE); else return (INVALID); - + case SERVFAIL:/* could not find name server records*/ /* stick_in_queue(dname, type, class, data); */ if (needs_prime_cache) @@ -214,7 +214,7 @@ validate(dname, qdomain, server, type, class, data, dlen free_nsp(nsp); #endif return (INVALID); - + case OK: /*proceed */ dprintf(5, (ddt, "validate:found ns records\n")); if (needs_prime_cache) @@ -242,7 +242,7 @@ validate(dname, qdomain, server, type, class, data, dlen } /*validate*/ /*********************************************************************** - * validate rr returned by somebody against your own database, if you are + * validate rr returned by somebody against your own database, if you are * authoritative for the information. if you have a record that matches, * return 1, else return 0. validate() above will use this and determine * if the record should be returned/discarded. @@ -255,10 +255,10 @@ isvalid(np, type, class, data, dlen) int dlen; { register struct databuf *dp; - + for (dp = np->n_data; dp != NULL; dp = dp->d_next) { if (!wanted(dp, class, type)) { - if ((type == T_CNAME) && (class == dp->d_class)) { + if ((type == T_CNAME) && (class == dp->d_class)) { /* if a cname exists, any other will not */ return (0); /* we come here only for zone info, @@ -267,9 +267,9 @@ isvalid(np, type, class, data, dlen) } continue; } - /* type and class match, if i get here + /* type and class match, if i get here * let's now compare the data section, per RR type - */ + */ /* unless, of course, the data was negative, in which case * we should return FAILURE since we should not have found @@ -277,7 +277,7 @@ isvalid(np, type, class, data, dlen) */ if ((data == NULL) || (dlen == 0)) return (0); - + /* XXX: why aren't we just calling db_cmp()? */ switch (type) { @@ -318,7 +318,7 @@ isvalid(np, type, class, data, dlen) if (x == 0) return (1); else - break; + break; case T_MINFO: case T_SOA: @@ -326,16 +326,16 @@ isvalid(np, type, class, data, dlen) /* compare first string */ x = strncasecmp((char *)dp->d_data, data, strlen(data) + 1); - if (x != 0) + if (x != 0) break; /* move to second string */ td = data + (strlen(data) + 1); - tdp = dp->d_data + + tdp = dp->d_data + (strlen((char *)dp->d_data)+1); /* compare second string */ - x = strncasecmp(td, (char *)tdp, + x = strncasecmp(td, (char *)tdp, strlen((char *)td+1)); if (x != 0) break; @@ -354,7 +354,7 @@ isvalid(np, type, class, data, dlen) if (x != 0) break; } - + /* everything was equal, wow! * so return a success */ @@ -369,7 +369,7 @@ isvalid(np, type, class, data, dlen) break; td = data + INT16SZ; tdp = dp->d_data + INT16SZ; - x = strncasecmp(td, (char *)tdp, + x = strncasecmp(td, (char *)tdp, strlen((char *)td) + 1); if (x != 0) break; @@ -411,7 +411,7 @@ isvalid(np, type, class, data, dlen) if ((data == NULL) || (dlen == 0)) { /* negative data, report success */ return (1); - } + } /* positive data, no such RR, validation failed */ return (0); } @@ -419,8 +419,8 @@ isvalid(np, type, class, data, dlen) /****************************************************************** * get a list of databufs that have ns addresses for the closest domain * you know about, get their addresses and confirm that server indeed - * is one of them. if yes return 1 else 0. - * first checks the cache that we build in nslookup() earlier + * is one of them. if yes return 1 else 0. + * first checks the cache that we build in nslookup() earlier * when we ns_forw(). if unableto find it there, it checks the entire * hash table to do address translations. *******************************************************************/ @@ -469,7 +469,7 @@ check_addr_ns(nsp, server, dname) } /************************************************************************* - * checks in hash tables for the address of servers whose name is in the + * checks in hash tables for the address of servers whose name is in the * data section of nsp records. borrows code from nslookup()/ns_forw.c * largely. *************************************************************************/ @@ -575,7 +575,7 @@ store_name_addr(servername, serveraddr, syslogdname, sysloginfo) free(nameaddrlist[i].nsname); nameaddrlist[i].nsname = savestr(servername); return; - } + } } /* we have to add this one to our cache */ @@ -601,9 +601,9 @@ store_name_addr(servername, serveraddr, syslogdname, sysloginfo) * Decode the resource record 'rrp' and validate the RR. * Borrows code almost entirely from doupdate(). is a rather * non-invasive routine since it just goes thru the same motions - * as doupdate but just marks the array validatelist entry as + * as doupdate but just marks the array validatelist entry as * the return code from validate(). This is later used in doupdate - * to cache/not cache the entry. also used in update_msg() to + * to cache/not cache the entry. also used in update_msg() to * delete/keep the record from the outgoing message. */ int @@ -753,7 +753,7 @@ dovalidate(msg, msglen, rrp, zone, flags, qdomain, server, VCode) cp += n; cp1 += (n = strlen((char *)cp1) + 1); n1 = sizeof(data) - n; - + /* get second name */ n = dn_expand(msg, msg + msglen, cp, (char *)cp1, n1); if (n < 0) { @@ -917,7 +917,7 @@ update_msg(msg, msglen, Vlist, c) } #endif /* just making sure we do not do all the work for nothing */ - for (i=0; i<c; i++) { + for (i=0; i<c; i++) { if (Vlist[i] == INVALID) { inv = 1; break; @@ -1005,7 +1005,7 @@ update_msg(msg, msglen, Vlist, c) newlen += (n_new+2*INT16SZ); rembuflen -= (n_new+2*INT16SZ); /* have to decode and copy every Valid RR from here */ - + cp = msg +HFIXEDSZ +qlen; /*skip header and query section*/ for (i = 0; i < c; i++) { if (Vlist[i] == INVALID) { @@ -1019,7 +1019,7 @@ update_msg(msg, msglen, Vlist, c) hp->rcode = FORMERR; goto badend; } - n_new = dn_comp(dname, newcp, rembuflen, dnptrs, edp); + n_new = dn_comp(dname, newcp, rembuflen, dnptrs, edp); if (n_new < 0) goto badend; cp += n; @@ -1155,7 +1155,7 @@ update_msg(msg, msglen, Vlist, c) bcopy(cp,newcp,INT16SZ); cp += INT16SZ; newcp += INT16SZ; - + /* get name */ n = dn_expand(msg, eom, cp, (char *)data, sizeof data); if (n < 0) { @@ -1228,7 +1228,7 @@ update_msg(msg, msglen, Vlist, c) } *msglen = newlen; free((char *)newmsg); - + #ifdef DEBUG if (debug >= 10) fp_nquery(msg, *msglen, ddt); diff --git a/usr.sbin/named/options.h b/usr.sbin/named/options.h index 81f27f3..6f58a5e 100644 --- a/usr.sbin/named/options.h +++ b/usr.sbin/named/options.h @@ -1,15 +1,15 @@ /* options.h - specify the conditionally-compiled features * vix 28mar92 [moved out of the Makefile because they were getting too big] * - * $Id: options.h,v 8.7 1995/12/29 21:08:13 vixie Exp $ + * $Id: options.h,v 1.4 1995/08/20 21:19:08 peter Exp $ */ /* * ++Copyright++ * - - * Copyright (c) + * Copyright (c) * 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: @@ -25,7 +25,7 @@ * 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 @@ -39,14 +39,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -76,27 +76,27 @@ */ #define DEBUG /* enable -d flag and SIGUSR[12] support (ucb) */ -/*#define ALLOW_T_UNSPEC /* enable the "unspec" RR type for old athena (ucb) */ -/*#define INVQ /* enable inverse queries (nslookup) (ucb/vix) */ -/*#define DSTORAGE /* debug malloc overruns using storage.o (ucb/vix) */ -/*#define DMALLOC /* trace malloc orphans using dmalloc.o (vix) */ +/*#define ALLOW_T_UNSPEC*//* enable the "unspec" RR type for old athena (ucb) */ +#define INVQ /* enable inverse queries (nslookup) (ucb/vix) */ +/*#define DSTORAGE*/ /* debug malloc overruns using storage.o (ucb/vix) */ +/*#define DMALLOC*/ /* trace malloc orphans using dmalloc.o (vix) */ #define XFRNETS /* enable "xfrnets" command in named.boot (vix) */ #define PID_FIX /* be careful about overwriting named.pid file (del) */ #define FWD_LOOP /* try to break out of forwarding loops (del) */ #define NO_GLUE /* don't accept or send out-of-zone glue (del) */ #define BOGUSNS /* detect bogus nameservers (mcsun) */ #define QRYLOG /* enable SIGWINCH for query logging (bb) */ -/*#define YPKLUDGE /* deal effectively with broken "ypserv -i" (mcsun) */ +/*#define YPKLUDGE*/ /* deal effectively with broken "ypserv -i" (mcsun) */ #define TRACEROOT /* trace bogus root servers and ignore them (pma,bb) */ -/*#define LOCALDOM /* permit "domain" directive in named.boot (ucb) */ +/*#define LOCALDOM*/ /* permit "domain" directive in named.boot (ucb) */ #define FORCED_RELOAD /* refresh secondary zones on SIGHUP (pma) */ #define SLAVE_FORWARD /* use sensible timeouts on slave forwarders (pma) */ #define WANT_PIDFILE /* if you want the named.pid file (ucb/arc) */ #define DOTTED_SERIAL /* if you want to be able to specify dotted serial#s */ -/*#define SENSIBLE_DOTS /* if you want dotted serial#s to make numeric sense */ +/*#define SENSIBLE_DOTS*//* if you want dotted serial#s to make numeric sense */ #define NCACHE /* negative caching (anant@isi.edu) */ -/*#define VALIDATE /* validation procedure (anant@isi.edu) (BUGGY!) */ -/*#define SHORT_FNAMES /* file names used in named-xfer need to be short */ +/*#define VALIDATE*/ /* validation procedure (anant@isi.edu) (BUGGY!)*/ +/*#define SHORT_FNAMES*//* file names used in named-xfer need to be short */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname (mpa) */ #define STUBS /* allow transfers of NS only for a zone (mpa) */ #ifndef LOGFAC @@ -111,14 +111,14 @@ #define LAME_DELEGATION /* lame delegations (original-del,reworked-bb&del)*/ #define LAME_LOGGING LOG_WARNING /* log lame delegations, set log level */ #define GETSER_LOGGING LOG_INFO /* log errors/timeouts getting serial number */ -/*#define RETURNSOA /* good code that the world isn't ready for yet */ +/*#define RETURNSOA*/ /* good code that the world isn't ready for yet */ #define CLEANCACHE /* useful and necessary in the face of NCACHE */ #define PURGE_ZONE /* remove all traces of a zone when reloading (mpa) */ #define STATS /* keep nameserver statistics; uses more memory */ #define RENICE /* named-xfer should run at normal priority */ #define XSTATS /* extended statistics, syslogged periodically (bg) */ -/*#define BIND_NOTIFY /* experimental - do not enable in customer products */ -/*#define LOC_RR /* support for (draft) LOC record parsing (ckd) */ +/*#define BIND_NOTIFY*/ /* experimental - do not enable in customer products */ +/*#define LOC_RR*/ /* support for (draft) LOC record parsing (ckd) */ #define SORT_RESPONSE /* should we try to sort responses optimally? (vix) */ /*--------------------------------------------* diff --git a/usr.sbin/named/pathnames.h b/usr.sbin/named/pathnames.h index 7ded7d2..5adf1a2 100644 --- a/usr.sbin/named/pathnames.h +++ b/usr.sbin/named/pathnames.h @@ -1,6 +1,6 @@ /* * @(#)pathnames.h 5.4 (Berkeley) 6/1/90 - * $Id: pathnames.h,v 8.1 1994/12/15 06:24:14 vixie Exp $ + * $Id: pathnames.h,v 1.1.1.1 1994/09/22 19:46:13 pst Exp $ */ /* @@ -8,7 +8,7 @@ * - * Copyright (c) 1989 * 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: @@ -24,7 +24,7 @@ * 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 @@ -38,14 +38,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/portability.h b/usr.sbin/named/portability.h index 160b435..ed01d22 100644 --- a/usr.sbin/named/portability.h +++ b/usr.sbin/named/portability.h @@ -1,15 +1,15 @@ /* portability.h - include or define things that aren't present on all systems * vixie@decwrl 26dec92 [new] * - * $Id: portability.h,v 8.11 1995/12/22 10:20:19 vixie Exp $ + * $Id: portability.h,v 1.3 1995/08/20 21:19:11 peter Exp $ */ /* * ++Copyright++ * - - * Copyright (c) + * Copyright (c) * 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: @@ -25,7 +25,7 @@ * 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 @@ -39,14 +39,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT diff --git a/usr.sbin/named/storage.c b/usr.sbin/named/storage.c index 6ae2163..15623f4 100644 --- a/usr.sbin/named/storage.c +++ b/usr.sbin/named/storage.c @@ -3,7 +3,7 @@ * - * Copyright (c) 1985, 1989 * 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: @@ -19,7 +19,7 @@ * 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 @@ -33,14 +33,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -56,8 +56,8 @@ #include <sys/param.h> #include <syslog.h> -#include "../conf/portability.h" -#include "../conf/options.h" +#include "portability.h" +#include "options.h" extern void panic __P((int, const char *)); #ifdef DSTORAGE @@ -74,18 +74,18 @@ extern void panic __P((int, const char *)); * * Author - * Michael John Muuss - * + * * Source - * SECAD/VLD Computing Consortium, Bldg 394 * The U. S. Army Ballistic Research Laboratory * Aberdeen Proving Ground, Maryland 21005-5066 - * + * * Copyright Notice - * This software is Copyright (C) 1987 by the United States Army. * All rights reserved. */ #ifndef lint -static char RCSid[] = "$Id: storage.c,v 8.1 1994/12/15 06:24:14 vixie Exp $"; +static char RCSid[] = "$Id: storage.c,v 1.3 1995/05/30 03:49:05 rgrimes Exp $"; #endif #undef malloc @@ -159,7 +159,7 @@ char *ptr; /* * R T _ P R M E M - * + * * Print map of memory currently in use. */ void diff --git a/usr.sbin/named/tools/Makefile b/usr.sbin/named/tools/Makefile new file mode 100644 index 0000000..fa23e68 --- /dev/null +++ b/usr.sbin/named/tools/Makefile @@ -0,0 +1,5 @@ +# @(#)Makefile 4.10 (Berkeley) 5/29/90 + +SUBDIR= named.reload named.restart ndc + +.include <bsd.subdir.mk> diff --git a/usr.sbin/named/tools/named.reload/Makefile b/usr.sbin/named/tools/named.reload/Makefile new file mode 100644 index 0000000..bb71c64 --- /dev/null +++ b/usr.sbin/named/tools/named.reload/Makefile @@ -0,0 +1,22 @@ +# @(#)Makefile 5.1 (Berkeley) 5/28/90 + +MAN8= named.reload.8 +CLEANFILES+=named.reload + +PIDDIR=/var/run +INDOT= +DESTSBIN=${DESTDIR}${BINDIR} + +beforeinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ + named.reload ${DESTDIR}${BINDIR} + +all: named.reload + +named.reload: named.reload.sh Makefile + sed -e "s|%DESTSBIN%|${DESTSBIN}|" \ + -e "s|%INDOT%|${INDOT}|" \ + < ${.CURDIR}/named.reload.sh > named.reload + +.include "${.CURDIR}/../../../Makefile.inc" +.include <bsd.prog.mk> diff --git a/usr.sbin/named/tools/named.reload/named.reload.sh b/usr.sbin/named/tools/named.reload/named.reload.sh index 0b6495a..c800023 100644 --- a/usr.sbin/named/tools/named.reload/named.reload.sh +++ b/usr.sbin/named/tools/named.reload/named.reload.sh @@ -1,7 +1,7 @@ #!/bin/sh - # # from named.reload 5.2 (Berkeley) 6/27/89 -# $Id: named.reload.sh,v 8.1 1994/12/15 06:24:14 vixie Exp $ +# $Id: named.reload.sh,v 1.2 1994/09/22 20:45:23 pst Exp $ # exec %DESTSBIN%/%INDOT%ndc reload diff --git a/usr.sbin/named/tools/named.restart/Makefile b/usr.sbin/named/tools/named.restart/Makefile new file mode 100644 index 0000000..4c3a700 --- /dev/null +++ b/usr.sbin/named/tools/named.restart/Makefile @@ -0,0 +1,23 @@ +# @(#)Makefile 5.1 (Berkeley) 5/28/90 +# $Id: Makefile,v 1.4 1995/07/25 00:37:31 bde Exp $ + +MAN8= named.restart.8 +CLEANFILES+=named.restart + +PIDDIR=/var/run +INDOT= +DESTSBIN=${DESTDIR}${DESTBIN} + +beforeinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ + named.restart ${DESTDIR}${BINDIR} + +all: named.restart + +named.restart: named.restart.sh Makefile + sed -e "s|%INDOT%|${INDOT}|" \ + -e "s|%DESTSBIN%|${BINDIR}|" \ + < ${.CURDIR}/named.restart.sh > named.restart + +.include "${.CURDIR}/../../../Makefile.inc" +.include <bsd.prog.mk> diff --git a/usr.sbin/named/tools/named.restart/named.restart.8 b/usr.sbin/named/tools/named.restart/named.restart.8 index 8b11b64..7670dd1 100644 --- a/usr.sbin/named/tools/named.restart/named.restart.8 +++ b/usr.sbin/named/tools/named.restart/named.restart.8 @@ -51,6 +51,7 @@ .\" - .\" --Copyright-- .\" +.\" $Id: named.restart.8,v 1.3 1995/05/03 03:26:56 rgrimes Exp $ .\" from hostname.7 6.4 (Berkeley) 1/16/90 .\" .TH NAMED.RESTART 8 "June 26, 1993" @@ -59,7 +60,9 @@ named.restart \- stop and restart the name server .SH DESCRIPTION This command sends a \s-1SIGKILL\s+1 to the running name server and then -starts a new one. +starts a new one if +.IR /etc/sysconfig +states that one should be running on this system. .SH BUGS Does not check to see if the name server is actually running, and could use a stale PID cache file which may result in the death of an unrelated diff --git a/usr.sbin/named/tools/named.restart/named.restart.sh b/usr.sbin/named/tools/named.restart/named.restart.sh index 4d073e6..eb4c7ec 100644 --- a/usr.sbin/named/tools/named.restart/named.restart.sh +++ b/usr.sbin/named/tools/named.restart/named.restart.sh @@ -1,7 +1,7 @@ #!/bin/sh - # # from named.restart 5.4 (Berkeley) 6/27/89 -# $Id: named.restart.sh,v 8.1 1994/12/15 06:24:14 vixie Exp $ +# $Id: named.restart.sh,v 1.3 1995/05/03 03:26:59 rgrimes Exp $ # exec %DESTSBIN%/%INDOT%ndc restart diff --git a/usr.sbin/named/tools/ndc/Makefile b/usr.sbin/named/tools/ndc/Makefile new file mode 100644 index 0000000..1283121 --- /dev/null +++ b/usr.sbin/named/tools/ndc/Makefile @@ -0,0 +1,25 @@ +MAN8= ndc.8 +CLEANFILES+=ndc + +PIDDIR=/var/run +INDOT= +PS=ps +IOT=ABRT +DESTSBIN=${DESTDIR}${BINDIR} + +beforeinstall: + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \ + ndc ${DESTDIR}${BINDIR} + +all: ndc + +ndc: ndc.sh Makefile + sed -e "s|%DESTSBIN%|${DESTSBIN}|" \ + -e "s|%INDOT%|${INDOT}|" \ + -e "s|%PIDDIR%|${PIDDIR}|" \ + -e "s|%PS%|${PS}|" \ + -e "s|%IOT%|${IOT}|" \ + < ${.CURDIR}/ndc.sh > ndc + +.include "${.CURDIR}/../../../Makefile.inc" +.include <bsd.prog.mk> diff --git a/usr.sbin/named/tools/ndc/ndc.sh b/usr.sbin/named/tools/ndc/ndc.sh index 883dabc..f745967 100644 --- a/usr.sbin/named/tools/ndc/ndc.sh +++ b/usr.sbin/named/tools/ndc/ndc.sh @@ -48,11 +48,18 @@ do echo "$0: start: named (pid $PID) already running" continue } + # If there is a global system configuration file, suck it in. + if [ -f /etc/sysconfig ]; then + . /etc/sysconfig + fi rm -f $PIDFILE - %INDOT%named && { - sleep 5 - echo Name Server Started - } + # $namedflags is imported from /etc/sysconfig + if [ "X${namedflags}" != "XNO" ]; then + %INDOT%named ${namedflags} && { + sleep 5 + echo Name Server Started + } + fi ;; stop) [ $RUNNING -eq 0 ] && { @@ -69,11 +76,18 @@ do [ $RUNNING -eq 1 ] && { kill $PID && sleep 5 } + # If there is a global system configuration file, suck it in. + if [ -f /etc/sysconfig ]; then + . /etc/sysconfig + fi rm -f $PIDFILE - %INDOT%named && { - sleep 5 - echo Name Server Restarted - } + # $namedflags is imported from /etc/sysconfig + if [ "X${namedflags}" != "XNO" ]; then + %INDOT%named ${namedflags} && { + sleep 5 + echo Name Server Restarted + } + fi ;; *) eval "$USAGE";; esac diff --git a/usr.sbin/named/tools/nsquery/nsquery.c b/usr.sbin/named/tools/nsquery/nsquery.c deleted file mode 100644 index c7ff6eb..0000000 --- a/usr.sbin/named/tools/nsquery/nsquery.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * 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. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nsquery.c 4.8 (Berkeley) 6/1/90"; -static char rcsid[] = "$Id: nsquery.c,v 4.9.1.4 1994/06/11 22:05:07 vixie Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/nameser.h> -#include <arpa/inet.h> -#include <stdio.h> -#include <netdb.h> -#include <resolv.h> -#include "../conf/portability.h" - -main(argc, argv) - int argc; - char **argv; -{ - extern struct __res_state _res; - register struct hostent *hp; - register char *s; - - res_init(); - - if (argc >= 2 && strcmp(argv[1], "-d") == 0) { - _res.options |= RES_DEBUG; - argc--; - argv++; - } - if (argc < 2) { - fprintf(stderr, "usage: nsquery [-d] host [server]\n"); - exit(1); - } - if (argc == 3) { - hp = gethostbyname(argv[2]); - if (hp == NULL) { - fprintf(stderr, "nsquery:"); - herror(argv[2]); - exit(1); - } - printf("\nServer:\n"); - printanswer(hp); - _res.nsaddr.sin_addr = *(struct in_addr *)hp->h_addr; -#ifdef nsaddr /* struct __res_state includes nscount and nsaddr_list[] */ - _res.nscount = 1; -#endif - } - - hp = gethostbyname(argv[1]); - if (hp == NULL) { - fprintf(stderr, "nsquery: %s: ", argv[1]); - herror((char *)NULL); - exit(1); - } - printanswer(hp); - exit(0); -} - -printanswer(hp) - register struct hostent *hp; -{ - register char **cp; - - printf("Name: %s\n", hp->h_name); -#if BSD >= 43 || defined(h_addr) - printf("Addresses:"); - for (cp = hp->h_addr_list; cp && *cp; cp++) - printf(" %s", inet_ntoa(*(struct in_addr *)(*cp))); - printf("\n"); -#else - printf("Address: %s\n", inet_ntoa(*(struct in_addr *)hp->h_addr)); -#endif - printf("Aliases:"); - for (cp = hp->h_aliases; cp && *cp && **cp; cp++) - printf(" %s", *cp); - printf("\n\n"); -} diff --git a/usr.sbin/named/tools/nstest/nstest.c b/usr.sbin/named/tools/nstest/nstest.c deleted file mode 100644 index f20388d..0000000 --- a/usr.sbin/named/tools/nstest/nstest.c +++ /dev/null @@ -1,424 +0,0 @@ -/* - * ++Copyright++ 1986 - * - - * Copyright (c) 1986 - * 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. - * - - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies, and that - * the name of Digital Equipment Corporation not be used in advertising or - * publicity pertaining to distribution of the document or software without - * specific, written prior permission. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL - * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT - * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL - * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR - * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS - * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS - * SOFTWARE. - * - - * --Copyright-- - */ - -#ifndef lint -char copyright[] = -"@(#) Copyright (c) 1986 Regents of the University of California.\n\ - portions Copyright (c) 1993 Digital Equipment Corporation\n\ - All rights reserved.\n"; -#endif /* not lint */ - -#ifndef lint -static char sccsid[] = "@(#)nstest.c 4.15 (Berkeley) 3/21/91"; -static char rcsid[] = "$Id: nstest.c,v 4.9.1.6 1994/06/01 21:10:11 vixie Exp $"; -#endif /* not lint */ - -#include <sys/param.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <arpa/nameser.h> -#include <stdio.h> -#include <resolv.h> -#include "../conf/portability.h" - -char *progname; -FILE *log; -#define MAXDATA 256 /* really should get this from named/db.h */ -main(argc, argv) - char **argv; -{ - register char *cp; - register u_char *ucp; - struct hostent *hp; - u_short port = htons(NAMESERVER_PORT); - char buf[BUFSIZ]; - u_char packet[PACKETSZ], answer[8*1024], OldRRData[MAXDATA]; - struct rrec NewRR; - u_int32_t l; - int n, dump_packet; - - NewRR.r_data = (char *) malloc(MAXDATA); - NewRR.r_data = (char *) malloc(MAXDATA); - progname = argv[0]; - dump_packet = 0; - _res.options |= RES_DEBUG|RES_RECURSE; - (void) res_init(); - while (argc > 1 && argv[1][0] == '-') { - argc--; - cp = *++argv; - while (*++cp) - switch (*cp) { - case 'p': - if (--argc <= 0) - usage(); - port = htons(atoi(*++argv)); - break; - - case 'i': - _res.options |= RES_IGNTC; - break; - - case 'v': - _res.options |= RES_USEVC|RES_STAYOPEN; - break; - - case 'r': - _res.options &= ~RES_RECURSE; - break; - - case 'd': - dump_packet++; - break; - - default: - usage(); - } - } - _res.nsaddr.sin_family = AF_INET; - _res.nsaddr.sin_addr = inet_makeaddr(IN_LOOPBACKNET, 1); - _res.nsaddr.sin_port = port; - if (argc > 1) { - if (!inet_aton(argv[1], - (struct in_addr *)&_res.nsaddr.sin_addr)) - usage(); - } - if (argc > 2) { - log = fopen(argv[2],"w"); - if (log == NULL) perror(argv[2]); - } - for (;;) { - printf("> "); - fflush(stdout); - if ((cp = fgets(buf, sizeof buf, stdin)) == NULL) - break; - switch (*cp++) { - case 'a': - n = res_mkquery(QUERY, cp, C_IN, T_A, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'A': - n = ntohl(inet_addr(cp)); - putlong((u_int32_t)n, (u_char*)cp); - n = res_mkquery(IQUERY, "", C_IN, T_A, (u_char *)cp, - INT32SZ, NULL, - packet, sizeof(packet)); - break; - - case 'f': - n = res_mkquery(QUERY, cp, C_ANY, T_UINFO, NULL, - 0, NULL, packet, sizeof packet); - break; - - case 'F': - n = res_mkquery(QUERY, cp, C_IN, T_AFSDB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'g': - n = res_mkquery(QUERY, cp, C_ANY, T_GID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'G': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_GID, (u_char *)cp, - sizeof(int), NULL, packet, sizeof packet); - break; - - case 'c': - n = res_mkquery(QUERY, cp, C_IN, T_CNAME, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'h': - n = res_mkquery(QUERY, cp, C_IN, T_HINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'm': - n = res_mkquery(QUERY, cp, C_IN, T_MX, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'M': - n = res_mkquery(QUERY, cp, C_IN, T_MAILB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'n': - n = res_mkquery(QUERY, cp, C_IN, T_NS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'p': - n = res_mkquery(QUERY, cp, C_IN, T_PTR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 's': - n = res_mkquery(QUERY, cp, C_IN, T_SOA, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'T': - n = res_mkquery(QUERY, cp, C_IN, T_TXT, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'u': - n = res_mkquery(QUERY, cp, C_ANY, T_UID, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'U': - *(int *)cp = htonl(atoi(cp)); - n = res_mkquery(IQUERY, "", C_ANY, T_UID, (u_char *)cp, - sizeof(int), NULL, - packet, sizeof packet); - break; - - case 'x': - n = res_mkquery(QUERY, cp, C_IN, T_AXFR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'w': - n = res_mkquery(QUERY, cp, C_IN, T_WKS, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'b': - n = res_mkquery(QUERY, cp, C_IN, T_MB, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'B': - n = res_mkquery(QUERY, cp, C_IN, T_MG, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'i': - n = res_mkquery(QUERY, cp, C_IN, T_MINFO, NULL, 0, - NULL, packet, sizeof packet); - break; - - case 'r': - n = res_mkquery(QUERY, cp, C_IN, T_MR, NULL, 0, - NULL, packet, sizeof packet); - break; - - case '*': - n = res_mkquery(QUERY, cp, C_IN, T_ANY, NULL, 0, - NULL, packet, sizeof packet); - break; - -#ifdef ALLOW_UPDATES - case '^': - { - char IType[10], TempStr[50]; - int Type, oldnbytes, nbytes, i; -#ifdef ALLOW_T_UNSPEC - printf("Data type (a = T_A, u = T_UNSPEC): "); - gets(IType); - if (IType[0] == 'u') { - Type = T_UNSPEC; - printf("How many data bytes? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - (NewRR.r_data)[i] = (char) i; - } - } else { -#endif /* ALLOW_T_UNSPEC */ - Type = T_A; - nbytes = INT32SZ; - printf( - "Inet addr for new dname (e.g., 192.4.3.2): " - ); - gets(TempStr); - putlong(ntohl(inet_addr(TempStr)), - NewRR.r_data); -#ifdef ALLOW_T_UNSPEC - } -#endif - NewRR.r_class = C_IN; - NewRR.r_type = Type; - NewRR.r_size = nbytes; - NewRR.r_ttl = 99999999; - printf("Add, modify, or modify all (a/m/M)? "); - gets(TempStr); - if (TempStr[0] == 'a') { - n = res_mkquery(UPDATEA, cp, C_IN, Type, - OldRRData, nbytes, - &NewRR, packet, - sizeof packet); - } else { - if (TempStr[0] == 'm') { - printf("How many data bytes in old RR? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &oldnbytes); - for (i = 0; i < oldnbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATEM, cp, - C_IN, Type, - OldRRData, oldnbytes, - &NewRR, packet, - sizeof packet); - } else { /* Modify all */ - n = res_mkquery(UPDATEMA, cp, - C_IN, Type, NULL, 0, - &NewRR, packet, - sizeof packet); - - } - } - } - break; - -#ifdef ALLOW_T_UNSPEC - case 'D': - n = res_mkquery(UPDATEDA, cp, C_IN, T_UNSPEC, - (char *)0, 0, NULL, - packet, sizeof packet); - break; - - case 'd': - { - char TempStr[100]; - int nbytes, i; - printf("How many data bytes in oldrr data? "); - gets(TempStr); /* Throw away CR */ - sscanf(TempStr, "%d", &nbytes); - for (i = 0; i < nbytes; i++) { - OldRRData[i] = (char) i; - } - n = res_mkquery(UPDATED, cp, C_IN, T_UNSPEC, - OldRRData, nbytes, NULL, - packet, sizeof packet); - } - break; -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - - default: - printf("a{host} - query T_A\n"); - printf("A{addr} - iquery T_A\n"); - printf("b{user} - query T_MB\n"); - printf("B{user} - query T_MG\n"); - printf("f{host} - query T_UINFO\n"); - printf("g{host} - query T_GID\n"); - printf("G{gid} - iquery T_GID\n"); - printf("h{host} - query T_HINFO\n"); - printf("i{host} - query T_MINFO\n"); - printf("p{host} - query T_PTR\n"); - printf("m{host} - query T_MX\n"); - printf("M{host} - query T_MAILB\n"); - printf("n{host} - query T_NS\n"); - printf("r{host} - query T_MR\n"); - printf("s{host} - query T_SOA\n"); - printf("T{host} - query T_TXT\n"); - printf("u{host} - query T_UID\n"); - printf("U{uid} - iquery T_UID\n"); - printf("x{host} - query T_AXFR\n"); - printf("w{host} - query T_WKS\n"); - printf("F{host} - query T_AFSDB\n"); - printf("c{host} - query T_CNAME\n"); - printf("*{host} - query T_ANY\n"); -#ifdef ALLOW_UPDATES - printf("^{host} - add/mod/moda (T_A/T_UNSPEC)\n"); -#ifdef ALLOW_T_UNSPEC - printf("D{host} - deletea T_UNSPEC\n"); - printf("d{host} - delete T_UNSPEC\n"); -#endif /* ALLOW_T_UNSPEC */ -#endif /* ALLOW_UPDATES */ - continue; - } - if (n < 0) { - printf("res_mkquery: buffer too small\n"); - continue; - } - if (log) { - fprintf(log,"SEND QUERY\n"); - fp_query(packet, log); - } - n = res_send(packet, n, answer, sizeof(answer)); - if (n < 0) { - printf("res_send: send error\n"); - if (log) fprintf(log, "res_send: send error\n"); - } - else { - if (dump_packet) { - int f; - f = creat("ns_packet.dump", 0644); - write(f, answer, n); - (void) close(f); - } - if (log) { - fprintf(log, "GOT ANSWER\n"); - fp_query(answer, log); - } - } - } -} - -usage() -{ - fprintf(stderr, "Usage: %s [-v] [-i] [-r] [-d] [-p port] hostaddr\n", - progname); - exit(1); -} diff --git a/usr.sbin/named/tree.c b/usr.sbin/named/tree.c index 58607ea..4bad68c 100644 --- a/usr.sbin/named/tree.c +++ b/usr.sbin/named/tree.c @@ -33,7 +33,7 @@ static char RCSid[] = "$Id:"; #ifndef _PATH_XFER # include <stdlib.h> #else -# include "../conf/portability.h" +# include "portability.h" #endif #include "tree.h" @@ -44,7 +44,7 @@ static char *debugFuncs[256]; # define ENTER(proc) { \ debugFuncs[debugDepth] = proc; \ fprintf(stderr, "ENTER(%d:%s.%s)\n", \ - debugDepth, DEBUG, + debugDepth, DEBUG, \ debugFuncs[debugDepth]); \ debugDepth++; \ } @@ -93,7 +93,7 @@ tree_init(ppr_tree) *ppr_tree = NULL; RETV } - + tree_t tree_srch(ppr_tree, pfi_compare, p_user) diff --git a/usr.sbin/named/tree.h b/usr.sbin/named/tree.h index 7d027b9..030a928 100644 --- a/usr.sbin/named/tree.h +++ b/usr.sbin/named/tree.h @@ -3,7 +3,7 @@ * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes] * vix 27jun86 [broken out of tree.c] * - * $Id: tree.h,v 8.1 1994/12/15 06:24:14 vixie Exp $ + * $Id: tree.h,v 1.1.1.2 1995/08/18 21:16:28 peter Exp $ */ diff --git a/usr.sbin/named/tree.man3 b/usr.sbin/named/tree.man3 deleted file mode 100644 index 5be48783..0000000 --- a/usr.sbin/named/tree.man3 +++ /dev/null @@ -1,154 +0,0 @@ -.TH TREE 3 "5 April 1994" -.\" from .TH TREE 3 "22 Jan 1993" -.\" from .TH TREE 2 "23 June 1986" -.UC 4 -.SH NAME -tree_init, tree_mung, tree_srch, tree_add, tree_delete, tree_trav -\- balanced binary tree routines -.SH SYNOPSIS -.nf -.B void -.B tree_init(tree) -.B void **tree; -.PP -.B void * -.B tree_srch(tree, compare, data) -.B void **tree; -.B int (*compare)(); -.B void *data; -.PP -.B void -.B tree_add(tree, compare, data, del_uar) -.B void **tree; -.B int (*compare)(); -.B void *data; -.B void (*del_uar)(); -.PP -.B int -.B tree_delete(tree, compare, data, del_uar) -.B void **tree; -.B int (*compare)(); -.B void *data; -.B void (*del_uar)(); -.PP -.B int -.B tree_trav(tree, trav_uar) -.B void **tree; -.B int (*trav_uar)(); -.PP -.B void -.B tree_mung(tree, del_uar) -.B void **tree; -.B void (*del_uar)(); -.fi -.SH DESCRIPTION -These functions create and manipulate a balanced binary (AVL) tree. Each node -of the tree contains the expected left & right subtree pointers, a short int -balance indicator, and a pointer to the user data. On a 32 bit system, this -means an overhead of 4+4+2+4 bytes per node (or, on a RISC or otherwise -alignment constrained system with implied padding, 4+4+4+4 bytes per node). -There is no key data type enforced by this package; a caller supplied -compare routine is used to compare user data blocks. -.PP -Balanced binary trees are very fast on searches and replacements, but have a -moderately high cost for additions and deletions. If your application does a -lot more searches and replacements than it does additions and deletions, the -balanced (AVL) binary tree is a good choice for a data structure. -.PP -.I Tree_init -creates an empty tree and binds it to -.I tree -(which for this and all other routines in this package should be declared as -a pointer to void or int, and passed by reference), which can then be used by -other routines in this package. Note that more than one -.I tree -variable can exist at once; thus multiple trees can be manipulated -simultaneously. -.PP -.I Tree_srch -searches a tree for a specific node and returns either -.I NULL -if no node was found, or the value of the user data pointer if the node -was found. -.I compare -is the address of a function to compare two user data blocks. This routine -should work much the way -.IR strcmp (3) -does; in fact, -.I strcmp -could be used if the user data was a \s-2NUL\s+2 terminated string. -.I data -is the address of a user data block to be used by -.I compare -as the search criteria. The tree is searched for a node where -.I compare -returns 0. -.PP -.I Tree_add -inserts or replaces a node in the specified tree. The tree specified by -.I tree -is searched as in -.I tree_srch, -and if a node is found to match -.I data, -then the -.I del_uar -function, if non\-\s-2NULL\s+2, is called with the address of the user data -block for the node (this routine should deallocate any dynamic memory which -is referenced exclusively by the node); the user data pointer for the node -is then replaced by the value of -.I data. -If no node is found to match, a new node is added (which may or may not -cause a transparent rebalance operation), with a user data pointer equal to -.I data. -A rebalance may or may not occur, depending on where the node is added -and what the rest of the tree looks like. -.I Tree_add -will return the -.I data -pointer unless catastrophe occurs in which case it will return \s-2NULL\s+2. -.PP -.I Tree_delete -deletes a node from -.I tree. -A rebalance may or may not occur, depending on where the node is removed from -and what the rest of the tree looks like. -.I Tree_delete -returns TRUE if a node was deleted, FALSE otherwise. -.PP -.I Tree_trav -traverses all of -.I tree, -calling -.I trav_uar -with the address of each user data block. If -.I trav_uar -returns FALSE at any time, -.I tree_trav -will immediately return FALSE to its caller. Otherwise all nodes will be -reached and -.I tree_trav -will return TRUE. -.PP -.I Tree_mung -deletes every node in -.I tree, -calling -.I del_uar -(if it is not \s-2NULL\s+2) with the user data address from each node (see -.I tree_add -and -.I tree_delete -above). The tree is left in the same state that -.I tree_init -leaves it in \- i.e., empty. -.SH BUGS -Should have a way for the caller to specify application specific -.I malloc -and -.I free -functions to be used internally when allocating meta data. -.SH AUTHOR -Paul Vixie, converted and augumented from Modula\-2 examples in -.I Algorithms & Data Structures, -Niklaus Wirth, Prentice\-Hall, ISBN 0\-13\-022005\-1. diff --git a/usr.sbin/named/xfer/Makefile b/usr.sbin/named/xfer/Makefile new file mode 100644 index 0000000..bf26e94 --- /dev/null +++ b/usr.sbin/named/xfer/Makefile @@ -0,0 +1,23 @@ +# @(#)Makefile 5.1 (Berkeley) 5/28/90 + +PROG= named-xfer +SRCS= named-xfer.c db_glue.c +OBJS+= version.o +CLEANFILES+=version.c version.o +CFLAGS+=-I${.CURDIR}/.. +.PATH: ${.CURDIR}/.. +BINDIR= /usr/libexec +MAN8= named-xfer.8 + + +VER = 4.9.3-REL + +version.c: ${.CURDIR}/../Version.c ${.CURDIR}/Makefile ${SRCS} + (LC_TIME=; export LC_TIME; u=$${USER-root} d=`pwd |sed -e 's|/obj/|/src/|'` \ + h=`hostname` t=`date`; \ + sed -e "s|%WHEN%|$${t}|" -e "s|%VERSION%|"${VER}"|" \ + -e "s|%WHOANDWHERE%|$${u}@$${h}:$${d}|" \ + < ${.CURDIR}/../Version.c > version.c) + +.include "../../Makefile.inc" +.include <bsd.prog.mk> diff --git a/usr.sbin/named/xfer/named-xfer.c b/usr.sbin/named/xfer/named-xfer.c index c33eb85..f7a5d5c 100644 --- a/usr.sbin/named/xfer/named-xfer.c +++ b/usr.sbin/named/xfer/named-xfer.c @@ -11,7 +11,7 @@ * - * Copyright (c) 1988, 1990 * 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: @@ -27,7 +27,7 @@ * 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 @@ -41,14 +41,14 @@ * SUCH DAMAGE. * - * Portions Copyright (c) 1993 by Digital Equipment Corporation. - * + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies, and that * the name of Digital Equipment Corporation not be used in advertising or * publicity pertaining to distribution of the document or software without * specific, written prior permission. - * + * * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT @@ -70,7 +70,7 @@ char copyright[] = #if !defined(lint) && !defined(SABER) static char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91"; -static char rcsid[] = "$Id: named-xfer.c,v 8.10 1995/12/06 20:34:38 vixie Exp $"; +static char rcsid[] = "$Id: named-xfer.c,v 1.4 1995/08/20 21:49:40 peter Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -79,6 +79,7 @@ static char rcsid[] = "$Id: named-xfer.c,v 8.10 1995/12/06 20:34:38 vixie Exp $" #include <sys/socket.h> #include <netinet/in.h> +#include <netiso/iso.h> #if defined(__osf__) # include <sys/mbuf.h> # include <net/route.h> @@ -215,7 +216,7 @@ main(argc, argv) case 'z': /* zone == domain */ domain = optarg; domain_len = strlen(domain); - while ((domain_len > 0) && + while ((domain_len > 0) && (domain[domain_len-1] == '.')) domain[--domain_len] = '\0'; break; @@ -354,7 +355,7 @@ main(argc, argv) buildprotolist(); /* init zone data */ - + zp = &zone; #ifdef STUBS if (stub_only) @@ -441,7 +442,7 @@ main(argc, argv) } /*NOTREACHED*/ } - + static char *UsageText[] = { "\t-z zone_to_transfer\n", "\t-f db_file\n", @@ -566,7 +567,7 @@ getzone(zp, serial_no, port) syslog(LOG_INFO, "socket: %m"); error++; break; - } + } dprintf(2, (ddt, "connecting to server #%d [%s].%d\n", cnt+1, inet_ntoa(sin.sin_addr), ntohs(sin.sin_port))); @@ -604,7 +605,7 @@ getzone(zp, serial_no, port) syslog(LOG_INFO, "writemsg: %m"); error++; (void) my_close(s); - continue; + continue; } /* * Get out your butterfly net and catch the SOA @@ -766,7 +767,7 @@ getzone(zp, serial_no, port) type = T_SOA; else if (!nscnt) type = T_NS; - else + else type = T_SOA; } else #endif @@ -808,7 +809,7 @@ getzone(zp, serial_no, port) "writemsg: %m"); error++; (void) my_close(s); - break; + break; } } /* @@ -884,7 +885,7 @@ getzone(zp, serial_no, port) error++; break; } - + } else { #endif /*STUBS*/ n = print_output(buf, bufsize, cp); @@ -1037,7 +1038,7 @@ read_alarm() { read_interrupted = 1; } - + static int netread(fd, buf, len, timeout) int fd; @@ -1154,6 +1155,7 @@ print_output(msg, msglen, rrp) register HEADER *hp = (HEADER *) msg; u_int32_t addr, ttl; int i, j, tab, result, class, type, dlen, n1, n; + struct iso_addr isoa; char data[BUFSIZ]; u_char *cp1, *cp2, *temp_ptr; char *cdata, *origin, *proto, dname[MAXDNAME]; @@ -1360,7 +1362,7 @@ print_output(msg, msglen, rrp) * that might have been altered by ignored records. * (This means that we sometimes output unnecessary $ORIGIN * lines, but that is harmless.) - * + * * Also update prev_comment now. */ if (prev_comment && ignore[0] == '\0') { @@ -1537,7 +1539,11 @@ print_output(msg, msglen, rrp) break; case T_NSAP: - fprintf(dbfp, "%s\n", inet_nsap_ntoa(n, cp, NULL)); + isoa.isoa_len = n; + if (isoa.isoa_len > sizeof(isoa.isoa_genaddr)) + isoa.isoa_len = sizeof(isoa.isoa_genaddr); + bcopy(cp, isoa.isoa_genaddr, isoa.isoa_len); + fprintf(dbfp, "%s\n", iso_ntoa(&isoa)); break; case T_UINFO: |