pkgsrc-WIP-changes archive

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

Add validns version 0.8 (apparently...)



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Thu Dec 20 17:34:31 2018 +0100
Changeset:	113014ac579f067d6ebe90fce6105571343e7cd3

Added Files:
	validns/DESCR
	validns/Makefile
	validns/PLIST
	validns/distinfo
	validns/patches/patch-Makefile
	validns/patches/patch-base32hex.c
	validns/patches/patch-base64.c
	validns/patches/patch-carp.c
	validns/patches/patch-cert.c
	validns/patches/patch-loc.c
	validns/patches/patch-main.c
	validns/patches/patch-naptr.c
	validns/patches/patch-nsec.c
	validns/patches/patch-nsec3.c
	validns/patches/patch-nsec3param.c
	validns/patches/patch-rr.c
	validns/patches/patch-textparse.c
	validns/patches/patch-tlsa.c
	validns/patches/patch-x25.c

Log Message:
Add validns version 0.8 (apparently...)

The github repository doesn't have any releases, but the
man page talks about version 0.8.

validns is a DNS and DSNSEC zone file validator.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=113014ac579f067d6ebe90fce6105571343e7cd3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 validns/DESCR                      |   1 +
 validns/Makefile                   |  19 ++
 validns/PLIST                      |   3 +
 validns/distinfo                   |  21 ++
 validns/patches/patch-Makefile     |  45 ++++
 validns/patches/patch-base32hex.c  |  15 ++
 validns/patches/patch-base64.c     |  15 ++
 validns/patches/patch-carp.c       |  16 ++
 validns/patches/patch-cert.c       |  24 ++
 validns/patches/patch-loc.c        |  60 +++++
 validns/patches/patch-main.c       |  92 ++++++++
 validns/patches/patch-naptr.c      |  15 ++
 validns/patches/patch-nsec.c       |  15 ++
 validns/patches/patch-nsec3.c      |  15 ++
 validns/patches/patch-nsec3param.c |  15 ++
 validns/patches/patch-rr.c         |  24 ++
 validns/patches/patch-textparse.c  | 450 +++++++++++++++++++++++++++++++++++++
 validns/patches/patch-tlsa.c       |  24 ++
 validns/patches/patch-x25.c        |  15 ++
 19 files changed, 884 insertions(+)

