Commit Diff


commit - 9e58f57ecfc14e4a294969440cc27c593e376723
commit + 27110135a3f008761b9c98da1717e78cd3718c7f
blob - 6192d32e471111b3405817abb7b6458f4b7ba79b
blob + 8f230b4e1b39dadf22df47771ae4c6cddec26841
--- Makefile.netbsd
+++ Makefile.netbsd
@@ -2,9 +2,9 @@ PROG=wildcarddnsd
 
 SRCS=main.c parse.y reply.c additional.c region.c wildcard.c recurse.c log.c axfr.c filter.c ratelimit.c whitelist.c
 
-CFLAGS= -Wall -g -I/usr/pkg/include/db46/
+CFLAGS= -Wall -g -I/usr/pkg/include/db5/
 LDFLAGS= -Wall -g -L/usr/pkg/lib -R/usr/pkg/lib
-LDADD= -lcrypto -lssl -ldb46
+LDADD= -lcrypto -lssl -ldb5
 
 OBJDIR=.
 BINDIR=/usr/local/sbin
blob - fac8430101a4bc654fd4deb9fbcf2d1523b6e076
blob + f6ab5545763e2362ad3916188212f22c0bbd46f6
--- README
+++ README
@@ -1,4 +1,4 @@
-$Id: README,v 1.30 2014/11/07 09:13:25 pjp Exp $
+$Id: README,v 1.31 2014/11/07 10:33:12 pjp Exp $
 
 1. README
 2. WHY WILDCARDNS?
@@ -130,9 +130,22 @@ $ make install
 3.4 NetBSD
 ----------
 
-I don't have a NetBSD box handy at the moment.  Once I have one I'll look
-at this process.
+The tests for this were done on NetBSD 6.1.5
 
+## configure the platform
+$ sh configure
+## the following will install the development programs you'll need (as root)
+$ cd /usr/pkgsrc/databases/db5 && make install
+## add a privsep user with a chroot directory (as root)
+$ useradd -m wdnsd
+## create the db directory (as root)
+$ mkdir -p /var/db/wdns 
+## make the program
+$ make
+## install the binary (as root)
+$ make install
+## done, create a config file and start wildcarddnsd
+
 3.5 Mac OS X
 ------------
 
@@ -147,7 +160,7 @@ Operating System**| makes and compiles | responds to q
 ------------------+--------------------+---------------------+-------------+
 FreeBSD 10        |        yes         |       yes           | version 5   |
 ------------------+--------------------+---------------------+-------------+
-NetBSD 5.1        |        yes*        |       yes           | version 4.6 |
+NetBSD 5.6.1      |        yes*        |       yes           | version 5   |
 ------------------+--------------------+---------------------+-------------+
 OpenBSD 5.4       |        yes         |       yes           | version 4.6 |
 ------------------+--------------------+---------------------+-------------+
blob - 5843e3f104ceafe76cab5030f03a0288ae2fe73f
blob + 434e9b4ba2a06dfcfb94f707cac2ae7e37ca9760
--- main.c
+++ main.c
@@ -172,7 +172,7 @@ static struct tcps {
 } *tn1, *tnp, *tntmp;
 
 
