386BSD 0.1 development
[unix-history] / usr / src / usr.sbin / named / db_load.c
index 507917f..10709ff 100644 (file)
@@ -2,23 +2,37 @@
  * Copyright (c) 1986, 1988, 1990 Regents of the University of California.
  * All rights reserved.
  *
  * Copyright (c) 1986, 1988, 1990 Regents of the University of California.
  * All rights reserved.
  *
- * Redistribution and use in source and binary forms are permitted provided
- * that: (1) source distributions retain this entire copyright notice and
- * comment, and (2) distributions including binaries display the following
- * acknowledgement:  ``This product includes software developed by the
- * University of California, Berkeley and its contributors'' in the
- * documentation or other materials provided with the distribution and in
- * all advertising materials mentioning features or use of this software.
- * 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 ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ * 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.
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)db_load.c  4.37 (Berkeley) 6/1/90";
+static char sccsid[] = "@(#)db_load.c  4.38 (Berkeley) 3/2/91";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -172,7 +186,7 @@ db_load(filename, in_origin, zp, doinginclude)
                        continue;
 
                case ORIGIN:
                        continue;
 
                case ORIGIN:
-                       (void) strcpy(buf, origin);
+                       (void) strcpy((char *)buf, origin);
                        if (!getword(origin, sizeof(origin), fp))
                                break;
 #ifdef DEBUG
                        if (!getword(origin, sizeof(origin), fp))
                                break;
 #ifdef DEBUG
@@ -232,13 +246,13 @@ db_load(filename, in_origin, zp, doinginclude)
                                        break;
                        }
                        for (mp = m_class; mp < m_class+NCLASS; mp++)
                                        break;
                        }
                        for (mp = m_class; mp < m_class+NCLASS; mp++)
-                               if (!strcasecmp(buf, mp->token)) {
+                               if (!strcasecmp((char *)buf, mp->token)) {
                                        class = mp->val;
                                        (void) getword(buf, sizeof(buf), fp);
                                        break;
                                }
                        for (mp = m_type; mp < m_type+NTYPE; mp++)
                                        class = mp->val;
                                        (void) getword(buf, sizeof(buf), fp);
                                        break;
                                }
                        for (mp = m_type; mp < m_type+NTYPE; mp++)
-                               if (!strcasecmp(buf, mp->token)) {
+                               if (!strcasecmp((char *)buf, mp->token)) {
                                        type = mp->val;
                                        goto fndtype;
                                }
                                        type = mp->val;
                                        goto fndtype;
                                }
@@ -282,7 +296,7 @@ db_load(filename, in_origin, zp, doinginclude)
                                break;
 
                        case T_HINFO:
                                break;
 
                        case T_HINFO:
