Source-Changes-HG archive

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

[src/trunk]: src/dist/bind sync with 8.3.3.



details:   https://anonhg.NetBSD.org/src/rev/a92fa6d3f13b
branches:  trunk
changeset: 533354:a92fa6d3f13b
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Jun 28 06:11:47 2002 +0000

description:
sync with 8.3.3.

diffstat:

 dist/bind/README                      |    5 +
 dist/bind/bin/named-xfer/named-xfer.c |   10 +-
 dist/bind/bin/named/ns_ctl.c          |  104 ++++++++++++++++++-
 dist/bind/bin/named/ns_defs.h         |    5 +-
 dist/bind/bin/named/ns_main.c         |   33 ++---
 dist/bind/bin/named/ns_maint.c        |   15 ++-
 dist/bind/bin/named/ns_resp.c         |   23 +++-
 dist/bind/bin/ndc/ndc.c               |  188 +++++++++++++++++++++++++++++++++-
 dist/bind/lib/irs/dns_ho.c            |   52 ++++----
 dist/bind/lib/irs/dns_nw.c            |   24 +--
 10 files changed, 381 insertions(+), 78 deletions(-)

diffs (truncated from 991 to 300 lines):

diff -r 4a91fbddec73 -r a92fa6d3f13b dist/bind/README
--- a/dist/bind/README  Fri Jun 28 05:59:12 2002 +0000
+++ b/dist/bind/README  Fri Jun 28 06:11:47 2002 +0000
@@ -10,6 +10,11 @@
 Note that BIND 8 is in "end-of-life", having been replaced by BIND 9.  See
 http://www.isc.org/ for more details.
 
+BIND 8.3.3 Highlights
+       Security Fix libbind. All applications linked against libbind
+       need to relinked.
+       'rndc restart' now preserves named's arguements
+
 BIND 8.3.2 Highlights
        dig, nslookup, host and nsupdate have improved IPv6 support.
 
diff -r 4a91fbddec73 -r a92fa6d3f13b dist/bind/bin/named-xfer/named-xfer.c
--- a/dist/bind/bin/named-xfer/named-xfer.c     Fri Jun 28 05:59:12 2002 +0000
+++ b/dist/bind/bin/named-xfer/named-xfer.c     Fri Jun 28 06:11:47 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: named-xfer.c,v 1.5 2002/06/20 11:42:59 itojun Exp $    */
+/*     $NetBSD: named-xfer.c,v 1.6 2002/06/28 06:11:51 itojun Exp $    */
 
 /*
  * The original version of named-xfer by Kevin Dunlap.
@@ -132,7 +132,7 @@
 
 #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.120 2002/01/29 06:54:52 marka Exp";
+static const char rcsid[] = "Id: named-xfer.c,v 8.121 2002/06/26 03:27:22 marka Exp";
 #endif /* not lint */
 
 #include "port_before.h"
@@ -752,6 +752,7 @@
        default:
                result = XFER_FAIL;
                /* fall through */
+       case XFER_REFUSED:
        case XFER_TIMEOUT:
        case XFER_FAIL:
                (void) unlink(tmpname);
@@ -1069,6 +1070,7 @@
        u_int32_t query_serial = serial_no;
        int first_soa_printed;
        struct in_addr z_axfr_src;
+       int refused = 0;
 
 #ifdef DEBUG
        if (debug) {
@@ -1632,6 +1634,7 @@
                                                       my_addr_text,
                                                       inet_ntoa(sin.sin_addr),
                                                       zp->z_origin);
+                                               refused = 1;
                                        } else {
                                                syslog(LOG_INFO,
                                  "[%s] record too short from [%s], zone %s\n",
@@ -1914,6 +1917,7 @@
                                                       my_addr_text,
                                                       inet_ntoa(sin.sin_addr),
                                                       zp->z_origin);
+                                               refused = 1;
                                        } else {
                                                syslog(LOG_INFO,
                                  "[%s] record too short from [%s], zone %s\n",
@@ -1953,6 +1957,8 @@
        }
        if (!error)
                return (XFER_TIMEOUT);
+       if (refused)
+               return (XFER_REFUSED);
        return (XFER_FAIL);
 }
 
diff -r 4a91fbddec73 -r a92fa6d3f13b dist/bind/bin/named/ns_ctl.c
--- a/dist/bind/bin/named/ns_ctl.c      Fri Jun 28 05:59:12 2002 +0000
+++ b/dist/bind/bin/named/ns_ctl.c      Fri Jun 28 06:11:47 2002 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: ns_ctl.c,v 1.5 2002/06/20 11:42:57 itojun Exp $        */
+/*     $NetBSD: ns_ctl.c,v 1.6 2002/06/28 06:11:48 itojun Exp $        */
 
 #if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "Id: ns_ctl.c,v 8.46 2001/12/19 11:53:48 marka Exp";
