webbuilder_pel7ppc64lebuilder0
5 years ago
12 changed files with 18389 additions and 28 deletions
@ -0,0 +1,53 @@ |
|||||||
|
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c |
||||||
|
index 252a02f..bfffb8a 100644 |
||||||
|
--- a/lib/dns/resolver.c |
||||||
|
+++ b/lib/dns/resolver.c |
||||||
|
@@ -5957,6 +5957,7 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname, |
||||||
|
unsigned int nlabels; |
||||||
|
dns_fixedname_t fixed; |
||||||
|
dns_name_t prefix; |
||||||
|
+ int order; |
||||||
|
|
||||||
|
REQUIRE(rdataset != NULL); |
||||||
|
REQUIRE(rdataset->type == dns_rdatatype_cname || |
||||||
|
@@ -5979,18 +5980,26 @@ is_answertarget_allowed(fetchctx_t *fctx, dns_name_t *qname, dns_name_t *rname, |
||||||
|
tname = &cname.cname; |
||||||
|
break; |
||||||
|
case dns_rdatatype_dname: |
||||||
|
+ if (dns_name_fullcompare(qname, rname, &order, &nlabels) != |
||||||
|
+ dns_namereln_subdomain) |
||||||
|
+ { |
||||||
|
+ return (ISC_TRUE); |
||||||
|
+ } |
||||||
|
result = dns_rdata_tostruct(&rdata, &dname, NULL); |
||||||
|
RUNTIME_CHECK(result == ISC_R_SUCCESS); |
||||||
|
dns_name_init(&prefix, NULL); |
||||||
|
dns_fixedname_init(&fixed); |
||||||
|
tname = dns_fixedname_name(&fixed); |
||||||
|
- nlabels = dns_name_countlabels(qname) - |
||||||
|
- dns_name_countlabels(rname); |
||||||
|
+ nlabels = dns_name_countlabels(rname); |
||||||
|
dns_name_split(qname, nlabels, &prefix, NULL); |
||||||
|
result = dns_name_concatenate(&prefix, &dname.dname, tname, |
||||||
|
NULL); |
||||||
|
- if (result == DNS_R_NAMETOOLONG) |
||||||
|
+ if (result == DNS_R_NAMETOOLONG) { |
||||||
|
+ if (chainingp != NULL) { |
||||||
|
+ *chainingp = ISC_TRUE; |
||||||
|
+ } |
||||||
|
return (ISC_TRUE); |
||||||
|
+ } |
||||||
|
RUNTIME_CHECK(result == ISC_R_SUCCESS); |
||||||
|
break; |
||||||
|
default: |
||||||
|
@@ -6719,7 +6728,9 @@ answer_response(fetchctx_t *fctx) { |
||||||
|
} |
||||||
|
if ((ardataset->type == dns_rdatatype_cname || |
||||||
|
ardataset->type == dns_rdatatype_dname) && |
||||||
|
- !is_answertarget_allowed(fctx, qname, aname, ardataset, |
||||||
|
+ type != ardataset->type && |
||||||
|
+ type != dns_rdatatype_any && |
||||||
|
+ !is_answertarget_allowed(fctx, qname, aname, ardataset, |
||||||
|
NULL)) |
||||||
|
{ |
||||||
|
return (DNS_R_SERVFAIL); |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,232 @@ |
|||||||
|
From 4a0a86d84ff11337c363e0540947da136b296b70 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Evan Hunt <each@isc.org> |
||||||
|
Date: Fri, 29 Apr 2016 14:17:21 -0700 |
||||||
|
Subject: [PATCH] [master] more python2/3 compatibility fixes; use setup.py to |
||||||
|
install |
||||||
|
|
||||||
|
--- |
||||||
|
bin/python/Makefile.in | 2 ++ |
||||||
|
bin/python/isc/Makefile.in | 28 +++------------------------- |
||||||
|
bin/python/isc/__init__.py | 6 ++++-- |
||||||
|
bin/python/isc/checkds.py | 5 +++-- |
||||||
|
bin/python/isc/coverage.py | 7 +++---- |
||||||
|
bin/python/isc/dnskey.py | 4 ++-- |
||||||
|
bin/python/isc/keymgr.py | 7 +++---- |
||||||
|
bin/python/isc/policy.py | 6 +++++- |
||||||
|
bin/python/setup.py | 8 ++++++++ |
||||||
|
9 files changed, 33 insertions(+), 40 deletions(-) |
||||||
|
create mode 100644 bin/python/setup.py |
||||||
|
|
||||||
|
diff --git a/bin/python/Makefile.in b/bin/python/Makefile.in |
||||||
|
index 1e4af9c2e2..7ef32cc59b 100644 |
||||||
|
--- a/bin/python/Makefile.in |
||||||
|
+++ b/bin/python/Makefile.in |
||||||
|
@@ -55,9 +55,11 @@ install:: ${TARGETS} installdirs |
||||||
|
${INSTALL_DATA} ${srcdir}/dnssec-checkds.8 ${DESTDIR}${mandir}/man8 |
||||||
|
${INSTALL_DATA} ${srcdir}/dnssec-coverage.8 ${DESTDIR}${mandir}/man8 |
||||||
|
${INSTALL_DATA} ${srcdir}/dnssec-keymgr.8 ${DESTDIR}${mandir}/man8 |
||||||
|
+ test -z "${PYTHON}" || ${PYTHON} setup.py install --prefix=${DESTDIR}${prefix} |
||||||
|
|
||||||
|
clean distclean:: |
||||||
|
rm -f ${TARGETS} |
||||||
|
+ rm -rf build |
||||||
|
|
||||||
|
distclean:: |
||||||
|
rm -f dnssec-checkds.py dnssec-coverage.py dnssec-keymgr.py |
||||||
|
diff --git a/bin/python/isc/Makefile.in b/bin/python/isc/Makefile.in |
||||||
|
index 425d054cce..a72f6e4054 100644 |
||||||
|
--- a/bin/python/isc/Makefile.in |
||||||
|
+++ b/bin/python/isc/Makefile.in |
||||||
|
@@ -24,44 +24,22 @@ PYTHON = @PYTHON@ |
||||||
|
|
||||||
|
PYSRCS = __init__.py dnskey.py eventlist.py keydict.py \ |
||||||
|
keyevent.py keyzone.py policy.py |
||||||
|
-TARGETS = parsetab.py parsetab.pyc \ |
||||||
|
- __init__.pyc dnskey.pyc eventlist.py keydict.py \ |
||||||
|
- keyevent.pyc keyzone.pyc policy.pyc |
||||||
|
+TARGETS = parsetab.py |
||||||
|
|
||||||
|
@BIND9_MAKE_RULES@ |
||||||
|
|
||||||
|
%.pyc: %.py |
||||||
|
$(PYTHON) -m compileall . |
||||||
|
|
||||||
|
-parsetab.py parsetab.pyc: policy.py |
||||||
|
+parsetab.py: policy.py |
||||||
|
$(PYTHON) policy.py parse /dev/null > /dev/null |
||||||
|
$(PYTHON) -m parsetab |
||||||
|
|
||||||
|
-installdirs: |
||||||
|
- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}/isc |
||||||
|
- |
||||||
|
-install:: ${PYSRCS} installdirs |
||||||
|
- ${INSTALL_SCRIPT} __init__.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} __init__.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} dnskey.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} dnskey.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} eventlist.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} eventlist.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keydict.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keydict.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keyevent.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keyevent.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keyzone.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} keyzone.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} policy.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} policy.pyc ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} parsetab.py ${DESTDIR}${libdir} |
||||||
|
- ${INSTALL_SCRIPT} parsetab.pyc ${DESTDIR}${libdir} |
||||||
|
- |
||||||
|
check test: subdirs |
||||||
|
|
||||||
|
clean distclean:: |
||||||
|
rm -f *.pyc parser.out parsetab.py |
||||||
|
+ rm -rf __pycache__ build |
||||||
|
|
||||||
|
distclean:: |
||||||
|
rm -Rf utils.py |
||||||
|
\ No newline at end of file |
||||||
|
diff --git a/bin/python/isc/__init__.py b/bin/python/isc/__init__.py |
||||||
|
index 0d79f356fd..10b3c45cf1 100644 |
||||||
|
--- a/bin/python/isc/__init__.py |
||||||
|
+++ b/bin/python/isc/__init__.py |
||||||
|
@@ -13,8 +13,10 @@ |
||||||
|
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION |
||||||
|
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
||||||
|
|
||||||
|
-__all__ = ['dnskey', 'eventlist', 'keydict', 'keyevent', 'keyseries', |
||||||
|
- 'keyzone', 'policy', 'parsetab', 'utils'] |
||||||
|
+__all__ = ['checkds', 'coverage', 'keymgr', 'dnskey', 'eventlist', |
||||||
|
+ 'keydict', 'keyevent', 'keyseries', 'keyzone', 'policy', |
||||||
|
+ 'parsetab', 'utils'] |
||||||
|
+ |
||||||
|
from isc.dnskey import * |
||||||
|
from isc.eventlist import * |
||||||
|
from isc.keydict import * |
||||||
|
diff --git a/bin/python/isc/checkds.py b/bin/python/isc/checkds.py |
||||||
|
index 64ca12ebc6..2b7da39fc9 100644 |
||||||
|
--- a/bin/python/isc/checkds.py |
||||||
|
+++ b/bin/python/isc/checkds.py |
||||||
|
@@ -42,7 +42,7 @@ class SECRR: |
||||||
|
if not rrtext: |
||||||
|
raise Exception |
||||||
|
|
||||||
|
- fields = rrtext.split() |
||||||
|
+ fields = rrtext.decode('ascii').split() |
||||||
|
if len(fields) < 7: |
||||||
|
raise Exception |
||||||
|
|
||||||
|
@@ -75,7 +75,8 @@ class SECRR: |
||||||
|
fields = fields[2:] |
||||||
|
|
||||||
|
if fields[0].upper() != self.rrtype: |
||||||
|
- raise Exception |
||||||
|
+ raise Exception('%s does not match %s' % |
||||||
|
+ (fields[0].upper(), self.rrtype)) |
||||||
|
|
||||||
|
self.keyid, self.keyalg, self.hashalg = map(int, fields[1:4]) |
||||||
|
self.digest = ''.join(fields[4:]).upper() |
||||||
|
diff --git a/bin/python/isc/coverage.py b/bin/python/isc/coverage.py |
||||||
|
index c9e89596f7..bfe811bee8 100644 |
||||||
|
--- a/bin/python/isc/coverage.py |
||||||
|
+++ b/bin/python/isc/coverage.py |
||||||
|
@@ -27,9 +27,7 @@ from collections import defaultdict |
||||||
|
|
||||||
|
prog = 'dnssec-coverage' |
||||||
|
|
||||||
|
-from isc import * |
||||||
|
-from isc.utils import prefix |
||||||
|
- |
||||||
|
+from isc import dnskey, eventlist, keydict, keyevent, keyzone, utils |
||||||
|
|
||||||
|
############################################################################ |
||||||
|
# print a fatal error and exit |
||||||
|
@@ -139,7 +137,8 @@ def set_path(command, default=None): |
||||||
|
def parse_args(): |
||||||
|
"""Read command line arguments, set global 'args' structure""" |
||||||
|
compilezone = set_path('named-compilezone', |
||||||
|
- os.path.join(prefix('sbin'), 'named-compilezone')) |
||||||
|
+ os.path.join(utils.prefix('sbin'), |
||||||
|
+ 'named-compilezone')) |
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description=prog + ': checks future ' + |
||||||
|
'DNSKEY coverage for a zone') |
||||||
|
diff --git a/bin/python/isc/dnskey.py b/bin/python/isc/dnskey.py |
||||||
|
index f1559e7239..14079504b6 100644 |
||||||
|
--- a/bin/python/isc/dnskey.py |
||||||
|
+++ b/bin/python/isc/dnskey.py |
||||||
|
@@ -205,11 +205,11 @@ class dnskey: |
||||||
|
raise Exception('unable to generate key: ' + str(stderr)) |
||||||
|
|
||||||
|
try: |
||||||
|
- keystr = stdout.splitlines()[0] |
||||||
|
+ keystr = stdout.splitlines()[0].decode('ascii') |
||||||
|
newkey = dnskey(keystr, keys_dir, ttl) |
||||||
|
return newkey |
||||||
|
except Exception as e: |
||||||
|
- raise Exception('unable to generate key: %s' % str(e)) |
||||||
|
+ raise Exception('unable to parse generated key: %s' % str(e)) |
||||||
|
|
||||||
|
def generate_successor(self, keygen_bin, **kwargs): |
||||||
|
quiet = kwargs.get('quiet', False) |
||||||
|
diff --git a/bin/python/isc/keymgr.py b/bin/python/isc/keymgr.py |
||||||
|
index a3a9043965..cbe86ab65e 100644 |
||||||
|
--- a/bin/python/isc/keymgr.py |
||||||
|
+++ b/bin/python/isc/keymgr.py |
||||||
|
@@ -20,8 +20,7 @@ from collections import defaultdict |
||||||
|
|
||||||
|
prog='dnssec-keymgr' |
||||||
|
|
||||||
|
-from isc import * |
||||||
|
-from isc.utils import prefix |
||||||
|
+from isc import dnskey, keydict, keyseries, policy, parsetab, utils |
||||||
|
|
||||||
|
############################################################################ |
||||||
|
# print a fatal error and exit |
||||||
|
@@ -63,9 +62,9 @@ def parse_args(): |
||||||
|
""" |
||||||
|
|
||||||
|
keygen = set_path('dnssec-keygen', |
||||||
|
- os.path.join(prefix('sbin'), 'dnssec-keygen')) |
||||||
|
+ os.path.join(utils.prefix('sbin'), 'dnssec-keygen')) |
||||||
|
settime = set_path('dnssec-settime', |
||||||
|
- os.path.join(prefix('sbin'), 'dnssec-settime')) |
||||||
|
+ os.path.join(utils.prefix('sbin'), 'dnssec-settime')) |
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description=prog + ': schedule ' |
||||||
|
'DNSSEC key rollovers according to a ' |
||||||
|
diff --git a/bin/python/isc/policy.py b/bin/python/isc/policy.py |
||||||
|
index ed106c6c92..dbb4abf010 100644 |
||||||
|
--- a/bin/python/isc/policy.py |
||||||
|
+++ b/bin/python/isc/policy.py |
||||||
|
@@ -104,8 +104,12 @@ class PolicyLex: |
||||||
|
t.lexer.skip(1) |
||||||
|
|
||||||
|
def __init__(self, **kwargs): |
||||||
|
+ if 'maketrans' in dir(str): |
||||||
|
+ trans = str.maketrans('_', '-') |
||||||
|
+ else: |
||||||
|
+ trans = maketrans('_', '-') |
||||||
|
for r in self.reserved: |
||||||
|
- self.reserved_map[r.lower().translate(maketrans('_', '-'))] = r |
||||||
|
+ self.reserved_map[r.lower().translate(trans)] = r |
||||||
|
self.lexer = lex.lex(object=self, **kwargs) |
||||||
|
|
||||||
|
def test(self, text): |
||||||
|
diff --git a/bin/python/setup.py b/bin/python/setup.py |
||||||
|
new file mode 100644 |
||||||
|
index 0000000000..d7ea4a4d41 |
||||||
|
--- /dev/null |
||||||
|
+++ b/bin/python/setup.py |
||||||
|
@@ -0,0 +1,8 @@ |
||||||
|
+from distutils.core import setup |
||||||
|
+setup(name='isc', |
||||||
|
+ version='2.0', |
||||||
|
+ description='Python functions to support BIND utilities', |
||||||
|
+ url='https://www.isc.org/bind', |
||||||
|
+ author='Internet Systems Consortium, Inc', |
||||||
|
+ license='ISC', |
||||||
|
+ packages=['isc']) |
||||||
|
-- |
||||||
|
2.14.3 |
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,54 @@ |
|||||||
|
From 9f9ce5d91a944407e13360e9c92c090d23777a8b Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mark Andrews <marka@isc.org> |
||||||
|
Date: Fri, 27 May 2016 18:39:33 +1000 |
||||||
|
Subject: [PATCH] fix merge error |
||||||
|
|
||||||
|
--- |
||||||
|
bin/named/query.c | 31 +++++++++++++++++++++++++++++++ |
||||||
|
1 file changed, 31 insertions(+) |
||||||
|
|
||||||
|
diff --git a/bin/named/query.c b/bin/named/query.c |
||||||
|
index 6e988f5686..2c44e9ff53 100644 |
||||||
|
--- a/bin/named/query.c |
||||||
|
+++ b/bin/named/query.c |
||||||
|
@@ -7195,6 +7195,37 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) |
||||||
|
* we know the answer. |
||||||
|
*/ |
||||||
|
|
||||||
|
+ /* |
||||||
|
+ * If we have a zero ttl from the cache refetch it. |
||||||
|
+ */ |
||||||
|
+ if (!is_zone && event == NULL && rdataset->ttl == 0 && |
||||||
|
+ RECURSIONOK(client)) |
||||||
|
+ { |
||||||
|
+ if (dns_rdataset_isassociated(rdataset)) |
||||||
|
+ dns_rdataset_disassociate(rdataset); |
||||||
|
+ if (sigrdataset != NULL && |
||||||
|
+ dns_rdataset_isassociated(sigrdataset)) |
||||||
|
+ dns_rdataset_disassociate(sigrdataset); |
||||||
|
+ if (node != NULL) |
||||||
|
+ dns_db_detachnode(db, &node); |
||||||
|
+ |
||||||
|
+ result = query_recurse(client, qtype, |
||||||
|
+ client->query.qname, |
||||||
|
+ NULL, NULL, resuming); |
||||||
|
+ if (result == ISC_R_SUCCESS) { |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_RECURSING; |
||||||
|
+ if (dns64) |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_DNS64; |
||||||
|
+ if (dns64_exclude) |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_DNS64EXCLUDE; |
||||||
|
+ } else |
||||||
|
+ RECURSE_ERROR(result); |
||||||
|
+ goto cleanup; |
||||||
|
+ } |
||||||
|
+ |
||||||
|
#ifdef ALLOW_FILTER_AAAA_ON_V4 |
||||||
|
/* |
||||||
|
* Optionally hide AAAAs from IPv4 clients if there is an A. |
||||||
|
-- |
||||||
|
2.14.4 |
||||||
|
|
@ -0,0 +1,183 @@ |
|||||||
|
From 02412bfe731d0cb229eb22f0ca4e8fbaed601cbe Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mark Andrews <marka@isc.org> |
||||||
|
Date: Fri, 27 May 2016 09:59:46 +1000 |
||||||
|
Subject: [PATCH] 4377. [bug] Don't reuse zero TTL responses beyond |
||||||
|
the current client set (excludes ANY/SIG/RRSIG |
||||||
|
queries). [RT #42142] |
||||||
|
|
||||||
|
(cherry picked from commit aabcb1fde0ca255ff30f0a5c10cbd39f798cc5b7) |
||||||
|
|
||||||
|
REDIRECT macro is 9.11.0+ |
||||||
|
--- |
||||||
|
bin/named/query.c | 31 +++++++++++++++ |
||||||
|
bin/tests/system/zero/ans5/ans.pl | 81 +++++++++++++++++++++++++++++++++++++++ |
||||||
|
bin/tests/system/zero/ns1/root.db | 2 + |
||||||
|
bin/tests/system/zero/tests.sh | 13 +++++++ |
||||||
|
4 files changed, 127 insertions(+) |
||||||
|
create mode 100644 bin/tests/system/zero/ans5/ans.pl |
||||||
|
|
||||||
|
diff --git a/bin/named/query.c b/bin/named/query.c |
||||||
|
index 2c44e9ff53..3b402f1d01 100644 |
||||||
|
--- a/bin/named/query.c |
||||||
|
+++ b/bin/named/query.c |
||||||
|
@@ -6816,6 +6816,37 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) |
||||||
|
goto cleanup; |
||||||
|
|
||||||
|
case DNS_R_CNAME: |
||||||
|
+ /* |
||||||
|
+ * If we have a zero ttl from the cache refetch it. |
||||||
|
+ */ |
||||||
|
+ if (!is_zone && event == NULL && rdataset->ttl == 0 && |
||||||
|
+ RECURSIONOK(client)) |
||||||
|
+ { |
||||||
|
+ if (dns_rdataset_isassociated(rdataset)) |
||||||
|
+ dns_rdataset_disassociate(rdataset); |
||||||
|
+ if (sigrdataset != NULL && |
||||||
|
+ dns_rdataset_isassociated(sigrdataset)) |
||||||
|
+ dns_rdataset_disassociate(sigrdataset); |
||||||
|
+ if (node != NULL) |
||||||
|
+ dns_db_detachnode(db, &node); |
||||||
|
+ |
||||||
|
+ result = query_recurse(client, qtype, |
||||||
|
+ client->query.qname, |
||||||
|
+ NULL, NULL, resuming); |
||||||
|
+ if (result == ISC_R_SUCCESS) { |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_RECURSING; |
||||||
|
+ if (dns64) |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_DNS64; |
||||||
|
+ if (dns64_exclude) |
||||||
|
+ client->query.attributes |= |
||||||
|
+ NS_QUERYATTR_DNS64EXCLUDE; |
||||||
|
+ } else |
||||||
|
+ RECURSE_ERROR(result); |
||||||
|
+ goto cleanup; |
||||||
|
+ } |
||||||
|
+ |
||||||
|
/* |
||||||
|
* Keep a copy of the rdataset. We have to do this because |
||||||
|
* query_addrrset may clear 'rdataset' (to prevent the |
||||||
|
diff --git a/bin/tests/system/zero/ans5/ans.pl b/bin/tests/system/zero/ans5/ans.pl |
||||||
|
new file mode 100644 |
||||||
|
index 0000000000..9dfa18e444 |
||||||
|
--- /dev/null |
||||||
|
+++ b/bin/tests/system/zero/ans5/ans.pl |
||||||
|
@@ -0,0 +1,81 @@ |
||||||
|
+#!/usr/bin/perl -w |
||||||
|
+# |
||||||
|
+# Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC") |
||||||
|
+# |
||||||
|
+# Permission to use, copy, modify, and/or distribute this software for any |
||||||
|
+# purpose with or without fee is hereby granted, provided that the above |
||||||
|
+# copyright notice and this permission notice appear in all copies. |
||||||
|
+# |
||||||
|
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH |
||||||
|
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY |
||||||
|
+# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, |
||||||
|
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM |
||||||
|
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE |
||||||
|
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
||||||
|
+# PERFORMANCE OF THIS SOFTWARE. |
||||||
|
+ |
||||||
|
+# |
||||||
|
+# Don't respond if the "norespond" file exists; otherwise respond to |
||||||
|
+# any A or AAAA query. |
||||||
|
+# |
||||||
|
+ |
||||||
|
+use IO::File; |
||||||
|
+use IO::Socket; |
||||||
|
+use Net::DNS; |
||||||
|
+use Net::DNS::Packet; |
||||||
|
+ |
||||||
|
+my $sock = IO::Socket::INET->new(LocalAddr => "10.53.0.5", |
||||||
|
+ LocalPort => 5300, Proto => "udp") or die "$!"; |
||||||
|
+ |
||||||
|
+my $pidf = new IO::File "ans.pid", "w" or die "cannot open pid file: $!"; |
||||||
|
+print $pidf "$$\n" or die "cannot write pid file: $!"; |
||||||
|
+$pidf->close or die "cannot close pid file: $!"; |
||||||
|
+sub rmpid { unlink "ans.pid"; exit 1; }; |
||||||
|
+ |
||||||
|
+$SIG{INT} = \&rmpid; |
||||||
|
+$SIG{TERM} = \&rmpid; |
||||||
|
+ |
||||||
|
+my $octet = 0; |
||||||
|
+ |
||||||
|
+for (;;) { |
||||||
|
+ $sock->recv($buf, 512); |
||||||
|
+ |
||||||
|
+ print "**** request from " , $sock->peerhost, " port ", $sock->peerport, "\n"; |
||||||
|
+ |
||||||
|
+ my $packet; |
||||||
|
+ |
||||||
|
+ if ($Net::DNS::VERSION > 0.68) { |
||||||
|
+ $packet = new Net::DNS::Packet(\$buf, 0); |
||||||
|
+ $@ and die $@; |
||||||
|
+ } else { |
||||||
|
+ my $err; |
||||||
|
+ ($packet, $err) = new Net::DNS::Packet(\$buf, 0); |
||||||
|
+ $err and die $err; |
||||||
|
+ } |
||||||
|
+ |
||||||
|
+ print "REQUEST:\n"; |
||||||
|
+ $packet->print; |
||||||
|
+ |
||||||
|
+ $packet->header->qr(1); |
||||||
|
+ |
||||||
|
+ my @questions = $packet->question; |
||||||
|
+ my $qname = $questions[0]->qname; |
||||||
|
+ my $qtype = $questions[0]->qtype; |
||||||
|
+ |
||||||
|
+ $packet->header->aa(1); |
||||||
|
+ if ($qtype eq "A") { |
||||||
|
+ $packet->push("answer", |
||||||
|
+ new Net::DNS::RR($qname . |
||||||
|
+ " 0 A 192.0.2." . $octet)); |
||||||
|
+ $octet = $octet + 1; |
||||||
|
+ } elsif ($qtype eq "AAAA") { |
||||||
|
+ $packet->push("answer", |
||||||
|
+ new Net::DNS::RR($qname . |
||||||
|
+ " 300 AAAA 2001:db8:beef::1")); |
||||||
|
+ } |
||||||
|
+ |
||||||
|
+ $sock->send($packet->data); |
||||||
|
+ print "RESPONSE:\n"; |
||||||
|
+ $packet->print; |
||||||
|
+ print "\n"; |
||||||
|
+} |
||||||
|
diff --git a/bin/tests/system/zero/ns1/root.db b/bin/tests/system/zero/ns1/root.db |
||||||
|
index 69aca86fb8..beb97cb693 100644 |
||||||
|
--- a/bin/tests/system/zero/ns1/root.db |
||||||
|
+++ b/bin/tests/system/zero/ns1/root.db |
||||||
|
@@ -22,3 +22,5 @@ example. NS ns2.example. |
||||||
|
ns2.example. A 10.53.0.2 |
||||||
|
example. NS ns4.example. |
||||||
|
ns4.example. A 10.53.0.4 |
||||||
|
+increment. NS incrementns. |
||||||
|
+incrementns A 10.53.0.5 |
||||||
|
diff --git a/bin/tests/system/zero/tests.sh b/bin/tests/system/zero/tests.sh |
||||||
|
index 15c2906a92..bbb78f0fd8 100644 |
||||||
|
--- a/bin/tests/system/zero/tests.sh |
||||||
|
+++ b/bin/tests/system/zero/tests.sh |
||||||
|
@@ -44,5 +44,18 @@ done |
||||||
|
if [ $ret != 0 ]; then echo "I:failed"; fi |
||||||
|
status=`expr $status + $ret` |
||||||
|
|
||||||
|
+echo "I:check repeated recursive lookups of non recurring zero ttl responses get new values" |
||||||
|
+count=`( |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+dig +short -p 5300 @10.53.0.3 foo.increment |
||||||
|
+) | sort -u | wc -l ` |
||||||
|
+if [ $count -ne 7 ] ; then echo "I:failed (count=$count)"; ret=1; fi |
||||||
|
+status=`expr $status + $ret` |
||||||
|
+ |
||||||
|
echo "I:exit status: $status" |
||||||
|
exit $status |
||||||
|
-- |
||||||
|
2.14.4 |
||||||
|
|
@ -0,0 +1,28 @@ |
|||||||
|
From 89293e44e0d022463b03a92a30b3790d4569bd50 Mon Sep 17 00:00:00 2001 |
||||||
|
From: Mark Andrews <marka@isc.org> |
||||||
|
Date: Thu, 20 Feb 2014 23:04:54 +1100 |
||||||
|
Subject: [PATCH] 3752. [bug] Address potential REQUIRE failure if |
||||||
|
DNS_STYLEFLAG_COMMENTDATA is set when printing out |
||||||
|
a rdataset. |
||||||
|
|
||||||
|
(cherry picked from commit 86856f4f3069bb2d75851b56401ffde18f41198f) |
||||||
|
--- |
||||||
|
lib/dns/masterdump.c | 2 +- |
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-) |
||||||
|
|
||||||
|
diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c |
||||||
|
index 80fcd4c12d..58dcd3de3e 100644 |
||||||
|
--- a/lib/dns/masterdump.c |
||||||
|
+++ b/lib/dns/masterdump.c |
||||||
|
@@ -451,7 +451,7 @@ rdataset_totext(dns_rdataset_t *rdataset, |
||||||
|
* Comment? |
||||||
|
*/ |
||||||
|
if ((ctx->style.flags & DNS_STYLEFLAG_COMMENTDATA) != 0) |
||||||
|
- isc_buffer_putstr(target, ";"); |
||||||
|
+ RETERR(str_totext(";", target)); |
||||||
|
|
||||||
|
/* |
||||||
|
* Owner name. |
||||||
|
-- |
||||||
|
2.14.5 |
||||||
|
|
Loading…
Reference in new issue