-                               n = strlen(buf);
+                               n = strlen((char *)buf);
                                if (n > 255) {
                                    syslog(LOG_WARNING,
                                        "%s: line %d: CPU type too long",
                                if (n > 255) {
                                    syslog(LOG_WARNING,
                                        "%s: line %d: CPU type too long",
@@ -294,7 +308,7 @@ db_load(filename, in_origin, zp, doinginclude)
                                n++;
                                if (!getword(buf, sizeof(buf), fp))
                                        break;
                                n++;
                                if (!getword(buf, sizeof(buf), fp))
                                        break;
-                               i = strlen(buf);
+                               i = strlen((char *)buf);
                                if (i > 255) {
                                    syslog(LOG_WARNING,
                                        "%s: line %d: OS type too long",
                                if (i > 255) {
                                    syslog(LOG_WARNING,
                                        "%s: line %d: OS type too long",
@@ -309,15 +323,16 @@ db_load(filename, in_origin, zp, doinginclude)
 
                        case T_SOA:
                        case T_MINFO:
 
                        case T_SOA:
                        case T_MINFO:
-                               (void) strcpy(data, buf);
+                               (void) strcpy((char *)data, (char *)buf);
                                makename(data, origin);
                                makename(data, origin);
-                               cp = data + strlen(data) + 1;
-                               if (!getword(cp, sizeof(data) - (cp - data),fp)) {
+                               cp = data + strlen((char *)data) + 1;
+                               if (!getword(cp,
+                                   sizeof(data) - (cp - data),fp)) {
                                        n = cp - data;
                                        break;
                                }
                                makename(cp, origin);
                                        n = cp - data;
                                        break;
                                }
                                makename(cp, origin);
-                               cp += strlen(cp) + 1;
+                               cp += strlen((char *)cp) + 1;
                                if (type == T_MINFO) {
                                        n = cp - data;
                                        break;
                                if (type == T_MINFO) {
                                        n = cp - data;
                                        break;
@@ -379,26 +394,30 @@ db_load(filename, in_origin, zp, doinginclude)
                        case T_MG:
                        case T_MR:
                        case T_PTR:
                        case T_MG:
                        case T_MR:
                        case T_PTR:
-                               (void) strcpy(data, buf);
+                               (void) strcpy((char *)data, (char *)buf);
                                makename(data, origin);
                                makename(data, origin);
-                               n = strlen(data) + 1;
+                               n = strlen((char *)data) + 1;
                                break;
 
                        case T_UINFO:
                                break;
 
                        case T_UINFO:
-                               cp = (u_char *)index(buf, '&');
+                               cp = (u_char *)index((char *)buf, '&');
                                bzero(data, sizeof(data));
                                if ( cp != NULL) {
                                bzero(data, sizeof(data));
                                if ( cp != NULL) {
-                                       (void) strncpy(data, buf, cp - buf);
+                                       (void) strncpy((char *)data,
+                                           (char *)buf, cp - buf);
                                        op = index(domain, '.');
                                        if ( op != NULL)
                                        op = index(domain, '.');
                                        if ( op != NULL)
-                                           (void) strncat(data,
+                                           (void) strncat((char *)data,
                                                domain,op-domain);
                                        else
                                                domain,op-domain);
                                        else
-                                               (void) strcat(data, domain);
-                                       (void) strcat(data, ++cp);
+                                               (void) strcat((char *)data,
+                                                   domain);
+                                       (void) strcat((char *)data,
+                                           (char *)++cp);
                                } else
                                } else
-                                       (void) strcpy(data, buf);
-                               n = strlen(data) + 1;
+                                       (void) strcpy((char *)data,
+                                           (char *)buf);
+                               n = strlen((char *)data) + 1;
                                break;
                        case T_MX:
                                n = 0;
                                break;
                        case T_MX:
                                n = 0;
@@ -414,17 +433,17 @@ db_load(filename, in_origin, zp, doinginclude)
 
                                if (!getword(buf, sizeof(buf), fp))
                                            break;
 
                                if (!getword(buf, sizeof(buf), fp))
                                            break;
-                               (void) strcpy(cp,buf);
+                               (void) strcpy((char *)cp, (char *)buf);
                                makename(cp, origin);
                                /* get pointer to place in data */
                                makename(cp, origin);
                                /* get pointer to place in data */
-                               cp += strlen(cp) +1;
+                               cp += strlen((char *)cp) +1;
 
                                /* now save length */
                                n = (cp - data);
                                break;
 
                        case T_TXT:
 
                                /* now save length */
                                n = (cp - data);
                                break;
 
                        case T_TXT:
-                               i = strlen(buf);
+                               i = strlen((char *)buf);
                                cp = data;
                                cp1 = buf;
                                /*
                                cp = data;
                                cp1 = buf;
                                /*
@@ -459,8 +478,9 @@ db_load(filename, in_origin, zp, doinginclude)
                                    if (debug)
                                        fprintf(ddt, "loading T_UNSPEC\n");
 #endif DEBUG
                                    if (debug)
                                        fprintf(ddt, "loading T_UNSPEC\n");
 #endif DEBUG
-                                    if (rcode = atob(buf, strlen(buf), data,
-                                                   sizeof(data), &n)) {
+                                    if (rcode = atob(buf,
+                                       strlen((char *)buf), data,
+                                       sizeof(data), &n)) {
                                         if (rcode == CONV_OVERFLOW) {
 #ifdef DEBUG
                                             if (debug)
                                         if (rcode == CONV_OVERFLOW) {
 #ifdef DEBUG
                                             if (debug)