Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/dist/bind/bin Pull up revision 1.1 (new) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/85e8241206e8
branches:  netbsd-1-4
changeset: 469793:85e8241206e8
user:      he <he%NetBSD.org@localhost>
date:      Sat Dec 04 16:57:02 1999 +0000

description:
Pull up revision 1.1 (new) (requested by christos and veego):
  Update to BIND 8.2.2-P5.

diffstat:

 dist/bind/bin/named-xfer/named-xfer.c |  2947 +++++++++++++++++++++++++++++++++
 dist/bind/bin/ndc/ndc.c               |   700 +++++++
 dist/bind/bin/nslookup/commands.l     |   224 ++
 3 files changed, 3871 insertions(+), 0 deletions(-)

diffs (truncated from 3883 to 300 lines):

diff -r 9d2d9b83c3b9 -r 85e8241206e8 dist/bind/bin/named-xfer/named-xfer.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/dist/bind/bin/named-xfer/named-xfer.c     Sat Dec 04 16:57:02 1999 +0000
@@ -0,0 +1,2947 @@
+/*     $NetBSD: named-xfer.c,v 1.1.1.1.2.2 1999/12/04 16:57:02 he Exp $        */
+
+/*
+ * The original version of named-xfer by Kevin Dunlap.
+ * Completed and integrated with named by David Waitzman
+ *     (dwaitzman%bbn.com@localhost) 3/14/88.
+ * Modified by M. Karels and O. Kure 10-88.
+ * Modified extensively since then by just about everybody.
+ */
+
+/*
+ * 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:
+ * 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.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software.  No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE.  IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+
+/*
+ * Portions Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * 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.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM 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.
+ */
+
+/*
+ * Portions Copyright (c) 1998 by MetaInfo, Incorporated.
+ * 
+ * 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 MetaInfo Incorporated 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 METAINFO INCORPORATED DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL METAINFO INCORPRATED
+ * 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.
+ */
+#if !defined(lint) && !defined(SABER)
+char copyright[] =
+"@(#) Copyright (c) 1988, 1990 The Regents of the University of California.\n\
+ portions Copyright (c) 1993 Digital Equipment Corporation\n\
+ portions Copyright (c) 1998 MetaInfo, Inc.\n\
+ portions Copyright (c) 1995, 1996 Internet Software Consorium\n\
+ All rights reserved.\n";
+#endif /* not lint */
+
+#if !defined(lint) && !defined(SABER)
+static const char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91";
+static const char rcsid[] = "Id: named-xfer.c,v 8.89 1999/11/09 20:36:54 marka Exp";
+#endif /* not lint */
+
+#include "port_before.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/file.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include <netinet/in.h>
+#include <netdb.h>
+#include <arpa/inet.h>
+#include <arpa/nameser.h>
+
+#include <limits.h>
+#include <ctype.h>
+#include <errno.h>
+#include <math.h>
+#include <resolv.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <syslog.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+#include <isc/eventlib.h>
+#include <isc/list.h>
+#include <isc/logging.h>
+/* This still uses malloc/free, but the tsig routines allocate memory with
+ * memget, and we free it with memput.
+ */
+#include <isc/memcluster.h>
+
+#include <isc/dst.h>
+
+#include "port_after.h"
+
+
+#define MAIN_PROGRAM
+#include "../named/named.h"
+#undef MAIN_PROGRAM
+
+#define MAX_XFER_RESTARTS 2
+
+#define ENABLE_IXFR 0
+
+# ifdef SHORT_FNAMES
+extern long pathconf __P((const char *path, int name));        /* XXX */
+# endif
+
+
+static struct zoneinfo zone;           /* zone information */
+
+static char            *ddtfilename = NULL,
+                       *ddtfile = NULL;
+
+static char   *tmpname = NULL, 
+                       *tmpiname = NULL,       /* temporary file name for ixfr transaction file */
+                       *domain;        /* domain being xfered */
+
+static int             quiet = 0,
+                       read_interrupted = 0,
+                       curclass,
+                       domain_len;             /* strlen(domain) */
+
+static FILE            *fp = NULL,
+                       *dbfp = NULL,
+                       *ixfp = NULL;
+
+static char            *ProgName;
+
+static void            usage(const char *),
+                       tsig_init(const char *);
+static int             getzone(struct zoneinfo *, u_int32_t, int),
+                       print_output(struct zoneinfo *, u_int32_t, 
+                                    u_char *, int, u_char *),
+                       netread(int, char *, int, int),
+                       writemsg(int, const u_char *, int);
+static void            ixfr_log(const u_char *msg, int len, int *delete,
+                                FILE *file, struct sockaddr_in *sin,
+                                char *domain, u_int32_t serial_no, int *);
+static SIG_FN          read_alarm(void);
+static SIG_FN          term_handler(void);
+static const char      *soa_zinfo(struct zoneinfo *, u_char *, u_char*),
+                       *tsig_rcode(int);
+
+struct zoneinfo                zp_start, zp_finish;
+
+static int             restarts = 0;
+static int             check_serial = 0;
+static int             xfr_qtype = T_AXFR;
+static u_int32_t       old_serial;
+
+FILE                   *ddt = NULL;
+int                    servermethode[NSMAX];
+char                   *soa_buf;
+
+typedef struct _tsig_node {
+       struct in_addr addr;
+       DST_KEY *dst_key;
+       LINK(struct _tsig_node) link;
+} tsig_node;
+
+LIST(tsig_node)                tsig_list;
+
+/*
+ * Debugging printf.
+ */
+void
+dprintf(int level, const char *format, ...) {
+       va_list ap;
+
+       va_start(ap, format);
+       if (ddt != NULL && debug >= level)
+               (void) vfprintf(ddt, format, ap);
+       va_end(ap);
+}
+
+static int
+init_xfer_logging() {
+       log_channel chan;
+
+       if (log_new_context(ns_log_max_category, NULL, &log_ctx) < 0) {
+               perror("log_new_context");
+               return (0);
+       }
+       log_option(log_ctx, LOG_OPTION_DEBUG, debug);
+       log_option(log_ctx, LOG_OPTION_LEVEL, debug);
+
+       log_ctx_valid = 1;
+
+       chan = log_new_syslog_channel(0, 0, LOG_DAEMON);
+       if (chan == NULL)
+               return (0);
+       if (log_add_channel(log_ctx, ns_log_default, chan) < 0) {
+               perror("log_add_channel syslog");
+               return (0);
+       }
+
+       if (debug) {
+               unsigned int flags = LOG_USE_CONTEXT_LEVEL|LOG_REQUIRE_DEBUG;
+
+               chan = log_new_file_channel(flags, 0, NULL, ddt, 0, ULONG_MAX);
+               if (chan == NULL)
+                       return (0);
+               if (log_add_channel(log_ctx, ns_log_default, chan) < 0) {
+                       perror("log_add_channel debug");
+                       return (0);
+               }
+       }
+
+       return (1);
+}
+
+void cleanup_for_exit(void) {
+#ifdef DEBUG
+       if (!debug)
+#endif



Home | Main Index | Thread Index | Old Index