+static const char rcsid[] = "Id: ns_ctl.c,v 8.47 2002/06/24 07:11:07 marka Exp";
 #endif /* not lint */
 
 /*
@@ -114,6 +114,8 @@
 static void            verb_exec(struct ctl_sctx *, struct ctl_sess *,
                                  const struct ctl_verb *,
                                  const char *, u_int, const void *, void *);
+static void            exec_closure(struct ctl_sctx *, struct ctl_sess *,
+                                    void *);
 static void            verb_reload(struct ctl_sctx *, struct ctl_sess *,
                                    const struct ctl_verb *,
                                    const char *, u_int, const void *, void *);
@@ -143,6 +145,9 @@
 static void            verb_quit(struct ctl_sctx *, struct ctl_sess *,
                                  const struct ctl_verb *,
                                  const char *, u_int, const void *, void *);
+static void            verb_args(struct ctl_sctx *, struct ctl_sess *,
+                                 const struct ctl_verb *,
+                                 const char *, u_int, const void *, void *);
 
 /* Private data. */
 
@@ -164,6 +169,7 @@
        { "qrylog",     verb_querylog,  "qrylog"},
        { "help",       verb_help,      "help"},
        { "quit",       verb_quit,      "quit"},
+       { "args",       verb_args,      "args"},
        { NULL,         NULL,           NULL}
 };
 
@@ -796,14 +802,26 @@
                           saved_argv[0], save);
                ctl_response(sess, 502, save, 0, NULL, NULL, NULL,
                             NULL, 0);
+       } else if (user_name != NULL || group_name != NULL) {
+               ctl_response(sess, 502,
+                            "can't exec as user or group was specified",
+                            0, NULL, NULL, NULL, NULL, 0);
        } else {
-               ns_need(main_need_restart);
                ctl_response(sess, 250, "Restart initiated.", 0, NULL,
-                            NULL, NULL, NULL, 0);
+                            exec_closure, NULL, NULL, 0);
        }
 }
 
 static void
+exec_closure(struct ctl_sctx *sctx, struct ctl_sess *sess, void *uap) {
+
+       UNUSED(sctx);
+       UNUSED(sess);
+       UNUSED(uap);
+       ns_need(main_need_restart);
+}
+
+static void
 verb_reload(struct ctl_sctx *ctl, struct ctl_sess *sess,
            const struct ctl_verb *verb, const char *rest,
            u_int respflags, const void *respctx, void *uctx)
@@ -1051,3 +1069,81 @@
        ctl_response(sess, 221, "End of control session.", CTL_EXIT, NULL,
                     NULL, NULL, NULL, 0);
 }
