Commit Diff
Diff:
622f18c5a721bb992d2fd44926dbd3b6b128ade9
6d6e8a4eafe96f39266e6d0c1c446cc9ffbb81c8
Commit:
6d6e8a4eafe96f39266e6d0c1c446cc9ffbb81c8
Tree:
f9548d7d48696716e485bb6a844ada259621bc92
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Sat Apr 11 07:15:22 2020 UTC
Message:
mostly a clean up fix a bug in parse.y, squelch a verbose compiler message under linux in dnssec.c (but bail out if we need to with a dance around ret) tested on Linux/arm
blob - 024d0d3934d1e074739d0cef73ea1f04f99d2979
blob + 228689e509963fde761e40ed84aa577d8d13bca4
--- dnssec.c
+++ dnssec.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dnssec.c,v 1.25 2019/07/05 08:14:50 pjp Exp $
+ * $Id: dnssec.c,v 1.26 2020/04/11 07:15:22 pjp Exp $
*/
#include <sys/types.h>
@@ -962,14 +962,18 @@ find_nsec3_match_closest(char *name, int namelen, stru
struct rbtree *
find_nsec3_wildcard_closest(char *name, int namelen, struct rbtree *rbt, ddDB *db)
{
+ struct rbtree *rbt0 = NULL;
+ struct rrset *rrset = NULL;
+ struct rr *rrp = NULL;
+
char *hashname;
char *backname;
char *dname;
+ char *p;
char wildcard[DNS_MAXNAME + 1];
+
int backnamelen;
- struct rbtree *rbt0 = NULL;
- struct rrset *rrset = NULL;
- struct rr *rrp = NULL;
+ int ret;
if ((rrset = find_rr(rbt, DNS_TYPE_NSEC3PARAM)) == NULL) {
return NULL;
@@ -987,8 +991,14 @@ find_nsec3_wildcard_closest(char *name, int namelen, s
#if DEBUG
dolog(LOG_INFO, "next closer = %s\n", rbt0->humanname);
#endif
+ p = rbt0->humanname;
+ ret = snprintf(wildcard, sizeof(wildcard), "*.%s", p);
+ if (ret >= sizeof(wildcard)) {
+ dolog(LOG_INFO, "result was truncated\n");
+ free(rbt0);
+ return NULL;
+ }
- snprintf(wildcard, sizeof(wildcard), "*.%s", rbt0->humanname);
backname = dns_label(wildcard, &backnamelen);
hashname = hash_name(backname, backnamelen, (struct nsec3param *)rrp->rdata);
blob - 686f447177635f7e81c59064c92427bf6e793eb9
blob + ed870637772d11a89f7d0e94e73c3b2010cd34b6
--- parse.y
+++ parse.y
@@ -21,7 +21,7 @@
*/
/*
- * $Id: parse.y,v 1.94 2020/03/06 12:03:51 pjp Exp $
+ * $Id: parse.y,v 1.95 2020/04/11 07:15:22 pjp Exp $
*/
%{
@@ -3482,7 +3482,7 @@ create_nsec_bitmap(char *rrlist, char *bitmap, int *le
for (ap = argv; ap < &argv[255] &&
(*ap = strsep(&rrlist, " ")) != NULL; argc++) {
- if (*ap != '\0') {
+ if (**ap != '\0') {
ap++;
}
}
blob - b43048d499f781ef2c4e9c92c3b43e48e0f7c5ca
blob + 900cf88c0cc4b8c4fb89d91b659a7dad4fe7fdd2
--- query.c
+++ query.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: query.c,v 1.2 2020/04/11 06:00:07 pjp Exp $
+ * $Id: query.c,v 1.3 2020/04/11 07:15:22 pjp Exp $
*/
#include <sys/types.h>
@@ -78,7 +78,10 @@
static struct timeval tv0;
static time_t current_time;
+u_int16_t port = 53;
+int bytes_received;
+
/* prototypes */
int dig(int argc, char *argv[]);
@@ -88,39 +91,22 @@ int lookup_name(FILE *, int, char *, u_int16_t, struc
int notglue(ddDB *, struct rbtree *, char *);
+
+extern int debug;
+extern int verbose;
+
+extern int dnssec;
+extern int tsig;
+
+/* externs */
+
extern int insert_axfr(char *, char *);
extern int insert_filter(char *, char *);
extern int insert_whitelist(char *, char *);
extern int insert_notifyslave(char *, char *);
extern int usage(int argc, char *argv[]);
extern void dolog(int pri, char *fmt, ...);
-extern int debug;
-extern int verbose;
-extern int bytes_received;
-
-extern int illdestination;
-extern int *ptr;
-
-extern int notify;
-extern int whitelist;
-extern int bcount;
-extern char *bind_list[255];
-extern char *interface_list[255];
-extern int bflag;
-extern int ratelimit_packets_per_second;
-extern int ratelimit;
-u_int16_t port = 53;
-extern int nflag;
-extern int iflag;
-extern int lflag;
-extern int icount;
-extern int vslen;
-extern char *versionstring;
-u_int64_t expiredon, signedon;
-
-/* externs */
-
extern uint32_t unpack32(char *);
extern uint16_t unpack16(char *);
extern void unpack(char *, char *, int);
@@ -186,8 +172,7 @@ extern int insert_tsig_key(char *, int, char *);
extern int insert_region(char *, char *);
-extern int dnssec;
-extern int tsig;
+/* this struct must be under externs */
static struct raxfr_logic supported[] = {
{ DNS_TYPE_A, 0, raxfr_a },
blob - c964ecb0ac19b15b5d5ae2b665e8f891bd6d7483
blob + 316031437c4e40385802891f306f48e15982bbce
--- sign.c
+++ sign.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: sign.c,v 1.1 2020/04/10 17:08:14 pjp Exp $
+ * $Id: sign.c,v 1.2 2020/04/11 07:15:22 pjp Exp $
*/
#include <sys/types.h>
@@ -126,6 +126,7 @@ static struct keysentry {
SLIST_ENTRY(keysentry) keys_entry;
} *kn, *knp;
+u_int64_t expiredon, signedon;
/* prototypes */
@@ -212,7 +213,6 @@ extern int lflag;
extern int icount;
extern int vslen;
extern char *versionstring;
-u_int64_t expiredon, signedon;
/* externs */
blob - 00d37bab3f8bced0760ca67939ccb890ee0cd1db
blob + 9c83e48ce5d675f7b0d37d83d6917140e052ba72
--- util.c
+++ util.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: util.c,v 1.59 2020/01/16 13:29:03 pjp Exp $
+ * $Id: util.c,v 1.60 2020/04/11 07:15:22 pjp Exp $
*/
#include <sys/types.h>
@@ -116,11 +116,10 @@ char * bitmap2human(char *, int);
int lookup_axfr(FILE *, int, char *, struct soa *, u_int32_t, char *, char *, int *, int *, int *);
int dn_contains(char *name, int len, char *anchorname, int alen);
+
int bytes_received;
-
/* externs */
-
extern int debug;
extern int *ptr;
extern int tsig;
repomaster@centroid.eu