-static const char rcsid[] = "$Id: main.c,v 1.102 2014/10/08 21:08:54 pjp Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.103 2014/11/07 10:33:12 pjp Exp $";
 
 /* 
  * MAIN - set up arguments, set up database, set up sockets, call mainloop
@@ -234,7 +234,7 @@ main(int argc, char *argv[])
 			bind_list[bcount++] = optarg;	
 			break;
 		case 'c':
-#if !defined __OpenBSD__ && !defined __NetBSD__
+#if !defined __OpenBSD__ 
 			cachesize = atoi(optarg);
 #else
 			cachesize = strtonum(optarg, 1, 0xffffffff, NULL);
@@ -2750,7 +2750,13 @@ axfrentry:
 											continue;
 										}
 
+#ifdef __NetBSD__
+										ttlptr = (int *) CMSG_DATA(cmsg);
+#else
 										ttlptr = (u_char *) CMSG_DATA(cmsg);
+#endif
+
+
 										received_ttl = (u_int)*ttlptr;
                      				}
 				}
blob - 3a6771a293a98439066f4269596b1fecf2f94b28
blob + 7471629c310475854453406a63f79a6ae43224ed
--- parse.y
+++ parse.y
@@ -97,7 +97,7 @@ typedef struct {
 #define YYSTYPE_IS_DECLARED 1
 #endif
 
-static const char rcsid[] = "$Id: parse.y,v 1.24 2014/09/27 17:38:28 pjp Exp $";
+static const char rcsid[] = "$Id: parse.y,v 1.25 2014/11/07 10:33:12 pjp Exp $";
 static int version = 0;
 static int state = 0;
 static uint8_t region = 0;
@@ -1434,7 +1434,7 @@ yylex() 
 			}
 
 			for (cp = &buf[0]; *cp != '\0'; cp++) {
-				if ((! isdigit(*cp)) && (*cp != '.'))
+				if ((! isdigit((int)*cp)) && (*cp != '.'))
 					break;
 			}	
 
@@ -1596,7 +1596,7 @@ check_rr(char *domainname, char *mytype, int itype, in
 	}
 
 	for (i = 0, p = domainname; i < strlen(domainname); i++) {
-		*p = tolower(*p);
+		*p = tolower((int)*p);
 		p++;
 	}
 
@@ -1642,7 +1642,7 @@ fill_cname(char *name, char *type, int myttl, char *ho
 	int i ;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_CNAME, &converted_namelen);
@@ -1702,7 +1702,7 @@ fill_ptr(char *name, char *type, int myttl, char *host
 	int i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_PTR, &converted_namelen);
@@ -1763,7 +1763,7 @@ fill_spf(char *name, char *type, int myttl, char *msg)
 	int len, i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	if ((len = strlen(msg)) > 255) {
@@ -1817,7 +1817,7 @@ fill_naptr(char *name, char *type, int myttl, int orde
 	int i, naptr_namelen;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	if ((flagslen = strlen(flags)) > 255 ||
@@ -1895,7 +1895,7 @@ fill_txt(char *name, char *type, int myttl, char *msg)
 	int len, i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	if ((len = strlen(msg)) > 255) {
@@ -1949,7 +1949,7 @@ fill_sshfp(char *name, char *type, int myttl, int alg,
 	int len, i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_SSHFP, &converted_namelen);
@@ -2026,7 +2026,7 @@ fill_srv(char *name, char *type, int myttl, int priori
 	int len, i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_SRV, &converted_namelen);
@@ -2098,7 +2098,7 @@ fill_mx(char *name, char *type, int myttl, int priorit
 	int len, i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_MX, &converted_namelen);
@@ -2162,7 +2162,7 @@ fill_balance(char *name, char *type, int myttl, char *
 	int i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_BALANCE, &converted_namelen);
@@ -2227,7 +2227,7 @@ fill_a(char *name, char *type, int myttl, char *a)
 	int i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_A, &converted_namelen);
@@ -2290,7 +2290,7 @@ fill_aaaa(char *name, char *type, int myttl, char *aaa
 
 	
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_AAAA, &converted_namelen);
@@ -2350,7 +2350,7 @@ fill_ns(char *name, char *type, int myttl, char *names
 
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	if (strcasecmp(type, "ns") == 0) {
@@ -2432,7 +2432,7 @@ fill_soa(char *name, char *type, int myttl, char *auth
 	int i;
 
 	for (i = 0; i < strlen(name); i++) {
-		name[i] = tolower(name[i]);
+		name[i] = tolower((int)name[i]);
 	}
 
 	converted_name = check_rr(name, type, DNS_TYPE_SOA, &converted_namelen);
@@ -2713,7 +2713,9 @@ temp_inet_net_pton_ipv6(const char *src, void *dst, si
         int     bits;
         char    buf[sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:255:255:255:255/128")];
         char            *sep;
+#if defined __OpenBSD__ || defined __FreeBSD__
         const char      *errstr;
+#endif
 
 #ifndef __linux__
         if (strlcpy(buf, src, sizeof buf) >= sizeof buf) {
@@ -2737,12 +2739,12 @@ temp_inet_net_pton_ipv6(const char *src, void *dst, si
         if (sep == NULL)
                 return 128;
 
-#if ! defined __linux__ && ! defined __APPLE__
+#if ! defined __linux__ && ! defined __APPLE__ && ! defined __NetBSD__
         bits = strtonum(sep, 0, 128, &errstr);
-#else
-	bits = atoi(sep);
         if (errstr)
                 return (-1);
+#else
+	bits = atoi(sep);
 #endif
 
         return bits;