diffs:
diff --git a/validns/DESCR b/validns/DESCR
new file mode 100644
index 0000000000..d48cd376fd
--- /dev/null
+++ b/validns/DESCR
@@ -0,0 +1 @@
+validns is a DNS and DSNSEC zone file validator.
diff --git a/validns/Makefile b/validns/Makefile
new file mode 100644
index 0000000000..25e7d5caa8
--- /dev/null
+++ b/validns/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD$
+
+DISTNAME=	validns
+PKGNAME=	validns-0.8
+CATEGORIES=	net
+MASTER_SITES=	${MASTER_SITE_GITHUB:=tobez/}
+GITHUB_PROJECT=	validns
+GITHUB_TAG=	f423245b9867359398f83e8a60fea167ad7694ca
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+COMMENT=	DNS and DNSSEC zone file validator
+LICENSE=	2-clause-bsd
+
+USE_LANGUAGES=	c
+USE_TOOLS+=	gmake
+WRKSRC=		${WRKDIR}/${DISTNAME}-${GITHUB_TAG}
+
+.include "../../wip/judy/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/validns/PLIST b/validns/PLIST
new file mode 100644
index 0000000000..6eca3c991e
--- /dev/null
+++ b/validns/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD$
+bin/validns
+man/man1/validns.1
diff --git a/validns/distinfo b/validns/distinfo
new file mode 100644
index 0000000000..ed8e36a800
--- /dev/null
+++ b/validns/distinfo
@@ -0,0 +1,21 @@
+$NetBSD$
+
+SHA1 (validns-f423245b9867359398f83e8a60fea167ad7694ca.tar.gz) = ca6a82104a75ed28ae13ed7577cd57a355c239b5
+RMD160 (validns-f423245b9867359398f83e8a60fea167ad7694ca.tar.gz) = 218782537d73256fb9a2fbc50da32414857792e8
+SHA512 (validns-f423245b9867359398f83e8a60fea167ad7694ca.tar.gz) = 2b42d256712c823f0ab5549a05954c4d80f5849fcc33f17eba3d4680e65b8bc6b1e350dfbacd982b800981ac0308305e3a6fce2e990e687133a98ecb4d7be103
+Size (validns-f423245b9867359398f83e8a60fea167ad7694ca.tar.gz) = 230306 bytes
+SHA1 (patch-Makefile) = 9212b049087139c7446b9317e8bbbafb3c589cd6
+SHA1 (patch-base32hex.c) = be66cfc75a4d204e28af79096806b86f39c1e701
+SHA1 (patch-base64.c) = 9d89278c3023d785f4286163e3f21f0714e999a0
+SHA1 (patch-carp.c) = 1191373ede9a0b6b4e4023056cbcbbbcb1010f4b
+SHA1 (patch-cert.c) = 25cde2c4914c9c5e73b8e2c55211e4baabedddb3
+SHA1 (patch-loc.c) = 17705f915b28197a388d097223b4fd0486163398
+SHA1 (patch-main.c) = 8ac62bb59916c2d9f0c85b6a177b2cdf91ddb942
+SHA1 (patch-naptr.c) = 6247a5f25407b7cc2d95083e19b39b1425f43f9b
+SHA1 (patch-nsec.c) = 791910fe98705614a0656e66d707a4eac850af65
+SHA1 (patch-nsec3.c) = 36627ed0b73694e7b39ba287010ac28c7979da2c
+SHA1 (patch-nsec3param.c) = b396524fd5ef0321f1f9b84f7fa6533c851de24c
+SHA1 (patch-rr.c) = 67aba9922ec1584715bad1325d316a75fddf02ee
+SHA1 (patch-textparse.c) = 3cbabb87f56949c4fc0d722479d4768a9515f2d3
+SHA1 (patch-tlsa.c) = ec35acbbe41811cee845e3d7e503221c9fa5d0ec
+SHA1 (patch-x25.c) = 44d0a07bd2a669884ac2b13b655719753beae091
diff --git a/validns/patches/patch-Makefile b/validns/patches/patch-Makefile
new file mode 100644
index 0000000000..6f53e7d550
--- /dev/null
+++ b/validns/patches/patch-Makefile
@@ -0,0 +1,45 @@
+$NetBSD$
+
+Add -L and -Wl,-R args to link to pick up Judy library.
+Add "all" and "install" targets.
+Remove / comment-out non-pkgsrc include and library paths..
+
+--- Makefile.orig	2017-08-04 14:27:44.000000000 +0000
++++ Makefile
+@@ -1,9 +1,11 @@
+ # The following options seem to work fine on Linux, FreeBSD, and Darwin
+ OPTIMIZE=-O2 -g
+ CFLAGS=-Wall -Werror -pthread -fno-strict-aliasing
+-INCPATH=-I/usr/local/include -I/opt/local/include -I/usr/local/ssl/include
++# INCPATH=-I/usr/local/include -I/opt/local/include -I/usr/local/ssl/include
+ CC?=cc
+ 
++EXTRALPATH=-L${PREFIX}/lib -Wl,-R,${PREFIX}/lib
++
+ # These additional options work on Solaris/gcc to which I have an access
+ # (when combined with the options above, and CC=gcc).
+ #EXTRALPATH=-L/usr/local/ssl/lib -Wl,-R,/usr/local/ssl/lib
+@@ -18,6 +20,14 @@ CC?=cc
+ #EXTRALIBS-lrt -lnsl
+ #EXTRALINKING=-mt -lpthread
+ 
++all: validns
++
++install:
++	mkdir -p ${DESTDIR}/${PREFIX}/bin
++	install -c -m 555 validns ${DESTDIR}/${PREFIX}/bin
++	mkdir -p ${DESTDIR}/${PREFIX}/man/man1
++	install -c -m 444 validns.1 ${DESTDIR}/${PREFIX}/man/man1
++
+ validns: main.o carp.o mempool.o textparse.o base64.o base32hex.o \
+ 	rr.o soa.o a.o cname.o mx.o ns.o \
+ 	rrsig.o nsec.o dnskey.o txt.o aaaa.o \
+@@ -39,7 +49,7 @@ validns: main.o carp.o mempool.o textpar
+ 	    ipseckey.o cbtree.o mb.o mg.o mr.o minfo.o \
+ 	    afsdb.o x25.o isdn.o rt.o px.o kx.o \
+ 	    dlv.o dhcid.o nsap.o caa.o \
+-	    -L/usr/local/lib -L/opt/local/lib $(EXTRALPATH) \
++	    $(EXTRALPATH) \
+ 	    -lJudy -lcrypto $(EXTRALIBS) $(EXTRALINKING)
+ 
+ clean:
diff --git a/validns/patches/patch-base32hex.c b/validns/patches/patch-base32hex.c
new file mode 100644
index 0000000000..686be8f373
--- /dev/null
+++ b/validns/patches/patch-base32hex.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- base32hex.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ base32hex.c
+@@ -48,7 +48,7 @@ decode_base32hex(void *dest, char *src, 
+             v = *src - 'a' + 10;
+         else if (*src >= '0' && *src <= '9')
+             v = *src - '0';
+-        else if (isspace(*src) || *src == '=') {
++        else if (isspace((unsigned char)*src) || *src == '=') {
+             src++;
+             continue;
+         } else {
diff --git a/validns/patches/patch-base64.c b/validns/patches/patch-base64.c
new file mode 100644
index 0000000000..45d12ad7c0
--- /dev/null
+++ b/validns/patches/patch-base64.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- base64.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ base64.c
+@@ -39,7 +39,7 @@ decode_base64(void *dest, char *src, siz
+             v = 62;
+         else if (*src == '/')
+             v = 63;
+-        else if (isspace(*src) || *src == '=') {
++        else if (isspace((unsigned char)*src) || *src == '=') {
+             src++;
+             continue;
+         } else {
diff --git a/validns/patches/patch-carp.c b/validns/patches/patch-carp.c
new file mode 100644
index 0000000000..d3f62bcfa0
--- /dev/null
+++ b/validns/patches/patch-carp.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Add use of getprogname() for NetBSD and OpenBSD.
+This part of the code could do with some more work...
+
+--- carp.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ carp.c
+@@ -102,7 +102,7 @@ static char proggy[MAXPATHLEN];
+ 
+ const char *thisprogname(void)
+ {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+     return getprogname();
+ #elif defined(__APPLE__)
+     return getprogname();
diff --git a/validns/patches/patch-cert.c b/validns/patches/patch-cert.c
new file mode 100644
index 0000000000..88d695b682
--- /dev/null
+++ b/validns/patches/patch-cert.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- cert.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ cert.c
+@@ -29,7 +29,7 @@ static int extract_certificate_type(char
+     int type;
+     char *str_type;
+ 
+-    if (isdigit(**s)) {
++    if (isdigit((unsigned char)**s)) {
+         type = extract_integer(s, what, NULL);
+         if (type >= 1 && type <= 8)
+             return type;
+@@ -90,7 +90,7 @@ static struct rr* cert_parse(char *name,
+         return bitch("bad key tag");
+     rr->key_tag = key_tag;
+ 
+-    if (isdigit(*s)) {
++    if (isdigit((unsigned char)*s)) {
+         alg = extract_integer(&s, "algorithm", NULL);
+         if (alg < 0)    return NULL;
+         if (alg > 255)  return bitch("bad algorithm");
diff --git a/validns/patches/patch-loc.c b/validns/patches/patch-loc.c
new file mode 100644
index 0000000000..ea032a5f79
--- /dev/null
+++ b/validns/patches/patch-loc.c
@@ -0,0 +1,60 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- loc.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ loc.c
+@@ -64,7 +64,7 @@ static struct rr *loc_parse(char *name, 
+     deg = i;
+     min = 0;
+     sec = 0;
+-    if (isdigit(*s)) {
++    if (isdigit((unsigned char)*s)) {
+         i = extract_integer(&s, "minutes latitude", NULL);
+         if (i < 0)
+             return NULL;
+@@ -72,7 +72,7 @@ static struct rr *loc_parse(char *name, 
+             return bitch("minutes latitude not in the range 0..59");
+         min = i;
+ 
+-        if (isdigit(*s)) { /* restricted floating point, starting with a digit */
++        if (isdigit((unsigned char)*s)) { /* restricted floating point, starting with a digit */
+             if (extract_double(&s, "seconds latitude", &sec, 0) < 0)
+                 return NULL;
+             if (sec < 0 || sec > 59.999)
+@@ -89,7 +89,7 @@ static struct rr *loc_parse(char *name, 
+     } else {
+         return bitch("latitude: N or S is expected");
+     }
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         return bitch("latitude: N or S is expected");
+     }
+     s = skip_white_space(s);
+@@ -104,7 +104,7 @@ static struct rr *loc_parse(char *name, 
+     deg = i;
+     min = 0;
+     sec = 0;
+-    if (isdigit(*s)) {
++    if (isdigit((unsigned char)*s)) {
+         i = extract_integer(&s, "minutes longitude", NULL);
+         if (i < 0)
+             return NULL;
+@@ -112,7 +112,7 @@ static struct rr *loc_parse(char *name, 
+             return bitch("minutes longitude not in the range 0..59");
+         min = i;
+ 
+-        if (isdigit(*s)) { /* restricted floating point, starting with a digit */
++        if (isdigit((unsigned char)*s)) { /* restricted floating point, starting with a digit */
+             if (extract_double(&s, "seconds longitude", &sec, 0) < 0)
+                 return NULL;
+             if (sec < 0 || sec > 59.999)
+@@ -129,7 +129,7 @@ static struct rr *loc_parse(char *name, 
+     } else {
+         return bitch("longitude: E or W is expected");
+     }
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         return bitch("longitude: E or W is expected");
+     }
+     s = skip_white_space(s);
diff --git a/validns/patches/patch-main.c b/validns/patches/patch-main.c
new file mode 100644
index 0000000000..8c1341c885
--- /dev/null
+++ b/validns/patches/patch-main.c
@@ -0,0 +1,92 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- main.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ main.c
+@@ -109,8 +109,8 @@ static char *process_directive(char *s)
+     if (*(s+1) == 'O' && strncmp(s, "$ORIGIN", 7) == 0) {
+         char *o;
+         s += 7;
+-        if (!isspace(*s)) {
+-            if (isalnum(*s)) goto unrecognized_directive;
++        if (!isspace((unsigned char)*s)) {
++            if (isalnum((unsigned char)*s)) goto unrecognized_directive;
+             return bitch("bad $ORIGIN format");
+         }
+         s = skip_white_space(s);
+@@ -128,8 +128,8 @@ static char *process_directive(char *s)
+         }
+     } else if (*(s+1) == 'T' && strncmp(s, "$TTL", 4) == 0) {
+         s += 4;
+-        if (!isspace(*s)) {
+-            if (isalnum(*s)) goto unrecognized_directive;
++        if (!isspace((unsigned char)*s)) {
++            if (isalnum((unsigned char)*s)) goto unrecognized_directive;
+             return bitch("bad $TTL format");
+         }
+         s = skip_white_space(s);
+@@ -149,8 +149,8 @@ static char *process_directive(char *s)
+         char *lhs, *rdtype;
+ 
+         s += 9;
+-        if (!isspace(*s)) {
+-            if (isalnum(*s)) goto unrecognized_directive;
++        if (!isspace((unsigned char)*s)) {
++            if (isalnum((unsigned char)*s)) goto unrecognized_directive;
+             return bitch("bad $GENERATE format");
+         }
+         s = skip_white_space(s);
+@@ -190,13 +190,13 @@ static char *process_directive(char *s)
+         char *p, *f;
+         char c;
+         s += 8;
+-        if (!isspace(*s)) {
+-            if (isalnum(*s)) goto unrecognized_directive;
++        if (!isspace((unsigned char)*s)) {
++            if (isalnum((unsigned char)*s)) goto unrecognized_directive;
+             return bitch("bad $INCLUDE format");
+         }
+         s = skip_white_space(s);
+         p = s;
+-        while (*s && !isspace(*s) && *s != ';')
++        while (*s && !isspace((unsigned char)*s) && *s != ';')
+             s++;
+         c = *s;
+         *s = '\0';
+@@ -221,7 +221,7 @@ static char *process_directive(char *s)
+     } else {
+ unrecognized_directive:
+         s = d-1;
+-        while (isalnum(*d)) d++;
++        while (isalnum((unsigned char)*d)) d++;
+         *d = '\0';
+         return bitch("unrecognized directive: %s", s);
+     }
+@@ -276,7 +276,7 @@ read_zone_file(void)
+                 continue;
+ 
+             s = file_info->buf;
+-            if (!isspace(*s)) {
++            if (!isspace((unsigned char)*s)) {
+                 /* <domain-name>, $INCLUDE, $ORIGIN */
+                 if (*s == '$') {
+                     process_directive(s);
+@@ -298,7 +298,7 @@ read_zone_file(void)
+             }
+             if (G.default_ttl >= 0)
+                 ttl = G.default_ttl;
+-            if (isdigit(*s)) {
++            if (isdigit((unsigned char)*s)) {
+                 ttl = extract_timevalue(&s, "TTL");
+                 if (ttl < 0)
+                     continue;
+@@ -323,7 +323,7 @@ read_zone_file(void)
+                 if (!class)
+                     continue;
+                 if (*class == 'i' && *(class+1) == 'n' && *(class+2) == 0) {
+-                    if (isdigit(*s)) {
++                    if (isdigit((unsigned char)*s)) {
+                         ttl = extract_timevalue(&s, "TTL");
+                         if (ttl < 0)
+                             continue;
diff --git a/validns/patches/patch-naptr.c b/validns/patches/patch-naptr.c
new file mode 100644
index 0000000000..1bcfab95f4
--- /dev/null
+++ b/validns/patches/patch-naptr.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- naptr.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ naptr.c
+@@ -42,7 +42,7 @@ static struct rr *naptr_parse(char *name
+     if (text.length < 0)
+         return NULL;
+     for (i = 0; i < text.length; i++) {
+-        if (!isalnum(text.data[i])) {
++        if (!isalnum((unsigned char)text.data[i])) {
+             return bitch("flags contains illegal characters");
+         }
+     }
diff --git a/validns/patches/patch-nsec.c b/validns/patches/patch-nsec.c
new file mode 100644
index 0000000000..f044ac5a85
--- /dev/null
+++ b/validns/patches/patch-nsec.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- nsec.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ nsec.c
+@@ -133,7 +133,7 @@ void validate_nsec_chain(void)
+         freeall_temp();
+         s = rr->next_domain;
+         t = name;
+-        while (*s) *t++ = tolower(*s++);
++        while (*s) *t++ = tolower((unsigned char)*s++);
+         *t = 0;
+         rr_set = find_rr_set(T_NSEC, name);
+         if (!rr_set) {
diff --git a/validns/patches/patch-nsec3.c b/validns/patches/patch-nsec3.c
new file mode 100644
index 0000000000..bcdb030a5c
--- /dev/null
+++ b/validns/patches/patch-nsec3.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- nsec3.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ nsec3.c
+@@ -65,7 +65,7 @@ static struct rr* nsec3_parse(char *name
+         rr->salt.length = 0;
+         rr->salt.data = NULL;
+         s++;
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')')
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
+             return bitch("salt is not valid");
+         s = skip_white_space(s);
+     } else {
diff --git a/validns/patches/patch-nsec3param.c b/validns/patches/patch-nsec3param.c
new file mode 100644
index 0000000000..0d2d1707b3
--- /dev/null
+++ b/validns/patches/patch-nsec3param.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- nsec3param.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ nsec3param.c
+@@ -58,7 +58,7 @@ static struct rr* nsec3param_parse(char 
+         rr->salt.length = 0;
+         rr->salt.data = NULL;
+         s++;
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')')
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
+             return bitch("salt is not valid");
+         s = skip_white_space(s);
+     } else {
diff --git a/validns/patches/patch-rr.c b/validns/patches/patch-rr.c
new file mode 100644
index 0000000000..7dd86f06ab
--- /dev/null
+++ b/validns/patches/patch-rr.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- rr.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ rr.c
+@@ -449,7 +449,7 @@ invalid:
+     }
+     if (*s++ != '#')
+         goto invalid;
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')')
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')')
+         goto invalid;
+     s = skip_white_space(s);
+     if (!s) return NULL;
+@@ -841,7 +841,7 @@ int extract_algorithm(char **s, char *wh
+     int alg;
+     char *str_alg;
+ 
+-    if (isdigit(**s)) {
++    if (isdigit((unsigned char)**s)) {
+         alg = extract_integer(s, what, NULL);
+         if (algorithm_type(alg) == ALG_UNSUPPORTED) {
+             bitch("bad or unsupported algorithm %d", alg);
diff --git a/validns/patches/patch-textparse.c b/validns/patches/patch-textparse.c
new file mode 100644
index 0000000000..a02f284612
--- /dev/null
+++ b/validns/patches/patch-textparse.c
@@ -0,0 +1,450 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- textparse.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ textparse.c
+@@ -26,7 +26,7 @@
+ 
+ int empty_line_or_comment(char *s)
+ {
+-    while (isspace(*s)) s++;
++    while (isspace((unsigned char)*s)) s++;
+     if (!*s) return 1;
+     if (*s == ';')  return 1;
+     return 0;
+@@ -34,7 +34,7 @@ int empty_line_or_comment(char *s)
+ 
+ char *skip_white_space(char *s)
+ {
+-    while (isspace(*s)) s++;
++    while (isspace((unsigned char)*s)) s++;
+     if (*s == ';') {
+         while (*s) s++;
+     }
+@@ -76,20 +76,20 @@ static char *extract_name_slow(char **in
+     int d, l, ol;
+ 
+     while (1) {
+-        if (isalnum(*s) || *s == '_' || *s == '.' || *s == '-' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$')) {
++        if (isalnum((unsigned char)*s) || *s == '_' || *s == '.' || *s == '-' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$')) {
+             if (t-buf >= 1022)
+                 return bitch("name too long");
+             *t++ = *s++;
+         } else if (*s == '\\') {
+             s++;
+-            if (isdigit(*s)) {
++            if (isdigit((unsigned char)*s)) {
+                 d = *s - '0';
+                 s++;
+-                if (!isdigit(*s))
++                if (!isdigit((unsigned char)*s))
+                     return bitch("bad escape sequence");
+                 d = d*10 + *s - '0';
+                 s++;
+-                if (!isdigit(*s))
++                if (!isdigit((unsigned char)*s))
+                     return bitch("bad escape sequence");
+                 d = d*10 + *s - '0';
+                 s++;
+@@ -114,7 +114,7 @@ static char *extract_name_slow(char **in
+             break;
+         }
+     }
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         return bitch("%s is not valid", what);
+     }
+     *t = '\0';
+@@ -154,7 +154,7 @@ static char *extract_name_slow(char **in
+     if (!(options & KEEP_CAPITALIZATION)) {
+         t = buf;
+         while (*t) {
+-            *t = tolower(*t);
++            *t = tolower((unsigned char)*t);
+             t++;
+         }
+     }
+@@ -173,7 +173,7 @@ char *extract_name(char **input, char *w
+ 
+     if (*s == '@') {
+         s++;
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+             return bitch("literal @ in %s is not all by itself", what);
+         }
+         if (!file_info->current_origin) {
+@@ -181,7 +181,7 @@ char *extract_name(char **input, char *w
+         }
+         r = quickstrdup(file_info->current_origin);
+     } else {
+-        if (!(isalnum(*s) || *s == '_' || *s == '.' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$'))) {
++        if (!(isalnum((unsigned char)*s) || *s == '_' || *s == '.' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$'))) {
+             if (*s == '*') {
+                 wildcard = 1;
+             } else {
+@@ -191,9 +191,9 @@ char *extract_name(char **input, char *w
+             }
+         }
+         s++;
+-        while (isalnum(*s) || *s == '.' || *s == '-' || *s == '_' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$'))
++        while (isalnum((unsigned char)*s) || *s == '.' || *s == '-' || *s == '_' || *s == '/' || ((options & DOLLAR_OK_IN_NAMES) && *s == '$'))
+             s++;
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+             if (*s == '\\')
+                 return extract_name_slow(input, what, options);
+             return bitch("%s is not valid", what);
+@@ -226,7 +226,7 @@ char *extract_name(char **input, char *w
+     if (!(options & KEEP_CAPITALIZATION)) {
+         s = r;
+         while (*s) {
+-            *s = tolower(*s);
++            *s = tolower((unsigned char)*s);
+             s++;
+         }
+     }
+@@ -244,13 +244,13 @@ char *extract_label(char **input, char *
+     char *r = NULL;
+     char *end = NULL;
+ 
+-    if (!isalpha(*s)) {
++    if (!isalpha((unsigned char)*s)) {
+         return bitch("%s expected", what);
+     }
+     s++;
+-    while (isalnum(*s))
++    while (isalnum((unsigned char)*s))
+         s++;
+-    if (*s && !isspace(*s)) {
++    if (*s && !isspace((unsigned char)*s)) {
+         return bitch("%s is not valid", what);
+     }
+     if (!*s)    end = s;
+@@ -270,7 +270,7 @@ char *extract_label(char **input, char *
+     }
+     s = r;
+     while (*s) {
+-        *s = tolower(*s);
++        *s = tolower((unsigned char)*s);
+         s++;
+     }
+     return r;
+@@ -283,14 +283,14 @@ long long extract_integer(char **input, 
+     char *end = NULL;
+     char c;
+ 
+-    if (!isdigit(*s)) {
++    if (!isdigit((unsigned char)*s)) {
+         bitch("%s expected", what);
+         return -1;
+     }
+     s++;
+-    while (isdigit(*s))
++    while (isdigit((unsigned char)*s))
+         s++;
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         if (!extra_delimiters || strchr(extra_delimiters, *s) == NULL) {
+             bitch("%s is not valid", what);
+             return -1;
+@@ -320,9 +320,9 @@ int extract_double(char **input, char *w
+     char c;
+     int saw_m = 0;
+ 
+-    while (isdigit(*s) || *s == '+' || *s == '-' || *s == '.')
++    while (isdigit((unsigned char)*s) || *s == '+' || *s == '-' || *s == '.')
+         s++;
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         if (skip_m && (*s == 'm' || *s == 'M')) {
+             saw_m = 1;
+         } else {
+@@ -343,7 +343,7 @@ int extract_double(char **input, char *w
+ 
+     if (saw_m) {
+         s++;
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+             bitch("%s is not valid", what);
+             return -1;
+         }
+@@ -364,36 +364,36 @@ long extract_timevalue(char **input, cha
+     char *s = *input;
+     int r = 0, acc = 0;
+ 
+-    if (!isdigit(*s)) {
++    if (!isdigit((unsigned char)*s)) {
+         bitch("%s expected", what);
+         return -1;
+     }
+ next_component:
+     r = 0;
+-    while (isdigit(*s)) {
++    while (isdigit((unsigned char)*s)) {
+         r *= 10;
+         r += *s - '0';
+         s++;
+     }
+-    if (tolower(*s) == 's') {
++    if (tolower((unsigned char)*s) == 's') {
+         s++;
+-    } else if (tolower(*s) == 'm') {
++    } else if (tolower((unsigned char)*s) == 'm') {
+         r *= 60;
+         s++;
+-    } else if (tolower(*s) == 'h') {
++    } else if (tolower((unsigned char)*s) == 'h') {
+         r *= 3600;
+         s++;
+-    } else if (tolower(*s) == 'd') {
++    } else if (tolower((unsigned char)*s) == 'd') {
+         r *= 86400;
+         s++;
+-    } else if (tolower(*s) == 'w') {
++    } else if (tolower((unsigned char)*s) == 'w') {
+         r *= 604800;
+         s++;
+     }
+     acc += r;
+-    if (isdigit(*s)) goto next_component;
++    if (isdigit((unsigned char)*s)) goto next_component;
+ 
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -415,66 +415,66 @@ long long extract_timestamp(char **input
+     long long epoch = 0;
+     struct tm tm;
+ 
+-    if (!isdigit(*s)) {
++    if (!isdigit((unsigned char)*s)) {
+         bitch("%s expected", what);
+         return -1;
+     }
+     year = year*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     year = year*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     year = year*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     year = year*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     month = month*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     month = month*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     day = day*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     day = day*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     hour = hour*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     hour = hour*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     minute = minute*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     minute = minute*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     second = second*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (!isdigit(*s)) goto looks_like_epoch;
++    if (!isdigit((unsigned char)*s)) goto looks_like_epoch;
+     second = second*10 + *s - '0';
+     epoch = epoch*10 + *s - '0';
+     s++;
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -500,7 +500,7 @@ long long extract_timestamp(char **input
+     goto done;
+ 
+ looks_like_epoch:
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -516,14 +516,14 @@ int extract_ipv4(char **input, char *wha
+     char *s = *input;
+     char c;
+ 
+-    while (isdigit(*s) || *s == '.') {
++    while (isdigit((unsigned char)*s) || *s == '.') {
+         s++;
+     }
+     if (s == *input) {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -547,7 +547,7 @@ int extract_ipv6(char **input, char *wha
+     char *s = *input;
+     char c;
+ 
+-    while (isdigit(*s) || *s == ':' || *s == '.' ||
++    while (isdigit((unsigned char)*s) || *s == ':' || *s == '.' ||
+           (*s >= 'a' && *s <= 'f') || (*s >= 'A' && *s <= 'F'))
+     {
+         s++;
+@@ -556,7 +556,7 @@ int extract_ipv6(char **input, char *wha
+         bitch("%s is not valid", what);
+         return -1;
+     }
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -581,10 +581,10 @@ int extract_u64(char **input, char *what
+     uint8_t result = 0;
+     unsigned u;
+ 
+-    #define GETHEXBLOCK if (!isxdigit(*s)) { bitch("%s is not valid", what); return -1; } \
++    #define GETHEXBLOCK if (!isxdigit((unsigned char)*s)) { bitch("%s is not valid", what); return -1; } \
+         u = 0; \
+-        while (isxdigit(*s)) { \
+-            if (isdigit(*s)) { \
++        while (isxdigit((unsigned char)*s)) { \
++            if (isdigit((unsigned char)*s)) { \
+                 u = (u << 4) | (*s - '0'); \
+             } else if (*s >= 'a' && *s <= 'f') { \
+                 u = (u << 4) | (*s - 'a' + 10); \
+@@ -606,7 +606,7 @@ int extract_u64(char **input, char *what
+     #undef GETHEXBLOCK
+     #undef SKIPCOLON
+ 
+-    if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++    if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+         bitch("%s is not valid", what);
+         return -1;
+     }
+@@ -647,7 +647,7 @@ dump_binary_data(FILE *f, struct binary_
+         for (i = 0; i < 16 && mem_len > 0; i++, mem_len--, s++) {
+             o[pos[i]] = hex[*s >> 4];
+             o[pos[i]+1] = hex[*s & 0x0f];
+-            o[51+i] = isprint(*s) ? *s : '.';
++            o[51+i] = isprint((unsigned char)*s) ? *s : '.';
+         }
+         fprintf(f, "%s", o);
+     }
+@@ -662,11 +662,11 @@ struct binary_data extract_base64_binary
+     int bl;
+ 
+     while (s && *s) {
+-        if (!isalnum(*s) && *s != '=' && *s != '+' && *s != '/') {
++        if (!isalnum((unsigned char)*s) && *s != '=' && *s != '+' && *s != '/') {
+             bitch("%s expected", what);
+             return r;
+         }
+-        while (isalnum(*s) || *s == '=' || *s == '+' || *s == '/') {
++        while (isalnum((unsigned char)*s) || *s == '=' || *s == '+' || *s == '/') {
+             if (l64 >= 4095) {
+                 bitch("%s is too long", what);
+                 return r;
+@@ -737,7 +737,7 @@ struct binary_data extract_text(char **i
+     int c;
+ 
+     if (*s != '"') {
+-        while (*s && !isspace(*s)) {
++        while (*s && !isspace((unsigned char)*s)) {
+             o[l++] = *s++;
+         }
+         *input = skip_white_space(s);
+@@ -758,9 +758,9 @@ more_text:
+             if (*s == 0) {
+                 bitch("bad backslash quoting of %s", what);
+                 return r;
+-            } else if (isdigit(*s)) {
++            } else if (isdigit((unsigned char)*s)) {
+                 c = 0;
+-                while (isdigit(*s)) {
++                while (isdigit((unsigned char)*s)) {
+                     c = c*10 + *s - '0';
+                     s++;
+                 }
+@@ -814,7 +814,7 @@ struct binary_data extract_hex_binary_da
+     if (s[0] == '0' && (s[1] == 'x' || s[1] == 'X'))
+         s += 2;
+     if (eat_whitespace == EXTRACT_DONT_EAT_WHITESPACE) {
+-        while (isxdigit(*s)) {
++        while (isxdigit((unsigned char)*s)) {
+             if (hl >= 4095) {
+                 bitch("%s is too long", what);
+                 return r;
+@@ -823,18 +823,18 @@ struct binary_data extract_hex_binary_da
+             s++;
+             hl++;
+         }
+-        if (*s && !isspace(*s) && *s != ';' && *s != ')') {
++        if (*s && !isspace((unsigned char)*s) && *s != ';' && *s != ')') {
+             bitch("%s is not valid", what);
+             return r;
+         }
+         *input = skip_white_space(s);
+     } else if (eat_whitespace == EXTRACT_EAT_WHITESPACE) {
+         while (s && *s) {
+-            if (!isxdigit(*s)) {
++            if (!isxdigit((unsigned char)*s)) {
+                 bitch("%s expected", what);
+                 return r;
+             }
+-            while (isxdigit(*s)) {
++            while (isxdigit((unsigned char)*s)) {
+                 if (hl >= 4095) {
+                     bitch("%s is too long", what);
+                     return r;
+@@ -859,7 +859,7 @@ struct binary_data extract_hex_binary_da
+     memset(r.data, 0, r.length);
+     for (hi = 0; hi < hl-hb; hi++) {
+         r.data[hi/2] <<= 4;
+-        r.data[hi/2] |= 0x0f & (isdigit(hex[hi+hb]) ? hex[hi+hb] - '0' : tolower(hex[hi+hb]) - 'a' + 10);
++        r.data[hi/2] |= 0x0f & (isdigit((unsigned char)hex[hi+hb]) ? hex[hi+hb] - '0' : tolower((unsigned char)hex[hi+hb]) - 'a' + 10);
+     }
+     return r;
+ }
diff --git a/validns/patches/patch-tlsa.c b/validns/patches/patch-tlsa.c
new file mode 100644
index 0000000000..5499e2f4ae
--- /dev/null
+++ b/validns/patches/patch-tlsa.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- tlsa.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ tlsa.c
+@@ -105,7 +105,7 @@ not_a_prefixed_domain_name:
+             return moan(rr->file_name, rr->line, "not a proper prefixed DNS domain name");
+         }
+         s++;
+-        while (isdigit(*s)) {
++        while (isdigit((unsigned char)*s)) {
+             port = port * 10  + *s - '0';
+             s++;
+         }
+@@ -134,7 +134,7 @@ static void* smimea_validate_set(struct 
+ 
+         /* c93f1e400f26708f98cb19d936620da35eec8f72e57f9eec01c1afd6._smimecert.example.com. */
+         s = named_rr->name;
+-        while (isxdigit(*s)) {
++        while (isxdigit((unsigned char)*s)) {
+             hash_len++;
+             s++;
+         }
diff --git a/validns/patches/patch-x25.c b/validns/patches/patch-x25.c
new file mode 100644
index 0000000000..9342d53d90
--- /dev/null
+++ b/validns/patches/patch-x25.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+Args to isxxxx() etc. shall be "unsigned char".
+
+--- x25.c.orig	2017-08-04 14:27:44.000000000 +0000
++++ x25.c
+@@ -34,7 +34,7 @@ static struct rr *x25_parse(char *name, 
+     if (rr->psdn_address.length < 4)
+         return bitch("PSDN-address too short");
+     for (i = 0; i < rr->psdn_address.length; i++) {
+-        if (!isdigit(rr->psdn_address.data[i]))
++        if (!isdigit((unsigned char)rr->psdn_address.data[i]))
+             return bitch("PSDN-address contains non-digits");
+     }
+ 


Home | Main Index | Thread Index | Old Index