+
+static char hex[] = "0123456789abcdef";
+
+struct pvt_args {
+       int     argc;
+       char            text[MAX_STR_LEN];
+};
+
+static void
+args_closure(struct ctl_sctx *sctx, struct ctl_sess *sess, void *uap) {
+       struct pvt_args *pvt = ctl_getcsctx(sess);
+
+       UNUSED(sctx);
+       UNUSED(uap);
+
+       memput(pvt, sizeof *pvt);
+       ctl_setcsctx(sess, NULL);
+}
+
+static void
+verb_args(struct ctl_sctx *ctl, struct ctl_sess *sess,
+         const struct ctl_verb *verb, const char *rest,
+         u_int respflags, const void *respctx, void *uctx)
+{
+       struct pvt_args *pvt = ctl_getcsctx(sess);
+       char *cp, *tp;
+
+       UNUSED(ctl);
+       UNUSED(verb);
+       UNUSED(rest);
+       UNUSED(respflags);
+       UNUSED(respctx);
+       UNUSED(uctx);
+
+       if (pvt == NULL) {
+               unsigned int i = 0;
+               pvt = memget(sizeof *pvt);
+               if (pvt == NULL) {
+                       ctl_response(sess, 505, "(out of memory)",
+                                    0, NULL, NULL, NULL, NULL, 0);
+                       return;
+               }
+               pvt->argc = 0;
+               ctl_setcsctx(sess, pvt);
+
+               /* Send the arguement count. */
+               while (saved_argv[i] != NULL)
+                       i++;
+               sprintf(pvt->text, "%u", i);
+               ctl_response(sess, 250, pvt->text, CTL_MORE,
+                            NULL, args_closure, NULL, NULL, 0);
+               return;
+       }
+
+       /*
+        * Percent escape arguement.
+        */
+       cp = saved_argv[pvt->argc++];
+       tp = pvt->text;
+       while (cp && *cp != NULL)
+               if (*cp == '%' || *cp == ' ' ||
+                   !isprint((unsigned char)*cp)) {
+                       if (tp >= pvt->text + sizeof(pvt->text) - 4)
+                               break;
+                       *tp++ = '%';
+                       *tp++ = hex[(*cp>>4)&0xf];
+                       *tp++ = hex[(*cp++)&0xf];
+               } else {
+                       if (tp >= pvt->text + sizeof(pvt->text) - 2)
+                               break;
+                       *tp++ = *cp++;
+               }
+       *tp = '\0';
+       
+       ctl_response(sess, 250, pvt->text, 
+                    saved_argv[pvt->argc] == NULL ? 0 : CTL_MORE,
+                    NULL, args_closure, NULL, NULL, 0);
+}
diff -r 4a91fbddec73 -r a92fa6d3f13b dist/bind/bin/named/ns_defs.h
--- a/dist/bind/bin/named/ns_defs.h     Fri Jun 28 05:59:12 2002 +0000
+++ b/dist/bind/bin/named/ns_defs.h     Fri Jun 28 06:11:47 2002 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: ns_defs.h,v 1.5 2002/06/20 11:42:57 itojun Exp $       */
+/*     $NetBSD: ns_defs.h,v 1.6 2002/06/28 06:11:48 itojun Exp $       */
 
 /*
  *     from ns.h       4.33 (Berkeley) 8/23/90
- *     Id: ns_defs.h,v 8.120 2002/05/24 03:04:56 marka Exp
+ *     Id: ns_defs.h,v 8.121 2002/06/26 03:27:19 marka Exp
  */
 
 /*
@@ -439,6 +439,7 @@
 #define XFER_SUCCESSAXFR 4              /* named-xfr recived a xfr */
 #define XFER_SUCCESSIXFR 5              /* named-xfr recived a ixfr */
 #define XFER_SUCCESSAXFRIXFRFILE 6      /* named-xfr received AXFR for IXFR */
+#define XFER_REFUSED 7                 /* one master returned REFUSED */
 #define XFER_ISAXFR     -1              /* the last XFR is AXFR */
 #define XFER_ISIXFR     -2              /* the last XFR is IXFR */
 #define XFER_ISAXFRIXFR        -3              /* the last XFR is AXFR but we must create IXFR base */
diff -r 4a91fbddec73 -r a92fa6d3f13b dist/bind/bin/named/ns_main.c
--- a/dist/bind/bin/named/ns_main.c     Fri Jun 28 05:59:12 2002 +0000
+++ b/dist/bind/bin/named/ns_main.c     Fri Jun 28 06:11:47 2002 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: ns_main.c,v 1.12 2002/06/20 11:42:57 itojun Exp $      */
+/*     $NetBSD: ns_main.c,v 1.13 2002/06/28 06:11:49 itojun Exp $      */
 
 #if !defined(lint) && !defined(SABER)
 static const char sccsid[] = "@(#)ns_main.c    4.55 (Berkeley) 7/1/91";
-static const char rcsid[] = "Id: ns_main.c,v 8.159 2002/06/05 04:53:48 marka Exp";
+static const char rcsid[] = "Id: ns_main.c,v 8.160 2002/06/24 07:06:55 marka Exp";
 #endif /* not lint */
 
 /*
@@ -178,7 +178,7 @@
 static u_int16_t               nsid_state2;
 static int                     nsid_algorithm;
 
-static int                     needs = 0, needs_exit = 0;
+static int                     needs = 0, needs_exit = 0, needs_restart = 0;
 static handler                 handlers[main_need_num];
 static void                    savedg_waitfunc(evContext, void*, const void*);
 static void                    need_waitfunc(evContext, void *, const void *);
@@ -560,7 +560,10 @@
                else
                        INSIST_ERR(errno == EINTR);
        }
-       ns_info(ns_log_default, "named shutting down");
+       if (needs_restart)
+               ns_info(ns_log_default, "named restarting");
+       else
+               ns_info(ns_log_default, "named shutting down");
 #ifdef BIND_UPDATE
        dynamic_about_to_exit();
 #endif
@@ -573,8 +576,11 @@
        else
                shutdown_configuration();
 
-       /* Cleanup for system-dependent stuff */
-       custom_shutdown();
+       if (needs_restart)
+               execvp(saved_argv[0], saved_argv);
+       else
+               /* Cleanup for system-dependent stuff */
+               custom_shutdown();
        
        return (0);
 }
@@ -2777,19 +2783,8 @@
        
 static void
 ns_restart(void) {



Home | Main Index | Thread Index | Old Index