From 7726ce77a6022935f00c209bdd28ae3320a5560e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 9 Apr 2019 20:15:24 +0200 Subject: [PATCH 01/79] Some patches adapted to v9_14 --- bind-9.11-oot-manual.patch | 52 ++++++------ bind-9.11-pk11.patch | 14 ---- bind-9.11-rh1205168.patch | 120 --------------------------- bind-9.9.1-P2-multlib-conflict.patch | 17 +--- bind-95-rh452060.patch | 42 ---------- bind.spec | 10 +-- bind93-rh490837.patch | 19 ++--- bind97-rh478718.patch | 51 ------------ bind97-rh645544.patch | 15 ++-- 9 files changed, 44 insertions(+), 296 deletions(-) delete mode 100644 bind-9.11-rh1205168.patch delete mode 100644 bind-95-rh452060.patch delete mode 100644 bind97-rh478718.patch diff --git a/bind-9.11-oot-manual.patch b/bind-9.11-oot-manual.patch index 84e9d25..fe1788f 100644 --- a/bind-9.11-oot-manual.patch +++ b/bind-9.11-oot-manual.patch @@ -1,4 +1,4 @@ -From 8ca95f47231822df2b9c171a4da1e93ca5b748eb Mon Sep 17 00:00:00 2001 +From c5b39725cd4f3f30eac7eeafd7802005a1fad533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 25 Jul 2018 12:24:16 +0200 Subject: [PATCH] Use make automatic variables to install updated manuals @@ -12,17 +12,17 @@ Install all files in single command instead of iterating on each of them. bin/delv/Makefile.in | 6 ++++-- bin/dig/Makefile.in | 8 ++++---- bin/dnssec/Makefile.in | 6 ++++-- - bin/named/Makefile.in | 13 +++++++++---- + bin/named/Makefile.in | 12 +++++++++--- bin/pkcs11/Makefile.in | 9 ++++----- bin/python/Makefile.in | 8 ++++---- bin/tools/Makefile.in | 25 +++++++++++++++---------- - 9 files changed, 54 insertions(+), 38 deletions(-) + 9 files changed, 54 insertions(+), 37 deletions(-) diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in -index c124e80..1174f8d 100644 +index 8f009a4..de3c066 100644 --- a/bin/check/Makefile.in +++ b/bin/check/Makefile.in -@@ -83,12 +83,14 @@ installdirs: +@@ -84,12 +84,14 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 @@ -41,10 +41,10 @@ index c124e80..1174f8d 100644 uninstall:: rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8 diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index 87f13dd..7865c0c 100644 +index 0588f8b..44d87fd 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in -@@ -95,13 +95,14 @@ installdirs: +@@ -93,13 +93,14 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 @@ -64,7 +64,7 @@ index 87f13dd..7865c0c 100644 uninstall:: rm -f ${DESTDIR}${mandir}/man8/tsig-keygen.8 diff --git a/bin/delv/Makefile.in b/bin/delv/Makefile.in -index e2d2802..19361a8 100644 +index ea106f8..77adc91 100644 --- a/bin/delv/Makefile.in +++ b/bin/delv/Makefile.in @@ -63,10 +63,12 @@ installdirs: @@ -83,10 +83,10 @@ index e2d2802..19361a8 100644 uninstall:: rm -f ${DESTDIR}${mandir}/man1/delv.1 diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in -index a9830a9..d7ac0b6 100644 +index 8ea146f..3a97024 100644 --- a/bin/dig/Makefile.in +++ b/bin/dig/Makefile.in -@@ -91,16 +91,16 @@ installdirs: +@@ -93,16 +93,16 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 @@ -108,10 +108,10 @@ index a9830a9..d7ac0b6 100644 uninstall:: for m in ${MANPAGES}; do \ diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in -index 2239ad1..ce0a177 100644 +index dfaad27..be1ac3b 100644 --- a/bin/dnssec/Makefile.in +++ b/bin/dnssec/Makefile.in -@@ -110,9 +110,11 @@ installdirs: +@@ -114,9 +114,11 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 @@ -126,36 +126,34 @@ index 2239ad1..ce0a177 100644 uninstall:: for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index e1f85a9..d92bc9a 100644 +index 0485002..10d568f 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in -@@ -176,12 +176,17 @@ installdirs: +@@ -169,10 +169,16 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5 $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 --install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs +-install:: named@EXEEXT@ installdirs +install-man5: named.conf.5 + ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5 + -+install-man8: named.8 lwresd.8 ++install-man8: named.8 + ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 + +install-man: install-man5 install-man8 + -+install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs install-man ++install:: named@EXEEXT@ installdirs install-man ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} - (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@) - ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/lwresd.8 ${DESTDIR}${mandir}/man8 - ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5 uninstall:: rm -f ${DESTDIR}${mandir}/man5/named.conf.5 diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index ae90616..a058c91 100644 +index 2fd9861..96aec05 100644 --- a/bin/pkcs11/Makefile.in +++ b/bin/pkcs11/Makefile.in -@@ -71,7 +71,10 @@ installdirs: +@@ -69,7 +69,10 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 @@ -167,7 +165,7 @@ index ae90616..a058c91 100644 ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-list@EXEEXT@ \ ${DESTDIR}${sbindir} ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-destroy@EXEEXT@ \ -@@ -80,10 +83,6 @@ install:: ${TARGETS} installdirs +@@ -78,10 +81,6 @@ install:: ${TARGETS} installdirs ${DESTDIR}${sbindir} ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-tokens@EXEEXT@ \ ${DESTDIR}${sbindir} @@ -201,10 +199,10 @@ index aa678d4..064c404 100644 if test -n "${DESTDIR}" ; then \ ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \ diff --git a/bin/tools/Makefile.in b/bin/tools/Makefile.in -index 7bf2af4..c395bc7 100644 +index 0fd2847..3c4f028 100644 --- a/bin/tools/Makefile.in +++ b/bin/tools/Makefile.in -@@ -119,17 +119,27 @@ installdirs: +@@ -107,17 +107,27 @@ installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 @@ -237,20 +235,18 @@ index 7bf2af4..c395bc7 100644 ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} arpaname@EXEEXT@ \ ${DESTDIR}${bindir} ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-journalprint@EXEEXT@ \ -@@ -144,13 +154,8 @@ install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ +@@ -128,11 +138,6 @@ install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ ${DESTDIR}${sbindir} ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} mdig@EXEEXT@ \ ${DESTDIR}${bindir} - ${INSTALL_DATA} ${srcdir}/arpaname.1 ${DESTDIR}${mandir}/man1 - ${INSTALL_DATA} ${srcdir}/isc-hmac-fixup.8 ${DESTDIR}${mandir}/man8 - ${INSTALL_DATA} ${srcdir}/named-journalprint.8 ${DESTDIR}${mandir}/man8 - ${INSTALL_DATA} ${srcdir}/named-rrchecker.1 ${DESTDIR}${mandir}/man1 - ${INSTALL_DATA} ${srcdir}/nsec3hash.8 ${DESTDIR}${mandir}/man8 - ${INSTALL_DATA} ${srcdir}/genrandom.8 ${DESTDIR}${mandir}/man8 - ${INSTALL_DATA} ${srcdir}/mdig.1 ${DESTDIR}${mandir}/man1 uninstall:: rm -f ${DESTDIR}${mandir}/man1/mdig.1 -- -2.14.4 +2.20.1 diff --git a/bind-9.11-pk11.patch b/bind-9.11-pk11.patch index d802314..fd75a6c 100644 --- a/bind-9.11-pk11.patch +++ b/bind-9.11-pk11.patch @@ -1,17 +1,3 @@ -diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h -index 640519a..fc40472 100644 ---- a/lib/dns/dst_internal.h -+++ b/lib/dns/dst_internal.h -@@ -59,6 +59,9 @@ - #include - #include - #endif -+#if PKCS11CRYPTO -+#include -+#endif - - ISC_LANG_BEGINDECLS - diff --git a/lib/isc/include/pk11/internal.h b/lib/isc/include/pk11/internal.h index aa8907a..603712a 100644 --- a/lib/isc/include/pk11/internal.h diff --git a/bind-9.11-rh1205168.patch b/bind-9.11-rh1205168.patch deleted file mode 100644 index 181cec9..0000000 --- a/bind-9.11-rh1205168.patch +++ /dev/null @@ -1,120 +0,0 @@ -From 90416594843a56550e40b11561807786219ce1c4 Mon Sep 17 00:00:00 2001 -From: Evan Hunt -Date: Mon, 11 Sep 2017 15:01:36 -0700 -Subject: [PATCH] remap getaddrinfo() to irs_getgetaddrinfo() - -The libirs version of getaddrinfo() cannot be called from within BIND9. - -fix prototypes ---- - lib/irs/include/irs/netdb.h.in | 94 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 94 insertions(+) - -diff --git a/lib/irs/include/irs/netdb.h.in b/lib/irs/include/irs/netdb.h.in -index 23dcd37..f36113d 100644 ---- a/lib/irs/include/irs/netdb.h.in -+++ b/lib/irs/include/irs/netdb.h.in -@@ -150,6 +150,100 @@ struct addrinfo { - #define NI_DGRAM 0x00000010 - - /* -+ * Define to map into irs_ namespace. -+ */ -+ -+#define IRS_NAMESPACE -+ -+#ifdef IRS_NAMESPACE -+ -+/* -+ * Use our versions not the ones from the C library. -+ */ -+ -+#ifdef getnameinfo -+#undef getnameinfo -+#endif -+#define getnameinfo irs_getnameinfo -+ -+#ifdef getaddrinfo -+#undef getaddrinfo -+#endif -+#define getaddrinfo irs_getaddrinfo -+ -+#ifdef freeaddrinfo -+#undef freeaddrinfo -+#endif -+#define freeaddrinfo irs_freeaddrinfo -+ -+#ifdef gai_strerror -+#undef gai_strerror -+#endif -+#define gai_strerror irs_gai_strerror -+ -+#endif -+ -+extern int getaddrinfo (const char *name, -+ const char *service, -+ const struct addrinfo *req, -+ struct addrinfo **pai); -+extern int getnameinfo (const struct sockaddr *sa, -+ socklen_t salen, char *host, -+ socklen_t hostlen, char *serv, -+ socklen_t servlen, int flags); -+extern void freeaddrinfo (struct addrinfo *ai); -+extern const char *gai_strerror (int ecode); -+ -+/* -+ * Define to map into irs_ namespace. -+ */ -+ -+#define IRS_NAMESPACE -+ -+#ifdef IRS_NAMESPACE -+ -+/* -+ * Use our versions not the ones from the C library. -+ */ -+ -+#ifdef getnameinfo -+#undef getnameinfo -+#endif -+#define getnameinfo irs_getnameinfo -+ -+#ifdef getaddrinfo -+#undef getaddrinfo -+#endif -+#define getaddrinfo irs_getaddrinfo -+ -+#ifdef freeaddrinfo -+#undef freeaddrinfo -+#endif -+#define freeaddrinfo irs_freeaddrinfo -+ -+#ifdef gai_strerror -+#undef gai_strerror -+#endif -+#define gai_strerror irs_gai_strerror -+ -+int -+getaddrinfo(const char *hostname, const char *servname, -+ const struct addrinfo *hints, struct addrinfo **res); -+ -+int -+getnameinfo(const struct sockaddr *sa, IRS_GETNAMEINFO_SOCKLEN_T salen, -+ char *host, IRS_GETNAMEINFO_BUFLEN_T hostlen, -+ char *serv, IRS_GETNAMEINFO_BUFLEN_T servlen, -+ IRS_GETNAMEINFO_FLAGS_T flags); -+ -+void freeaddrinfo (struct addrinfo *ai); -+ -+IRS_GAISTRERROR_RETURN_T -+gai_strerror(int ecode); -+ -+#endif -+ -+/* - * Tell Emacs to use C mode on this file. - * Local variables: - * mode: c --- -2.9.5 - diff --git a/bind-9.9.1-P2-multlib-conflict.patch b/bind-9.9.1-P2-multlib-conflict.patch index 8768b86..1de1e04 100644 --- a/bind-9.9.1-P2-multlib-conflict.patch +++ b/bind-9.9.1-P2-multlib-conflict.patch @@ -1,18 +1,5 @@ -diff --git a/config.h.in b/config.h.in -index 4ecaa8f..2f65ccc 100644 ---- a/config.h.in -+++ b/config.h.in -@@ -600,7 +600,7 @@ int sigwait(const unsigned int *set, int *sig); - #undef PREFER_GOSTASN1 - - /* The size of `void *', as computed by sizeof. */ --#undef SIZEOF_VOID_P -+/* #undef SIZEOF_VOID_P */ - - /* Define to 1 if you have the ANSI C header files. */ - #undef STDC_HEADERS diff --git a/isc-config.sh.in b/isc-config.sh.in -index a8a0a89..b5e94ed 100644 +index 40f9bba..e446da2 100644 --- a/isc-config.sh.in +++ b/isc-config.sh.in @@ -13,7 +13,18 @@ prefix=@prefix@ @@ -35,7 +22,7 @@ index a8a0a89..b5e94ed 100644 usage() { -@@ -132,6 +143,16 @@ if test x"$echo_libs" = x"true"; then +@@ -128,6 +139,16 @@ if test x"$echo_libs" = x"true"; then if test x"${exec_prefix_set}" = x"true"; then libs="-L${exec_prefix}/lib" else diff --git a/bind-95-rh452060.patch b/bind-95-rh452060.patch deleted file mode 100644 index c57ccab..0000000 --- a/bind-95-rh452060.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c -index aa5315d..1fa711a 100644 ---- a/bin/dig/dighost.c -+++ b/bin/dig/dighost.c -@@ -1814,6 +1814,13 @@ clear_query(dig_query_t *query) { - - if (query->timer != NULL) - isc_timer_detach(&query->timer); -+ -+ if (query->waiting_senddone) { -+ debug("send_done not yet called"); -+ query->pending_free = true; -+ return; -+ } -+ - lookup = query->lookup; - - if (lookup->current_query == query) -@@ -1839,10 +1846,7 @@ clear_query(dig_query_t *query) { - isc_mempool_put(commctx, query->recvspace); - isc_buffer_invalidate(&query->recvbuf); - isc_buffer_invalidate(&query->lengthbuf); -- if (query->waiting_senddone) -- query->pending_free = true; -- else -- isc_mem_free(mctx, query); -+ isc_mem_free(mctx, query); - } - - /*% -@@ -2892,9 +2896,9 @@ send_done(isc_task_t *_task, isc_event_t *event) { - isc_event_free(&event); - - if (query->pending_free) -- isc_mem_free(mctx, query); -+ clear_query(query); - -- check_if_done(); -+ check_next_lookup(l); - UNLOCK_LOOKUP; - } - diff --git a/bind.spec b/bind.spec index 3e2de10..bf07be7 100644 --- a/bind.spec +++ b/bind.spec @@ -63,8 +63,8 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.11.14 -Release: 4%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Version: 9.14.0 +Release: 0%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -113,9 +113,7 @@ Patch10: bind-9.5-PIE.patch Patch16: bind-9.3.2-redhat_doc.patch Patch72: bind-9.5-dlz-64bit.patch Patch101:bind-96-old-api.patch -Patch102:bind-95-rh452060.patch Patch106:bind93-rh490837.patch -Patch109:bind97-rh478718.patch Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch Patch131:bind-9.9.1-P2-multlib-conflict.patch @@ -128,7 +126,6 @@ Patch136:bind-9.10-dist-native-pkcs11.patch # introduced by https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=fc9f0ac5778f78003a7acc957a23711811fec122 Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch -Patch145:bind-9.11-rh1205168.patch # [ISC-Bugs #46853] commit cb616c6d5c2ece1fac37fa6e0bca2b53d4043098 ISC 4851 Patch149:bind-9.11-kyua-pkcs11.patch # Avoid conflicts with OpenSSL PKCS11 engine @@ -540,14 +537,11 @@ are used for building ISC DHCP. %patch10 -p1 -b .PIE %patch16 -p1 -b .redhat_doc %patch72 -p1 -b .64bit -%patch102 -p1 -b .rh452060 %patch106 -p1 -b .rh490837 -%patch109 -p1 -b .rh478718 %patch112 -p1 -b .rh645544 %patch130 -p1 -b .libdb %patch131 -p1 -b .multlib-conflict %patch140 -p1 -b .rh1410433 -%patch145 -p1 -b .rh1205168 %patch153 -p1 -b .export_suffix %patch154 -p1 -b .oot-man %patch155 -p1 -b .pk11-internal diff --git a/bind93-rh490837.patch b/bind93-rh490837.patch index 6ea55ba..6390c2f 100644 --- a/bind93-rh490837.patch +++ b/bind93-rh490837.patch @@ -13,14 +13,14 @@ index 1f44b5a..a3625f9 100644 #endif /* ISC_STDIO_H */ diff --git a/lib/isc/lex.c b/lib/isc/lex.c -index a8955bc..fc6103b 100644 +index ca5fe6d..b0152eb 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c -@@ -434,17 +434,14 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { +@@ -433,15 +433,11 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { if (source->is_file) { stream = source->input; --#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) +-#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) - c = getc_unlocked(stream); -#else - c = getc(stream); @@ -36,15 +36,12 @@ index a8955bc..fc6103b 100644 + source->result = result; goto done; } -+ source->at_eof = true; - } - } else { diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c -index 2f12bcc..5bfd648 100644 +index d72d56f..4287ff3 100644 --- a/lib/isc/unix/errno2result.c +++ b/lib/isc/unix/errno2result.c -@@ -40,6 +40,7 @@ isc___errno2result(int posixerrno, bool dolog, +@@ -42,6 +42,7 @@ isc___errno2result(int posixerrno, bool dolog, case EINVAL: /* XXX sometimes this is not for files */ case ENAMETOOLONG: case EBADF: @@ -53,10 +50,10 @@ index 2f12bcc..5bfd648 100644 case ENOENT: return (ISC_R_FILENOTFOUND); diff --git a/lib/isc/unix/stdio.c b/lib/isc/unix/stdio.c -index e60fa65..77f0b13 100644 +index d2b1dda..79630b2 100644 --- a/lib/isc/unix/stdio.c +++ b/lib/isc/unix/stdio.c -@@ -149,3 +149,22 @@ isc_stdio_sync(FILE *f) { +@@ -141,3 +141,22 @@ isc_stdio_sync(FILE *f) { return (isc__errno2result(errno)); } @@ -68,7 +65,7 @@ index e60fa65..77f0b13 100644 +#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) + r = fgetc_unlocked(f); +#else -+ r = fgets(f); ++ r = fgetc(f); +#endif + + if (r == EOF) diff --git a/bind97-rh478718.patch b/bind97-rh478718.patch deleted file mode 100644 index dfc4165..0000000 --- a/bind97-rh478718.patch +++ /dev/null @@ -1,51 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 26c509e..c1bfd62 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -4152,6 +4152,10 @@ if test "yes" = "$use_atomic"; then - AC_MSG_RESULT($arch) - fi - -+if test ! "$arch" = "x86_64" -a "$have_xaddq" = "yes"; then -+ AC_MSG_ERROR([XADDQ present but disabled by Fedora patch!]) -+fi -+ - if test "yes" = "$have_atomic"; then - AC_MSG_CHECKING([compiler support for inline assembly code]) - -diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in -index c902d46..9c7c342 100644 ---- a/lib/isc/include/isc/platform.h.in -+++ b/lib/isc/include/isc/platform.h.in -@@ -284,19 +284,25 @@ - * If the "xaddq" operation (64bit xadd) is available on this architecture, - * ISC_PLATFORM_HAVEXADDQ will be defined. - */ --@ISC_PLATFORM_HAVEXADDQ@ - - /* -- * If the 32-bit "atomic swap" operation is available on this -- * architecture, ISC_PLATFORM_HAVEATOMICSTORE" will be defined. -+ * If the 64-bit "atomic swap" operation is available on this -+ * architecture, ISC_PLATFORM_HAVEATOMICSTOREQ" will be defined. - */ --@ISC_PLATFORM_HAVEATOMICSTORE@ -+ -+#ifdef __x86_64__ -+#define ISC_PLATFORM_HAVEXADDQ 1 -+#define ISC_PLATFORM_HAVEATOMICSTOREQ 1 -+#else -+#undef ISC_PLATFORM_HAVEXADDQ -+#undef ISC_PLATFORM_HAVEATOMICSTOREQ -+#endif - - /* -- * If the 64-bit "atomic swap" operation is available on this -+ * If the 32-bit "atomic swap" operation is available on this - * architecture, ISC_PLATFORM_HAVEATOMICSTORE" will be defined. - */ --@ISC_PLATFORM_HAVEATOMICSTOREQ@ -+@ISC_PLATFORM_HAVEATOMICSTORE@ - - /* - * If the "compare-and-exchange" operation is available on this architecture, diff --git a/bind97-rh645544.patch b/bind97-rh645544.patch index d1d8429..282fa2f 100644 --- a/bind97-rh645544.patch +++ b/bind97-rh645544.patch @@ -1,7 +1,8 @@ -diff -up bind-9.9.4rc2/lib/dns/resolver.c.rh645544 bind-9.9.4rc2/lib/dns/resolver.c ---- bind-9.9.4rc2/lib/dns/resolver.c.rh645544 2013-08-19 10:30:52.000000000 +0200 -+++ bind-9.9.4rc2/lib/dns/resolver.c 2013-09-06 17:58:03.864165823 +0200 -@@ -1138,7 +1138,7 @@ log_edns(fetchctx_t *fctx) { +diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c +index 2a6e69c..b2f8cec 100644 +--- a/lib/dns/resolver.c ++++ b/lib/dns/resolver.c +@@ -1676,7 +1676,7 @@ log_edns(fetchctx_t *fctx) { */ dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_EDNS_DISABLED, @@ -9,8 +10,8 @@ diff -up bind-9.9.4rc2/lib/dns/resolver.c.rh645544 bind-9.9.4rc2/lib/dns/resolve + DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(1), "success resolving '%s' (in '%s'?) after %s", fctx->info, domainbuf, fctx->reason); - -@@ -3804,7 +3804,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrin + } +@@ -5084,7 +5084,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) { dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, @@ -19,7 +20,7 @@ diff -up bind-9.9.4rc2/lib/dns/resolver.c.rh645544 bind-9.9.4rc2/lib/dns/resolve "lame server resolving '%s' (in '%s'?): %s", namebuf, domainbuf, addrbuf); } -@@ -3831,7 +3831,7 @@ log_formerr(fetchctx_t *fctx, const char +@@ -5111,7 +5111,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) { } isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, From 0b18b1b5171698c51d9140742fb6e92cf46dd7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 23 Jul 2019 15:18:02 +0200 Subject: [PATCH 02/79] Initial steps towards buildable 9.14 --- bind-9.11-fips-tests.patch | 662 ++-------- bind-9.11-host-idn-disable.patch | 92 -- bind-9.11-rh1624100.patch | 288 ----- bind-9.11-rh1663318.patch | 48 - bind-9.11-rt31459.patch | 1835 +-------------------------- bind-9.11-unit-disable-random.patch | 15 +- bind.spec | 26 +- bind97-rh669163.patch | 14 - random.data | Bin 4096 -> 0 bytes 9 files changed, 160 insertions(+), 2820 deletions(-) delete mode 100644 bind-9.11-host-idn-disable.patch delete mode 100644 bind-9.11-rh1624100.patch delete mode 100644 bind-9.11-rh1663318.patch delete mode 100644 bind97-rh669163.patch delete mode 100644 random.data diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index 29dda07..18e0433 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From c23daf334d5487fa53fef88c82312e439a2d8523 Mon Sep 17 00:00:00 2001 +From f37b26cb7c8f7351d22dfea79df33edb74d42e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -76,35 +76,22 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/catz/ns2/named.conf.in | 2 +- bin/tests/system/checkconf/bad-tsig.conf | 2 +- bin/tests/system/checkconf/good.conf | 2 +- - bin/tests/system/digdelv/ns2/example.db | 15 +++-- - bin/tests/system/digdelv/tests.sh | 20 +++--- - bin/tests/system/dlv/ns1/sign.sh | 4 +- - bin/tests/system/dlv/ns2/sign.sh | 4 +- - bin/tests/system/dlv/ns6/sign.sh | 66 +++++++++--------- - bin/tests/system/dnssec/ns2/sign.sh | 8 +-- - bin/tests/system/dnssec/ns5/trusted.conf.bad | 2 +- - bin/tests/system/dnssec/tests.sh | 4 +- - bin/tests/system/feature-test.c | 14 ++++ - bin/tests/system/filter-aaaa/ns1/sign.sh | 4 +- - bin/tests/system/filter-aaaa/ns4/sign.sh | 4 +- + bin/tests/system/dlv/ns3/sign.sh | 1 + + bin/tests/system/feature-test.c | 13 ++++ bin/tests/system/notify/ns5/named.conf.in | 6 +- bin/tests/system/notify/tests.sh | 6 +- bin/tests/system/nsupdate/ns1/named.conf.in | 2 +- bin/tests/system/nsupdate/ns2/named.conf.in | 2 +- - bin/tests/system/nsupdate/setup.sh | 7 +- + bin/tests/system/nsupdate/setup.sh | 6 +- bin/tests/system/nsupdate/tests.sh | 11 ++- bin/tests/system/rndc/setup.sh | 2 +- bin/tests/system/rndc/tests.sh | 23 ++++--- - bin/tests/system/tsig/clean.sh | 1 + bin/tests/system/tsig/ns1/named.conf.in | 10 +-- bin/tests/system/tsig/setup.sh | 5 ++ bin/tests/system/tsig/tests.sh | 67 ++++++++++++------- - bin/tests/system/tsiggss/setup.sh | 2 +- bin/tests/system/upforwd/ns1/named.conf.in | 2 +- bin/tests/system/upforwd/tests.sh | 2 +- - bin/tests/system/tsig/ns1/rndc5.conf.in | 10 +++ - 45 files changed, 232 insertions(+), 171 deletions(-) - create mode 100644 bin/tests/system/tsig/ns1/rndc5.conf.in + 33 files changed, 151 insertions(+), 107 deletions(-) diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in index 0ea6502..026db3f 100644 @@ -208,7 +195,7 @@ index 4b4e050..0e679a8 100644 }; diff --git a/bin/tests/system/acl/tests.sh b/bin/tests/system/acl/tests.sh -index 09f31f2..f88f0d4 100644 +index fe49a86..d7819f1 100644 --- a/bin/tests/system/acl/tests.sh +++ b/bin/tests/system/acl/tests.sh @@ -22,14 +22,14 @@ echo_i "testing basic ACL processing" @@ -334,11 +321,11 @@ index 09f31f2..f88f0d4 100644 echo_i "testing allow-query-on ACL processing" diff --git a/bin/tests/system/allow-query/ns2/named10.conf.in b/bin/tests/system/allow-query/ns2/named10.conf.in -index 1569913..e9c5c2d 100644 +index c5f38c9..00db0da 100644 --- a/bin/tests/system/allow-query/ns2/named10.conf.in +++ b/bin/tests/system/allow-query/ns2/named10.conf.in -@@ -12,7 +12,7 @@ - controls { /* empty */ }; +@@ -10,7 +10,7 @@ + */ key one { - algorithm hmac-md5; @@ -347,11 +334,11 @@ index 1569913..e9c5c2d 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named11.conf.in b/bin/tests/system/allow-query/ns2/named11.conf.in -index 18ac91c..2b1c873 100644 +index 56e5cc4..2c32b71 100644 --- a/bin/tests/system/allow-query/ns2/named11.conf.in +++ b/bin/tests/system/allow-query/ns2/named11.conf.in -@@ -12,12 +12,12 @@ - controls { /* empty */ }; +@@ -10,12 +10,12 @@ + */ key one { - algorithm hmac-md5; @@ -366,11 +353,11 @@ index 18ac91c..2b1c873 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named12.conf.in b/bin/tests/system/allow-query/ns2/named12.conf.in -index b824844..dd48945 100644 +index 8381950..21a6366 100644 --- a/bin/tests/system/allow-query/ns2/named12.conf.in +++ b/bin/tests/system/allow-query/ns2/named12.conf.in -@@ -12,7 +12,7 @@ - controls { /* empty */ }; +@@ -10,7 +10,7 @@ + */ key one { - algorithm hmac-md5; @@ -379,11 +366,11 @@ index b824844..dd48945 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named30.conf.in b/bin/tests/system/allow-query/ns2/named30.conf.in -index aeb1540..bfce58b 100644 +index 0e5ff55..a90ed6a 100644 --- a/bin/tests/system/allow-query/ns2/named30.conf.in +++ b/bin/tests/system/allow-query/ns2/named30.conf.in -@@ -12,7 +12,7 @@ - controls { /* empty */ }; +@@ -10,7 +10,7 @@ + */ key one { - algorithm hmac-md5; @@ -392,11 +379,11 @@ index aeb1540..bfce58b 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named31.conf.in b/bin/tests/system/allow-query/ns2/named31.conf.in -index d4b7432..e0f5252 100644 +index faadb3f..b99f337 100644 --- a/bin/tests/system/allow-query/ns2/named31.conf.in +++ b/bin/tests/system/allow-query/ns2/named31.conf.in -@@ -12,12 +12,12 @@ - controls { /* empty */ }; +@@ -10,12 +10,12 @@ + */ key one { - algorithm hmac-md5; @@ -411,11 +398,11 @@ index d4b7432..e0f5252 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named32.conf.in b/bin/tests/system/allow-query/ns2/named32.conf.in -index c025938..87afb3f 100644 +index 9e78dd0..ea7a413 100644 --- a/bin/tests/system/allow-query/ns2/named32.conf.in +++ b/bin/tests/system/allow-query/ns2/named32.conf.in -@@ -12,7 +12,7 @@ - controls { /* empty */ }; +@@ -10,7 +10,7 @@ + */ key one { - algorithm hmac-md5; @@ -424,10 +411,10 @@ index c025938..87afb3f 100644 }; diff --git a/bin/tests/system/allow-query/ns2/named40.conf.in b/bin/tests/system/allow-query/ns2/named40.conf.in -index d83b376..d726b94 100644 +index f4bc399..e01f312 100644 --- a/bin/tests/system/allow-query/ns2/named40.conf.in +++ b/bin/tests/system/allow-query/ns2/named40.conf.in -@@ -16,12 +16,12 @@ acl accept { 10.53.0.2; }; +@@ -14,12 +14,12 @@ acl accept { 10.53.0.2; }; acl badaccept { 10.53.0.1; }; key one { @@ -443,10 +430,10 @@ index d83b376..d726b94 100644 }; diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh -index fb6059d..f960156 100644 +index 479910c..53b9e5c 100644 --- a/bin/tests/system/allow-query/tests.sh +++ b/bin/tests/system/allow-query/tests.sh -@@ -190,7 +190,7 @@ rndc_reload +@@ -182,7 +182,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: key allowed - query allowed" ret=0 @@ -455,7 +442,7 @@ index fb6059d..f960156 100644 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -203,7 +203,7 @@ rndc_reload +@@ -195,7 +195,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: key not allowed - query refused" ret=0 @@ -464,7 +451,7 @@ index fb6059d..f960156 100644 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -216,7 +216,7 @@ rndc_reload +@@ -208,7 +208,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: key disallowed - query refused" ret=0 @@ -473,7 +460,7 @@ index fb6059d..f960156 100644 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -349,7 +349,7 @@ rndc_reload +@@ -341,7 +341,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: views key allowed - query allowed" ret=0 @@ -482,7 +469,7 @@ index fb6059d..f960156 100644 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -362,7 +362,7 @@ rndc_reload +@@ -354,7 +354,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: views key not allowed - query refused" ret=0 @@ -491,7 +478,7 @@ index fb6059d..f960156 100644 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -375,7 +375,7 @@ rndc_reload +@@ -367,7 +367,7 @@ rndc_reload ns2 10.53.0.2 echo_i "test $n: views key disallowed - query refused" ret=0 @@ -500,7 +487,7 @@ index fb6059d..f960156 100644 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.normal.example' dig.out.ns2.$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -508,7 +508,7 @@ status=`expr $status + $ret` +@@ -500,7 +500,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "test $n: zone key allowed - query allowed" ret=0 @@ -509,7 +496,7 @@ index fb6059d..f960156 100644 grep 'status: NOERROR' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -518,7 +518,7 @@ status=`expr $status + $ret` +@@ -510,7 +510,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "test $n: zone key not allowed - query refused" ret=0 @@ -518,7 +505,7 @@ index fb6059d..f960156 100644 grep 'status: REFUSED' dig.out.ns2.$n > /dev/null || ret=1 grep '^a.keyallow.example' dig.out.ns2.$n > /dev/null && ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -@@ -528,7 +528,7 @@ status=`expr $status + $ret` +@@ -520,7 +520,7 @@ status=`expr $status + $ret` n=`expr $n + 1` echo_i "test $n: zone key disallowed - query refused" ret=0 @@ -563,10 +550,10 @@ index 21be03e..e57c308 100644 }; diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf -index 9ab35b3..486551a 100644 +index d627d2a..9d0322a 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf -@@ -153,6 +153,6 @@ dyndb "name" "library.so" { +@@ -157,6 +157,6 @@ dyndb "name" "library.so" { system; }; key "mykey" { @@ -574,473 +561,51 @@ index 9ab35b3..486551a 100644 + algorithm "hmac-sha256"; secret "qwertyuiopasdfgh"; }; -diff --git a/bin/tests/system/digdelv/ns2/example.db b/bin/tests/system/digdelv/ns2/example.db -index f4e30f5..9f53e31 100644 ---- a/bin/tests/system/digdelv/ns2/example.db -+++ b/bin/tests/system/digdelv/ns2/example.db -@@ -38,12 +38,15 @@ foo SSHFP 2 1 123456789abcdef67890123456789abcdef67890 - ;; - ;; we are not testing DNSSEC behavior, so we don't care about the semantics - ;; of the following records. --dnskey 300 DNSKEY 256 3 1 ( -- AQPTpWyReB/e9Ii6mVGnakS8hX2zkh/iUYAg -- +Ge4noWROpTWOIBvm76zeJPWs4Zfqa1IsswD -- Ix5Mqeg0zwclz59uecKsKyx5w9IhtZ8plc4R -- b9VIE5x7KNHAYTvTO5d4S8M= -- ) -+dnskey 300 DNSKEY 256 3 8 ( -+ AwEAAaWmCoDpj2K59zcpqnmnQM7IC/XbjS6jIP7uTBR4X7p1bdQJzAeo -+ EnMhnpnxPp0j+20eZm4847DB2U+HuHy79Mvqd3aozTmfBJvzjKs9qyba -+ zY/ZHn6BDYxNJiFfjSS/VJ1KuQPDbpCzhm2hbvT5s9nSOaG0WyRk+d+R -+ qEca11E7ZKkmmNiGlyzMAgfmTTBwgxWBAAhvd9nU1GqD6eQ6Z63hpTc/ -+ KDIHnFTo7pOcZ4z5urIKUMCMcFytedETlEoR5CIWGPdQq2eIEEMfn5ld -+ QqdEZRHVErD9og8aluJ2s767HZb8LzjCfYgBFoT9/n48T75oZLEKtSkG -+ /idCeeQlaLU= -+ ) - - ; TTL of 3 weeks - weeks 1814400 A 10.53.0.2 -diff --git a/bin/tests/system/digdelv/tests.sh b/bin/tests/system/digdelv/tests.sh -index ade45ce..d3aff24 100644 ---- a/bin/tests/system/digdelv/tests.sh -+++ b/bin/tests/system/digdelv/tests.sh -@@ -106,7 +106,7 @@ if [ -x "$DIG" ] ; then - echo_i "checking dig +rrcomments works for DNSKEY($n)" - ret=0 - $DIG $DIGOPTS +tcp @10.53.0.3 +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1 -- grep "; ZSK; alg = RSAMD5 ; key id = 30795" < dig.out.test$n > /dev/null || ret=1 -+ grep "; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1 - check_ttl_range dig.out.test$n "DNSKEY" 300 || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` -@@ -115,7 +115,7 @@ if [ -x "$DIG" ] ; then - echo_i "checking dig +short +rrcomments works for DNSKEY ($n)" - ret=0 - $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1 -- grep "; ZSK; alg = RSAMD5 ; key id = 30795" < dig.out.test$n > /dev/null || ret=1 -+ grep "; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -123,7 +123,7 @@ if [ -x "$DIG" ] ; then - echo_i "checking dig +short +nosplit works($n)" - ret=0 - $DIG $DIGOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > dig.out.test$n || ret=1 -- grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < dig.out.test$n > /dev/null || ret=1 -+ grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=$" < dig.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -131,7 +131,7 @@ if [ -x "$DIG" ] ; then - echo_i "checking dig +short +rrcomments works($n)" - ret=0 - $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1 -- grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1 -+ grep "aLU= ; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -148,7 +148,7 @@ if [ -x "$DIG" ] ; then - echo_i "checking dig +short +rrcomments works($n)" - ret=0 - $DIG $DIGOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > dig.out.test$n || ret=1 -- grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < dig.out.test$n > /dev/null || ret=1 -+ grep "aLU= ; ZSK; alg = RSASHA256 ; key id = 36895$" < dig.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -695,7 +695,7 @@ if [ -x ${DELV} ] ; then - echo_i "checking delv +rrcomments works for DNSKEY($n)" - ret=0 - $DELV $DELVOPTS +tcp @10.53.0.3 +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1 -- grep "; ZSK; alg = RSAMD5 ; key id = 30795" < delv.out.test$n > /dev/null || ret=1 -+ grep "; ZSK; alg = RSASHA256 ; key id = 36895" < delv.out.test$n > /dev/null || ret=1 - check_ttl_range delv.out.test$n "DNSKEY" 300 || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` -@@ -704,7 +704,7 @@ if [ -x ${DELV} ] ; then - echo_i "checking delv +short +rrcomments works for DNSKEY ($n)" - ret=0 - $DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1 -- grep "; ZSK; alg = RSAMD5 ; key id = 30795" < delv.out.test$n > /dev/null || ret=1 -+ grep "; ZSK; alg = RSASHA256 ; key id = 36895" < delv.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -712,7 +712,7 @@ if [ -x ${DELV} ] ; then - echo_i "checking delv +short +rrcomments works ($n)" - ret=0 - $DELV $DELVOPTS +tcp @10.53.0.3 +short +rrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1 -- grep "S8M= ; ZSK; alg = RSAMD5 ; key id = 30795$" < delv.out.test$n > /dev/null || ret=1 -+ grep "aLU= ; ZSK; alg = RSASHA256 ; key id = 36895$" < delv.out.test$n > /dev/null || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi - status=`expr $status + $ret` - -@@ -720,7 +720,7 @@ if [ -x ${DELV} ] ; then - echo_i "checking delv +short +nosplit works ($n)" - ret=0 - $DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit DNSKEY dnskey.example > delv.out.test$n || ret=1 -- grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=" < delv.out.test$n > /dev/null || ret=1 -+ grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=" < delv.out.test$n > /dev/null || ret=1 - if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi - f=`awk '{print NF}' < delv.out.test$n` - test "${f:-0}" -eq 14 || ret=1 -@@ -731,7 +731,7 @@ if [ -x ${DELV} ] ; then - echo_i "checking delv +short +nosplit +norrcomments works ($n)" - ret=0 - $DELV $DELVOPTS +tcp @10.53.0.3 +short +nosplit +norrcomments DNSKEY dnskey.example > delv.out.test$n || ret=1 -- grep "Z8plc4Rb9VIE5x7KNHAYTvTO5d4S8M=$" < delv.out.test$n > /dev/null || ret=1 -+ grep "T9/n48T75oZLEKtSkG/idCeeQlaLU=$" < delv.out.test$n > /dev/null || ret=1 - if test `wc -l < delv.out.test$n` != 1 ; then ret=1 ; fi - f=`awk '{print NF}' < delv.out.test$n` - test "${f:-0}" -eq 4 || ret=1 -diff --git a/bin/tests/system/dlv/ns1/sign.sh b/bin/tests/system/dlv/ns1/sign.sh -index 606e7cc..a3a0d60 100755 ---- a/bin/tests/system/dlv/ns1/sign.sh -+++ b/bin/tests/system/dlv/ns1/sign.sh -@@ -23,8 +23,8 @@ infile=root.db.in - zonefile=root.db - outfile=root.signed - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -diff --git a/bin/tests/system/dlv/ns2/sign.sh b/bin/tests/system/dlv/ns2/sign.sh -index 9825c57..202c978 100755 ---- a/bin/tests/system/dlv/ns2/sign.sh -+++ b/bin/tests/system/dlv/ns2/sign.sh -@@ -24,8 +24,8 @@ zonefile=druz.db - outfile=druz.pre - dlvzone=utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -diff --git a/bin/tests/system/dlv/ns6/sign.sh b/bin/tests/system/dlv/ns6/sign.sh -index 1e39862..4ed19ac 100755 ---- a/bin/tests/system/dlv/ns6/sign.sh -+++ b/bin/tests/system/dlv/ns6/sign.sh -@@ -16,13 +16,15 @@ SYSTESTDIR=dlv - - echo_i "dlv/ns6/sign.sh" - +diff --git a/bin/tests/system/dlv/ns3/sign.sh b/bin/tests/system/dlv/ns3/sign.sh +index fa51ae1..bc46942 100755 +--- a/bin/tests/system/dlv/ns3/sign.sh ++++ b/bin/tests/system/dlv/ns3/sign.sh +@@ -19,6 +19,7 @@ echo_i "dlv/ns3/sign.sh" + dlvzone=dlv.utld. + dlvsets= + dssets= +bits=1024 -+ - zone=grand.child1.utld. + + zone=child1.utld. infile=child.db.in - zonefile=grand.child1.utld.db - outfile=grand.child1.signed - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -36,8 +38,8 @@ zonefile=grand.child3.utld.db - outfile=grand.child3.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -51,8 +53,8 @@ zonefile=grand.child4.utld.db - outfile=grand.child4.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -66,8 +68,8 @@ zonefile=grand.child5.utld.db - outfile=grand.child5.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -81,8 +83,8 @@ zonefile=grand.child7.utld.db - outfile=grand.child7.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -96,8 +98,8 @@ zonefile=grand.child8.utld.db - outfile=grand.child8.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -111,8 +113,8 @@ zonefile=grand.child9.utld.db - outfile=grand.child9.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -125,8 +127,8 @@ zonefile=grand.child10.utld.db - outfile=grand.child10.signed - dlvzone=dlv.utld. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -138,8 +140,8 @@ infile=child.db.in - zonefile=grand.child1.druz.db - outfile=grand.child1.druz.signed - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -153,8 +155,8 @@ zonefile=grand.child3.druz.db - outfile=grand.child3.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -168,8 +170,8 @@ zonefile=grand.child4.druz.db - outfile=grand.child4.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -183,8 +185,8 @@ zonefile=grand.child5.druz.db - outfile=grand.child5.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -198,8 +200,8 @@ zonefile=grand.child7.druz.db - outfile=grand.child7.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -213,8 +215,8 @@ zonefile=grand.child8.druz.db - outfile=grand.child8.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -228,8 +230,8 @@ zonefile=grand.child9.druz.db - outfile=grand.child9.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -@@ -242,8 +244,8 @@ zonefile=grand.child10.druz.db - outfile=grand.child10.druz.signed - dlvzone=dlv.druz. - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b $bits -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -diff --git a/bin/tests/system/dnssec/ns2/sign.sh b/bin/tests/system/dnssec/ns2/sign.sh -index 13fb924..1ffa279 100644 ---- a/bin/tests/system/dnssec/ns2/sign.sh -+++ b/bin/tests/system/dnssec/ns2/sign.sh -@@ -126,8 +126,8 @@ zone=in-addr.arpa. - infile=in-addr.arpa.db.in - zonefile=in-addr.arpa.db - --keyname1=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone` --keyname2=`$KEYGEN -q -r $RANDFILE -a DSA -b 768 -n zone $zone` -+keyname1=`$KEYGEN -q -r $RANDFILE -a DSA -b 1024 -n zone $zone` -+keyname2=`$KEYGEN -q -r $RANDFILE -a DSA -b 1024 -n zone $zone` - - cat $infile $keyname1.key $keyname2.key >$zonefile - $SIGNER -P -g -r $RANDFILE -o $zone -k $keyname1 $zonefile $keyname2 > /dev/null -@@ -138,7 +138,7 @@ privzone=private.secure.example - privinfile=private.secure.example.db.in - privzonefile=private.secure.example.db - --privkeyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $privzone` -+privkeyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $privzone` - - cat $privinfile $privkeyname.key >$privzonefile - -@@ -152,7 +152,7 @@ dlvinfile=dlv.db.in - dlvzonefile=dlv.db - dlvsetfile=dlvset-${privzone}${TP} - --dlvkeyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $dlvzone` -+dlvkeyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $dlvzone` - - cat $dlvinfile $dlvkeyname.key $dlvsetfile > $dlvzonefile - -diff --git a/bin/tests/system/dnssec/ns5/trusted.conf.bad b/bin/tests/system/dnssec/ns5/trusted.conf.bad -index ed30460..e6b1126 100644 ---- a/bin/tests/system/dnssec/ns5/trusted.conf.bad -+++ b/bin/tests/system/dnssec/ns5/trusted.conf.bad -@@ -10,5 +10,5 @@ - */ - - trusted-keys { -- "." 256 3 1 "AQO6Cl+slAf+iuieDim9L3kujFHQD7s/IOj03ClMOpKYcTXtK4mRpuULVfvWxDi9Ew/gj0xLnnX7z9OJHIxLI+DSrAHd8Dm0XfBEAtVtJSn70GaPZgnLMw1rk5ap2DsEoWk="; -+ "." 256 3 8 "AwEAAarwAdjV4gIhpBCjXVAScRFEx3co7k8smJdxrnqoGsl5NB7EZ9jRdgvCXbJn6v8y9jlNWVHvaC8ilhfhLh0A1vLWiWv4ijd/12xcnrY7xpG7Cu3YkxUxaXJ7Jdg/Iw1+9mGgXF1v4UbCIcw/3U3cxyk7OxYg+VSb5KBAQSR0upxV"; - }; -diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh -index b31c1b4..a5e237b 100644 ---- a/bin/tests/system/dnssec/tests.sh -+++ b/bin/tests/system/dnssec/tests.sh -@@ -3235,8 +3235,8 @@ do - alg=`expr $alg + 1` - continue;; - 3) size="-b 512";; -- 5) size="-b 512";; -- 6) size="-b 512";; -+ 5) size="-b 1024";; -+ 6) size="-b 1024";; - 7) size="-b 512";; - 8) size="-b 512";; - 10) size="-b 1024";; diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c -index c1249ed..20a3139 100644 +index 8b9deb6..ceb4fe8 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c @@ -19,6 +19,7 @@ #include #include #include -+#include ++#include #include #ifdef WIN32 -@@ -47,6 +48,7 @@ usage() { - fprintf(stderr, " --have-geoip2\n"); - fprintf(stderr, " --have-libxml2\n"); - fprintf(stderr, " --ipv6only=no\n"); -+ fprintf(stderr, " --md5\n"); - fprintf(stderr, " --rpz-nsdname\n"); - fprintf(stderr, " --rpz-nsip\n"); - fprintf(stderr, " --with-idn\n"); -@@ -155,6 +157,18 @@ main(int argc, char **argv) { +@@ -159,6 +160,18 @@ main(int argc, char **argv) { #endif } + if (strcmp(argv[1], "--md5") == 0) { -+#ifdef PK11_MD5_DISABLE -+ return (1); -+#else -+ if (isc_md5_available()) { ++ unsigned char digest[ISC_MAX_MD_SIZE]; ++ const char test[] = test; ++ ++ if (isc_md(ISC_MD_MD5, test, sizeof(test), ++ digest, sizeof(digest)) == ISC_R_SUCCESS) { + return (0); + } else { + return (1); + } -+#endif + } + - if (strcmp(argv[1], "--rpz-nsip") == 0) { - #ifdef ENABLE_RPZ_NSIP + if (strcmp(argv[1], "--ipv6only=no") == 0) { + #ifdef WIN32 return (0); -diff --git a/bin/tests/system/filter-aaaa/ns1/sign.sh b/bin/tests/system/filter-aaaa/ns1/sign.sh -index f755581..4a7d890 100755 ---- a/bin/tests/system/filter-aaaa/ns1/sign.sh -+++ b/bin/tests/system/filter-aaaa/ns1/sign.sh -@@ -21,8 +21,8 @@ infile=signed.db.in - zonefile=signed.db.signed - outfile=signed.db.signed - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - -diff --git a/bin/tests/system/filter-aaaa/ns4/sign.sh b/bin/tests/system/filter-aaaa/ns4/sign.sh -index f755581..4a7d890 100755 ---- a/bin/tests/system/filter-aaaa/ns4/sign.sh -+++ b/bin/tests/system/filter-aaaa/ns4/sign.sh -@@ -21,8 +21,8 @@ infile=signed.db.in - zonefile=signed.db.signed - outfile=signed.db.signed - --keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` --keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone 2> /dev/null` -+keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` -+keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 1024 -n zone $zone 2> /dev/null` - - cat $infile $keyname1.key $keyname2.key >$zonefile - diff --git a/bin/tests/system/notify/ns5/named.conf.in b/bin/tests/system/notify/ns5/named.conf.in -index cfcfe8f..0a1614d 100644 +index 2976bfc..256d846 100644 --- a/bin/tests/system/notify/ns5/named.conf.in +++ b/bin/tests/system/notify/ns5/named.conf.in @@ -10,17 +10,17 @@ @@ -1065,7 +630,7 @@ index cfcfe8f..0a1614d 100644 }; diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh -index 1f6e6d0..c08bd25 100644 +index fb2eb74..0e45424 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -212,16 +212,16 @@ ret=0 @@ -1089,22 +654,9 @@ index 1f6e6d0..c08bd25 100644 grep "test string" dig.out.b.ns5.test$n > /dev/null && grep "test string" dig.out.c.ns5.test$n > /dev/null && diff --git a/bin/tests/system/nsupdate/ns1/named.conf.in b/bin/tests/system/nsupdate/ns1/named.conf.in -index 1d999ad..26b6b7c 100644 +index e7b6adb..4ad5cc1 100644 --- a/bin/tests/system/nsupdate/ns1/named.conf.in +++ b/bin/tests/system/nsupdate/ns1/named.conf.in -@@ -32,7 +32,7 @@ controls { - }; - - key altkey { -- algorithm hmac-md5; -+ algorithm hmac-sha512; - secret "1234abcd8765"; - }; - -diff --git a/bin/tests/system/nsupdate/ns2/named.conf.in b/bin/tests/system/nsupdate/ns2/named.conf.in -index 4549184..cb7dccd 100644 ---- a/bin/tests/system/nsupdate/ns2/named.conf.in -+++ b/bin/tests/system/nsupdate/ns2/named.conf.in @@ -33,7 +33,7 @@ controls { }; @@ -1114,29 +666,41 @@ index 4549184..cb7dccd 100644 secret "1234abcd8765"; }; +diff --git a/bin/tests/system/nsupdate/ns2/named.conf.in b/bin/tests/system/nsupdate/ns2/named.conf.in +index b703843..8bfe2b0 100644 +--- a/bin/tests/system/nsupdate/ns2/named.conf.in ++++ b/bin/tests/system/nsupdate/ns2/named.conf.in +@@ -32,7 +32,7 @@ controls { + }; + + key altkey { +- algorithm hmac-md5; ++ algorithm hmac-sha512; + secret "1234abcd8765"; + }; + diff --git a/bin/tests/system/nsupdate/setup.sh b/bin/tests/system/nsupdate/setup.sh -index 21805c5..0d3d85c 100644 +index 5d70114..6c4b55a 100644 --- a/bin/tests/system/nsupdate/setup.sh +++ b/bin/tests/system/nsupdate/setup.sh -@@ -58,7 +58,12 @@ EOF +@@ -56,7 +56,11 @@ EOF - $DDNSCONFGEN -q -r $RANDFILE -z example.nil > ns1/ddns.key + $DDNSCONFGEN -q -z example.nil > ns1/ddns.key --$DDNSCONFGEN -q -r $RANDFILE -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key +-$DDNSCONFGEN -q -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key +if $FEATURETEST --md5; then -+ $DDNSCONFGEN -q -r $RANDFILE -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key ++ $DDNSCONFGEN -q -a hmac-md5 -k md5-key -z keytests.nil > ns1/md5.key +else + echo -n > ns1/md5.key +fi -+ - $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha1 -k sha1-key -z keytests.nil > ns1/sha1.key - $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key - $DDNSCONFGEN -q -r $RANDFILE -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key + $DDNSCONFGEN -q -a hmac-sha1 -k sha1-key -z keytests.nil > ns1/sha1.key + $DDNSCONFGEN -q -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key + $DDNSCONFGEN -q -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh -index 4da4849..b3bc807 100755 +index dd0286f..906135c 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh -@@ -708,7 +708,14 @@ fi +@@ -700,7 +700,14 @@ fi n=`expr $n + 1` ret=0 echo_i "check TSIG key algorithms ($n)" @@ -1152,7 +716,7 @@ index 4da4849..b3bc807 100755 $NSUPDATE -k ns1/${alg}.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add ${alg}.keytests.nil. 600 A 10.10.10.3 -@@ -716,7 +723,7 @@ send +@@ -708,7 +715,7 @@ send END done sleep 2 @@ -1162,10 +726,10 @@ index 4da4849..b3bc807 100755 done if [ $ret -ne 0 ]; then diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh -index 343869e..c30efb0 100644 +index cb64dd9..c9b2447 100644 --- a/bin/tests/system/rndc/setup.sh +++ b/bin/tests/system/rndc/setup.sh -@@ -37,7 +37,7 @@ make_key () { +@@ -35,7 +35,7 @@ make_key () { sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf } @@ -1175,10 +739,10 @@ index 343869e..c30efb0 100644 make_key 3 ${EXTRAPORT3} hmac-sha224 make_key 4 ${EXTRAPORT4} hmac-sha256 diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh -index 57e066d..186a723 100644 +index 7cbe2c7..b8cc6a0 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh -@@ -348,15 +348,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi +@@ -356,15 +356,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` @@ -1208,15 +772,6 @@ index 57e066d..186a723 100644 n=`expr $n + 1` echo_i "testing rndc with hmac-sha1 ($n)" -diff --git a/bin/tests/system/tsig/clean.sh b/bin/tests/system/tsig/clean.sh -index 576ec70..cb7a852 100644 ---- a/bin/tests/system/tsig/clean.sh -+++ b/bin/tests/system/tsig/clean.sh -@@ -20,3 +20,4 @@ rm -f */named.run - rm -f ns*/named.lock - rm -f Kexample.net.+163+* - rm -f keygen.out? -+rm -f ns1/named.conf diff --git a/bin/tests/system/tsig/ns1/named.conf.in b/bin/tests/system/tsig/ns1/named.conf.in index fbf30c6..f61657d 100644 --- a/bin/tests/system/tsig/ns1/named.conf.in @@ -1246,20 +801,20 @@ index fbf30c6..f61657d 100644 key "sha1-trunc" { secret "FrSt77yPTFx6hTs4i2tKLB9LmE0="; diff --git a/bin/tests/system/tsig/setup.sh b/bin/tests/system/tsig/setup.sh -index 4dd4a25..aa0f966 100644 +index b3e0450..90a6ce4 100644 --- a/bin/tests/system/tsig/setup.sh +++ b/bin/tests/system/tsig/setup.sh -@@ -17,3 +17,8 @@ $SHELL clean.sh - copy_setports ns1/named.conf.in ns1/named.conf +@@ -15,3 +15,8 @@ SYSTEMTESTTOP=.. + $SHELL clean.sh - test -r $RANDFILE || $GENRANDOM $RANDOMSIZE $RANDFILE + copy_setports ns1/named.conf.in ns1/named.conf + +if $FEATURETEST --md5 +then + cat ns1/rndc5.conf.in >> ns1/named.conf +fi diff --git a/bin/tests/system/tsig/tests.sh b/bin/tests/system/tsig/tests.sh -index f731fa6..cade35b 100644 +index 3a720de..e20e7f9 100644 --- a/bin/tests/system/tsig/tests.sh +++ b/bin/tests/system/tsig/tests.sh @@ -26,20 +26,25 @@ sha512="jI/Pa4qRu96t76Pns5Z/Ndxbn3QCkwcxLOgt9vgvnJw5wqTRvNyk3FtD6yIMd1dWVlqZ+Y4f @@ -1350,19 +905,8 @@ index f731fa6..cade35b 100644 fi echo_i "fetching using hmac-sha1-80 (BADTRUNC)" -diff --git a/bin/tests/system/tsiggss/setup.sh b/bin/tests/system/tsiggss/setup.sh -index 0d21c7b..dbcb7b4 100644 ---- a/bin/tests/system/tsiggss/setup.sh -+++ b/bin/tests/system/tsiggss/setup.sh -@@ -18,5 +18,5 @@ test -r $RANDFILE || $GENRANDOM $RANDOMSIZE $RANDFILE - - copy_setports ns1/named.conf.in ns1/named.conf - --key=`$KEYGEN -Cq -K ns1 -a DSA -b 512 -r $RANDFILE -n HOST -T KEY key.example.nil.` -+key=`$KEYGEN -Cq -K ns1 -a DSA -b 1024 -r $RANDFILE -n HOST -T KEY key.example.nil.` - cat ns1/example.nil.db.in ns1/${key}.key > ns1/example.nil.db diff --git a/bin/tests/system/upforwd/ns1/named.conf.in b/bin/tests/system/upforwd/ns1/named.conf.in -index e0a30cd..6a77b1c 100644 +index ea42b4d..08676da 100644 --- a/bin/tests/system/upforwd/ns1/named.conf.in +++ b/bin/tests/system/upforwd/ns1/named.conf.in @@ -10,7 +10,7 @@ @@ -1387,22 +931,6 @@ index b0694bb..9adae82 100644 server 10.53.0.3 ${PORT} update add updated.example. 600 A 10.10.10.1 update add updated.example. 600 TXT Foo -diff --git a/bin/tests/system/tsig/ns1/rndc5.conf.in b/bin/tests/system/tsig/ns1/rndc5.conf.in -new file mode 100644 -index 0000000..0682194 ---- /dev/null -+++ b/bin/tests/system/tsig/ns1/rndc5.conf.in -@@ -0,0 +1,10 @@ -+# Conditionally included when support for MD5 is available -+key "md5" { -+ secret "97rnFx24Tfna4mHPfgnerA=="; -+ algorithm hmac-md5; -+}; -+ -+key "md5-trunc" { -+ secret "97rnFx24Tfna4mHPfgnerA=="; -+ algorithm hmac-md5-80; -+}; -- 2.20.1 diff --git a/bind-9.11-host-idn-disable.patch b/bind-9.11-host-idn-disable.patch deleted file mode 100644 index 7f02b4c..0000000 --- a/bind-9.11-host-idn-disable.patch +++ /dev/null @@ -1,92 +0,0 @@ -From ec50eff97c259b5bfbfa4e050d69fe7b39b0f15a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Tue, 25 Sep 2018 18:08:46 +0200 -Subject: [PATCH] Disable IDN from environment as documented - -Manual page of host contained instructions to disable IDN processing -when it was built with libidn2. When refactoring IDN support however, -support for disabling IDN in host and nslookup was lost. Use also -environment variable and document it for nslookup, host and dig. - -Support variable CHARSET=ASCII to disable IDN, supported in downstream -RH patch since RHEL 5. ---- - bin/dig/dig.docbook | 4 +++- - bin/dig/dighost.c | 5 +++++ - bin/dig/host.docbook | 2 +- - bin/dig/nslookup.docbook | 15 +++++++++++++++ - 4 files changed, 24 insertions(+), 2 deletions(-) - -diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook -index 5d19301..933af79 100644 ---- a/bin/dig/dig.docbook -+++ b/bin/dig/dig.docbook -@@ -1312,7 +1312,9 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr - reply from the server. - If you'd like to turn off the IDN support for some reason, use - parameters +noidnin and -- +noidnout. -+ +noidnout or define -+ the IDN_DISABLE environment variable. -+ - - - -diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c -index 5eabc1f..73aaab8 100644 ---- a/bin/dig/dighost.c -+++ b/bin/dig/dighost.c -@@ -826,6 +826,11 @@ make_empty_lookup(void) { - looknew->badcookie = true; - #ifdef WITH_IDN_SUPPORT - looknew->idnin = isatty(1)?(getenv("IDN_DISABLE") == NULL):false; -+ if (looknew->idnin) { -+ const char *charset = getenv("CHARSET"); -+ if (charset && !strcmp(charset, "ASCII")) -+ looknew->idnin = false; -+ } - #else - looknew->idnin = false; - #endif -diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook -index da0f8fb..9689b5a 100644 ---- a/bin/dig/host.docbook -+++ b/bin/dig/host.docbook -@@ -379,7 +379,7 @@ - host appropriately converts character encoding of - domain name before sending a request to DNS server or displaying a - reply from the server. -- If you'd like to turn off the IDN support for some reason, defines -+ If you'd like to turn off the IDN support for some reason, define - the IDN_DISABLE environment variable. - The IDN support is disabled if the variable is set when - host runs. -diff --git a/bin/dig/nslookup.docbook b/bin/dig/nslookup.docbook -index d46fc2d..6d7d181 100644 ---- a/bin/dig/nslookup.docbook -+++ b/bin/dig/nslookup.docbook -@@ -495,6 +495,21 @@ nslookup -query=hinfo -timeout=10 - - - -+ IDN SUPPORT -+ -+ -+ If nslookup has been built with IDN (internationalized -+ domain name) support, it can accept and display non-ASCII domain names. -+ nslookup appropriately converts character encoding of -+ domain name before sending a request to DNS server or displaying a -+ reply from the server. -+ If you'd like to turn off the IDN support for some reason, define -+ the IDN_DISABLE environment variable. -+ The IDN support is disabled if the variable is set when -+ nslookup runs. -+ -+ -+ - FILES - - /etc/resolv.conf --- -2.20.1 - diff --git a/bind-9.11-rh1624100.patch b/bind-9.11-rh1624100.patch deleted file mode 100644 index 5764ed7..0000000 --- a/bind-9.11-rh1624100.patch +++ /dev/null @@ -1,288 +0,0 @@ -From 76594cba9a1e910bb36160d96fc3872349341799 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= -Date: Wed, 25 Apr 2018 14:04:31 +0200 -Subject: [PATCH] Replace isc_safe routines with their OpenSSL counter parts - -(cherry picked from commit 66ba2fdad583d962a1f4971c85d58381f0849e4d) - -Remove isc_safe_memcompare, it's not needed anywhere and can't be replaced with CRYPTO_memcmp() - -(cherry picked from commit b105ccee68ccc3c18e6ea530063b3c8e5a42571c) - -Fix the isc_safe_memwipe() usage with (NULL, >0) - -(cherry picked from commit 083461d3329ff6f2410745848a926090586a9846) ---- - bin/dnssec/dnssec-signzone.c | 2 +- - lib/dns/nsec3.c | 4 +- - lib/dns/spnego.c | 4 +- - lib/isc/Makefile.in | 8 +--- - lib/isc/include/isc/safe.h | 18 ++------ - lib/isc/safe.c | 83 ------------------------------------ - lib/isc/tests/safe_test.c | 18 -------- - 7 files changed, 11 insertions(+), 126 deletions(-) - delete mode 100644 lib/isc/safe.c - -diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c -index 6ddaebe..d921870 100644 ---- a/bin/dnssec/dnssec-signzone.c -+++ b/bin/dnssec/dnssec-signzone.c -@@ -787,7 +787,7 @@ hashlist_add_dns_name(hashlist_t *l, /*const*/ dns_name_t *name, - - static int - hashlist_comp(const void *a, const void *b) { -- return (isc_safe_memcompare(a, b, hash_length + 1)); -+ return (memcmp(a, b, hash_length + 1)); - } - - static void -diff --git a/lib/dns/nsec3.c b/lib/dns/nsec3.c -index 6ae7ca8..01426d6 100644 ---- a/lib/dns/nsec3.c -+++ b/lib/dns/nsec3.c -@@ -1963,7 +1963,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, dns_name_t* name, - * Work out what this NSEC3 covers. - * Inside (<0) or outside (>=0). - */ -- scope = isc_safe_memcompare(owner, nsec3.next, nsec3.next_length); -+ scope = memcmp(owner, nsec3.next, nsec3.next_length); - - /* - * Prepare to compute all the hashes. -@@ -1987,7 +1987,7 @@ dns_nsec3_noexistnodata(dns_rdatatype_t type, dns_name_t* name, - return (ISC_R_IGNORE); - } - -- order = isc_safe_memcompare(hash, owner, length); -+ order = memcmp(hash, owner, length); - if (first && order == 0) { - /* - * The hashes are the same. -diff --git a/lib/dns/spnego.c b/lib/dns/spnego.c -index ad77f24..670982a 100644 ---- a/lib/dns/spnego.c -+++ b/lib/dns/spnego.c -@@ -371,7 +371,7 @@ gssapi_spnego_decapsulate(OM_uint32 *, - - /* mod_auth_kerb.c */ - --static int -+static isc_boolean_t - cmp_gss_type(gss_buffer_t token, gss_OID gssoid) - { - unsigned char *p; -@@ -395,7 +395,7 @@ cmp_gss_type(gss_buffer_t token, gss_OID gssoid) - if (((OM_uint32) *p++) != gssoid->length) - return (GSS_S_DEFECTIVE_TOKEN); - -- return (isc_safe_memcompare(p, gssoid->elements, gssoid->length)); -+ return (!isc_safe_memequal(p, gssoid->elements, gssoid->length)); - } - - /* accept_sec_context.c */ -diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in -index 0fd0837..8ad54bb 100644 ---- a/lib/isc/Makefile.in -+++ b/lib/isc/Makefile.in -@@ -60,7 +60,7 @@ OBJS = @ISC_EXTRA_OBJS@ @ISC_PK11_O@ @ISC_PK11_RESULT_O@ \ - parseint.@O@ portset.@O@ quota.@O@ radix.@O@ random.@O@ \ - ratelimiter.@O@ refcount.@O@ region.@O@ regex.@O@ result.@O@ \ - rwlock.@O@ \ -- safe.@O@ serial.@O@ siphash.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ stats.@O@ \ -+ serial.@O@ siphash.@O@ sha1.@O@ sha2.@O@ sockaddr.@O@ stats.@O@ \ - string.@O@ strtoul.@O@ symtab.@O@ task.@O@ taskpool.@O@ \ - tm.@O@ timer.@O@ version.@O@ \ - ${UNIXOBJS} ${NLSOBJS} ${THREADOBJS} -@@ -79,7 +79,7 @@ SRCS = @ISC_EXTRA_SRCS@ @ISC_PK11_C@ @ISC_PK11_RESULT_C@ \ - netaddr.c netscope.c pool.c ondestroy.c \ - parseint.c portset.c quota.c radix.c random.c ${CHACHASRCS} \ - ratelimiter.c refcount.c region.c regex.c result.c rwlock.c \ -- safe.c serial.c siphash.c sha1.c sha2.c sockaddr.c stats.c string.c \ -+ serial.c siphash.c sha1.c sha2.c sockaddr.c stats.c string.c \ - strtoul.c symtab.c task.c taskpool.c timer.c \ - tm.c version.c - -@@ -95,10 +95,6 @@ TESTDIRS = @UNITTESTS@ - - @BIND9_MAKE_RULES@ - --safe.@O@: safe.c -- ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} @CCNOOPT@ \ -- -c ${srcdir}/safe.c -- - version.@O@: version.c - ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ - -DVERSION=\"${VERSION}\" \ -diff --git a/lib/isc/include/isc/safe.h b/lib/isc/include/isc/safe.h -index 66ed08b..88b8f47 100644 ---- a/lib/isc/include/isc/safe.h -+++ b/lib/isc/include/isc/safe.h -@@ -15,29 +15,19 @@ - - /*! \file isc/safe.h */ - --#include -- --#include --#include -+#include -+#include - - ISC_LANG_BEGINDECLS - --bool --isc_safe_memequal(const void *s1, const void *s2, size_t n); -+#define isc_safe_memequal(s1, s2, n) !CRYPTO_memcmp(s1, s2, n) - /*%< - * Returns true iff. two blocks of memory are equal, otherwise - * false. - * - */ - --int --isc_safe_memcompare(const void *b1, const void *b2, size_t len); --/*%< -- * Clone of libc memcmp() which is safe to differential timing attacks. -- */ -- --void --isc_safe_memwipe(void *ptr, size_t len); -+#define isc_safe_memwipe(ptr, len) OPENSSL_cleanse(ptr, len) - /*%< - * Clear the memory of length `len` pointed to by `ptr`. - * -diff --git a/lib/isc/safe.c b/lib/isc/safe.c -deleted file mode 100644 -index 7a464b6..0000000 ---- a/lib/isc/safe.c -+++ /dev/null -@@ -1,83 +0,0 @@ --/* -- * Copyright (C) Internet Systems Consortium, Inc. ("ISC") -- * -- * This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. -- * -- * See the COPYRIGHT file distributed with this work for additional -- * information regarding copyright ownership. -- */ -- --/*! \file */ -- --#include -- --#include -- --#include --#include --#include -- --#ifdef WIN32 --#include --#endif -- --#ifdef _MSC_VER --#pragma optimize("", off) --#endif -- --bool --isc_safe_memequal(const void *s1, const void *s2, size_t n) { -- uint8_t acc = 0; -- -- if (n != 0U) { -- const uint8_t *p1 = s1, *p2 = s2; -- -- do { -- acc |= *p1++ ^ *p2++; -- } while (--n != 0U); -- } -- return (acc == 0); --} -- -- --int --isc_safe_memcompare(const void *b1, const void *b2, size_t len) { -- const unsigned char *p1 = b1, *p2 = b2; -- size_t i; -- int res = 0, done = 0; -- -- for (i = 0; i < len; i++) { -- /* lt is -1 if p1[i] < p2[i]; else 0. */ -- int lt = (p1[i] - p2[i]) >> CHAR_BIT; -- -- /* gt is -1 if p1[i] > p2[i]; else 0. */ -- int gt = (p2[i] - p1[i]) >> CHAR_BIT; -- -- /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */ -- int cmp = lt - gt; -- -- /* set res = cmp if !done. */ -- res |= cmp & ~done; -- -- /* set done if p1[i] != p2[i]. */ -- done |= lt | gt; -- } -- -- return (res); --} -- --void --isc_safe_memwipe(void *ptr, size_t len) { -- if (ISC_UNLIKELY(ptr == NULL || len == 0)) -- return; -- --#ifdef WIN32 -- SecureZeroMemory(ptr, len); --#elif HAVE_EXPLICIT_BZERO -- explicit_bzero(ptr, len); --#else -- memset(ptr, 0, len); --#endif --} -diff --git a/lib/isc/tests/safe_test.c b/lib/isc/tests/safe_test.c -index 266ac75..60e9181 100644 ---- a/lib/isc/tests/safe_test.c -+++ b/lib/isc/tests/safe_test.c -@@ -45,22 +45,6 @@ isc_safe_memequal_test(void **state) { - "\x00\x00\x00\x00", 4)); - } - --/* test isc_safe_memcompare() */ --static void --isc_safe_memcompare_test(void **state) { -- UNUSED(state); -- -- assert_int_equal(isc_safe_memcompare("test", "test", 4), 0); -- assert_true(isc_safe_memcompare("test", "tesc", 4) > 0); -- assert_true(isc_safe_memcompare("test", "tesy", 4) < 0); -- assert_int_equal(isc_safe_memcompare("\x00\x00\x00\x00", -- "\x00\x00\x00\x00", 4), 0); -- assert_true(isc_safe_memcompare("\x00\x00\x00\x00", -- "\x00\x00\x00\x01", 4) < 0); -- assert_true(isc_safe_memcompare("\x00\x00\x00\x02", -- "\x00\x00\x00\x00", 4) > 0); --} -- - /* test isc_safe_memwipe() */ - static void - isc_safe_memwipe_test(void **state) { -@@ -69,7 +53,6 @@ isc_safe_memwipe_test(void **state) { - /* These should pass. */ - isc_safe_memwipe(NULL, 0); - isc_safe_memwipe((void *) -1, 0); -- isc_safe_memwipe(NULL, 42); - - /* - * isc_safe_memwipe(ptr, size) should function same as -@@ -108,7 +91,6 @@ main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(isc_safe_memequal_test), - cmocka_unit_test(isc_safe_memwipe_test), -- cmocka_unit_test(isc_safe_memcompare_test), - }; - - return (cmocka_run_group_tests(tests, NULL, NULL)); --- -2.20.1 - diff --git a/bind-9.11-rh1663318.patch b/bind-9.11-rh1663318.patch deleted file mode 100644 index 1af7efb..0000000 --- a/bind-9.11-rh1663318.patch +++ /dev/null @@ -1,48 +0,0 @@ -From b16a1ff25644bb075f454afe68ee63f6f385ca9c Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Wed, 23 Jan 2019 21:11:07 +0100 -Subject: [PATCH] Made RAND_status check optional (broke --disable-crypto-rand) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Unlike upstream, skip it also for DHCP. - -Disable RAND_status also in non-threaded builds. DHCP is built without -threads and should not check RAND_status on dns library initialization. -Lack of entropy is possible state for dhclient, but it must not fail -even in this case. Because DHCP itself does not require custom random -generator, leave default RAND_OpenSSL configured. It should help TLS -connection to LDAP in single DHCP binary, while keeping secure random -data if needed. - -(modified upstream commit 8a98277811ea50035ff37b744fa3dc5b75bee099) - -Signed-off-by: Petr Menšík ---- - lib/dns/openssl_link.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c -index 7a233dd..941eb17 100644 ---- a/lib/dns/openssl_link.c -+++ b/lib/dns/openssl_link.c -@@ -289,6 +289,7 @@ dst__openssl_init(const char *engine) { - #endif - #endif /* !defined(OPENSSL_NO_ENGINE) */ - -+#if defined(ISC_PLATFORM_CRYPTORANDOM) && defined(ISC_PLATFORM_USETHREADS) - /* Protect ourselves against unseeded PRNG */ - if (RAND_status() != 1) { - FATAL_ERROR(__FILE__, __LINE__, -@@ -296,6 +297,7 @@ dst__openssl_init(const char *engine) { - "cannot be initialized (see the `PRNG not " - "seeded' message in the OpenSSL FAQ)"); - } -+#endif - - return (ISC_R_SUCCESS); - --- -2.20.1 - diff --git a/bind-9.11-rt31459.patch b/bind-9.11-rt31459.patch index efcc6fa..587fc28 100644 --- a/bind-9.11-rt31459.patch +++ b/bind-9.11-rt31459.patch @@ -1,4 +1,4 @@ -From e83a6723d84e4c4400ca646077393a24b092c623 Mon Sep 17 00:00:00 2001 +From 31612e4f76eeb07d0fffa33814ce5edef04b286a Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Tue, 12 Sep 2017 19:05:46 -0700 Subject: [PATCH] rebased rt31459c @@ -13,383 +13,24 @@ DNS_OPENSSL_LIBS -> DST_OPENSSL_LIBS Include new unit test --- - bin/confgen/keygen.c | 7 + - bin/dnssec/dnssec-dsfromkey.c | 8 +- - bin/dnssec/dnssec-importkey.c | 8 +- - bin/dnssec/dnssec-revoke.c | 8 +- - bin/dnssec/dnssec-settime.c | 8 +- - bin/dnssec/dnssec-signzone.c | 11 +- - bin/dnssec/dnssec-verify.c | 8 +- - bin/dnssec/dnssectool.c | 11 +- - bin/named/server.c | 6 + - bin/nsupdate/nsupdate.c | 14 +- - bin/tests/makejournal.c | 6 +- - bin/tests/system/pipelined/pipequeries.c | 20 +- - bin/tests/system/pipelined/tests.sh | 4 +- - bin/tests/system/rsabigexponent/bigkey.c | 4 + - bin/tests/system/tkey/keycreate.c | 26 ++- - bin/tests/system/tkey/keydelete.c | 26 ++- - bin/tests/system/tkey/tests.sh | 8 +- - bin/tools/mdig.c | 3 +- - configure | 250 +++++++++++++---------- - configure.ac | 77 ++++++- - lib/dns/dst_api.c | 21 +- - lib/dns/include/dst/dst.h | 8 + - lib/dns/lib.c | 15 +- - lib/dns/openssl_link.c | 72 ++++++- - lib/dns/pkcs11.c | 29 ++- - lib/dns/tests/Kyuafile | 1 + - lib/dns/tests/Makefile.in | 7 + - lib/dns/tests/dstrandom_test.c | 115 +++++++++++ - lib/dns/win32/libdns.def.in | 7 + - lib/isc/entropy.c | 24 +++ - lib/isc/include/isc/entropy.h | 12 ++ - lib/isc/include/isc/platform.h.in | 5 + - lib/isc/include/isc/types.h | 2 + - lib/isc/pk11.c | 12 +- - lib/isc/win32/include/isc/platform.h.in | 5 + - win32utils/Configure | 28 ++- - 36 files changed, 701 insertions(+), 175 deletions(-) - create mode 100644 lib/dns/tests/dstrandom_test.c + bin/tests/system/pipelined/pipequeries.c | 1 + + bin/tests/system/pipelined/tests.sh | 4 +- + bin/tests/system/tkey/keycreate.c | 1 + + bin/tests/system/tkey/keydelete.c | 1 + + bin/tests/system/tkey/tests.sh | 8 +- + configure | 97 ++++++++++-------------- + lib/dns/include/dst/dst.h | 8 ++ + lib/dns/lib.c | 1 + + lib/dns/tests/Makefile.in | 5 ++ + lib/isc/include/isc/types.h | 2 + + win32utils/Configure | 4 +- + 11 files changed, 66 insertions(+), 66 deletions(-) -diff --git a/bin/confgen/keygen.c b/bin/confgen/keygen.c -index 5015abb..295e16f 100644 ---- a/bin/confgen/keygen.c -+++ b/bin/confgen/keygen.c -@@ -165,6 +165,13 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg, - randomfile = NULL; - open_keyboard = ISC_ENTROPY_KEYBOARDYES; - } -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(ectx, true); -+ } -+#endif - DO("start entropy source", isc_entropy_usebestsource(ectx, - &entropy_source, - randomfile, -diff --git a/bin/dnssec/dnssec-dsfromkey.c b/bin/dnssec/dnssec-dsfromkey.c -index d9d6bb9..de4b15f 100644 ---- a/bin/dnssec/dnssec-dsfromkey.c -+++ b/bin/dnssec/dnssec-dsfromkey.c -@@ -498,14 +498,14 @@ main(int argc, char **argv) { - - if (ectx == NULL) - setup_entropy(mctx, NULL, &ectx); -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("could not initialize hash"); - result = dst_lib_init(mctx, ectx, - ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY); - if (result != ISC_R_SUCCESS) - fatal("could not initialize dst: %s", - isc_result_totext(result)); -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("could not initialize hash"); - isc_entropy_stopcallbacksources(ectx); - - setup_logging(mctx, &log); -@@ -574,8 +574,8 @@ main(int argc, char **argv) { - if (dns_rdataset_isassociated(&rdataset)) - dns_rdataset_disassociate(&rdataset); - cleanup_logging(&log); -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - cleanup_entropy(&ectx); - dns_name_destroy(); - if (verbose > 10) -diff --git a/bin/dnssec/dnssec-importkey.c b/bin/dnssec/dnssec-importkey.c -index d65a514..04b3094 100644 ---- a/bin/dnssec/dnssec-importkey.c -+++ b/bin/dnssec/dnssec-importkey.c -@@ -404,14 +404,14 @@ main(int argc, char **argv) { - - if (ectx == NULL) - setup_entropy(mctx, NULL, &ectx); -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("could not initialize hash"); - result = dst_lib_init(mctx, ectx, - ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY); - if (result != ISC_R_SUCCESS) - fatal("could not initialize dst: %s", - isc_result_totext(result)); -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("could not initialize hash"); - isc_entropy_stopcallbacksources(ectx); - - setup_logging(mctx, &log); -@@ -455,8 +455,8 @@ main(int argc, char **argv) { - if (dns_rdataset_isassociated(&rdataset)) - dns_rdataset_disassociate(&rdataset); - cleanup_logging(&log); -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - cleanup_entropy(&ectx); - dns_name_destroy(); - if (verbose > 10) -diff --git a/bin/dnssec/dnssec-revoke.c b/bin/dnssec/dnssec-revoke.c -index 7d82dbf..10f9359 100644 ---- a/bin/dnssec/dnssec-revoke.c -+++ b/bin/dnssec/dnssec-revoke.c -@@ -184,14 +184,14 @@ main(int argc, char **argv) { - - if (ectx == NULL) - setup_entropy(mctx, NULL, &ectx); -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("Could not initialize hash"); - result = dst_lib_init2(mctx, ectx, engine, - ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY); - if (result != ISC_R_SUCCESS) - fatal("Could not initialize dst: %s", - isc_result_totext(result)); -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("Could not initialize hash"); - isc_entropy_stopcallbacksources(ectx); - - result = dst_key_fromnamedfile(filename, dir, -@@ -273,8 +273,8 @@ main(int argc, char **argv) { - - cleanup: - dst_key_free(&key); -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - cleanup_entropy(&ectx); - if (verbose > 10) - isc_mem_stats(mctx, stdout); -diff --git a/bin/dnssec/dnssec-settime.c b/bin/dnssec/dnssec-settime.c -index 7afcaee..1cfa511 100644 ---- a/bin/dnssec/dnssec-settime.c -+++ b/bin/dnssec/dnssec-settime.c -@@ -380,14 +380,14 @@ main(int argc, char **argv) { - - if (ectx == NULL) - setup_entropy(mctx, NULL, &ectx); -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("Could not initialize hash"); - result = dst_lib_init2(mctx, ectx, engine, - ISC_ENTROPY_BLOCKING | ISC_ENTROPY_GOODONLY); - if (result != ISC_R_SUCCESS) - fatal("Could not initialize dst: %s", - isc_result_totext(result)); -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("Could not initialize hash"); - isc_entropy_stopcallbacksources(ectx); - - if (predecessor != NULL) { -@@ -672,8 +672,8 @@ main(int argc, char **argv) { - if (prevkey != NULL) - dst_key_free(&prevkey); - dst_key_free(&key); -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - cleanup_entropy(&ectx); - if (verbose > 10) - isc_mem_stats(mctx, stdout); -diff --git a/bin/dnssec/dnssec-signzone.c b/bin/dnssec/dnssec-signzone.c -index 71f5672..9b100ca 100644 ---- a/bin/dnssec/dnssec-signzone.c -+++ b/bin/dnssec/dnssec-signzone.c -@@ -3460,14 +3460,15 @@ main(int argc, char *argv[]) { - if (!pseudorandom) - eflags |= ISC_ENTROPY_GOODONLY; - -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("could not create hash context"); -- - result = dst_lib_init2(mctx, ectx, engine, eflags); - if (result != ISC_R_SUCCESS) - fatal("could not initialize dst: %s", - isc_result_totext(result)); -+ -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("could not create hash context"); -+ - isc_stdtime_get(&now); - - if (startstr != NULL) { -@@ -3879,8 +3880,8 @@ main(int argc, char *argv[]) { - dns_master_styledestroy(&dsstyle, mctx); - - cleanup_logging(&log); -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - cleanup_entropy(&ectx); - dns_name_destroy(); - if (verbose > 10) -diff --git a/bin/dnssec/dnssec-verify.c b/bin/dnssec/dnssec-verify.c -index 4c293bf..3263cbc 100644 ---- a/bin/dnssec/dnssec-verify.c -+++ b/bin/dnssec/dnssec-verify.c -@@ -281,15 +281,15 @@ main(int argc, char *argv[]) { - if (ectx == NULL) - setup_entropy(mctx, NULL, &ectx); - -- result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -- if (result != ISC_R_SUCCESS) -- fatal("could not create hash context"); -- - result = dst_lib_init2(mctx, ectx, engine, ISC_ENTROPY_BLOCKING); - if (result != ISC_R_SUCCESS) - fatal("could not initialize dst: %s", - isc_result_totext(result)); - -+ result = isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ fatal("could not create hash context"); -+ - isc_stdtime_get(&now); - - rdclass = strtoclass(classname); -diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c -index 9d2a016..a9f90b6 100644 ---- a/bin/dnssec/dnssectool.c -+++ b/bin/dnssec/dnssectool.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -235,7 +236,8 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - if (*ectx == NULL) { - result = isc_entropy_create(mctx, ectx); - if (result != ISC_R_SUCCESS) -- fatal("could not create entropy object"); -+ fatal("could not create entropy object: %s", -+ isc_result_totext(result)); - ISC_LIST_INIT(sources); - } - -@@ -244,6 +246,13 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - randomfile = NULL; - } - -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(*ectx, true); -+ } -+#endif - result = isc_entropy_usebestsource(*ectx, &source, randomfile, - usekeyboard); - -diff --git a/bin/named/server.c b/bin/named/server.c -index 5a860e4..21c340c 100644 ---- a/bin/named/server.c -+++ b/bin/named/server.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -8217,6 +8218,10 @@ load_configuration(const char *filename, ns_server_t *server, - "no source of entropy found"); - } else { - const char *randomdev = cfg_obj_asstring(obj); -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (strcmp(randomdev, ISC_PLATFORM_CRYPTORANDOM) == 0) -+ isc_entropy_usehook(ns_g_entropy, true); -+#else - int level = ISC_LOG_ERROR; - result = isc_entropy_createfilesource(ns_g_entropy, - randomdev); -@@ -8251,6 +8256,7 @@ load_configuration(const char *filename, ns_server_t *server, - } - isc_entropy_detach(&ns_g_fallbackentropy); - } -+#endif - #endif - } - -diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c -index bbb3936..0286987 100644 ---- a/bin/nsupdate/nsupdate.c -+++ b/bin/nsupdate/nsupdate.c -@@ -272,7 +272,8 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - if (*ectx == NULL) { - result = isc_entropy_create(mctx, ectx); - if (result != ISC_R_SUCCESS) -- fatal("could not create entropy object"); -+ fatal("could not create entropy object: %s", -+ isc_result_totext(result)); - ISC_LIST_INIT(sources); - } - -@@ -281,6 +282,13 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - randomfile = NULL; - } - -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(*ectx, true); -+ } -+#endif - result = isc_entropy_usebestsource(*ectx, &source, randomfile, - usekeyboard); - -@@ -979,11 +987,11 @@ setup_system(void) { - } - } - -- setup_entropy(gmctx, NULL, &entropy); -+ if (entropy == NULL) -+ setup_entropy(gmctx, NULL, &entropy); - - result = isc_hash_create(gmctx, entropy, DNS_NAME_MAXWIRE); - check_result(result, "isc_hash_create"); -- isc_hash_init(); - - result = dns_dispatchmgr_create(gmctx, entropy, &dispatchmgr); - check_result(result, "dns_dispatchmgr_create"); -diff --git a/bin/tests/makejournal.c b/bin/tests/makejournal.c -index 61a41b0..acc71a1 100644 ---- a/bin/tests/makejournal.c -+++ b/bin/tests/makejournal.c -@@ -102,12 +102,12 @@ main(int argc, char **argv) { - CHECK(isc_mem_create(0, 0, &mctx)); - CHECK(isc_entropy_create(mctx, &ectx)); - -- CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); -- hash_active = true; -- - CHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_BLOCKING)); - dst_active = true; - -+ CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); -+ hash_active = true; -+ - CHECK(isc_log_create(mctx, &lctx, &logconfig)); - isc_log_registercategories(lctx, categories); - isc_log_setcontext(lctx); diff --git a/bin/tests/system/pipelined/pipequeries.c b/bin/tests/system/pipelined/pipequeries.c -index c6ab7f8..f0a6ff2 100644 +index 74de833..4fac3cb 100644 --- a/bin/tests/system/pipelined/pipequeries.c +++ b/bin/tests/system/pipelined/pipequeries.c -@@ -204,6 +204,7 @@ sendqueries(isc_task_t *task, isc_event_t *event) { +@@ -205,6 +205,7 @@ sendqueries(isc_task_t *task, isc_event_t *event) { int main(int argc, char *argv[]) { @@ -397,56 +38,6 @@ index c6ab7f8..f0a6ff2 100644 isc_sockaddr_t bind_any; struct in_addr inaddr; isc_result_t result; -@@ -222,7 +223,7 @@ main(int argc, char *argv[]) { - int c; - - isc_commandline_errprint = false; -- while ((c = isc_commandline_parse(argc, argv, "p:")) != -1) { -+ while ((c = isc_commandline_parse(argc, argv, "p:r:")) != -1) { - switch (c) { - case 'p': - result = isc_parse_uint16(&port, -@@ -233,6 +234,9 @@ main(int argc, char *argv[]) { - exit(1); - } - break; -+ case 'r': -+ randomfile = isc_commandline_argument; -+ break; - case '?': - fprintf(stderr, "%s: invalid argument '%c'", - argv[0], c); -@@ -275,10 +279,18 @@ main(int argc, char *argv[]) { - - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); -- RUNCHECK(isc_entropy_createfilesource(ectx, "../random.data")); -- RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(ectx, true); -+ } -+#endif -+ if (randomfile != NULL) -+ RUNCHECK(isc_entropy_createfilesource(ectx, randomfile)); - - RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY)); -+ RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); - - taskmgr = NULL; - RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr)); -@@ -331,8 +343,8 @@ main(int argc, char *argv[]) { - isc_task_detach(&task); - isc_taskmgr_destroy(&taskmgr); - -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - isc_entropy_detach(&ectx); - - isc_log_destroy(&lctx); diff --git a/bin/tests/system/pipelined/tests.sh b/bin/tests/system/pipelined/tests.sh index 61f1ff7..ed1302a 100644 --- a/bin/tests/system/pipelined/tests.sh @@ -469,33 +60,11 @@ index 61f1ff7..ed1302a 100644 awk '{ print $1 " " $5 }' < rawb > outputb $DIFF refb outputb || ret=1 if [ $ret != 0 ]; then echo_i "failed"; fi -diff --git a/bin/tests/system/rsabigexponent/bigkey.c b/bin/tests/system/rsabigexponent/bigkey.c -index 4462f2e..f06268d 100644 ---- a/bin/tests/system/rsabigexponent/bigkey.c -+++ b/bin/tests/system/rsabigexponent/bigkey.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -183,6 +184,9 @@ main(int argc, char **argv) { - - CHECK(isc_mem_create(0, 0, &mctx), "isc_mem_create()"); - CHECK(isc_entropy_create(mctx, &ectx), "isc_entropy_create()"); -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ isc_entropy_usehook(ectx, true); -+#endif - CHECK(isc_entropy_usebestsource(ectx, &source, - "../random.data", - ISC_ENTROPY_KEYBOARDNO), diff --git a/bin/tests/system/tkey/keycreate.c b/bin/tests/system/tkey/keycreate.c -index 653c951..fe8698e 100644 +index c39f6a4..b29a3cb 100644 --- a/bin/tests/system/tkey/keycreate.c +++ b/bin/tests/system/tkey/keycreate.c -@@ -206,6 +206,7 @@ sendquery(isc_task_t *task, isc_event_t *event) { +@@ -195,6 +195,7 @@ sendquery(isc_task_t *task, isc_event_t *event) { int main(int argc, char *argv[]) { char *ourkeyname; @@ -503,65 +72,8 @@ index 653c951..fe8698e 100644 isc_taskmgr_t *taskmgr; isc_timermgr_t *timermgr; isc_socketmgr_t *socketmgr; -@@ -225,10 +226,21 @@ main(int argc, char *argv[]) { - - RUNCHECK(isc_app_start()); - -+ randomfile = NULL; -+ - if (argc < 2) { - fprintf(stderr, "I:no DH key provided\n"); - exit(-1); - } -+ if (strcmp(argv[1], "-r") == 0) { -+ if (argc < 4) { -+ fprintf(stderr, "I:no DH key provided\n"); -+ exit(-1); -+ } -+ randomfile = argv[2]; -+ argv += 2; -+ argc -= 2; -+ } - ourkeyname = argv[1]; - - if (argc >= 3) -@@ -242,14 +254,22 @@ main(int argc, char *argv[]) { - - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); -- RUNCHECK(isc_entropy_createfilesource(ectx, "../random.data")); -- RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(ectx, true); -+ } -+#endif -+ if (randomfile != NULL) -+ RUNCHECK(isc_entropy_createfilesource(ectx, randomfile)); - - log = NULL; - logconfig = NULL; - RUNCHECK(isc_log_create(mctx, &log, &logconfig)); - - RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY)); -+ RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); - - taskmgr = NULL; - RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr)); -@@ -328,8 +348,8 @@ main(int argc, char *argv[]) { - - isc_log_destroy(&log); - -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - isc_entropy_detach(&ectx); - - isc_mem_destroy(&mctx); diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c -index 70a40c3..2146f9b 100644 +index 547e8d0..efcea1d 100644 --- a/bin/tests/system/tkey/keydelete.c +++ b/bin/tests/system/tkey/keydelete.c @@ -136,6 +136,7 @@ sendquery(isc_task_t *task, isc_event_t *event) { @@ -572,68 +84,11 @@ index 70a40c3..2146f9b 100644 isc_taskmgr_t *taskmgr; isc_timermgr_t *timermgr; isc_socketmgr_t *socketmgr; -@@ -156,10 +157,21 @@ main(int argc, char **argv) { - - RUNCHECK(isc_app_start()); - -+ randomfile = NULL; -+ - if (argc < 2) { - fprintf(stderr, "I:no key to delete\n"); - exit(-1); - } -+ if (strcmp(argv[1], "-r") == 0) { -+ if (argc < 4) { -+ fprintf(stderr, "I:no DH key provided\n"); -+ exit(-1); -+ } -+ randomfile = argv[2]; -+ argv += 2; -+ argc -= 2; -+ } - keyname = argv[1]; - - dns_result_register(); -@@ -169,14 +181,22 @@ main(int argc, char **argv) { - - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); -- RUNCHECK(isc_entropy_createfilesource(ectx, "../random.data")); -- RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile != NULL && -+ strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -+ randomfile = NULL; -+ isc_entropy_usehook(ectx, true); -+ } -+#endif -+ if (randomfile != NULL) -+ RUNCHECK(isc_entropy_createfilesource(ectx, randomfile)); - - log = NULL; - logconfig = NULL; - RUNCHECK(isc_log_create(mctx, &log, &logconfig)); - - RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY)); -+ RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); - - taskmgr = NULL; - RUNCHECK(isc_taskmgr_create(mctx, 1, 0, &taskmgr)); -@@ -264,8 +284,8 @@ main(int argc, char **argv) { - - isc_log_destroy(&log); - -- dst_lib_destroy(); - isc_hash_destroy(); -+ dst_lib_destroy(); - isc_entropy_detach(&ectx); - - isc_mem_destroy(&mctx); diff --git a/bin/tests/system/tkey/tests.sh b/bin/tests/system/tkey/tests.sh -index 9f90dd7..fad6c83 100644 +index a293d32..51ed2cb 100644 --- a/bin/tests/system/tkey/tests.sh +++ b/bin/tests/system/tkey/tests.sh -@@ -33,7 +33,7 @@ for owner in . foo.example. +@@ -31,7 +31,7 @@ for owner in . foo.example. do echo "I:creating new key using owner name \"$owner\"" ret=0 @@ -642,7 +97,7 @@ index 9f90dd7..fad6c83 100644 if [ $ret != 0 ]; then echo "I:failed" status=`expr $status + $ret` -@@ -55,7 +55,7 @@ do +@@ -53,7 +53,7 @@ do echo "I:deleting new key" ret=0 @@ -651,7 +106,7 @@ index 9f90dd7..fad6c83 100644 if [ $ret != 0 ]; then echo "I:failed" fi -@@ -75,7 +75,7 @@ done +@@ -73,7 +73,7 @@ done echo "I:creating new key using owner name bar.example." ret=0 @@ -660,7 +115,7 @@ index 9f90dd7..fad6c83 100644 if [ $ret != 0 ]; then echo "I:failed" status=`expr $status + $ret` -@@ -116,7 +116,7 @@ status=`expr $status + $ret` +@@ -114,7 +114,7 @@ status=`expr $status + $ret` echo "I:recreating the bar.example. key" ret=0 @@ -669,29 +124,11 @@ index 9f90dd7..fad6c83 100644 if [ $ret != 0 ]; then echo "I:failed" status=`expr $status + $ret` -diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c -index bf6dbb6..0416b21 100644 ---- a/bin/tools/mdig.c -+++ b/bin/tools/mdig.c -@@ -1972,12 +1972,11 @@ main(int argc, char *argv[]) { - - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); -+ RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY)); - RUNCHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)); - RUNCHECK(isc_entropy_getdata(ectx, cookie_secret, - sizeof(cookie_secret), NULL, 0)); - -- RUNCHECK(dst_lib_init(mctx, ectx, ISC_ENTROPY_GOODONLY)); -- - ISC_LIST_INIT(queries); - parse_args(false, argc, argv); - if (server == NULL) diff --git a/configure b/configure -index aab472a..b686178 100755 +index 4c97c8c..1e047bd 100755 --- a/configure +++ b/configure -@@ -640,6 +640,7 @@ ac_includes_default="\ +@@ -632,6 +632,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS @@ -699,260 +136,7 @@ index aab472a..b686178 100755 BUILD_LIBS BUILD_LDFLAGS BUILD_CPPFLAGS -@@ -821,6 +822,7 @@ XMLSTATS - NZDTARGETS - NZDSRCS - NZD_TOOLS -+ISC_PLATFORM_CRYPTORANDOM - PKCS11_TEST - PKCS11_ED25519 - PKCS11_GOST -@@ -1045,6 +1047,7 @@ with_eddsa - with_aes - enable_openssl_hash - with_cc_alg -+enable_crypto_rand - with_lmdb - with_libxml2 - with_libjson -@@ -1745,6 +1748,7 @@ Optional Features: - --enable-threads enable multithreading - --enable-native-pkcs11 use native PKCS11 for all crypto [default=no] - --enable-openssl-hash use OpenSSL for hash functions [default=no] -+ --enable-crypto-rand use the crypto provider for random [default=yes] - --enable-largefile 64-bit file support - --enable-backtrace log stack backtrace on abort [default=yes] - --enable-symtable use internal symbol table for backtrace -@@ -17135,6 +17139,7 @@ case "$use_openssl" in - $as_echo "disabled because of native PKCS11" >&6; } - DST_OPENSSL_INC="" - CRYPTO="-DPKCS11CRYPTO" -+ CRYPTOLIB="pkcs11" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -17149,6 +17154,7 @@ $as_echo "disabled because of native PKCS11" >&6; } - $as_echo "no" >&6; } - DST_OPENSSL_INC="" - CRYPTO="" -+ CRYPTOLIB="" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -17161,6 +17167,7 @@ $as_echo "no" >&6; } - auto) - DST_OPENSSL_INC="" - CRYPTO="" -+ CRYPTOLIB="" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -17170,7 +17177,7 @@ $as_echo "no" >&6; } - OPENSSLLINKOBJS="" - OPENSSLLINKSRCS="" - as_fn_error $? "OpenSSL was not found in any of $openssldirs; use --with-openssl=/path --If you don't want OpenSSL, use --without-openssl" "$LINENO" 5 -+If you do not want OpenSSL, use --without-openssl" "$LINENO" 5 - ;; - *) - if test "yes" = "$want_native_pkcs11" -@@ -17201,6 +17208,7 @@ $as_echo "not found" >&6; } - as_fn_error $? "\"$use_openssl/include/openssl/opensslv.h\" not found" "$LINENO" 5 - fi - CRYPTO='-DOPENSSL' -+ CRYPTOLIB="openssl" - if test "/usr" = "$use_openssl" - then - DST_OPENSSL_INC="" -@@ -17826,8 +17834,6 @@ fi - # Use OpenSSL for hash functions - # - --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for using OpenSSL for hash functions" >&5 --$as_echo_n "checking for using OpenSSL for hash functions... " >&6; } - ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH" - case $want_openssl_hash in - yes) -@@ -18202,6 +18208,86 @@ if test "rt" = "$have_clock_gt"; then - LIBS="-lrt $LIBS" - fi - -+# -+# Use the crypto provider (OpenSSL/PKCS#11) for random functions -+# -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for using the crypto library (vs. builtin) for random functions" >&5 -+$as_echo_n "checking for using the crypto library (vs. builtin) for random functions... " >&6; } -+# Check whether --enable-crypto-rand was given. -+if test "${enable_crypto_rand+set}" = set; then : -+ enableval=$enable_crypto_rand; want_crypto_rand="$enableval" -+else -+ want_crypto_rand="auto" -+fi -+ -+if test "$want_crypto_rand" = "auto" -+then -+ case "$CRYPTOLIB" in -+ "") -+ want_crypto_rand="no" -+ ;; -+ pkcs11) -+ want_crypto_rand="yes" -+ ;; -+ openssl) -+ saved_cflags="$CFLAGS" -+ saved_libs="$LIBS" -+ CFLAGS="$CFLAGS $DST_OPENSSL_INC" -+ LIBS="$LIBS $DST_OPENSSL_LIBS" -+ if test "$cross_compiling" = yes; then : -+ want_crypto_rand="yes" -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+ -+unsigned char buf[128]; -+ -+int main() -+{ -+ if (RAND_bytes(buf, 128) != 1) -+ return (1); -+ return (0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ want_crypto_rand="yes" -+else -+ want_crypto_rand="no" -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ CFLAGS="$saved_cflags" -+ LIBS="$saved_libs" -+ ;; -+ *) -+ as_fn_error $? "Unknown crypto library define $CRYPTOLIB" "$LINENO" 5 -+ ;; -+ esac -+fi -+case $want_crypto_rand in -+ yes) -+ if test "$CRYPTOLIB" = "" -+ then -+ as_fn_error $? "No crypto library for random functions" "$LINENO" 5 -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$CRYPTOLIB\"" >&5 -+$as_echo "\"$CRYPTOLIB\"" >&6; } -+ ISC_PLATFORM_CRYPTORANDOM="#define ISC_PLATFORM_CRYPTORANDOM \"$CRYPTOLIB\"" -+ ;; -+ no) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ ISC_PLATFORM_CRYPTORANDOM="#undef ISC_PLATFORM_CRYPTORANDOM" -+ ;; -+esac -+ -+ - # - # was --with-lmdb specified? - # -@@ -20284,9 +20370,12 @@ _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t for buflen; int for flags" >&5 - $as_echo "size_t for buflen; int for flags" >&6; } -- $as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T size_t" >>confdefs.h -+ # Changed to solve multilib conflict on Fedora -+ # AC_DEFINE(IRS_GETNAMEINFO_SOCKLEN_T, size_t) -+ # AC_DEFINE(IRS_GETNAMEINFO_BUFLEN_T, size_t) -+ $as_echo "#define IRS_GETNAMEINFO_SOCKLEN_T socklen_t" >>confdefs.h - -- $as_echo "#define IRS_GETNAMEINFO_BUFLEN_T size_t" >>confdefs.h -+ $as_echo "#define IRS_GETNAMEINFO_BUFLEN_T socklen_t" >>confdefs.h - - $as_echo "#define IRS_GETNAMEINFO_FLAGS_T int" >>confdefs.h - -@@ -21601,12 +21690,7 @@ ISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM" - ISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM" - ISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM" - if test "yes" = "$use_atomic"; then -- have_atomic=yes # set default -- case "$host" in -- i[3456]86-*) -- # XXX: some old x86 architectures actually do not support -- # (some of) these operations. Do we need stricter checks? -- # The cast to long int works around a bug in the HP C Compiler -+ # The cast to long int works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. -@@ -21639,6 +21723,11 @@ cat >>confdefs.h <<_ACEOF - _ACEOF - - -+ have_atomic=yes # set default -+ case "$host" in -+ i[3456]86-*) -+ # XXX: some old x86 architectures actually do not support -+ # (some of) these operations. Do we need stricter checks? - if test $ac_cv_sizeof_void_p = 8; then - arch=x86_64 - have_xaddq=yes -@@ -21647,39 +21736,6 @@ _ACEOF - fi - ;; - x86_64-*|amd64-*) -- # The cast to long int works around a bug in the HP C Compiler --# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects --# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. --# This bug is HP SR number 8606223364. --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 --$as_echo_n "checking size of void *... " >&6; } --if ${ac_cv_sizeof_void_p+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : -- --else -- if test "$ac_cv_type_void_p" = yes; then -- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 --$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} --as_fn_error 77 "cannot compute sizeof (void *) --See \`config.log' for more details" "$LINENO" 5; } -- else -- ac_cv_sizeof_void_p=0 -- fi --fi -- --fi --{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 --$as_echo "$ac_cv_sizeof_void_p" >&6; } -- -- -- --cat >>confdefs.h <<_ACEOF --#define SIZEOF_VOID_P $ac_cv_sizeof_void_p --_ACEOF -- -- - if test $ac_cv_sizeof_void_p = 8; then - arch=x86_64 - have_xaddq=yes -@@ -21710,6 +21766,10 @@ $as_echo_n "checking architecture type for atomic operations... " >&6; } - $as_echo "$arch" >&6; } - fi - -+if test ! "$arch" = "x86_64" -a "$have_xaddq" = "yes"; then -+ as_fn_error $? "XADDQ present but disabled by Fedora patch!" "$LINENO" 5 -+fi -+ - if test "yes" = "$have_atomic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler support for inline assembly code" >&5 - $as_echo_n "checking compiler support for inline assembly code... " >&6; } -@@ -24264,6 +24324,30 @@ CFLAGS="$CFLAGS $SO_CFLAGS" +@@ -20509,6 +20510,30 @@ fi # dlzdir='${DLZ_DRIVER_DIR}' @@ -983,7 +167,7 @@ index aab472a..b686178 100755 # # Private autoconf macro to simplify configuring drivers: # -@@ -24594,11 +24678,11 @@ $as_echo "no" >&6; } +@@ -20839,11 +20864,11 @@ $as_echo "no" >&6; } $as_echo "using mysql with libs ${mysql_lib} and includes ${mysql_include}" >&6; } ;; *) @@ -998,7 +182,7 @@ index aab472a..b686178 100755 fi CONTRIB_DLZ="$CONTRIB_DLZ -DDLZ_MYSQL" -@@ -24683,7 +24767,7 @@ $as_echo "" >&6; } +@@ -20928,7 +20953,7 @@ $as_echo "" >&6; } # Check other locations for includes. # Order is important (sigh). @@ -1007,7 +191,7 @@ index aab472a..b686178 100755 # include a blank element first for d in "" $bdb_incdirs do -@@ -24708,57 +24792,9 @@ $as_echo "" >&6; } +@@ -20953,57 +20978,9 @@ $as_echo "" >&6; } bdb_libnames="db53 db-5.3 db51 db-5.1 db48 db-4.8 db47 db-4.7 db46 db-4.6 db45 db-4.5 db44 db-4.4 db43 db-4.3 db42 db-4.2 db41 db-4.1 db" for d in $bdb_libnames do @@ -1067,7 +251,7 @@ index aab472a..b686178 100755 break fi done -@@ -24917,10 +24953,10 @@ $as_echo "no" >&6; } +@@ -21162,10 +21139,10 @@ $as_echo "no" >&6; } DLZ_DRIVER_INCLUDES="$DLZ_DRIVER_INCLUDES -I$use_dlz_ldap/include" DLZ_DRIVER_LDAP_INCLUDES="-I$use_dlz_ldap/include" fi @@ -1081,7 +265,7 @@ index aab472a..b686178 100755 fi -@@ -25006,11 +25042,11 @@ fi +@@ -21251,11 +21228,11 @@ fi odbcdirs="/usr /usr/local /usr/pkg" for d in $odbcdirs do @@ -1095,7 +279,7 @@ index aab472a..b686178 100755 break fi done -@@ -25285,6 +25321,8 @@ DNS_CRYPTO_LIBS="$NEWFLAGS" +@@ -21530,6 +21507,8 @@ DNS_CRYPTO_LIBS="$NEWFLAGS" @@ -1104,272 +288,11 @@ index aab472a..b686178 100755 # # Commands to run at the end of config.status. # Don't just put these into configure, it won't work right if somebody -@@ -27661,6 +27699,8 @@ report() { - echo " IPv6 support (--enable-ipv6)" - test "X$CRYPTO" = "X" -o "yes" = "$want_native_pkcs11" || \ - echo " OpenSSL cryptography/DNSSEC (--with-openssl)" -+ test "no" = "$want_crypto_rand" || \ -+ echo " Crypto provider entropy source (--enable-crypto-rand)" - test "X$PYTHON" = "X" || echo " Python tools (--with-python)" - test "X$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)" - test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)" -@@ -27701,6 +27741,8 @@ report() { - echo " Very verbose query trace logging (--enable-querytrace)" - test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)" - -+ echo " Cryptographic library for DNSSEC: $CRYPTOLIB" -+ - echo " Dynamically loadable zone (DLZ) drivers:" - test "no" = "$use_dlz_bdb" || \ - echo " Berkeley DB (--with-dlz-bdb)" -@@ -27748,6 +27790,8 @@ report() { - echo " ECDSA algorithm support (--with-ecdsa)" - test "X$CRYPTO" = "X" -o "yes" = "$OPENSSL_ED25519" -o "yes" = "$PKCS11_ED25519" || \ - echo " EDDSA algorithm support (--with-eddsa)" -+ test "yes" = "$want_crypto_rand" || \ -+ echo " Crypto provider entropy source (--enable-crypto-rand)" - - test "yes" = "$enable_seccomp" || \ - echo " Use libseccomp system call filtering (--enable-seccomp)" -diff --git a/configure.ac b/configure.ac -index 0e16cc8..dd0055d 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1550,6 +1550,7 @@ case "$use_openssl" in - AC_MSG_RESULT(disabled because of native PKCS11) - DST_OPENSSL_INC="" - CRYPTO="-DPKCS11CRYPTO" -+ CRYPTOLIB="pkcs11" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -1563,6 +1564,7 @@ case "$use_openssl" in - AC_MSG_RESULT(no) - DST_OPENSSL_INC="" - CRYPTO="" -+ CRYPTOLIB="" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -1575,6 +1577,7 @@ case "$use_openssl" in - auto) - DST_OPENSSL_INC="" - CRYPTO="" -+ CRYPTOLIB="" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" - OPENSSLEDDSALINKOBJS="" -@@ -1585,7 +1588,7 @@ case "$use_openssl" in - OPENSSLLINKSRCS="" - AC_MSG_ERROR( - [OpenSSL was not found in any of $openssldirs; use --with-openssl=/path --If you don't want OpenSSL, use --without-openssl]) -+If you do not want OpenSSL, use --without-openssl]) - ;; - *) - if test "yes" = "$want_native_pkcs11" -@@ -1615,6 +1618,7 @@ If you don't want OpenSSL, use --without-openssl]) - AC_MSG_ERROR(["$use_openssl/include/openssl/opensslv.h" not found]) - fi - CRYPTO='-DOPENSSL' -+ CRYPTOLIB="openssl" - if test "/usr" = "$use_openssl" - then - DST_OPENSSL_INC="" -@@ -2050,7 +2054,6 @@ fi - # Use OpenSSL for hash functions - # - --AC_MSG_CHECKING(for using OpenSSL for hash functions) - ISC_PLATFORM_OPENSSLHASH="#undef ISC_PLATFORM_OPENSSLHASH" - case $want_openssl_hash in - yes) -@@ -2322,6 +2325,67 @@ if test "rt" = "$have_clock_gt"; then - LIBS="-lrt $LIBS" - fi - -+# -+# Use the crypto provider (OpenSSL/PKCS#11) for random functions -+# -+ -+AC_MSG_CHECKING(for using the crypto library (vs. builtin) for random functions) -+AC_ARG_ENABLE(crypto-rand, -+ [ --enable-crypto-rand use the crypto provider for random [[default=yes]]], -+ want_crypto_rand="$enableval", want_crypto_rand="auto") -+if test "$want_crypto_rand" = "auto" -+then -+ case "$CRYPTOLIB" in -+ "") -+ want_crypto_rand="no" -+ ;; -+ pkcs11) -+ want_crypto_rand="yes" -+ ;; -+ openssl) -+ saved_cflags="$CFLAGS" -+ saved_libs="$LIBS" -+ CFLAGS="$CFLAGS $DST_OPENSSL_INC" -+ LIBS="$LIBS $DST_OPENSSL_LIBS" -+ AC_TRY_RUN([ -+#include -+ -+unsigned char buf[128]; -+ -+int main() -+{ -+ if (RAND_bytes(buf, 128) != 1) -+ return (1); -+ return (0); -+} -+], -+ [want_crypto_rand="yes"], -+ [want_crypto_rand="no"], -+ [want_crypto_rand="yes"]) -+ CFLAGS="$saved_cflags" -+ LIBS="$saved_libs" -+ ;; -+ *) -+ AC_MSG_ERROR([Unknown crypto library define $CRYPTOLIB]) -+ ;; -+ esac -+fi -+case $want_crypto_rand in -+ yes) -+ if test "$CRYPTOLIB" = "" -+ then -+ AC_MSG_ERROR([No crypto library for random functions]) -+ fi -+ AC_MSG_RESULT(["$CRYPTOLIB"]) -+ ISC_PLATFORM_CRYPTORANDOM="#define ISC_PLATFORM_CRYPTORANDOM \"$CRYPTOLIB\"" -+ ;; -+ no) -+ AC_MSG_RESULT(no) -+ ISC_PLATFORM_CRYPTORANDOM="#undef ISC_PLATFORM_CRYPTORANDOM" -+ ;; -+esac -+AC_SUBST(ISC_PLATFORM_CRYPTORANDOM) -+ - # - # was --with-lmdb specified? - # -@@ -4118,12 +4182,12 @@ ISC_PLATFORM_USEGCCASM="#undef ISC_PLATFORM_USEGCCASM" - ISC_PLATFORM_USESTDASM="#undef ISC_PLATFORM_USESTDASM" - ISC_PLATFORM_USEMACASM="#undef ISC_PLATFORM_USEMACASM" - if test "yes" = "$use_atomic"; then -+ AC_CHECK_SIZEOF([void *]) - have_atomic=yes # set default - case "$host" in - [i[3456]86-*]) - # XXX: some old x86 architectures actually do not support - # (some of) these operations. Do we need stricter checks? -- AC_CHECK_SIZEOF([void *]) - if test $ac_cv_sizeof_void_p = 8; then - arch=x86_64 - have_xaddq=yes -@@ -4132,7 +4196,6 @@ if test "yes" = "$use_atomic"; then - fi - ;; - x86_64-*|amd64-*) -- AC_CHECK_SIZEOF([void *]) - if test $ac_cv_sizeof_void_p = 8; then - arch=x86_64 - have_xaddq=yes -@@ -5537,6 +5600,8 @@ report() { - echo " IPv6 support (--enable-ipv6)" - test "X$CRYPTO" = "X" -o "yes" = "$want_native_pkcs11" || \ - echo " OpenSSL cryptography/DNSSEC (--with-openssl)" -+ test "no" = "$want_crypto_rand" || \ -+ echo " Crypto provider entropy source (--enable-crypto-rand)" - test "X$PYTHON" = "X" || echo " Python tools (--with-python)" - test "X$XMLSTATS" = "X" || echo " XML statistics (--with-libxml2)" - test "X$JSONSTATS" = "X" || echo " JSON statistics (--with-libjson)" -@@ -5577,6 +5642,8 @@ report() { - echo " Very verbose query trace logging (--enable-querytrace)" - test "no" = "$with_cmocka" || echo " CMocka Unit Testing Framework (--with-cmocka)" - -+ echo " Cryptographic library for DNSSEC: $CRYPTOLIB" -+ - echo " Dynamically loadable zone (DLZ) drivers:" - test "no" = "$use_dlz_bdb" || \ - echo " Berkeley DB (--with-dlz-bdb)" -@@ -5624,6 +5691,8 @@ report() { - echo " ECDSA algorithm support (--with-ecdsa)" - test "X$CRYPTO" = "X" -o "yes" = "$OPENSSL_ED25519" -o "yes" = "$PKCS11_ED25519" || \ - echo " EDDSA algorithm support (--with-eddsa)" -+ test "yes" = "$want_crypto_rand" || \ -+ echo " Crypto provider entropy source (--enable-crypto-rand)" - - test "yes" = "$enable_seccomp" || \ - echo " Use libseccomp system call filtering (--enable-seccomp)" -diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c -index 65bf25d..1eccbe7 100644 ---- a/lib/dns/dst_api.c -+++ b/lib/dns/dst_api.c -@@ -277,6 +277,12 @@ dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx, - #ifdef GSSAPI - RETERR(dst__gssapi_init(&dst_t_func[DST_ALG_GSSAPI])); - #endif -+#if defined(OPENSSL) || defined(PKCS11CRYPTO) -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (dst_entropy_pool != NULL) -+ isc_entropy_sethook(dst_random_getdata); -+#endif -+#endif /* defined(OPENSSL) || defined(PKCS11CRYPTO) */ - dst_initialized = true; - return (ISC_R_SUCCESS); - -@@ -296,11 +302,19 @@ dst_lib_destroy(void) { - for (i = 0; i < DST_MAX_ALGS; i++) - if (dst_t_func[i] != NULL && dst_t_func[i]->cleanup != NULL) - dst_t_func[i]->cleanup(); -+#if defined(OPENSSL) || defined(PKCS11CRYPTO) -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (dst_entropy_pool != NULL) { -+ isc_entropy_usehook(dst_entropy_pool, false); -+ isc_entropy_sethook(NULL); -+ } -+#endif - #ifdef OPENSSL - dst__openssl_destroy(); - #elif PKCS11CRYPTO - (void) dst__pkcs11_destroy(); - #endif /* if OPENSSL, elif PKCS11CRYPTO */ -+#endif /* defined(OPENSSL) || defined(PKCS11CRYPTO) */ - if (dst__memory_pool != NULL) - isc_mem_detach(&dst__memory_pool); - if (dst_entropy_pool != NULL) -@@ -2002,13 +2016,17 @@ dst__entropy_getdata(void *buf, unsigned int len, bool pseudo) { - flags &= ~ISC_ENTROPY_GOODONLY; - else - flags |= ISC_ENTROPY_BLOCKING; -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ return (dst_random_getdata(buf, len, NULL, flags)); -+#else - return (isc_entropy_getdata(dst_entropy_pool, buf, len, NULL, flags)); -+#endif - #endif /* PKCS11CRYPTO */ - } - - unsigned int - dst__entropy_status(void) { --#ifndef PKCS11CRYPTO -+#if !defined(PKCS11CRYPTO) && !defined(ISC_PLATFORM_CRYPTORANDOM) - #ifdef GSSAPI - unsigned int flags = dst_entropy_flags; - isc_result_t ret; -@@ -2031,6 +2049,7 @@ dst__entropy_status(void) { - #endif - return (isc_entropy_status(dst_entropy_pool)); - #else -+ /* Doesn't matter as it is not used in this case. */ - return (0); - #endif - } diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h -index 1924e74..6813c96 100644 +index 3146d88..3f7ac4d 100644 --- a/lib/dns/include/dst/dst.h +++ b/lib/dns/include/dst/dst.h -@@ -159,6 +159,14 @@ dst_lib_destroy(void); +@@ -153,6 +153,14 @@ dst_lib_destroy(void); * Releases all resources allocated by DST. */ @@ -1385,18 +308,10 @@ index 1924e74..6813c96 100644 dst_algorithm_supported(unsigned int alg); /*%< diff --git a/lib/dns/lib.c b/lib/dns/lib.c -index 304814b..60543c4 100644 +index 5fccb57..1f627c4 100644 --- a/lib/dns/lib.c +++ b/lib/dns/lib.c -@@ -18,6 +18,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -78,6 +79,7 @@ static unsigned int references = 0; +@@ -51,6 +51,7 @@ static unsigned int references = 0; static void initialize(void) { isc_result_t result; @@ -1404,314 +319,11 @@ index 304814b..60543c4 100644 REQUIRE(initialize_done == false); -@@ -88,11 +90,14 @@ initialize(void) { - result = dns_ecdb_register(dns_g_mctx, &dbimp); - if (result != ISC_R_SUCCESS) - goto cleanup_mctx; -- result = isc_hash_create(dns_g_mctx, NULL, DNS_NAME_MAXWIRE); -+ result = isc_entropy_create(dns_g_mctx, &ectx); - if (result != ISC_R_SUCCESS) - goto cleanup_db; -+ result = isc_hash_create(dns_g_mctx, NULL, DNS_NAME_MAXWIRE); -+ if (result != ISC_R_SUCCESS) -+ goto cleanup_ectx; - -- result = dst_lib_init(dns_g_mctx, NULL, 0); -+ result = dst_lib_init(dns_g_mctx, ectx, 0); - if (result != ISC_R_SUCCESS) - goto cleanup_hash; - -@@ -100,11 +105,17 @@ initialize(void) { - if (result != ISC_R_SUCCESS) - goto cleanup_dst; - -+ isc_hash_init(); -+ isc_entropy_detach(&ectx); -+ - initialize_done = true; - return; - - cleanup_dst: - dst_lib_destroy(); -+ cleanup_ectx: -+ if (ectx != NULL) -+ isc_entropy_detach(&ectx); - cleanup_hash: - isc_hash_destroy(); - cleanup_db: -diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c -index 13e838f..ffe0a69 100644 ---- a/lib/dns/openssl_link.c -+++ b/lib/dns/openssl_link.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -46,8 +47,6 @@ - #include - #endif - --static RAND_METHOD *rm = NULL; -- - #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - static isc_mutex_t *locks = NULL; - static int nlocks; -@@ -57,6 +56,9 @@ static int nlocks; - static ENGINE *e = NULL; - #endif - -+#ifndef ISC_PLATFORM_CRYPTORANDOM -+static RAND_METHOD *rm = NULL; -+ - static int - entropy_get(unsigned char *buf, int num) { - isc_result_t result; -@@ -102,6 +104,7 @@ entropy_add(const void *buf, int num, double entropy) { - return (1); - } - #endif -+#endif /* !ISC_PLATFORM_CRYPTORANDOM */ - - #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - static void -@@ -192,7 +195,7 @@ _set_thread_id(CRYPTO_THREADID *id) - isc_result_t - dst__openssl_init(const char *engine) { - isc_result_t result; --#if !defined(OPENSSL_NO_ENGINE) -+#if !defined(OPENSSL_NO_ENGINE) && !defined(ISC_PLATFORM_CRYPTORANDOM) - ENGINE *re; - #else - UNUSED(engine); -@@ -222,6 +225,7 @@ dst__openssl_init(const char *engine) { - ERR_load_crypto_strings(); - #endif - -+#ifndef ISC_PLATFORM_CRYPTORANDOM - rm = mem_alloc(sizeof(RAND_METHOD) FILELINE); - if (rm == NULL) { - result = ISC_R_NOMEMORY; -@@ -233,6 +237,7 @@ dst__openssl_init(const char *engine) { - rm->add = entropy_add; - rm->pseudorand = entropy_getpseudo; - rm->status = entropy_status; -+#endif - - #if !defined(OPENSSL_NO_ENGINE) - #if !defined(CONF_MFLAGS_DEFAULT_SECTION) -@@ -266,6 +271,7 @@ dst__openssl_init(const char *engine) { - } - } - -+#ifndef ISC_PLATFORM_CRYPTORANDOM - re = ENGINE_get_default_RAND(); - if (re == NULL) { - re = ENGINE_new(); -@@ -278,9 +284,21 @@ dst__openssl_init(const char *engine) { - ENGINE_free(re); - } else - ENGINE_finish(re); -+#endif - #else -+#ifndef ISC_PLATFORM_CRYPTORANDOM - RAND_set_rand_method(rm); -+#endif - #endif /* !defined(OPENSSL_NO_ENGINE) */ -+ -+ /* Protect ourselves against unseeded PRNG */ -+ if (RAND_status() != 1) { -+ FATAL_ERROR(__FILE__, __LINE__, -+ "OpenSSL pseudorandom number generator " -+ "cannot be initialized (see the `PRNG not " -+ "seeded' message in the OpenSSL FAQ)"); -+ } -+ - return (ISC_R_SUCCESS); - - #if !defined(OPENSSL_NO_ENGINE) -@@ -288,10 +306,14 @@ dst__openssl_init(const char *engine) { - if (e != NULL) - ENGINE_free(e); - e = NULL; -+#ifndef ISC_PLATFORM_CRYPTORANDOM - mem_free(rm FILELINE); - rm = NULL; - #endif -+#endif -+#ifndef ISC_PLATFORM_CRYPTORANDOM - cleanup_mutexinit: -+#endif - #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) - CRYPTO_set_locking_callback(NULL); - DESTROYMUTEXBLOCK(locks, nlocks); -@@ -306,14 +328,17 @@ void - dst__openssl_destroy(void) { - #if !defined(LIBRESSL_VERSION_NUMBER) && (OPENSSL_VERSION_NUMBER >= 0x10100000L) - OPENSSL_cleanup(); -+#ifndef ISC_PLATFORM_CRYPTORANDOM - if (rm != NULL) { - mem_free(rm FILELINE); - rm = NULL; - } -+#endif - #else - /* - * Sequence taken from apps_shutdown() in . - */ -+#ifndef ISC_PLATFORM_CRYPTORANDOM - if (rm != NULL) { - #if OPENSSL_VERSION_NUMBER >= 0x00907000L - RAND_cleanup(); -@@ -321,6 +346,7 @@ dst__openssl_destroy(void) { - mem_free(rm FILELINE); - rm = NULL; - } -+#endif - #if (OPENSSL_VERSION_NUMBER >= 0x00907000L) - CONF_modules_free(); - #endif -@@ -456,11 +482,45 @@ dst__openssl_getengine(const char *engine) { - } - #endif - --#else /* OPENSSL */ -+isc_result_t -+dst_random_getdata(void *data, unsigned int length, -+ unsigned int *returned, unsigned int flags) { -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+#ifndef DONT_REQUIRE_DST_LIB_INIT -+ INSIST(dst__memory_pool != NULL); -+#endif -+ REQUIRE(data != NULL); -+ REQUIRE(length > 0); - --#include -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+ if ((flags & ISC_ENTROPY_GOODONLY) == 0) { -+ if (RAND_pseudo_bytes((unsigned char *)data, (int)length) < 0) -+ return (dst__openssl_toresult2("RAND_pseudo_bytes", -+ DST_R_OPENSSLFAILURE)); -+ } else { -+ if (RAND_bytes((unsigned char *)data, (int)length) != 1) -+ return (dst__openssl_toresult2("RAND_bytes", -+ DST_R_OPENSSLFAILURE)); -+ } -+#else -+ UNUSED(flags); - --EMPTY_TRANSLATION_UNIT -+ if (RAND_bytes((unsigned char *)data, (int)length) != 1) -+ return (dst__openssl_toresult2("RAND_bytes", -+ DST_R_OPENSSLFAILURE)); -+#endif -+ if (returned != NULL) -+ *returned = length; -+ return (ISC_R_SUCCESS); -+#else -+ UNUSED(data); -+ UNUSED(length); -+ UNUSED(returned); -+ UNUSED(flags); -+ -+ return (ISC_R_NOTIMPLEMENTED); -+#endif -+} - - #endif /* OPENSSL */ - /*! \file */ -diff --git a/lib/dns/pkcs11.c b/lib/dns/pkcs11.c -index 5a2c502..8eaef53 100644 ---- a/lib/dns/pkcs11.c -+++ b/lib/dns/pkcs11.c -@@ -13,12 +13,15 @@ - - #include - -+#include -+ - #include - #include - - #include - #include - -+#include "dst_internal.h" - #include "dst_pkcs11.h" - - isc_result_t -@@ -34,12 +37,32 @@ dst__pkcs11_toresult(const char *funcname, const char *file, int line, - return (fallback); - } - -+isc_result_t -+dst_random_getdata(void *data, unsigned int length, -+ unsigned int *returned, unsigned int flags) { -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ isc_result_t ret; - --#else /* PKCS11CRYPTO */ -+#ifndef DONT_REQUIRE_DST_LIB_INIT -+ INSIST(dst__memory_pool != NULL); -+#endif -+ REQUIRE(data != NULL); -+ REQUIRE(length > 0); -+ UNUSED(flags); - --#include -+ ret = pk11_rand_bytes(data, (int) length); -+ if ((ret == ISC_R_SUCCESS) && (returned != NULL)) -+ *returned = length; -+ return (ret); -+#else -+ UNUSED(data); -+ UNUSED(length); -+ UNUSED(returned); -+ UNUSED(flags); - --EMPTY_TRANSLATION_UNIT -+ return (ISC_R_NOTIMPLEMENTED); -+#endif -+} - - #endif /* PKCS11CRYPTO */ - /*! \file */ -diff --git a/lib/dns/tests/Kyuafile b/lib/dns/tests/Kyuafile -index 937b548..f3c0e38 100644 ---- a/lib/dns/tests/Kyuafile -+++ b/lib/dns/tests/Kyuafile -@@ -10,6 +10,7 @@ tap_test_program{name='dh_test'} - tap_test_program{name='dispatch_test'} - tap_test_program{name='dnstap_test'} - tap_test_program{name='dst_test'} -+tap_test_program{name='dstrandom_test'} - tap_test_program{name='geoip_test'} - tap_test_program{name='gost_test'} - tap_test_program{name='keytable_test'} diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in -index 90dc3a6..7671e1d 100644 +index 7b35b93..c5befff 100644 --- a/lib/dns/tests/Makefile.in +++ b/lib/dns/tests/Makefile.in -@@ -37,6 +37,7 @@ SRCS = acl_test.c \ - dnstap_test.c \ - dst_test.c \ - dnstest.c \ -+ dstrandom_test.c \ - geoip_test.c \ - gost_test.c \ - keytable_test.c \ -@@ -69,6 +70,7 @@ TARGETS = acl_test@EXEEXT@ \ - dh_test@EXEEXT@ \ - dispatch_test@EXEEXT@ \ - dnstap_test@EXEEXT@ \ -+ dstrandom_test@EXEEXT@ \ - dst_test@EXEEXT@ \ - geoip_test@EXEEXT@ \ - gost_test@EXEEXT@ \ -@@ -258,6 +260,11 @@ zt_test@EXEEXT@: zt_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} +@@ -259,6 +259,11 @@ zt_test@EXEEXT@: zt_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} ${LDFLAGS} -o $@ zt_test.@O@ dnstest.@O@ \ ${DNSLIBS} ${ISCLIBS} ${LIBS} @@ -1723,247 +335,11 @@ index 90dc3a6..7671e1d 100644 unit:: sh ${top_builddir}/unit/unittest.sh -diff --git a/lib/dns/tests/dstrandom_test.c b/lib/dns/tests/dstrandom_test.c -new file mode 100644 -index 0000000..bd3d164 ---- /dev/null -+++ b/lib/dns/tests/dstrandom_test.c -@@ -0,0 +1,115 @@ -+/* -+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC") -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * See the COPYRIGHT file distributed with this work for additional -+ * information regarding copyright ownership. -+ */ -+ -+#include -+ -+#if HAVE_CMOCKA -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#define UNIT_TESTING -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+isc_mem_t *mctx = NULL; -+isc_entropy_t *ectx = NULL; -+unsigned char buffer[128]; -+ -+/* isc_entropy_getdata() examples */ -+static void -+isc_entropy_getdata_test(void **state) { -+ isc_result_t result; -+ unsigned int returned, status; -+ const char *randomfile = "testdata/dstrandom/random.data"; -+ int ret; -+ -+ UNUSED(state); -+ -+ isc_mem_debugging |= ISC_MEM_DEBUGRECORD; -+ result = isc_mem_create(0, 0, &mctx); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ result = isc_entropy_create(mctx, &ectx); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ result = dst_lib_init(mctx, ectx, 0); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ isc_entropy_usehook(ectx, true); -+ -+ returned = 0; -+ result = isc_entropy_getdata(ectx, buffer, sizeof(buffer), -+ &returned, 0); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ assert_int_equal(returned, sizeof(buffer)); -+ -+ status = isc_entropy_status(ectx); -+ assert_int_equal(status, 0); -+ -+ isc_entropy_usehook(ectx, false); -+#endif -+ -+ ret = chdir(TESTS); -+ assert_int_equal(ret, 0); -+ -+ result = isc_entropy_createfilesource(ectx, randomfile); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ returned = 0; -+ result = isc_entropy_getdata(ectx, buffer, sizeof(buffer), -+ &returned, 0); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ assert_int_equal(returned, sizeof(buffer)); -+ -+ status = isc_entropy_status(ectx); -+ assert_true(status > 0); -+ -+ dst_lib_destroy(); -+ isc_entropy_detach(&ectx); -+ assert_null(ectx); -+ -+ isc_mem_destroy(&mctx); -+ assert_null(mctx); -+} -+ -+int -+main(void) { -+ const struct CMUnitTest tests[] = { -+ cmocka_unit_test(isc_entropy_getdata_test), -+ }; -+ -+ return (cmocka_run_group_tests(tests, NULL, NULL)); -+} -+ -+#else /* HAVE_CMOCKA */ -+ -+#include -+ -+int -+main(void) { -+ printf("1..0 # Skipped: cmocka not available\n"); -+ return (0); -+} -+ -+#endif -diff --git a/lib/dns/win32/libdns.def.in b/lib/dns/win32/libdns.def.in -index 63be973..40b21fa 100644 ---- a/lib/dns/win32/libdns.def.in -+++ b/lib/dns/win32/libdns.def.in -@@ -1485,6 +1485,13 @@ dst_lib_destroy - dst_lib_init - dst_lib_init2 - dst_lib_initmsgcat -+@IF PKCS11 -+dst_random_getdata -+@ELSE PKCS11 -+@IF OPENSSL -+dst_random_getdata -+@END OPENSSL -+@END PKCS11 - dst_region_computeid - dst_region_computerid - dst_result_register -diff --git a/lib/isc/entropy.c b/lib/isc/entropy.c -index ab2f617..ed05ed6 100644 ---- a/lib/isc/entropy.c -+++ b/lib/isc/entropy.c -@@ -104,11 +104,15 @@ struct isc_entropy { - uint32_t initialized; - uint32_t initcount; - isc_entropypool_t pool; -+ bool usehook; - unsigned int nsources; - isc_entropysource_t *nextsource; - ISC_LIST(isc_entropysource_t) sources; - }; - -+/*% Global Hook */ -+static isc_entropy_getdata_t hook; -+ - /*% Sample Queue */ - typedef struct { - uint32_t last_time; /*%< last time recorded */ -@@ -557,6 +561,11 @@ isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, - - LOCK(&ent->lock); - -+ if (ent->usehook && (hook != NULL)) { -+ UNLOCK(&ent->lock); -+ return (hook(data, length, returned, flags)); -+ } -+ - remain = length; - buf = data; - total = 0; -@@ -708,6 +717,7 @@ isc_entropy_create(isc_mem_t *mctx, isc_entropy_t **entp) { - ent->refcnt = 1; - ent->initialized = 0; - ent->initcount = 0; -+ ent->usehook = false; - ent->magic = ENTROPY_MAGIC; - - isc_entropypool_init(&ent->pool); -@@ -1286,3 +1296,17 @@ isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, - */ - return (final_result); - } -+ -+void -+isc_entropy_usehook(isc_entropy_t *ectx, bool onoff) { -+ REQUIRE(VALID_ENTROPY(ectx)); -+ -+ LOCK(&ectx->lock); -+ ectx->usehook = onoff; -+ UNLOCK(&ectx->lock); -+} -+ -+void -+isc_entropy_sethook(isc_entropy_getdata_t myhook) { -+ hook = myhook; -+} -diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h -index 4bba8e1..632166a 100644 ---- a/lib/isc/include/isc/entropy.h -+++ b/lib/isc/include/isc/entropy.h -@@ -304,6 +304,18 @@ isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, - * isc_entropy_createcallbacksource(). - */ - -+void -+isc_entropy_usehook(isc_entropy_t *ectx, bool onoff); -+/*!< -+ * \brief Mark/unmark the given entropy structure as being hooked. -+ */ -+ -+void -+isc_entropy_sethook(isc_entropy_getdata_t myhook); -+/*!< -+ * \brief Set the getdata hook (e.g., for a crypto random generator). -+ */ -+ - ISC_LANG_ENDDECLS - - #endif /* ISC_ENTROPY_H */ -diff --git a/lib/isc/include/isc/platform.h.in b/lib/isc/include/isc/platform.h.in -index 4192946..dbd1560 100644 ---- a/lib/isc/include/isc/platform.h.in -+++ b/lib/isc/include/isc/platform.h.in -@@ -359,6 +359,11 @@ - */ - @ISC_PLATFORM_HAVESTRINGSH@ - -+/* -+ * Define if the random functions are provided by crypto. -+ */ -+@ISC_PLATFORM_CRYPTORANDOM@ -+ - /* - * Define if the hash functions must be provided by OpenSSL. - */ diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h -index da9d66f..4205400 100644 +index f8e5ae6..d0dc9b5 100644 --- a/lib/isc/include/isc/types.h +++ b/lib/isc/include/isc/types.h -@@ -97,6 +97,8 @@ typedef struct isc_time isc_time_t; /*%< Time */ +@@ -82,6 +82,8 @@ typedef struct isc_time isc_time_t; /*%< Time */ typedef struct isc_timer isc_timer_t; /*%< Timer */ typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */ @@ -1972,61 +348,11 @@ index da9d66f..4205400 100644 typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *); typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *, int); -diff --git a/lib/isc/pk11.c b/lib/isc/pk11.c -index 68aebdc..4b85527 100644 ---- a/lib/isc/pk11.c -+++ b/lib/isc/pk11.c -@@ -321,14 +321,16 @@ pk11_rand_seed_fromfile(const char *randomfile) { - ret = isc_stdio_open(randomfile, "r", &stream); - if (ret != ISC_R_SUCCESS) - goto cleanup; -- ret = isc_stdio_read(seed, 1, SEEDSIZE, stream, &cc); -- if (ret!= ISC_R_SUCCESS) -- goto cleanup; -+ while (ret == ISC_R_SUCCESS) { -+ ret = isc_stdio_read(seed, 1, SEEDSIZE, stream, &cc); -+ if ((ret != ISC_R_SUCCESS) && (ret != ISC_R_EOF)) -+ goto cleanup; -+ (void) pkcs_C_SeedRandom(ctx.session, seed, (CK_ULONG) cc); -+ } - ret = isc_stdio_close(stream); - stream = NULL; -- if (ret!= ISC_R_SUCCESS) -+ if (ret != ISC_R_SUCCESS) - goto cleanup; -- (void) pkcs_C_SeedRandom(ctx.session, seed, (CK_ULONG) cc); - - cleanup: - if (stream != NULL) -diff --git a/lib/isc/win32/include/isc/platform.h.in b/lib/isc/win32/include/isc/platform.h.in -index 8ade705..fa72f9d 100644 ---- a/lib/isc/win32/include/isc/platform.h.in -+++ b/lib/isc/win32/include/isc/platform.h.in -@@ -73,6 +73,11 @@ - #define ISC_PLATFORM_NORETURN_PRE __declspec(noreturn) - #define ISC_PLATFORM_NORETURN_POST - -+/* -+ * Define if the random functions are provided by crypto. -+ */ -+@ISC_PLATFORM_CRYPTORANDOM@ -+ - /* - * Define if the hash functions must be provided by OpenSSL. - */ diff --git a/win32utils/Configure b/win32utils/Configure -index 953f2aa..55cc929 100644 +index 9731b0c..0b7bc6e 100644 --- a/win32utils/Configure +++ b/win32utils/Configure -@@ -382,6 +382,7 @@ my @substdefh = ("ALLOW_FILTER_AAAA", - my %configdefp; - - my @substdefp = ("ISC_PLATFORM_BUSYWAITNOP", -+ "ISC_PLATFORM_CRYPTORANDOM", - "ISC_PLATFORM_HAVEATOMICSTORE", - "ISC_PLATFORM_HAVEATOMICSTOREQ", - "ISC_PLATFORM_HAVECMPXCHG", -@@ -517,7 +518,8 @@ my @allcond = (@substcond, "NOTYET", "NOLONGER"); +@@ -353,7 +353,8 @@ my @allcond = (@substcond, "NOTYET", "NOLONGER"); # enable-xxx/disable-xxx @@ -2036,80 +362,7 @@ index 953f2aa..55cc929 100644 "fixed-rrset", "intrinsics", "isc-spnego", -@@ -580,6 +582,7 @@ my @help = ( - "\nOptional Features:\n", - " enable-intrinsics enable instrinsic/atomic functions [default=yes]\n", - " enable-native-pkcs11 use native PKCS#11 for all crypto [default=no]\n", -+" enable-crypto-rand use crypto provider for random [default=yes]\n", - " enable-openssl-hash use OpenSSL for hash functions [default=yes]\n", - " enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n", - " enable-filter-aaaa enable filtering of AAAA records [default=yes]\n", -@@ -628,7 +631,9 @@ my $want_clean = "no"; - my $want_unknown = "no"; - my $unknown_value; - my $enable_intrinsics = "yes"; -+my $cryptolib = ""; - my $enable_native_pkcs11 = "no"; -+my $enable_crypto_rand = "yes"; - my $enable_openssl_hash = "auto"; - my $enable_filter_aaaa = "yes"; - my $enable_isc_spnego = "yes"; -@@ -847,6 +852,10 @@ sub myenable { - if ($val =~ /^yes$/i) { - $enable_native_pkcs11 = "yes"; - } -+ } elsif ($key =~ /^crypto-rand$/i) { -+ if ($val =~ /^no$/i) { -+ $enable_crypto_rand = "no"; -+ } - } elsif ($key =~ /^openssl-hash$/i) { - if ($val =~ /^yes$/i) { - $enable_openssl_hash = "yes"; -@@ -1153,6 +1162,11 @@ if ($verbose) { - } else { - print "native-pkcs11: disabled\n"; - } -+ if ($enable_crypto_rand eq "yes") { -+ print "crypto-rand: enabled\n"; -+ } else { -+ print "crypto-rand: disabled\n"; -+ } - if ($enable_openssl_hash eq "yes") { - print "openssl-hash: enabled\n"; - } else { -@@ -1510,6 +1524,7 @@ if ($enable_intrinsics eq "yes") { - - # enable-native-pkcs11 - if ($enable_native_pkcs11 eq "yes") { -+ $cryptolib = "pkcs11"; - if ($use_openssl eq "auto") { - $use_openssl = "no"; - } -@@ -1719,6 +1734,7 @@ if ($use_openssl eq "yes") { - $openssl_dll = File::Spec->catdir($openssl_path, "@dirlist[0]"); - } - -+ $cryptolib = "openssl"; - $configcond{"OPENSSL"} = 1; - $configdefd{"CRYPTO"} = "OPENSSL"; - $configvar{"OPENSSL_PATH"} = "$openssl_path"; -@@ -2290,6 +2306,15 @@ if ($use_aes eq "yes") { - } - - -+# enable-crypto-rand -+if ($enable_crypto_rand eq "yes") { -+ if (($use_openssl eq "no") && ($enable_native_pkcs11 eq "no")) { -+ die "No crypto provider for random functions\n"; -+ } -+ $configdefp{"ISC_PLATFORM_CRYPTORANDOM"} = "\"$cryptolib\""; -+} -+print "Cryptographic library for DNSSEC: $cryptolib"; -+ - # enable-openssl-hash - if ($enable_openssl_hash eq "yes") { - if ($use_openssl eq "no") { -@@ -3665,6 +3690,7 @@ exit 0; +@@ -2929,6 +2930,7 @@ exit 0; # --enable-developer partially supported # --enable-newstats (9.9/9.9sub only) # --enable-native-pkcs11 supported @@ -2118,5 +371,5 @@ index 953f2aa..55cc929 100644 # --enable-openssl-hash supported # --enable-threads included without a way to disable it -- -2.21.0 +2.20.1 diff --git a/bind-9.11-unit-disable-random.patch b/bind-9.11-unit-disable-random.patch index 553f725..dbd0cb6 100644 --- a/bind-9.11-unit-disable-random.patch +++ b/bind-9.11-unit-disable-random.patch @@ -1,4 +1,4 @@ -From 373f07148217a8e70e33446f5108fb42d1079ba6 Mon Sep 17 00:00:00 2001 +From 605d1575414c67f5e7eefeaae9dd2d0820c082dc Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Thu, 21 Feb 2019 22:42:27 +0100 Subject: [PATCH] Disable random_test @@ -9,19 +9,18 @@ subtests can occasionally fail, stop it. It can be used again by defining 'unstable' variable in Kyuafile. --- - lib/isc/tests/Kyuafile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + lib/isc/tests/Kyuafile | 1 + + 1 file changed, 1 insertion(+) diff --git a/lib/isc/tests/Kyuafile b/lib/isc/tests/Kyuafile -index 4cd2574..9df2340 100644 +index e2b2498..df2741e 100644 --- a/lib/isc/tests/Kyuafile +++ b/lib/isc/tests/Kyuafile -@@ -19,7 +19,7 @@ tap_test_program{name='pool_test'} - tap_test_program{name='print_test'} +@@ -18,6 +18,7 @@ tap_test_program{name='parse_test'} + tap_test_program{name='pool_test'} tap_test_program{name='queue_test'} tap_test_program{name='radix_test'} --tap_test_program{name='random_test'} -+tap_test_program{name='random_test', required_configs='unstable'} ++-- tap_test_program{name='random_test', required_configs='unstable'} tap_test_program{name='regex_test'} tap_test_program{name='result_test'} tap_test_program{name='safe_test'} diff --git a/bind.spec b/bind.spec index bf07be7..c35e15d 100644 --- a/bind.spec +++ b/bind.spec @@ -133,23 +133,25 @@ Patch150:bind-9.11-engine-pkcs11.patch Patch153:bind-9.11-export-suffix.patch Patch154:bind-9.11-oot-manual.patch Patch155:bind-9.11-pk11.patch -Patch156:bind-9.11-fips-code.patch +# FIXME: needs review. Should not be required +#Patch156:bind-9.11-fips-code.patch Patch157:bind-9.11-fips-tests.patch # [RT #31459] commit 06a8051d2476fb526fe6960832209392c763a9af -Patch158:bind-9.11-rt31459.patch +#Patch158:bind-9.11-rt31459.patch # [RT #46047] commit 24172bd2eeba91441ab1c65d2717b0692309244a ISC 4724 -Patch159:bind-9.11-rt46047.patch +#Patch159:bind-9.11-rt46047.patch # commit 66ba2fdad583d962a1f4971c85d58381f0849e4d # commit b105ccee68ccc3c18e6ea530063b3c8e5a42571c # commit 083461d3329ff6f2410745848a926090586a9846 -Patch160:bind-9.11-rh1624100.patch +#Patch160:bind-9.11-rh1624100.patch # https://gitlab.isc.org/isc-projects/bind9/issues/555 -Patch161:bind-9.11-host-idn-disable.patch +#Patch161:bind-9.11-host-idn-disable.patch # https://gitlab.isc.org/isc-projects/bind9/commit/8a98277811e -Patch163:bind-9.11-rh1663318.patch +#Patch163:bind-9.11-rh1663318.patch # https://gitlab.isc.org/isc-projects/bind9/issues/819 Patch164:bind-9.11-rh1666814.patch # random_test fails too often by random, disable it +# not present on 9.14.0 Patch168:bind-9.11-unit-disable-random.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch @@ -545,13 +547,13 @@ are used for building ISC DHCP. %patch153 -p1 -b .export_suffix %patch154 -p1 -b .oot-man %patch155 -p1 -b .pk11-internal -%patch156 -p1 -b .fips-code +#%patch156 -p1 -b .fips-code %patch157 -p1 -b .fips-tests -%patch158 -p1 -b .rt31459 -%patch159 -p1 -b .rt46047 -%patch160 -p1 -b .rh1624100 -%patch161 -p1 -b .host-idn-disable -%patch163 -p1 -b .rh1663318 +#%patch158 -p1 -b .rt31459 +#%patch159 -p1 -b .rt46047 +#%patch160 -p1 -b .rh1624100 +#%patch161 -p1 -b .host-idn-disable +#%patch163 -p1 -b .rh1663318 %patch164 -p1 -b .rh1666814 %patch168 -p1 -b .random_test-disable %patch170 -p1 -b .featuretest-named diff --git a/bind97-rh669163.patch b/bind97-rh669163.patch deleted file mode 100644 index 125049f..0000000 --- a/bind97-rh669163.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up bind-9.7.2-P3/lib/lwres/lwconfig.c.rh669163 bind-9.7.2-P3/lib/lwres/lwconfig.c ---- bind-9.7.2-P3/lib/lwres/lwconfig.c.rh669163 2011-01-28 14:48:38.934472578 +0100 -+++ bind-9.7.2-P3/lib/lwres/lwconfig.c 2011-01-28 14:49:50.421326035 +0100 -@@ -612,6 +612,10 @@ lwres_conf_parse(lwres_context_t *ctx, c - break; - } - -+ /* Ignore options with no parameters */ -+ if (stopchar == '\n') -+ continue; -+ - if (strlen(word) == 0U) - rval = LWRES_R_SUCCESS; - else if (strcmp(word, "nameserver") == 0) diff --git a/random.data b/random.data deleted file mode 100644 index 354add021c50385a89450e5babe1977007bb3352..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmV+b5dZJ`_p!jz`{<|bNV`oX5JC2Ga9@8qoo4f?l+-NC@8v5K1{=o$sJ(MXEOSVw zGv^GbLd{mne_AVT3rzXm4X7NNLZi5Zek-Hl3(Qfwx;iSW6KHZ~nv7~XaFMAAeVh2x zmPdsD1|Q_jqS@I1WO|rx;wy^@HC>QdzQ5`{GQNzim|^M(%4-UFcO6| z69yO>y1GA7kp>?Ik+sjkA=lx^BW?*JYfN0 z7q``&{ap9r3r}&Bp+}X}YKA_tT|sqwfj5|>adRw;q#XjlN+rIqS#`LAQ`g!TxKZU* zQ}lyD3q(cmsjACTQ&&!@+tmkcdc#{LIz_-uzMSLnO7%l~ywQXi@iCweSn#0L8fNT9 zv+KT1+t^>WH)>sYQ6goHgfW)#{zb_+whDWiSY2_n*RuL^f*RBlIT`SC#oeFZ-x)UxNujigfa^>m8 zu;jewj{X6Og>TE3>}l?k7Ke%_89T^nq`hvrTya%U<-A+_o*My&LcG4c1rm#XOd?V1SspI&}vN z$pT{+f33B)5z1Q_E-y{5e1q$5FL?!{4O{7cQ#l7gDWN}O|LSrWntS;Us04k7h3HrL zupfh={aG8I;u0Frfyep2sYnx54CDYl7e>~?0vmz$wqrKF{>sOFN*tWevM9XQ-RF5M zWUm!pxGq^Oxpc2RkcSOh=$v7C`-DRAhB1AfY{A|6a%dlc@~0N!i*a&j)?9(^Yu$}d zeG~`AL^w=NjK_agJS_t1@&pl_J#=E~Gmro$3fD(?{4D8mT9eA*u+QfMLAFh+>+|Hfo3B>69>fT}Pt(ZSU1jk%MDJk2 z8{Z?%phPoWIvkNylm(l;^F89zrse;@p#szYNIl?SlIjUJ@M1;E|Vl}rqVXB3+uDrZ`&^4 z^8KV@!3o@UD1_qE9O4ZC7tUu1vYV5rU@z@twA{Jo8@nEHv-G93-X8J2*%w6o!X9-~ zL_st`^+x1ta&sQJd}*eQT+6`plBoZ;fgE86)dCxOj&A9}7#tM>Ov|SfYxX?Xa2j*k z`X9Pkr4vG)LU?m)%kuURPL1%vG3nzucmS~bZG5}$7*}-qlF<}vkJ#1(;R#MYdW8>8 zk0GB*$4(h{IZ&Wq=h(CN_`ph*VLTI9NNcV`&!>XUE49w*3lAI|r;gI|j&@7qAT!`x z{VG6T(ViMDE(11J0Yj;^P8*gxWK;VDkS79Y3%@{O2I<5t&)uGwlyJgCPAv9V*^Ztw z+peH{VDEyJ>h=_W&3_HTlhsD2&Le%vA--h1RvQA%D6|SxQ7kc^`eMq%mXYq$u!5hk zGIW;s4-ZZ}&<>9Fprah=*D`K`z&8!W zA1Z!OWZ*mreX>jv+Iryt*{($kvP335;79#nkx}OMai}p?s%0$qKttTPPp48DufuWx zA^2j%DkSFDEHV%63(wp>H}xZ{hL0@e9>vJv;7KRA5QpSa!cJQ;2Bh`x@f>64x&D|4 z!Yql9Ym{87bV39PGn`_jkBN~6Z--FM+jDzzJ^f&KF@DN|*>0*^FT=`6vSR4H@ae01SWQJZJkKi7OQf`rwb^ zV=c17HJqQFe1JA*6wB$ZOHd!V)zx5Zw1UICc5>e{$EvjY!0%r|VJLMcf+ySJWR zrYO+1%!a~zH#>Krg2(bZ#N=sJ4Rx@&k+*K0^wPh;I}WJ6!7sXORYTCi_{>iAD5GZq zq*r)F_M?)ldu%d8oQ7eC0;;K-OEqPs!K?WBt|WFrjh~UIB)q%Ou&pgQPwnH3i>Xs>(=(9(FGAe3VwA__I@ zba@TaAf<;oCYq}36~aNJ$FRBjtRsas^@i68ein7>>^DaTM^n2c`Fnu$P%&ogp})8U z``e|HRw^MM#N5uy66qV*iuKWep20R(65@KV%AFY zcfTKqC=GN>D9Wm`FwSGY^<{q`5D| zIx%;PiBQZShKEi?z;+LiTCar@NyLVGgMJJ7L157+Off<8-A)9(d|rg7+3gC!_{V3O zpK+wU!mtYk)JQab>ks+Y0YgIy@vSz(13Fgq9h-((1A+>FIXxdD6%3hD7t+yWN1)1Y zNnb1fmms4}Yw}eD$!qXa6rj7JboJZw8z9a6N>)?f24{`ZFl4cWG#699!tQuyQJR=L zbfV;k-k=FgR0@#VkY0gemz-vXVx`?ezZA8)%ff%|-AP;$7bigrUd%OKTzQF$itC&A(6h#(6&)xc2l^; zwp6 zltll=^|U^)xuoJpMDe_$m37NDbvRUr|F?f_WOWM4Y7cn?fNhsOzKzvrk=xV zr~G(o`4e}dE5`|G7Olpy4r;$XlI@B0NY4KQTUGcPG9Q~KvXfE9UZiMq4!to-Zf;B0 z6vGO&4bF{^0n|9;|G+4zgiXy5C_bC2#)cl6;*u)o3~kctV=N(XZ>i1|?87kyrk(km zuPmffVl4pM(nzdaa6G~k!-RE*c&O&_4U&U9RR2#YlauCPn>Fuabhg{d-_GSJIoq&u zRQ(=mbShm=L-J(bj+AHBR3=R#m*Pdx`U`}Prwb4#kk{=2Cvk}{CqjzHuGVLRfdzTl znVQ0*OuFL7ef1}^=}s3u zA2DlTMf6i5M{FmgC0;7_wo3BL_={G#AuMjwmKBe`YW=Qor+_-Y!GC_S52aSWbyDVt49~woS|*Bz1Wuph3+8xJ zE7p>Pr65{$OK+TBd8fQ1dS28;2}S=YW*@YVwOY2I03Z_4+2&d*G1cRY0GYBqiuOgg zikwo45~ouU+M&n+6|%0pz*8%{8WiZ9N_?-H=4SJqv1o`Z4lzc=S(Rxlnx;$ySUm_d yq`in=81o&*MtO8Rkxhh|?G`=X203G{YJ27jd%{@?@P3y7HGnvR-h<8?=IS24*8b%H From df81e828c7003aa1217810c80b0343f2e1418ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 23 Jul 2019 15:18:22 +0200 Subject: [PATCH 03/79] Update patches to build on 9.14 --- bind-9.10-dist-native-pkcs11.patch | 419 ++++++++++++----------------- bind-9.11-feature-test-named.patch | 51 ++-- bind-9.11-kyua-pkcs11.patch | 143 ++-------- bind-9.11-tests-pkcs11.patch | 16 +- bind-9.11-tests-variants.patch | 77 +++--- bind.spec | 39 ++- 6 files changed, 286 insertions(+), 459 deletions(-) diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index df0d896..a3ef6e4 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -1,41 +1,36 @@ diff --git a/bin/Makefile.in b/bin/Makefile.in -index f0c504a..ce7a2da 100644 +index 9ad7f62..094775a 100644 --- a/bin/Makefile.in +++ b/bin/Makefile.in -@@ -11,8 +11,8 @@ srcdir = @srcdir@ +@@ -11,7 +11,7 @@ srcdir = @srcdir@ VPATH = @srcdir@ top_srcdir = @top_srcdir@ -SUBDIRS = named rndc dig delv dnssec tools nsupdate check confgen \ -- @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests -+SUBDIRS = named named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools nsupdate \ -+ check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests ++SUBDIRS = named named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools nsupdate check confgen \ + @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ plugins tests TARGETS = - @BIND9_MAKE_RULES@ diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index 4b8ca13..32f4470 100644 +index be1ac3b..c1ee27c 100644 --- a/bin/dnssec-pkcs11/Makefile.in +++ b/bin/dnssec-pkcs11/Makefile.in -@@ -15,18 +15,18 @@ VERSION=@BIND9_VERSION@ +@@ -15,17 +15,17 @@ VERSION=@BIND9_VERSION@ @BIND9_MAKE_INCLUDES@ --CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @DST_OPENSSL_INC@ -+CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} +-CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ ++CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ --CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ @PKCS11_ENGINE@ \ -- @CRYPTO@ -DPK11_LIB_LOCATION=\"@PKCS11_PROVIDER@\" -+CDEFINES = -DVERSION=\"${VERSION}\" @PKCS11_ENGINE@ \ -+ @CRYPTO_PK11@ -DPK11_LIB_LOCATION=\"@PKCS11_PROVIDER@\" + CDEFINES = -DVERSION=\"${VERSION}\" CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ --ISCLIBS = ../../lib/isc/libisc.@A@ --ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ -+ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ +-DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ +-ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ +-ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ ++ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ ++ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ @@ -44,25 +39,32 @@ index 4b8ca13..32f4470 100644 DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} -@@ -35,10 +35,10 @@ LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@ +@@ -34,11 +34,11 @@ LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@ NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@ # Alphabetically --TARGETS = dnssec-keygen@EXEEXT@ dnssec-signzone@EXEEXT@ \ -- dnssec-keyfromlabel@EXEEXT@ dnssec-dsfromkey@EXEEXT@ \ -- dnssec-revoke@EXEEXT@ dnssec-settime@EXEEXT@ \ -- dnssec-verify@EXEEXT@ dnssec-importkey@EXEEXT@ -+TARGETS = dnssec-keygen-pkcs11@EXEEXT@ dnssec-signzone-pkcs11@EXEEXT@ \ -+ dnssec-keyfromlabel-pkcs11@EXEEXT@ dnssec-dsfromkey-pkcs11@EXEEXT@ \ -+ dnssec-revoke-pkcs11@EXEEXT@ dnssec-settime-pkcs11@EXEEXT@ \ -+ dnssec-verify-pkcs11@EXEEXT@ dnssec-importkey-pkcs11@EXEEXT@ +-TARGETS = dnssec-cds@EXEEXT@ dnssec-dsfromkey@EXEEXT@ \ +- dnssec-importkey@EXEEXT@ dnssec-keyfromlabel@EXEEXT@ \ +- dnssec-keygen@EXEEXT@ dnssec-revoke@EXEEXT@ \ +- dnssec-settime@EXEEXT@ dnssec-signzone@EXEEXT@ \ +- dnssec-verify@EXEEXT@ ++TARGETS = dnssec-cds-pkcs11@EXEEXT@ dnssec-dsfromkey-pkcs11@EXEEXT@ \ ++ dnssec-importkey-pkcs11@EXEEXT@ dnssec-keyfromlabel-pkcs11@EXEEXT@ \ ++ dnssec-keygen-pkcs11@EXEEXT@ dnssec-revoke-pkcs11@EXEEXT@ \ ++ dnssec-settime-pkcs11@EXEEXT@ dnssec-signzone-pkcs11@EXEEXT@ \ ++ dnssec-verify-pkcs11@EXEEXT@ OBJS = dnssectool.@O@ -@@ -59,15 +59,15 @@ MANOBJS = ${MANPAGES} ${HTMLPAGES} +@@ -61,19 +61,19 @@ MANOBJS = ${MANPAGES} ${HTMLPAGES} @BIND9_MAKE_RULES@ +-dnssec-cds@EXEEXT@: dnssec-cds.@O@ ${OBJS} ${DEPLIBS} ++dnssec-cds-pkcs11@EXEEXT@: dnssec-cds.@O@ ${OBJS} ${DEPLIBS} + export BASEOBJS="dnssec-cds.@O@ ${OBJS}"; \ + ${FINALBUILDCMD} + -dnssec-dsfromkey@EXEEXT@: dnssec-dsfromkey.@O@ ${OBJS} ${DEPLIBS} +dnssec-dsfromkey-pkcs11@EXEEXT@: dnssec-dsfromkey.@O@ ${OBJS} ${DEPLIBS} export BASEOBJS="dnssec-dsfromkey.@O@ ${OBJS}"; \ @@ -78,7 +80,7 @@ index 4b8ca13..32f4470 100644 export BASEOBJS="dnssec-keygen.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -75,7 +75,7 @@ dnssec-signzone.@O@: dnssec-signzone.c +@@ -81,7 +81,7 @@ dnssec-signzone.@O@: dnssec-signzone.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-signzone.c @@ -87,7 +89,7 @@ index 4b8ca13..32f4470 100644 export BASEOBJS="dnssec-signzone.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -83,19 +83,19 @@ dnssec-verify.@O@: dnssec-verify.c +@@ -89,19 +89,19 @@ dnssec-verify.@O@: dnssec-verify.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-verify.c @@ -111,7 +113,7 @@ index 4b8ca13..32f4470 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ dnssec-importkey.@O@ ${OBJS} ${LIBS} -@@ -106,16 +106,14 @@ docclean manclean maintainer-clean:: +@@ -112,16 +112,14 @@ docclean manclean maintainer-clean:: installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} @@ -129,49 +131,35 @@ index 4b8ca13..32f4470 100644 for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done clean distclean:: -diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in -index 4b8ca13..4175996 100644 ---- a/bin/dnssec/Makefile.in -+++ b/bin/dnssec/Makefile.in -@@ -17,7 +17,7 @@ VERSION=@BIND9_VERSION@ - - CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @DST_OPENSSL_INC@ - --CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ @PKCS11_ENGINE@ \ -+CDEFINES = -DVERSION=\"${VERSION}\" \ - @CRYPTO@ -DPK11_LIB_LOCATION=\"@PKCS11_PROVIDER@\" - CWARNINGS = - diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index 70e5571..b5a4a6b 100644 +index 856463f..dc826dd 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in @@ -43,27 +43,27 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ -- ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \ -- ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \ -+ ${LWRES_INCLUDES} ${DNS_PKCS11_INCLUDES} ${BIND9_INCLUDES} \ -+ ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_PKCS11_INCLUDES} \ - ${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @DST_OPENSSL_INC@ +- ${NS_INCLUDES} ${DNS_INCLUDES} \ ++ ${NS_INCLUDES} ${DNS_PKCS11_INCLUDES} \ + ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ +- ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ ++ ${ISC_PKCS11_INCLUDES} ${DLZDRIVER_INCLUDES} \ + ${DBDRIVER_INCLUDES} @OPENSSL_INCLUDES@ --CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ @PKCS11_ENGINE@ @USE_GSSAPI@ @CRYPTO@ -+CDEFINES = @USE_PKCS11@ @PKCS11_ENGINE@ @CRYPTO_PK11@ @USE_GSSAPI@ + CDEFINES = @CONTRIB_DLZ@ CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCLIBS = ../../lib/isccc/libisccc.@A@ --ISCLIBS = ../../lib/isc/libisc.@A@ --ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ -+ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ - LWRESLIBS = ../../lib/lwres/liblwres.@A@ +-ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ +-ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ ++ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ BIND9LIBS = ../../lib/bind9/libbind9.@A@ + NSLIBS = ../../lib/ns/libns.@A@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @@ -179,49 +167,51 @@ index 70e5571..b5a4a6b 100644 ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ +ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ - LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@ BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ + NSDEPLIBS = ../../lib/ns/libns.@A@ -@@ -72,15 +72,15 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ +@@ -72,17 +72,17 @@ DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ - LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ + LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@ -+ @LIBS@ +- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \ ++ @LIBCAP_LIBS@ \ + @LIBS@ - NOSYMLIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ + NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@ -+ @LIBS@ +- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \ ++ @LIBCAP_LIBS@ \ + @LIBS@ SUBDIRS = unix --TARGETS = named@EXEEXT@ lwresd@EXEEXT@ feature-test@EXEEXT@ +-TARGETS = named@EXEEXT@ feature-test@EXEEXT@ +TARGETS = named-pkcs11@EXEEXT@ feature-test-pkcs11@EXEEXT@ GEOIPLINKOBJS = geoip.@O@ - GEOIP2LINKOBJS = geoip.@O@ -@@ -94,8 +94,7 @@ OBJS = builtin.@O@ client.@O@ config.@O@ control.@O@ \ - tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \ - zoneconf.@O@ \ - lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \ -- lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \ + +@@ -90,8 +90,7 @@ OBJS = builtin.@O@ config.@O@ control.@O@ \ + controlconf.@O@ fuzz.@O@ @GEOIPLINKOBJS@ \ + log.@O@ logconf.@O@ main.@O@ \ + server.@O@ statschannel.@O@ \ +- tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ \ - ${DLZDRIVER_OBJS} ${DBDRIVER_OBJS} -+ lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ ++ tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@ -@@ -113,8 +112,7 @@ SRCS = builtin.c client.c config.c control.c \ - tkeyconf.c tsigconf.c update.c xfrout.c \ - zoneconf.c \ - lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \ -- lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \ +@@ -103,8 +102,7 @@ SRCS = builtin.c config.c control.c \ + controlconf.c fuzz.c @GEOIPLINKSRCS@ \ + log.c logconf.c main.c \ + server.c statschannel.c \ +- tkeyconf.c tsigconf.c zoneconf.c \ - ${DLZDRIVER_SRCS} ${DBDRIVER_SRCS} -+ lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c ++ tkeyconf.c tsigconf.c zoneconf.c - MANPAGES = named.8 lwresd.8 named.conf.5 + MANPAGES = named.8 named.conf.5 -@@ -154,21 +152,21 @@ server.@O@: server.c +@@ -143,7 +141,7 @@ server.@O@: server.c -DPRODUCT=\"${PRODUCT}\" \ -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c @@ -230,15 +220,7 @@ index 70e5571..b5a4a6b 100644 export MAKE_SYMTABLE="yes"; \ export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} - --lwresd@EXEEXT@: named@EXEEXT@ -+lwresd@EXEEXT@: named-pkcs11@EXEEXT@ - rm -f lwresd@EXEEXT@ -- @LN@ named@EXEEXT@ lwresd@EXEEXT@ -+ @LN@ named-pkcs11@EXEEXT@ lwresd@EXEEXT@ - - # Bit of hack, do not produce intermediate .o object for featuretest - feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c +@@ -153,7 +151,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -c ${top_srcdir}/bin/tests/system/feature-test.c @@ -247,44 +229,28 @@ index 70e5571..b5a4a6b 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} -@@ -201,16 +199,11 @@ install-man8: named.8 lwresd.8 +@@ -186,13 +184,13 @@ install-man8: named.8 install-man: install-man5 install-man8 --install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs install-man +-install:: named@EXEEXT@ installdirs install-man - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} -- (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@) -+install:: named-pkcs11@EXEEXT@ installdirs ++install:: named-pkcs11@EXEEXT@ installdirs install-man + ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-pkcs11@EXEEXT@ ${DESTDIR}${sbindir} uninstall:: -- rm -f ${DESTDIR}${mandir}/man5/named.conf.5 -- rm -f ${DESTDIR}${mandir}/man8/lwresd.8 -- rm -f ${DESTDIR}${mandir}/man8/named.8 -- rm -f ${DESTDIR}${sbindir}/lwresd@EXEEXT@ + rm -f ${DESTDIR}${mandir}/man5/named.conf.5 + rm -f ${DESTDIR}${mandir}/man8/named.8 - ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named@EXEEXT@ + ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-pkcs11@EXEEXT@ @DLZ_DRIVER_RULES@ -diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 70e5571..4cfed4d 100644 ---- a/bin/named/Makefile.in -+++ b/bin/named/Makefile.in -@@ -48,7 +48,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @DST_OPENSSL_INC@ - --CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ @PKCS11_ENGINE@ @USE_GSSAPI@ @CRYPTO@ -+CDEFINES = @CONTRIB_DLZ@ @USE_GSSAPI@ @CRYPTO@ - - CWARNINGS = - diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index a058c91..d4b689a 100644 +index 454d145..0e542f3 100644 --- a/bin/pkcs11/Makefile.in +++ b/bin/pkcs11/Makefile.in -@@ -15,13 +15,13 @@ top_srcdir = @top_srcdir@ +@@ -13,13 +13,13 @@ top_srcdir = @top_srcdir@ @BIND9_MAKE_INCLUDES@ @@ -293,8 +259,7 @@ index a058c91..d4b689a 100644 CDEFINES = --ISCLIBS = ../../lib/isc/libisc.@A@ @ISC_OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @ISC_OPENSSL_LIBS@ + ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ +ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @@ -302,13 +267,13 @@ index a058c91..d4b689a 100644 DEPLIBS = ${ISCDEPLIBS} diff --git a/configure.ac b/configure.ac -index 9b7d778..59ba20b 100644 +index 6e17d3a..0f7c850 100644 --- a/configure.ac +++ b/configure.ac -@@ -1139,12 +1139,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1188,12 +1188,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) - DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_LIBS" + DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" +DNS_CRYPTO_PK11_LIBS="$DNS_GSSAPI_LIBS $DNS_CRYPTO_PK11_LIBS" # @@ -319,96 +284,50 @@ index 9b7d778..59ba20b 100644 +AC_SUBST(DNS_CRYPTO_PK11_LIBS) # - # was --with-randomdev specified? -@@ -1494,11 +1496,11 @@ AC_ARG_ENABLE(openssl-hash, - AC_MSG_CHECKING(for OpenSSL library) - OPENSSL_WARNING= - openssldirs="/usr /usr/local /usr/local/ssl /opt/local /usr/pkg /usr/sfw" --if test "yes" = "$want_native_pkcs11" --then -- use_openssl="native_pkcs11" -- AC_MSG_RESULT(use of native PKCS11 instead) --fi -+# if test "yes" = "$want_native_pkcs11" -+# then -+# use_openssl="native_pkcs11" -+# AC_MSG_RESULT(use of native PKCS11 instead) -+# fi - - if test "auto" = "$use_openssl" - then -@@ -1511,6 +1513,7 @@ then - fi - done + # was --with-lmdb specified? +@@ -2466,6 +2468,9 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) + AC_SUBST(BIND9_NS_BUILDINCLUDE) + AC_SUBST(BIND9_BIND9_BUILDINCLUDE) + AC_SUBST(BIND9_IRS_BUILDINCLUDE) ++AC_SUBST(BIND9_ISC_PKCS11_BUILDINCLUDE) ++AC_SUBST(BIND9_DNS_PKCS11_BUILDINCLUDE) ++AC_SUBST(BIND9_NS_PKCS11_BUILDINCLUDE) + if test "X$srcdir" != "X"; then + BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" + BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" +@@ -2474,6 +2479,9 @@ if test "X$srcdir" != "X"; then + BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" + BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" + BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" ++ BIND9_ISC_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc-pkcs11/include" ++ BIND9_DNS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns-pkcs11/include" ++ BIND9_NS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns-pkcs11/include" + else + BIND9_ISC_BUILDINCLUDE="" + BIND9_ISCCC_BUILDINCLUDE="" +@@ -2482,6 +2490,9 @@ else + BIND9_NS_BUILDINCLUDE="" + BIND9_BIND9_BUILDINCLUDE="" + BIND9_IRS_BUILDINCLUDE="" ++ BIND9_ISC_PKCS11_BUILDINCLUDE="" ++ BIND9_DNS_PKCS11_BUILDINCLUDE="" ++ BIND9_NS_PKCS11_BUILDINCLUDE="" fi -+CRYPTO_PK11="" - OPENSSL_ECDSA="" - OPENSSL_GOST="" - OPENSSL_ED25519="" -@@ -1532,11 +1535,10 @@ case "$with_gost" in - ;; - esac --case "$use_openssl" in -- native_pkcs11) -- AC_MSG_RESULT(disabled because of native PKCS11) -+if test "$want_native_pkcs11" = "yes" -+then - DST_OPENSSL_INC="" -- CRYPTO="-DPKCS11CRYPTO" -+ CRYPTO_PK11="-DPKCS11CRYPTO" - CRYPTOLIB="pkcs11" - OPENSSLECDSALINKOBJS="" - OPENSSLECDSALINKSRCS="" -@@ -1546,7 +1548,9 @@ case "$use_openssl" in - OPENSSLGOSTLINKSRCS="" - OPENSSLLINKOBJS="" - OPENSSLLINKSRCS="" -- ;; -+fi -+ -+case "$use_openssl" in - no) - AC_MSG_RESULT(no) - DST_OPENSSL_INC="" -@@ -1578,7 +1582,7 @@ case "$use_openssl" in - If you do not want OpenSSL, use --without-openssl]) - ;; - *) -- if test "yes" = "$want_native_pkcs11" -+ if false # test "yes" = "$want_native_pkcs11" - then - AC_MSG_RESULT() - AC_MSG_ERROR([OpenSSL and native PKCS11 cannot be used together.]) -@@ -2006,6 +2010,7 @@ AC_SUBST(OPENSSL_ED25519) - AC_SUBST(OPENSSL_GOST) - - DNS_CRYPTO_LIBS="$DNS_CRYPTO_LIBS $DST_OPENSSL_LIBS" -+DNS_CRYPTO_PK11_LIBS="$DNS_CRYPTO_LIBS" - - ISC_PLATFORM_WANTAES="#undef ISC_PLATFORM_WANTAES" - if test "yes" = "$with_aes" -@@ -2291,6 +2296,7 @@ esac - AC_SUBST(PKCS11LINKOBJS) - AC_SUBST(PKCS11LINKSRCS) - AC_SUBST(CRYPTO) -+AC_SUBST(CRYPTO_PK11) - AC_SUBST(PKCS11_ECDSA) - AC_SUBST(PKCS11_GOST) - AC_SUBST(PKCS11_ED25519) -@@ -5405,8 +5411,11 @@ AC_CONFIG_FILES([ + AC_SUBST_FILE(BIND9_MAKE_INCLUDES) +@@ -2940,8 +2951,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile -+ bin/dnssec-pkcs11/Makefile ++ bin/dnssec-pkcs11/Makefile bin/named/Makefile bin/named/unix/Makefile + bin/named-pkcs11/Makefile + bin/named-pkcs11/unix/Makefile bin/nsupdate/Makefile bin/pkcs11/Makefile - bin/python/Makefile -@@ -5479,6 +5488,10 @@ AC_CONFIG_FILES([ + bin/plugins/Makefile +@@ -3014,6 +3028,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -419,16 +338,13 @@ index 9b7d778..59ba20b 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -5503,6 +5516,24 @@ AC_CONFIG_FILES([ +@@ -3034,6 +3052,20 @@ AC_CONFIG_FILES([ lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile -+ lib/isc-pkcs11/$arch/Makefile -+ lib/isc-pkcs11/$arch/include/Makefile -+ lib/isc-pkcs11/$arch/include/isc/Makefile -+ lib/isc-pkcs11/$thread_dir/Makefile -+ lib/isc-pkcs11/$thread_dir/include/Makefile -+ lib/isc-pkcs11/$thread_dir/include/isc/Makefile ++ lib/isc-pkcs11/pthreads/Makefile ++ lib/isc-pkcs11/pthreads/include/Makefile ++ lib/isc-pkcs11/pthreads/include/isc/Makefile + lib/isc-pkcs11/Makefile + lib/isc-pkcs11/include/Makefile + lib/isc-pkcs11/include/isc/Makefile @@ -436,7 +352,6 @@ index 9b7d778..59ba20b 100644 + lib/isc-pkcs11/include/pk11/Makefile + lib/isc-pkcs11/include/pkcs11/Makefile + lib/isc-pkcs11/tests/Makefile -+ lib/isc-pkcs11/nls/Makefile + lib/isc-pkcs11/unix/Makefile + lib/isc-pkcs11/unix/include/Makefile + lib/isc-pkcs11/unix/include/isc/Makefile @@ -445,46 +360,44 @@ index 9b7d778..59ba20b 100644 lib/isccc/include/Makefile lib/isccc/include/isccc/Makefile diff --git a/lib/Makefile.in b/lib/Makefile.in -index 81270a0..bcb5312 100644 +index ffa2d5a..439d748 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@ # Attempt to disable parallel processing. .NOTPARALLEL: .NO_PARALLEL: --SUBDIRS = isc isccc dns isccfg bind9 lwres irs samples -+SUBDIRS = isc isc-pkcs11 isccc dns dns-pkcs11 isccfg bind9 lwres irs samples +-SUBDIRS = isc isccc dns ns isccfg bind9 irs samples ++SUBDIRS = isc isc-pkcs11 isccc dns dns-pkcs11 ns isccfg bind9 irs samples TARGETS = @BIND9_MAKE_RULES@ diff --git a/lib/dns-pkcs11/Makefile.in b/lib/dns-pkcs11/Makefile.in -index 7f09bd6..c388d9e 100644 +index eb3346a..c9e4960 100644 --- a/lib/dns-pkcs11/Makefile.in +++ b/lib/dns-pkcs11/Makefile.in -@@ -26,17 +26,16 @@ VERSION=@BIND9_VERSION@ +@@ -26,16 +26,16 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ -CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ -- ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ -- @DST_OPENSSL_INC@ @DST_GSSAPI_INC@ +- ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ +CINCLUDES = -I. -I${top_srcdir}/lib/dns-pkcs11 -Iinclude ${DNS_PKCS11_INCLUDES} \ -+ ${ISC_PKCS11_INCLUDES} ${MAXMINDDB_CFLAGS} @DST_OPENSSL_INC@ @DST_GSSAPI_INC@ ++ ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ --CDEFINES = -DUSE_MD5 @CRYPTO@ @USE_GSSAPI@ ${USE_ISC_SPNEGO} -+CDEFINES = -DUSE_MD5 @CRYPTO_PK11@ @USE_GSSAPI@ ${USE_ISC_SPNEGO} + CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} CWARNINGS = --ISCLIBS = ../../lib/isc/libisc.@A@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ +-ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ +ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ - LIBS = ${MAXMINDDB_LIBS} @LIBS@ + LIBS = @LIBS@ -@@ -150,15 +149,15 @@ version.@O@: version.c +@@ -134,15 +134,15 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -504,9 +417,13 @@ index 7f09bd6..c388d9e 100644 include: gen ${MAKE} include/dns/enumtype.h -@@ -189,22 +188,22 @@ gen: gen.c - ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \ - ${BUILD_LIBS} ${LFS_LIBS} +@@ -168,25 +168,25 @@ code.h: gen + ./gen -s ${srcdir} > code.h || { rm -f $@ ; exit 1; } + + gen: gen.c +- ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ ++ ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc-pkcs11/include \ + ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS} -timestamp: include libdns.@A@ +timestamp: include libdns-pkcs11.@A@ @@ -531,23 +448,21 @@ index 7f09bd6..c388d9e 100644 + rm -f libdns-pkcs11.@A@ timestamp rm -f gen code.h include/dns/enumtype.h include/dns/enumclass.h rm -f include/dns/rdatastruct.h - rm -f dnstap.pb-c.c dnstap.pb-c.h + rm -f dnstap.pb-c.c dnstap.pb-c.h include/dns/dnstap.pb-c.h diff --git a/lib/isc-pkcs11/Makefile.in b/lib/isc-pkcs11/Makefile.in -index 8ad54bb..a3ecdfb 100644 +index ed87279..3171b48 100644 --- a/lib/isc-pkcs11/Makefile.in +++ b/lib/isc-pkcs11/Makefile.in -@@ -23,8 +23,8 @@ CINCLUDES = -I${srcdir}/unix/include \ - -I${srcdir}/@ISC_THREAD_DIR@/include \ - -I${srcdir}/@ISC_ARCH_DIR@/include \ +@@ -20,7 +20,7 @@ VERSION=@BIND9_VERSION@ + CINCLUDES = -I${srcdir}/unix/include \ + -I${srcdir}/pthreads/include \ -I./include \ -- -I${srcdir}/include ${DNS_INCLUDES} @ISC_OPENSSL_INC@ --CDEFINES = @CRYPTO@ -DPK11_LIB_LOCATION=\"${PROVIDER}\" -+ -I${srcdir}/include ${DNS_PKCS11_INCLUDES} -+CDEFINES = @CRYPTO_PK11@ -DPK11_LIB_LOCATION=\"${PROVIDER}\" +- -I${srcdir}/include ${DNS_INCLUDES} @OPENSSL_INCLUDES@ ++ -I${srcdir}/include ${DNS_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ + CDEFINES = CWARNINGS = - # Alphabetically -@@ -103,40 +103,40 @@ version.@O@: version.c +@@ -94,40 +94,40 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -600,21 +515,37 @@ index 8ad54bb..a3ecdfb 100644 - libisc-nosymtbl.la timestamp + rm -f libisc-pkcs11.@A@ libisc-pkcs11-nosymtbl.@A@ libisc-pkcs11.la \ + libisc-pkcs11-nosymtbl.la timestamp +diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in +index 5735829..7e62737 100644 +--- a/lib/isc-pkcs11/tests/Makefile.in ++++ b/lib/isc-pkcs11/tests/Makefile.in +@@ -18,7 +18,7 @@ VERSION=@BIND9_VERSION@ + CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ + CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\"" + +-ISCLIBS = ../libisc.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../libisc-pkcs11.@A@ @OPENSSL_LIBS@ + ISCDEPLIBS = ../libisc.@A@ + + LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/make/includes.in b/make/includes.in -index fa86ad1..3cfbe9f 100644 +index 48cdaf7..6e6572b 100644 --- a/make/includes.in +++ b/make/includes.in -@@ -43,3 +43,13 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ +@@ -39,3 +39,16 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ TEST_INCLUDES = \ -I${top_srcdir}/lib/tests/include + -+ISC_PKCS11_INCLUDES = @BIND9_ISC_BUILDINCLUDE@ \ ++ISC_PKCS11_INCLUDES = @BIND9_ISC_PKCS11_BUILDINCLUDE@ \ + -I${top_srcdir}/lib/isc-pkcs11 \ + -I${top_srcdir}/lib/isc-pkcs11/include \ + -I${top_srcdir}/lib/isc-pkcs11/unix/include \ -+ -I${top_srcdir}/lib/isc-pkcs11/@ISC_THREAD_DIR@/include \ -+ -I${top_srcdir}/lib/isc-pkcs11/@ISC_ARCH_DIR@/include ++ -I${top_srcdir}/lib/isc-pkcs11/pthreads/include + -+DNS_PKCS11_INCLUDES = @BIND9_DNS_BUILDINCLUDE@ \ ++DNS_PKCS11_INCLUDES = @BIND9_DNS_PKCS11_BUILDINCLUDE@ \ + -I${top_srcdir}/lib/dns-pkcs11/include ++ ++NS_PKCS11_INCLUDES = @BIND9_NS_PKCS11_BUILDINCLUDE@ \ ++ -I${top_srcdir}/lib/ns-pkcs11/include ++ diff --git a/bind-9.11-feature-test-named.patch b/bind-9.11-feature-test-named.patch index c8e6d57..1b89e1b 100644 --- a/bind-9.11-feature-test-named.patch +++ b/bind-9.11-feature-test-named.patch @@ -1,4 +1,4 @@ -From 3f2fafe5368655225eddf0537e58e425bbc297be Mon Sep 17 00:00:00 2001 +From b45cc1caf018d46753a03d59bb9e75cdeef1deeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 30 Jan 2019 14:37:17 +0100 Subject: [PATCH] Create feature-test in source directory @@ -6,40 +6,27 @@ Subject: [PATCH] Create feature-test in source directory Feature-test tool is used in system tests to test compiled in changes. Because we build more variants of named with different configuration, compile feature-test for each of them this way. - -Named variant specific feature-test does not have defined gss support, -even when it was enabled by configure. bin/tests/system Makefile defines -it, so define it also in named variants. --- - bin/named/Makefile.in | 13 +++++++++++-- + bin/named/Makefile.in | 11 ++++++++++- bin/tests/system/conf.sh.in | 2 +- - 2 files changed, 12 insertions(+), 3 deletions(-) + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 3166368..70e5571 100644 +index 10d568f..856463f 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in -@@ -48,7 +48,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @DST_OPENSSL_INC@ - --CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ @PKCS11_ENGINE@ @CRYPTO@ -+CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ @PKCS11_ENGINE@ @USE_GSSAPI@ @CRYPTO@ - - CWARNINGS = - -@@ -80,7 +80,7 @@ NOSYMLIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -82,7 +82,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix --TARGETS = named@EXEEXT@ lwresd@EXEEXT@ -+TARGETS = named@EXEEXT@ lwresd@EXEEXT@ feature-test@EXEEXT@ +-TARGETS = named@EXEEXT@ ++TARGETS = named@EXEEXT@ feature-test@EXEEXT@ GEOIPLINKOBJS = geoip.@O@ - GEOIP2LINKOBJS = geoip.@O@ -@@ -163,6 +163,15 @@ lwresd@EXEEXT@: named@EXEEXT@ - rm -f lwresd@EXEEXT@ - @LN@ named@EXEEXT@ lwresd@EXEEXT@ + +@@ -148,6 +148,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} + export BASEOBJS="${OBJS} ${UOBJS}"; \ + ${FINALBUILDCMD} +# Bit of hack, do not produce intermediate .o object for featuretest +feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c @@ -54,18 +41,18 @@ index 3166368..70e5571 100644 docclean manclean maintainer-clean:: diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index cedabbe..e1bf5da 100644 +index d9efc63..0f4ead0 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -71,7 +71,7 @@ DNSTAPREAD=$TOP/bin/tools/dnstap-read - MDIG=$TOP/bin/tools/mdig - NZD2NZF=$TOP/bin/tools/named-nzd2nzf - FSTRM_CAPTURE=@FSTRM_CAPTURE@ +@@ -38,7 +38,7 @@ DELV=$TOP/bin/delv/delv + DIG=$TOP/bin/dig/dig + DNSTAPREAD=$TOP/bin/tools/dnstap-read + DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey -FEATURETEST=$TOP/bin/tests/system/feature-test +FEATURETEST=$TOP/bin/named/feature-test - - RANDFILE=$TOP/bin/tests/system/random.data - + FSTRM_CAPTURE=@FSTRM_CAPTURE@ + IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey + JOURNALPRINT=$TOP/bin/tools/named-journalprint -- 2.20.1 diff --git a/bind-9.11-kyua-pkcs11.patch b/bind-9.11-kyua-pkcs11.patch index ac15d22..cb9fe4c 100644 --- a/bind-9.11-kyua-pkcs11.patch +++ b/bind-9.11-kyua-pkcs11.patch @@ -1,4 +1,4 @@ -From eb38d2278937ec3fe45d0af30cd080953bbb5b54 Mon Sep 17 00:00:00 2001 +From 9b9087cce00acd8f1fc2ce8e5c89d1dab1158683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 2 Jan 2018 18:13:07 +0100 Subject: [PATCH] Fix pkcs11 variants atf tests @@ -9,17 +9,16 @@ Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode --- configure.ac | 1 + lib/Kyuafile | 2 ++ - lib/dns-pkcs11/tests/Makefile.in | 10 +++++----- + lib/dns-pkcs11/tests/Makefile.in | 12 ++++++------ lib/dns-pkcs11/tests/dh_test.c | 3 ++- lib/isc-pkcs11/tests/Makefile.in | 6 +++--- - lib/isc-pkcs11/tests/hash_test.c | 32 +++++++++++++++++++++++++------- - 6 files changed, 38 insertions(+), 16 deletions(-) + 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac -index 0532feb..a83ddd5 100644 +index b7dd8e5..e9dbbba 100644 --- a/configure.ac +++ b/configure.ac -@@ -5578,6 +5578,7 @@ AC_CONFIG_FILES([ +@@ -3023,6 +3023,7 @@ AC_CONFIG_FILES([ lib/dns-pkcs11/include/Makefile lib/dns-pkcs11/include/dns/Makefile lib/dns-pkcs11/include/dst/Makefile @@ -28,7 +27,7 @@ index 0532feb..a83ddd5 100644 lib/irs/include/Makefile lib/irs/include/irs/Makefile diff --git a/lib/Kyuafile b/lib/Kyuafile -index 7c8bab0..eec9564 100644 +index 39ce986..dcfb139 100644 --- a/lib/Kyuafile +++ b/lib/Kyuafile @@ -2,8 +2,10 @@ syntax(2) @@ -41,34 +40,37 @@ index 7c8bab0..eec9564 100644 +include('isc-pkcs11/Kyuafile') include('isccc/Kyuafile') include('isccfg/Kyuafile') - include('lwres/Kyuafile') + include('ns/Kyuafile') diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index 7671e1d..e237d5c 100644 +index 7b35b93..c95d1c8 100644 --- a/lib/dns-pkcs11/tests/Makefile.in +++ b/lib/dns-pkcs11/tests/Makefile.in -@@ -17,12 +17,12 @@ VERSION=@BIND9_VERSION@ +@@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ - CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \ - @DST_OPENSSL_INC@ --CDEFINES = @CRYPTO@ -DTESTS="\"${top_builddir}/lib/dns/tests/\"" -+CDEFINES = @CRYPTO_PK11@ -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" + @BIND9_MAKE_INCLUDES@ --ISCLIBS = ../../isc/libisc.@A@ +-CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \ ++CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} \ + @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +-CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\"" ++CDEFINES = -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" + +-ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../../isc/libisc.@A@ --DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../libdns.@A@ @DNS_CRYPTO_LIBS@ -DNSDEPLIBS = ../libdns.@A@ +ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ +ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ -+DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ +DNSDEPLIBS = ../libdns-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ - CFLAGS = @CFLAGS@ @CMOCKA_CFLAGS@ + diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c -index 4dbfd82..a383b8e 100644 +index d83d9f5..d5bda29 100644 --- a/lib/dns-pkcs11/tests/dh_test.c +++ b/lib/dns-pkcs11/tests/dh_test.c -@@ -86,7 +86,8 @@ dh_computesecret(void **state) { +@@ -85,7 +85,8 @@ dh_computesecret(void **state) { result = dst_key_computesecret(key, key, &buf); assert_int_equal(result, DST_R_NOTPRIVATEKEY); result = key->func->computesecret(key, key, &buf); @@ -79,114 +81,23 @@ index 4dbfd82..a383b8e 100644 dst_key_free(&key); } diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in -index 2fdee0b..a263b35 100644 +index 5735829..97b26c1 100644 --- a/lib/isc-pkcs11/tests/Makefile.in +++ b/lib/isc-pkcs11/tests/Makefile.in @@ -16,10 +16,10 @@ VERSION=@BIND9_VERSION@ @BIND9_MAKE_INCLUDES@ - CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @ISC_OPENSSL_INC@ --CDEFINES = @CRYPTO@ -DTESTS="\"${top_builddir}/lib/isc/tests/\"" -+CDEFINES = @CRYPTO_PK11@ -DTESTS="\"${top_builddir}/lib/isc-pkcs11/tests/\"" + CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +-CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\"" ++CDEFINES = -DTESTS="\"${top_builddir}/lib/isc-pkcs11/tests/\"" --ISCLIBS = ../libisc.@A@ @ISC_OPENSSL_LIBS@ +-ISCLIBS = ../libisc.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../libisc.@A@ +ISCLIBS = ../libisc-pkcs11.@A@ @ISC_OPENSSL_LIBS@ +ISCDEPLIBS = ../libisc-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ - CFLAGS = @CFLAGS@ @CMOCKA_CFLAGS@ -diff --git a/lib/isc-pkcs11/tests/hash_test.c b/lib/isc-pkcs11/tests/hash_test.c -index 9c4d299..d9deba2 100644 ---- a/lib/isc-pkcs11/tests/hash_test.c -+++ b/lib/isc-pkcs11/tests/hash_test.c -@@ -85,7 +85,7 @@ typedef struct hash_testcase { - typedef struct hash_test_key { - const char *key; -- const int len; -+ const unsigned len; - } hash_test_key_t; - - /* non-hmac tests */ -@@ -956,8 +956,11 @@ isc_hmacsha1_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_SHA1_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_SHA1_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacsha1_init(&hmacsha1, buffer, test_key->len); -+ isc_hmacsha1_init(&hmacsha1, buffer, len); - isc_hmacsha1_update(&hmacsha1, - (const uint8_t *) testcase->input, - testcase->input_len); -@@ -1116,8 +1119,11 @@ isc_hmacsha224_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_SHA224_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_SHA224_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacsha224_init(&hmacsha224, buffer, test_key->len); -+ isc_hmacsha224_init(&hmacsha224, buffer, len); - isc_hmacsha224_update(&hmacsha224, - (const uint8_t *) testcase->input, - testcase->input_len); -@@ -1277,8 +1283,11 @@ isc_hmacsha256_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_SHA256_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_SHA256_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacsha256_init(&hmacsha256, buffer, test_key->len); -+ isc_hmacsha256_init(&hmacsha256, buffer, len); - isc_hmacsha256_update(&hmacsha256, - (const uint8_t *) testcase->input, - testcase->input_len); -@@ -1444,8 +1453,11 @@ isc_hmacsha384_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_SHA384_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_SHA384_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacsha384_init(&hmacsha384, buffer, test_key->len); -+ isc_hmacsha384_init(&hmacsha384, buffer, len); - isc_hmacsha384_update(&hmacsha384, - (const uint8_t *) testcase->input, - testcase->input_len); -@@ -1611,8 +1623,11 @@ isc_hmacsha512_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_SHA512_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_SHA512_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacsha512_init(&hmacsha512, buffer, test_key->len); -+ isc_hmacsha512_init(&hmacsha512, buffer, len); - isc_hmacsha512_update(&hmacsha512, - (const uint8_t *) testcase->input, - testcase->input_len); -@@ -1755,8 +1770,11 @@ isc_hmacmd5_test(void **state) { - hash_test_key_t *test_key = test_keys; - - while (testcase->input != NULL && testcase->result != NULL) { -+ int len = ISC_MAX(test_key->len, ISC_MD5_DIGESTLENGTH); -+ -+ memset(buffer, 0, ISC_MD5_DIGESTLENGTH); - memmove(buffer, test_key->key, test_key->len); -- isc_hmacmd5_init(&hmacmd5, buffer, test_key->len); -+ isc_hmacmd5_init(&hmacmd5, buffer, len); - isc_hmacmd5_update(&hmacmd5, - (const uint8_t *) testcase->input, - testcase->input_len); -- 2.20.1 diff --git a/bind-9.11-tests-pkcs11.patch b/bind-9.11-tests-pkcs11.patch index 79c55b2..cdba1b0 100644 --- a/bind-9.11-tests-pkcs11.patch +++ b/bind-9.11-tests-pkcs11.patch @@ -1,4 +1,4 @@ -From 66298a12b09784eab2c052ab22f87bb2b2f1267b Mon Sep 17 00:00:00 2001 +From 84fc64b556d5b5145eb7831393b856a26a818dc1 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 1 Mar 2019 15:55:46 +0100 Subject: [PATCH] Detect correctly pkcs11 support @@ -23,17 +23,17 @@ index b974708..3bbef4c 100644 $PK11DEL -w0 > /dev/null 2>&1 diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index a446c18..ede1203 100644 +index e7831d8..aa2d841 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -46,6 +46,7 @@ CHECKZONE=$TOP/bin/check/named-checkzone - CHECKCONF=$TOP/bin/check/named-checkconf +@@ -52,6 +52,7 @@ NSLOOKUP=$TOP/bin/dig/nslookup + NSUPDATE=$TOP/bin/nsupdate/nsupdate + NZD2NZF=$TOP/bin/tools/named-nzd2nzf + PK11DEL="$TOP/bin/pkcs11/pkcs11-destroy -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0" ++PK11DESTROY=$TOP/bin/pkcs11/pkcs11-destroy PK11GEN="$TOP/bin/pkcs11/pkcs11-keygen -q -s ${SLOT:-0} -p ${HSMPIN:-1234}" PK11LIST="$TOP/bin/pkcs11/pkcs11-list -s ${SLOT:-0} -p ${HSMPIN:-1234}" -+PK11DESTROY=$TOP/bin/pkcs11/pkcs11-destroy - PK11DEL="$TOP/bin/pkcs11/pkcs11-destroy -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0" - JOURNALPRINT=$TOP/bin/tools/named-journalprint - VERIFY=$TOP/bin/dnssec/dnssec-verify + RESOLVE=$TOP/lib/samples/resolve -- 2.20.1 diff --git a/bind-9.11-tests-variants.patch b/bind-9.11-tests-variants.patch index d983671..275f3cb 100644 --- a/bind-9.11-tests-variants.patch +++ b/bind-9.11-tests-variants.patch @@ -1,4 +1,4 @@ -From 06a22ff20ac3d68fa1f995c91068b43392425e43 Mon Sep 17 00:00:00 2001 +From e706bb1dccf0b3492664c591f99f698a2a40fce7 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 1 Mar 2019 15:48:20 +0100 Subject: [PATCH] Make alternative named builds testable in system tests @@ -13,53 +13,52 @@ export NAMED_VARIANT=-sdb DNSSEC_VARIANT= For pkcs variant use: export NAMED_VARIANT=-pkcs11 DNSSEC_VARIANT=-pkcs11 --- - bin/tests/system/conf.sh.in | 19 ++++++++++--------- - 1 file changed, 10 insertions(+), 9 deletions(-) + bin/tests/system/conf.sh.in | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index 4b0fe39..f135af6 100644 +index 0f4ead0..e7831d8 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -34,7 +34,7 @@ DISABLED_ALGORITHM=ECDSAP384SHA384 - DISABLED_ALGORITHM_NUMBER=14 - DISABLED_BITS=384 - +@@ -37,16 +37,16 @@ DDNSCONFGEN=$TOP/bin/confgen/ddns-confgen + DELV=$TOP/bin/delv/delv + DIG=$TOP/bin/dig/dig + DNSTAPREAD=$TOP/bin/tools/dnstap-read +-DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey +-FEATURETEST=$TOP/bin/named/feature-test ++DSFROMKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-dsfromkey${DNSSEC_VARIANT} ++FEATURETEST=$TOP/bin/named${NAMED_VARIANT}/feature-test${NAMED_VARIANT} + FSTRM_CAPTURE=@FSTRM_CAPTURE@ +-IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey ++IMPORTKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-importkey${DNSSEC_VARIANT} + JOURNALPRINT=$TOP/bin/tools/named-journalprint +-KEYFRLAB=$TOP/bin/dnssec/dnssec-keyfromlabel +-KEYGEN=$TOP/bin/dnssec/dnssec-keygen ++KEYFRLAB=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-keyfromlabel${DNSSEC_VARIANT} ++KEYGEN=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-keygen${DNSSEC_VARIANT} + KEYMGR=$TOP/bin/python/dnssec-keymgr + MDIG=$TOP/bin/tools/mdig -NAMED=$TOP/bin/named/named +NAMED=$TOP/bin/named${NAMED_VARIANT}/named${NAMED_VARIANT} - # We must use "named -l" instead of "lwresd" because argv[0] is lost - # if the program is libtoolized. - LWRESD="$TOP/bin/named/named -l" -@@ -45,13 +45,14 @@ NSUPDATE=$TOP/bin/nsupdate/nsupdate - DDNSCONFGEN=$TOP/bin/confgen/ddns-confgen - TSIGKEYGEN=$TOP/bin/confgen/tsig-keygen - RNDCCONFGEN=$TOP/bin/confgen/rndc-confgen --KEYGEN=$TOP/bin/dnssec/dnssec-keygen --KEYFRLAB=$TOP/bin/dnssec/dnssec-keyfromlabel --SIGNER=$TOP/bin/dnssec/dnssec-signzone + NSEC3HASH=$TOP/bin/tools/nsec3hash + NSLOOKUP=$TOP/bin/dig/nslookup + NSUPDATE=$TOP/bin/nsupdate/nsupdate +@@ -55,12 +55,12 @@ PK11DEL="$TOP/bin/pkcs11/pkcs11-destroy -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0" + PK11GEN="$TOP/bin/pkcs11/pkcs11-keygen -q -s ${SLOT:-0} -p ${HSMPIN:-1234}" + PK11LIST="$TOP/bin/pkcs11/pkcs11-list -s ${SLOT:-0} -p ${HSMPIN:-1234}" + RESOLVE=$TOP/lib/samples/resolve -REVOKE=$TOP/bin/dnssec/dnssec-revoke --SETTIME=$TOP/bin/dnssec/dnssec-settime --DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey --IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey -+KEYGEN=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-keygen${DNSSEC_VARIANT} -+KEYFRLAB=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-keyfromlabel${DNSSEC_VARIANT} -+SIGNER=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-signzone${DNSSEC_VARIANT} +REVOKE=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-revoke${DNSSEC_VARIANT} + RNDC=$TOP/bin/rndc/rndc + RNDCCONFGEN=$TOP/bin/confgen/rndc-confgen + RRCHECKER=$TOP/bin/tools/named-rrchecker +-SETTIME=$TOP/bin/dnssec/dnssec-settime +-SIGNER=$TOP/bin/dnssec/dnssec-signzone +SETTIME=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-settime${DNSSEC_VARIANT} -+DSFROMKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-dsfromkey${DNSSEC_VARIANT} -+IMPORTKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-importkey${DNSSEC_VARIANT} -+CHECKDS=$TOP/bin/python/dnssec-checkds - CHECKDS=$TOP/bin/python/dnssec-checkds - COVERAGE=$TOP/bin/python/dnssec-coverage - KEYMGR=$TOP/bin/python/dnssec-keymgr -@@ -71,7 +72,7 @@ DNSTAPREAD=$TOP/bin/tools/dnstap-read - MDIG=$TOP/bin/tools/mdig - NZD2NZF=$TOP/bin/tools/named-nzd2nzf - FSTRM_CAPTURE=@FSTRM_CAPTURE@ --FEATURETEST=$TOP/bin/named/feature-test -+FEATURETEST=$TOP/bin/named${NAMED_VARIANT}/feature-test${NAMED_VARIANT} - - RANDFILE=$TOP/bin/tests/system/random.data - ++SIGNER=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-signzone${DNSSEC_VARIANT} + TSIGKEYGEN=$TOP/bin/confgen/tsig-keygen + VERIFY=$TOP/bin/dnssec/dnssec-verify + WIRETEST=$TOP/bin/tests/wire_test -- 2.20.1 diff --git a/bind.spec b/bind.spec index c35e15d..1e83ecd 100644 --- a/bind.spec +++ b/bind.spec @@ -10,7 +10,9 @@ # bcond_without is built by default, unless --without X is passed # bcond_with is built only when --with X is passed to build %bcond_with SYSTEMTEST -%bcond_without SDB +# TODO: sdb tools from contrib were removed. +# Disable SDB for now +%bcond_with SDB %bcond_without GSSTSIG # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles @@ -55,10 +57,10 @@ # # lib*.so.X versions of selected libraries -%global sover_dns 1107 -%global sover_isc 1104 -%global sover_irs 161 -%global sover_isccfg 163 +%global sover_dns 1306 +%global sover_isc 1306 +%global sover_irs 1301 +%global sover_isccfg 1302 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind @@ -106,7 +108,6 @@ Source46: named-setup-rndc.service Source47: named-pkcs11.service Source48: setup-named-softhsm.sh Source49: named-chroot.files -Source50: random.data # Common patches Patch10: bind-9.5-PIE.patch @@ -118,7 +119,7 @@ Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch Patch131:bind-9.9.1-P2-multlib-conflict.patch Patch133:bind99-rh640538.patch -Patch134:bind97-rh669163.patch +#Patch134:bind97-rh669163.patch # lwres discontinued # Fedora specific patch to distribute native-pkcs#11 functionality Patch136:bind-9.10-dist-native-pkcs11.patch @@ -153,10 +154,12 @@ Patch164:bind-9.11-rh1666814.patch # random_test fails too often by random, disable it # not present on 9.14.0 Patch168:bind-9.11-unit-disable-random.patch +#Patch169:bind-9.11-feature-test-dlz.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch Patch173:bind-9.11-rh1732883.patch +#Patch174: bind-9.11-unit-timer-nothread.patch # Make sure jsonccp-devel does not interfere Patch174:bind-9.11-json-c.patch Patch175:bind-9.11-fips-disable.patch @@ -556,10 +559,12 @@ are used for building ISC DHCP. #%patch163 -p1 -b .rh1663318 %patch164 -p1 -b .rh1666814 %patch168 -p1 -b .random_test-disable +#%patch169 -p1 -b .featuretest-dlz %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant %patch172 -p1 -b .test-pkcs11 %patch173 -p1 -b .rh1732883 +#%patch174 -p1 -b .unit-timer %patch174 -p1 -b .json-c %patch175 -p1 -b .rh1709553 %patch177 -p1 -b .serve-stale @@ -570,9 +575,6 @@ are used for building ISC DHCP. %patch186 -p1 -b .rh1736762-8 %patch187 -p1 -b .oot-gen -mkdir lib/dns/tests/testdata/dstrandom -cp -a %{SOURCE50} lib/dns/tests/testdata/dstrandom/random.data - %if %{with PKCS11} cp -r bin/named{,-pkcs11} cp -r bin/dnssec{,-pkcs11} @@ -612,7 +614,7 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools %endif %patch133 -p1 -b .rh640538 -%patch134 -p1 -b .rh669163 +#%patch134 -p1 -b .rh669163 # Sparc and s390 arches need to use -fPIE %ifarch sparcv9 sparc64 s390 s390x @@ -669,15 +671,11 @@ export LIBDIR_SUFFIX --with-python=%{__python3} \ --with-libtool \ --localstatedir=/var \ - --enable-threads \ - --enable-ipv6 \ - --enable-filter-aaaa \ --with-pic \ --disable-static \ --includedir=%{_includedir}/bind9 \ --with-tuning=large \ --with-libidn2 \ - --enable-openssl-hash \ %if %{with GEOIP} --with-geoip \ %endif @@ -785,7 +783,6 @@ export LIBDIR_SUFFIX --libdir=%{_libdir}%{_export_dir} \ --includedir=%{_includedir}%{_export_dir}/ \ --disable-threads \ - --enable-openssl-hash \ %if %{with GSSTSIG} --with-gssapi=yes \ --disable-isc-spnego \ @@ -1341,9 +1338,9 @@ fi; %endif %files libs -%{_libdir}/libbind9.so.161* -%{_libdir}/libisccc.so.161* -%{_libdir}/liblwres.so.161* +%{_libdir}/libbind9.so.1302* +%{_libdir}/libisccc.so.1302* +%{_libdir}/libns.so.1304* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* @@ -1408,7 +1405,7 @@ fi; %{_includedir}/bind9/config.h %{_includedir}/bind9/bind9 %{_includedir}/bind9/isccc -%{_includedir}/bind9/lwres +%{_includedir}/bind9/ns %{_mandir}/man1/isc-config.sh.1* %{_mandir}/man1/bind9-config.1* %{_mandir}/man3/lwres* @@ -1569,7 +1566,9 @@ fi; %if %{with DLZ} && %{with BDB} %files dlz-bdb +%if %{with SDB} %{_sbindir}/dlzbdb +%endif %{_libdir}/bind/dlz_bdbhpt_dynamic.so %doc contrib/dlz/modules/bdbhpt/testing/* %doc contrib/dlz/modules/bdbhpt/README* From aaee84a4fb5aaccf9cf8f93df32b626c1c82c2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 23 Jul 2019 16:18:58 +0200 Subject: [PATCH 04/79] First version compiling up to tests Unfortunately, test fails. --- bind-9.10-dist-native-pkcs11.patch | 5 +- bind-9.11-fips-tests.patch | 15 ++--- bind-9.11-kyua-pkcs11.patch | 17 +++--- bind-9.14-json-c.patch | 95 ++++++++++++++++++++++++++++++ bind.spec | 12 ++-- 5 files changed, 123 insertions(+), 21 deletions(-) create mode 100644 bind-9.14-json-c.patch diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index a3ef6e4..dc18dc7 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -247,7 +247,7 @@ index 856463f..dc826dd 100644 @DLZ_DRIVER_RULES@ diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index 454d145..0e542f3 100644 +index 96aec05..0e542f3 100644 --- a/bin/pkcs11/Makefile.in +++ b/bin/pkcs11/Makefile.in @@ -13,13 +13,13 @@ top_srcdir = @top_srcdir@ @@ -259,7 +259,8 @@ index 454d145..0e542f3 100644 CDEFINES = - ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ +-ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ +ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index 18e0433..09169ae 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From f37b26cb7c8f7351d22dfea79df33edb74d42e23 Mon Sep 17 00:00:00 2001 +From 0b1c2b11ccec87da88bcdceeda814c489163461b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -77,7 +77,7 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/checkconf/bad-tsig.conf | 2 +- bin/tests/system/checkconf/good.conf | 2 +- bin/tests/system/dlv/ns3/sign.sh | 1 + - bin/tests/system/feature-test.c | 13 ++++ + bin/tests/system/feature-test.c | 14 ++++ bin/tests/system/notify/ns5/named.conf.in | 6 +- bin/tests/system/notify/tests.sh | 6 +- bin/tests/system/nsupdate/ns1/named.conf.in | 2 +- @@ -91,7 +91,7 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/tsig/tests.sh | 67 ++++++++++++------- bin/tests/system/upforwd/ns1/named.conf.in | 2 +- bin/tests/system/upforwd/tests.sh | 2 +- - 33 files changed, 151 insertions(+), 107 deletions(-) + 33 files changed, 152 insertions(+), 107 deletions(-) diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in index 0ea6502..026db3f 100644 @@ -574,7 +574,7 @@ index fa51ae1..bc46942 100755 zone=child1.utld. infile=child.db.in diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c -index 8b9deb6..ceb4fe8 100644 +index 8b9deb6..e5d8997 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c @@ -19,6 +19,7 @@ @@ -585,16 +585,17 @@ index 8b9deb6..ceb4fe8 100644 #include #ifdef WIN32 -@@ -159,6 +160,18 @@ main(int argc, char **argv) { +@@ -159,6 +160,19 @@ main(int argc, char **argv) { #endif } + if (strcmp(argv[1], "--md5") == 0) { + unsigned char digest[ISC_MAX_MD_SIZE]; -+ const char test[] = test; ++ const unsigned char test[] = "test"; ++ unsigned int size = sizeof(digest); + + if (isc_md(ISC_MD_MD5, test, sizeof(test), -+ digest, sizeof(digest)) == ISC_R_SUCCESS) { ++ digest, &size) == ISC_R_SUCCESS) { + return (0); + } else { + return (1); diff --git a/bind-9.11-kyua-pkcs11.patch b/bind-9.11-kyua-pkcs11.patch index cb9fe4c..87809b7 100644 --- a/bind-9.11-kyua-pkcs11.patch +++ b/bind-9.11-kyua-pkcs11.patch @@ -1,4 +1,4 @@ -From 9b9087cce00acd8f1fc2ce8e5c89d1dab1158683 Mon Sep 17 00:00:00 2001 +From c2e22d5b55fdc17cd51bf77980892e147c2b2ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 2 Jan 2018 18:13:07 +0100 Subject: [PATCH] Fix pkcs11 variants atf tests @@ -15,10 +15,10 @@ Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac -index b7dd8e5..e9dbbba 100644 +index 0f7c850..0532e5f 100644 --- a/configure.ac +++ b/configure.ac -@@ -3023,6 +3023,7 @@ AC_CONFIG_FILES([ +@@ -3032,6 +3032,7 @@ AC_CONFIG_FILES([ lib/dns-pkcs11/include/Makefile lib/dns-pkcs11/include/dns/Makefile lib/dns-pkcs11/include/dst/Makefile @@ -81,19 +81,20 @@ index d83d9f5..d5bda29 100644 dst_key_free(&key); } diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in -index 5735829..97b26c1 100644 +index 7e62737..e91cd67 100644 --- a/lib/isc-pkcs11/tests/Makefile.in +++ b/lib/isc-pkcs11/tests/Makefile.in -@@ -16,10 +16,10 @@ VERSION=@BIND9_VERSION@ +@@ -15,11 +15,11 @@ VERSION=@BIND9_VERSION@ + @BIND9_MAKE_INCLUDES@ - CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +-CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ -CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\"" ++CINCLUDES = -I. -Iinclude ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +CDEFINES = -DTESTS="\"${top_builddir}/lib/isc-pkcs11/tests/\"" --ISCLIBS = ../libisc.@A@ @OPENSSL_LIBS@ + ISCLIBS = ../libisc-pkcs11.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../libisc.@A@ -+ISCLIBS = ../libisc-pkcs11.@A@ @ISC_OPENSSL_LIBS@ +ISCDEPLIBS = ../libisc-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/bind-9.14-json-c.patch b/bind-9.14-json-c.patch new file mode 100644 index 0000000..870b46b --- /dev/null +++ b/bind-9.14-json-c.patch @@ -0,0 +1,95 @@ +From 0698eb93f6e618d2882ae2c8758c5fa87524bea6 Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Tue, 23 Jul 2019 12:10:39 +0200 +Subject: [PATCH] Allow explicitly using json-c but not libjson + +Separate detection of json support. Allows explicit use of json-c when +jsoncpp package is found. Have to use --without-libjson --with-json-c. +--- + configure.ac | 52 +++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 41 insertions(+), 11 deletions(-) + +diff --git a/configure.ac b/configure.ac +index f7978e4..40b4f9f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1331,7 +1331,6 @@ AC_ARG_WITH(libjson, + use_libjson="$withval", use_libjson="auto") + + have_libjson="" +-have_libjson_c="" + case "$use_libjson" in + no) + libjson_libs="" +@@ -1347,7 +1346,43 @@ case "$use_libjson" in + LIBS="$LIBS -L${d}/lib" + fi + have_libjson="yes" +- elif test -f "${d}/include/json-c/json.h" ++ fi ++ done ++ ;; ++ *) ++ if test -f "${use_libjson}/include/json/json.h" ++ then ++ libjson_cflags="-I${use_libjson}/include" ++ LIBS="$LIBS -L${use_libjson}/lib" ++ have_libjson="yes" ++ else ++ AC_MSG_ERROR([$use_libjson/include/json/json.h not found.]) ++ fi ++ ;; ++esac ++ ++# ++# was --with-json-c specified? ++# ++AC_ARG_WITH(json-c, ++ AS_HELP_STRING([--with-json-c[=PATH]], ++ [build with json-c library [yes|no|path]]), ++ use_json_c="$withval", use_json_c="$use_libjson") ++ ++if test "X${have_libjson}" != "X" ++then ++ # Do not use if libjson were found ++ use_json_c=no ++fi ++ ++have_libjson_c="" ++case "$use_json_c" in ++ no) ++ ;; ++ auto|yes) ++ for d in /usr /usr/local /opt/local ++ do ++ if test -f "${d}/include/json-c/json.h" + then + if test ${d} != /usr + then +@@ -1360,19 +1395,14 @@ case "$use_libjson" in + done + ;; + *) +- if test -f "${use_libjson}/include/json/json.h" +- then +- libjson_cflags="-I${use_libjson}/include" +- LIBS="$LIBS -L${use_libjson}/lib" +- have_libjson="yes" +- elif test -f "${use_libjson}/include/json-c/json.h" ++ if test -f "${use_json_c}/include/json-c/json.h" + then +- libjson_cflags="-I${use_libjson}/include" +- LIBS="$LIBS -L${use_libjson}/lib" ++ libjson_cflags="-I${use_json_c}/include" ++ LIBS="$LIBS -L${use_json_c}/lib" + have_libjson="yes" + have_libjson_c="yes" + else +- AC_MSG_ERROR([$use_libjson/include/json{,-c}/json.h not found.]) ++ AC_MSG_ERROR([$use_json_c/include/json-c/json.h not found.]) + fi + ;; + esac +-- +2.20.1 + diff --git a/bind.spec b/bind.spec index 1e83ecd..e2c3f60 100644 --- a/bind.spec +++ b/bind.spec @@ -21,8 +21,11 @@ %bcond_without LMDB %bcond_without JSON %bcond_without DNSTAP -%bcond_without DLZ +# TODO: mysql is not well suported without SDB. %bcond_with BDB +# skip DLZ for now +%bcond_with DLZ +# Support for builds without threads removed. DHCP no longer needs it anyway. %bcond_with EXPORT_LIBS # Legacy GeoIP support %bcond_with GEOIP @@ -163,6 +166,7 @@ Patch173:bind-9.11-rh1732883.patch # Make sure jsonccp-devel does not interfere Patch174:bind-9.11-json-c.patch Patch175:bind-9.11-fips-disable.patch +Patch176: bind-9.11-unit-dnstap-pkcs11.patch Patch177: bind-9.11-serve-stale.patch Patch178: bind-9.11-serve-stale-dbfix.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1736762 @@ -567,6 +571,7 @@ are used for building ISC DHCP. #%patch174 -p1 -b .unit-timer %patch174 -p1 -b .json-c %patch175 -p1 -b .rh1709553 +%patch176 -p1 -b .unit-dnstap %patch177 -p1 -b .serve-stale %patch178 -p1 -b .rh1770492 %patch183 -p1 -b .rh1736762-5 @@ -706,7 +711,7 @@ export LIBDIR_SUFFIX --with-lmdb=no \ %endif %if %{with JSON} - --with-libjson \ + --without-libjson --with-json-c \ %endif %if %{with DNSTAP} --enable-dnstap \ @@ -1401,14 +1406,13 @@ fi; %files devel %{_libdir}/libbind9.so %{_libdir}/libisccc.so -%{_libdir}/liblwres.so +%{_libdir}/libns.so %{_includedir}/bind9/config.h %{_includedir}/bind9/bind9 %{_includedir}/bind9/isccc %{_includedir}/bind9/ns %{_mandir}/man1/isc-config.sh.1* %{_mandir}/man1/bind9-config.1* -%{_mandir}/man3/lwres* %{_bindir}/isc-config.sh %{_bindir}/bind9-config %endif From 3c4d9d472a67824db82f1a3d948b98317688f212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 12:06:39 +0200 Subject: [PATCH 05/79] Update changelog --- bind.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index e2c3f60..538f891 100644 --- a/bind.spec +++ b/bind.spec @@ -69,7 +69,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.14.0 -Release: 0%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1608,7 +1608,10 @@ fi; %changelog -* Wed Jan 08 2020 Petr Menšík - 32:9.11.14-4 +* Wed Jan 08 2020 Petr Menšík - 32:9.14.0-1 +- Update to 9.14.0, disabled SDB and DLZ + + * Wed Jan 08 2020 Petr Menšík - 32:9.11.14-4 - Remove libmaxminddb-devel from devel package dependencies * Fri Jan 03 2020 Petr Menšík - 32:9.11.14-3 From 2dbb099871bad9c12b6ae248bcb4866b6648573e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 12:50:29 +0200 Subject: [PATCH 06/79] Update to 9.14.4 Current latest version fixes unit tests. --- .gitignore | 1 + bind-9.10-dist-native-pkcs11.patch | 74 ++++++++++++++++-------------- bind-9.11-feature-test-named.patch | 14 +++--- bind-9.11-fips-tests.patch | 27 +++-------- bind-9.11-kyua-pkcs11.patch | 12 ++--- bind-9.14.4.tar.gz.asc | 16 +++++++ bind.spec | 11 +++-- sources | 3 +- 8 files changed, 84 insertions(+), 74 deletions(-) create mode 100644 bind-9.14.4.tar.gz.asc diff --git a/.gitignore b/.gitignore index d72777d..2084547 100644 --- a/.gitignore +++ b/.gitignore @@ -92,6 +92,7 @@ bind-9.7.2b1.tar.gz /bind-9.11.5-P4.tar.gz /bind-9.11.6.tar.gz /bind-9.11.6-P1.tar.gz +/bind-9.14.4.tar.gz /bind-9.11.7.tar.gz /bind-9.11.8.tar.gz /bind-9.11.9.tar.gz diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index dc18dc7..c255fab 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -12,7 +12,7 @@ index 9ad7f62..094775a 100644 TARGETS = diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index be1ac3b..c1ee27c 100644 +index 321058b..5067ee1 100644 --- a/bin/dnssec-pkcs11/Makefile.in +++ b/bin/dnssec-pkcs11/Makefile.in @@ -15,17 +15,17 @@ VERSION=@BIND9_VERSION@ @@ -25,10 +25,10 @@ index be1ac3b..c1ee27c 100644 CDEFINES = -DVERSION=\"${VERSION}\" CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ -ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ +ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ @@ -132,10 +132,10 @@ index be1ac3b..c1ee27c 100644 clean distclean:: diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index 856463f..dc826dd 100644 +index eecfa76..416e12e 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in -@@ -43,27 +43,27 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ +@@ -43,9 +43,9 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ @@ -144,14 +144,15 @@ index 856463f..dc826dd 100644 ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ - ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ + ${ISC_PKCS11_INCLUDES} ${DLZDRIVER_INCLUDES} \ - ${DBDRIVER_INCLUDES} @OPENSSL_INCLUDES@ + ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ - CDEFINES = @CONTRIB_DLZ@ +@@ -53,18 +53,18 @@ CDEFINES = @CONTRIB_DLZ@ CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCLIBS = ../../lib/isccc/libisccc.@A@ -ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ @@ -170,7 +171,7 @@ index 856463f..dc826dd 100644 BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ NSDEPLIBS = ../../lib/ns/libns.@A@ -@@ -72,17 +72,17 @@ DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ +@@ -73,17 +73,17 @@ DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \ @@ -190,9 +191,9 @@ index 856463f..dc826dd 100644 +TARGETS = named-pkcs11@EXEEXT@ feature-test-pkcs11@EXEEXT@ GEOIPLINKOBJS = geoip.@O@ - -@@ -90,8 +90,7 @@ OBJS = builtin.@O@ config.@O@ control.@O@ \ - controlconf.@O@ fuzz.@O@ @GEOIPLINKOBJS@ \ + GEOIP2LINKOBJS = geoip.@O@ +@@ -93,8 +93,7 @@ OBJS = builtin.@O@ config.@O@ control.@O@ \ + @GEOIPLINKOBJS@ @GEOIP2LINKOBJS@ \ log.@O@ logconf.@O@ main.@O@ \ server.@O@ statschannel.@O@ \ - tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ \ @@ -201,8 +202,8 @@ index 856463f..dc826dd 100644 UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@ -@@ -103,8 +102,7 @@ SRCS = builtin.c config.c control.c \ - controlconf.c fuzz.c @GEOIPLINKSRCS@ \ +@@ -108,8 +107,7 @@ SRCS = builtin.c config.c control.c \ + @GEOIPLINKSRCS@ @GEOIP2LINKSRCS@ \ log.c logconf.c main.c \ server.c statschannel.c \ - tkeyconf.c tsigconf.c zoneconf.c \ @@ -211,7 +212,7 @@ index 856463f..dc826dd 100644 MANPAGES = named.8 named.conf.5 -@@ -143,7 +141,7 @@ server.@O@: server.c +@@ -149,7 +147,7 @@ server.@O@: server.c -DPRODUCT=\"${PRODUCT}\" \ -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c @@ -220,7 +221,7 @@ index 856463f..dc826dd 100644 export MAKE_SYMTABLE="yes"; \ export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} -@@ -153,7 +151,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c +@@ -159,7 +157,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -c ${top_srcdir}/bin/tests/system/feature-test.c @@ -229,7 +230,7 @@ index 856463f..dc826dd 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} -@@ -186,13 +184,13 @@ install-man8: named.8 +@@ -192,13 +190,13 @@ install-man8: named.8 install-man: install-man5 install-man8 @@ -268,10 +269,10 @@ index 96aec05..0e542f3 100644 DEPLIBS = ${ISCDEPLIBS} diff --git a/configure.ac b/configure.ac -index 6e17d3a..0f7c850 100644 +index 29106cb..3dff344 100644 --- a/configure.ac +++ b/configure.ac -@@ -1188,12 +1188,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1267,12 +1267,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" @@ -286,7 +287,7 @@ index 6e17d3a..0f7c850 100644 # # was --with-lmdb specified? -@@ -2466,6 +2468,9 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) +@@ -2542,6 +2544,9 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) AC_SUBST(BIND9_NS_BUILDINCLUDE) AC_SUBST(BIND9_BIND9_BUILDINCLUDE) AC_SUBST(BIND9_IRS_BUILDINCLUDE) @@ -296,7 +297,7 @@ index 6e17d3a..0f7c850 100644 if test "X$srcdir" != "X"; then BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" -@@ -2474,6 +2479,9 @@ if test "X$srcdir" != "X"; then +@@ -2550,6 +2555,9 @@ if test "X$srcdir" != "X"; then BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" @@ -306,7 +307,7 @@ index 6e17d3a..0f7c850 100644 else BIND9_ISC_BUILDINCLUDE="" BIND9_ISCCC_BUILDINCLUDE="" -@@ -2482,6 +2490,9 @@ else +@@ -2558,6 +2566,9 @@ else BIND9_NS_BUILDINCLUDE="" BIND9_BIND9_BUILDINCLUDE="" BIND9_IRS_BUILDINCLUDE="" @@ -316,7 +317,7 @@ index 6e17d3a..0f7c850 100644 fi AC_SUBST_FILE(BIND9_MAKE_INCLUDES) -@@ -2940,8 +2951,11 @@ AC_CONFIG_FILES([ +@@ -3021,8 +3032,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile @@ -328,7 +329,7 @@ index 6e17d3a..0f7c850 100644 bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile -@@ -3014,6 +3028,10 @@ AC_CONFIG_FILES([ +@@ -3095,6 +3109,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -339,7 +340,7 @@ index 6e17d3a..0f7c850 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -3034,6 +3052,20 @@ AC_CONFIG_FILES([ +@@ -3115,6 +3133,20 @@ AC_CONFIG_FILES([ lib/isc/unix/include/Makefile lib/isc/unix/include/isc/Makefile lib/isc/unix/include/pkcs11/Makefile @@ -374,17 +375,18 @@ index ffa2d5a..439d748 100644 @BIND9_MAKE_RULES@ diff --git a/lib/dns-pkcs11/Makefile.in b/lib/dns-pkcs11/Makefile.in -index eb3346a..c9e4960 100644 +index 60c87a8..50da232 100644 --- a/lib/dns-pkcs11/Makefile.in +++ b/lib/dns-pkcs11/Makefile.in -@@ -26,16 +26,16 @@ VERSION=@BIND9_VERSION@ +@@ -26,17 +26,17 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ -CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ -- ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ +- ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ +CINCLUDES = -I. -I${top_srcdir}/lib/dns-pkcs11 -Iinclude ${DNS_PKCS11_INCLUDES} \ -+ ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ ++ ${ISC_PKCS11_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @@ -396,9 +398,9 @@ index eb3346a..c9e4960 100644 -ISCDEPLIBS = ../../lib/isc/libisc.@A@ +ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ - LIBS = @LIBS@ + LIBS = ${MAXMINDDB_LIBS} @LIBS@ -@@ -134,15 +134,15 @@ version.@O@: version.c +@@ -138,15 +138,15 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -418,13 +420,15 @@ index eb3346a..c9e4960 100644 include: gen ${MAKE} include/dns/enumtype.h -@@ -168,25 +168,25 @@ code.h: gen +@@ -172,27 +172,27 @@ code.h: gen ./gen -s ${srcdir} > code.h || { rm -f $@ ; exit 1; } gen: gen.c - ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ + ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc-pkcs11/include \ - ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS} + ${LFS_CFLAGS} ${LFS_LDFLAGS} \ + ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \ + ${BUILD_LIBS} ${LFS_LIBS} -timestamp: include libdns.@A@ +timestamp: include libdns-pkcs11.@A@ @@ -449,7 +453,7 @@ index eb3346a..c9e4960 100644 + rm -f libdns-pkcs11.@A@ timestamp rm -f gen code.h include/dns/enumtype.h include/dns/enumclass.h rm -f include/dns/rdatastruct.h - rm -f dnstap.pb-c.c dnstap.pb-c.h include/dns/dnstap.pb-c.h + rm -f dnstap.pb-c.c dnstap.pb-c.h diff --git a/lib/isc-pkcs11/Makefile.in b/lib/isc-pkcs11/Makefile.in index ed87279..3171b48 100644 --- a/lib/isc-pkcs11/Makefile.in diff --git a/bind-9.11-feature-test-named.patch b/bind-9.11-feature-test-named.patch index 1b89e1b..61c31ea 100644 --- a/bind-9.11-feature-test-named.patch +++ b/bind-9.11-feature-test-named.patch @@ -1,4 +1,4 @@ -From b45cc1caf018d46753a03d59bb9e75cdeef1deeb Mon Sep 17 00:00:00 2001 +From 36e3d1b08f697190b259a8421472ec16b52315b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 30 Jan 2019 14:37:17 +0100 Subject: [PATCH] Create feature-test in source directory @@ -12,10 +12,10 @@ compile feature-test for each of them this way. 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 10d568f..856463f 100644 +index 4e8006d..eecfa76 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in -@@ -82,7 +82,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -83,7 +83,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix @@ -23,8 +23,8 @@ index 10d568f..856463f 100644 +TARGETS = named@EXEEXT@ feature-test@EXEEXT@ GEOIPLINKOBJS = geoip.@O@ - -@@ -148,6 +148,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} + GEOIP2LINKOBJS = geoip.@O@ +@@ -154,6 +154,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} @@ -41,10 +41,10 @@ index 10d568f..856463f 100644 docclean manclean maintainer-clean:: diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index d9efc63..0f4ead0 100644 +index c713d96..20366e5 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -38,7 +38,7 @@ DELV=$TOP/bin/delv/delv +@@ -34,7 +34,7 @@ DELV=$TOP/bin/delv/delv DIG=$TOP/bin/dig/dig DNSTAPREAD=$TOP/bin/tools/dnstap-read DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index 09169ae..f11fc5b 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From 0b1c2b11ccec87da88bcdceeda814c489163461b Mon Sep 17 00:00:00 2001 +From 11d42f5d851881fd559a716df78a18dba1d6975d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -76,7 +76,6 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/catz/ns2/named.conf.in | 2 +- bin/tests/system/checkconf/bad-tsig.conf | 2 +- bin/tests/system/checkconf/good.conf | 2 +- - bin/tests/system/dlv/ns3/sign.sh | 1 + bin/tests/system/feature-test.c | 14 ++++ bin/tests/system/notify/ns5/named.conf.in | 6 +- bin/tests/system/notify/tests.sh | 6 +- @@ -91,7 +90,7 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/tsig/tests.sh | 67 ++++++++++++------- bin/tests/system/upforwd/ns1/named.conf.in | 2 +- bin/tests/system/upforwd/tests.sh | 2 +- - 33 files changed, 152 insertions(+), 107 deletions(-) + 32 files changed, 151 insertions(+), 107 deletions(-) diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in index 0ea6502..026db3f 100644 @@ -561,20 +560,8 @@ index d627d2a..9d0322a 100644 + algorithm "hmac-sha256"; secret "qwertyuiopasdfgh"; }; -diff --git a/bin/tests/system/dlv/ns3/sign.sh b/bin/tests/system/dlv/ns3/sign.sh -index fa51ae1..bc46942 100755 ---- a/bin/tests/system/dlv/ns3/sign.sh -+++ b/bin/tests/system/dlv/ns3/sign.sh -@@ -19,6 +19,7 @@ echo_i "dlv/ns3/sign.sh" - dlvzone=dlv.utld. - dlvsets= - dssets= -+bits=1024 - - zone=child1.utld. - infile=child.db.in diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c -index 8b9deb6..e5d8997 100644 +index ff92ad2..746e022 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c @@ -19,6 +19,7 @@ @@ -585,7 +572,7 @@ index 8b9deb6..e5d8997 100644 #include #ifdef WIN32 -@@ -159,6 +160,19 @@ main(int argc, char **argv) { +@@ -168,6 +169,19 @@ main(int argc, char **argv) { #endif } @@ -698,10 +685,10 @@ index 5d70114..6c4b55a 100644 $DDNSCONFGEN -q -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key $DDNSCONFGEN -q -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh -index dd0286f..906135c 100755 +index b73d178..f573905 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh -@@ -700,7 +700,14 @@ fi +@@ -708,7 +708,14 @@ fi n=`expr $n + 1` ret=0 echo_i "check TSIG key algorithms ($n)" @@ -717,7 +704,7 @@ index dd0286f..906135c 100755 $NSUPDATE -k ns1/${alg}.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add ${alg}.keytests.nil. 600 A 10.10.10.3 -@@ -708,7 +715,7 @@ send +@@ -716,7 +723,7 @@ send END done sleep 2 diff --git a/bind-9.11-kyua-pkcs11.patch b/bind-9.11-kyua-pkcs11.patch index 87809b7..95e9843 100644 --- a/bind-9.11-kyua-pkcs11.patch +++ b/bind-9.11-kyua-pkcs11.patch @@ -1,4 +1,4 @@ -From c2e22d5b55fdc17cd51bf77980892e147c2b2ea1 Mon Sep 17 00:00:00 2001 +From f0ce2b4855b70f1fb04394b35626c37ebb0a8c75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 2 Jan 2018 18:13:07 +0100 Subject: [PATCH] Fix pkcs11 variants atf tests @@ -15,10 +15,10 @@ Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac -index 0f7c850..0532e5f 100644 +index 3dff344..424a542 100644 --- a/configure.ac +++ b/configure.ac -@@ -3032,6 +3032,7 @@ AC_CONFIG_FILES([ +@@ -3113,6 +3113,7 @@ AC_CONFIG_FILES([ lib/dns-pkcs11/include/Makefile lib/dns-pkcs11/include/dns/Makefile lib/dns-pkcs11/include/dst/Makefile @@ -42,7 +42,7 @@ index 39ce986..dcfb139 100644 include('isccfg/Kyuafile') include('ns/Kyuafile') diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index 7b35b93..c95d1c8 100644 +index eb297c9..144d6b2 100644 --- a/lib/dns-pkcs11/tests/Makefile.in +++ b/lib/dns-pkcs11/tests/Makefile.in @@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ @@ -57,11 +57,11 @@ index 7b35b93..c95d1c8 100644 -ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ -ISCDEPLIBS = ../../isc/libisc.@A@ --DNSLIBS = ../libdns.@A@ @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -DNSDEPLIBS = ../libdns.@A@ +ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ +ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ -+DNSLIBS = ../libdns-pkcs11.@A@ @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +DNSDEPLIBS = ../libdns-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/bind-9.14.4.tar.gz.asc b/bind-9.14.4.tar.gz.asc new file mode 100644 index 0000000..46eb6f8 --- /dev/null +++ b/bind-9.14.4.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABAgAdFiEErj+seWcR7Fn8AHqkdLtrmky7PTgFAl0u4wkACgkQdLtrmky7 +PThVjxAAgSBMHHL5U/vjlK1ZaNdOlwdG2b48+IYu3TkOnFHoAoX0Zkt12xgdWdHi +ChL645zHeCo16a7OY40wcDhmSa9lIB+M7D7SNNhFAp0Ta2DGKy3mvSloTup/XDeJ +cdb7rOQdvh70nf+YV4NKADP/QvQdAmMOEhNIZzAW2u+LOCcJwVAlaN1cMt2GEYLM +0qhKynPKNWcotA9RnCH3K2eNPT4u8X6MyU1XqA+JHJvwFLwJq6xpV8l7IfHEnK5l +6nhul6IlYAclHtFEw4rADQScQE8Zg2PXtb8Ajn/ml2nXbSjluprAWgHd8aUl2/gV +VZVzGI9ZaZD9a2Vkj9pJcNKWMcGk0tlBME5Sv9BIwx8jna66kze9z0AhaziwDgnV +4Ur+xYo784FzSXoxhwvSQlvbs18TZHTx9vYTg2xUIFO2bjIfdAY2oe2Hegr8u9mj +tCxnOJYE+xLJaj3CsPEoPwDcyV11Swka6+jqsA8ngVb99Y/tct8+BDd6zgjRQaSG +7ETk6Hi09QFAMe2YPy+BwcHhk05SD784Cvs3KH9W7x0uFVIdc7xVs+vwe+5SH/Q3 +IPCKfhk0k4A/dmjYSmKvzkT5UyIdt/VqVYuVFmMFLqs3Xf0F1KUt/3fJJJfGhaOp +tflZWGpR6Gou7TY/kMM35yGz9HnZ5uSWAOUhEQAHG1uKck49GjA= +=DwY1 +-----END PGP SIGNATURE----- diff --git a/bind.spec b/bind.spec index 538f891..6f90f56 100644 --- a/bind.spec +++ b/bind.spec @@ -68,7 +68,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.14.0 +Version: 9.14.4 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -166,7 +166,7 @@ Patch173:bind-9.11-rh1732883.patch # Make sure jsonccp-devel does not interfere Patch174:bind-9.11-json-c.patch Patch175:bind-9.11-fips-disable.patch -Patch176: bind-9.11-unit-dnstap-pkcs11.patch +#Patch176: bind-9.11-unit-dnstap-pkcs11.patch Patch177: bind-9.11-serve-stale.patch Patch178: bind-9.11-serve-stale-dbfix.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1736762 @@ -571,7 +571,7 @@ are used for building ISC DHCP. #%patch174 -p1 -b .unit-timer %patch174 -p1 -b .json-c %patch175 -p1 -b .rh1709553 -%patch176 -p1 -b .unit-dnstap +#%patch176 -p1 -b .unit-dnstap %patch177 -p1 -b .serve-stale %patch178 -p1 -b .rh1770492 %patch183 -p1 -b .rh1736762-5 @@ -877,7 +877,7 @@ export TSAN_OPTIONS="log_exe_name=true log_path=ThreadSanitizer exitcode=0" fi; popd %endif - +## End of UNITTEST %endif %if %{with SYSTEMTEST} @@ -1608,6 +1608,9 @@ fi; %changelog +* Wed Jan 08 2020 Petr Menšík - 32:9.14.4-1 +- Update to 9.14.4 + * Wed Jan 08 2020 Petr Menšík - 32:9.14.0-1 - Update to 9.14.0, disabled SDB and DLZ diff --git a/sources b/sources index d7c9b81..62a9471 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (bind-9.11.14.tar.gz) = fc7729e780e44c3c4e50059032fdae2af3d0e07b492b5088b2fefc15354829d3c9a83fab4f2ecaa9323cd7a37b1f7eb94890c149ba1df5c4fbea7a145095cbe9 -SHA512 (bind-9.11.14.tar.gz.asc) = fd28a1ebd4adf8c2854de434cc6f5f4d47d982eaad73fbb42dce8df97f7b069feb6e7c374178e203a07fff83f2cd021dfd10fb77dd6e8c5201ee4d299df98b89 +SHA512 (bind-9.14.4.tar.gz) = f5f4dc9b6a1d60838b59ce57ad37dc1e51fa26719aa203405a73850780f06bdc6ecea71c762efd464f946bdcce5a7c324de98caea36d2fe2781cce116fcd4932 From 0990c9b32df826c49eff3599e7519cfa4ae72ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 12:57:55 +0200 Subject: [PATCH 07/79] Remove last lwres remains --- bind.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/bind.spec b/bind.spec index 6f90f56..eda2faf 100644 --- a/bind.spec +++ b/bind.spec @@ -1280,7 +1280,6 @@ fi; %{_sbindir}/named-checkconf %{_bindir}/named-rrchecker %{_bindir}/mdig -%{_sbindir}/lwresd %{_sbindir}/named %{_sbindir}/rndc* %{_libexecdir}/generate-rndc-key.sh @@ -1290,7 +1289,6 @@ fi; %{_mandir}/man5/rndc.conf.5* %{_mandir}/man8/rndc.8* %{_mandir}/man8/named.8* -%{_mandir}/man8/lwresd.8* %{_mandir}/man8/named-checkconf.8* %{_mandir}/man8/rndc-confgen.8* %{_mandir}/man8/named-journalprint.8* From e34707285dc87db079017ece23dd0782bf964cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 13:15:47 +0200 Subject: [PATCH 08/79] Update so version, remove unused patches Remove already deleted patches from the list. Some patches still kept intact. --- bind.spec | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/bind.spec b/bind.spec index eda2faf..37b11d7 100644 --- a/bind.spec +++ b/bind.spec @@ -60,8 +60,8 @@ # # lib*.so.X versions of selected libraries -%global sover_dns 1306 -%global sover_isc 1306 +%global sover_dns 1309 +%global sover_isc 1308 %global sover_irs 1301 %global sover_isccfg 1302 @@ -122,7 +122,6 @@ Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch Patch131:bind-9.9.1-P2-multlib-conflict.patch Patch133:bind99-rh640538.patch -#Patch134:bind97-rh669163.patch # lwres discontinued # Fedora specific patch to distribute native-pkcs#11 functionality Patch136:bind-9.10-dist-native-pkcs11.patch @@ -144,14 +143,6 @@ Patch157:bind-9.11-fips-tests.patch #Patch158:bind-9.11-rt31459.patch # [RT #46047] commit 24172bd2eeba91441ab1c65d2717b0692309244a ISC 4724 #Patch159:bind-9.11-rt46047.patch -# commit 66ba2fdad583d962a1f4971c85d58381f0849e4d -# commit b105ccee68ccc3c18e6ea530063b3c8e5a42571c -# commit 083461d3329ff6f2410745848a926090586a9846 -#Patch160:bind-9.11-rh1624100.patch -# https://gitlab.isc.org/isc-projects/bind9/issues/555 -#Patch161:bind-9.11-host-idn-disable.patch -# https://gitlab.isc.org/isc-projects/bind9/commit/8a98277811e -#Patch163:bind-9.11-rh1663318.patch # https://gitlab.isc.org/isc-projects/bind9/issues/819 Patch164:bind-9.11-rh1666814.patch # random_test fails too often by random, disable it @@ -162,7 +153,6 @@ Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch Patch173:bind-9.11-rh1732883.patch -#Patch174: bind-9.11-unit-timer-nothread.patch # Make sure jsonccp-devel does not interfere Patch174:bind-9.11-json-c.patch Patch175:bind-9.11-fips-disable.patch @@ -1343,7 +1333,7 @@ fi; %files libs %{_libdir}/libbind9.so.1302* %{_libdir}/libisccc.so.1302* -%{_libdir}/libns.so.1304* +%{_libdir}/libns.so.1306* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* From eeb7df78d94b7c294bea3923d70703a23f374228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 14:05:39 +0200 Subject: [PATCH 09/79] Remove no longer distributed tools, include named plugin Includes new functionality as separate loadable library. Currently it uses another directory %{_libdir}/named. bind-dyndb-ldap uses %{_libdir}/bind. --- bind.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bind.spec b/bind.spec index 37b11d7..149e8c2 100644 --- a/bind.spec +++ b/bind.spec @@ -1260,6 +1260,7 @@ fi; %files %{_libdir}/bind +%{_libdir}/named %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/named %config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.root.key %{_tmpfilesdir}/named.conf @@ -1273,6 +1274,7 @@ fi; %{_sbindir}/named %{_sbindir}/rndc* %{_libexecdir}/generate-rndc-key.sh +%{_libdir}/named/filter-aaaa.so %{_mandir}/man1/mdig.1* %{_mandir}/man1/named-rrchecker.1* %{_mandir}/man5/named.conf.5* @@ -1282,6 +1284,7 @@ fi; %{_mandir}/man8/named-checkconf.8* %{_mandir}/man8/rndc-confgen.8* %{_mandir}/man8/named-journalprint.8* +%{_mandir}/man8/filter-aaaa.8.gz %doc CHANGES README named.conf.default %doc doc/arm/*html doc/arm/*pdf %doc sample/ @@ -1354,9 +1357,7 @@ fi; %{_bindir}/arpaname %{_sbindir}/ddns-confgen %{_sbindir}/tsig-keygen -%{_sbindir}/genrandom %{_sbindir}/nsec3hash -%{_sbindir}/isc-hmac-fixup %{_sbindir}/named-checkzone %{_sbindir}/named-compilezone %if %{with DNSTAP} @@ -1375,9 +1376,7 @@ fi; %{_mandir}/man1/arpaname.1* %{_mandir}/man8/ddns-confgen.8* %{_mandir}/man8/tsig-keygen.8* -%{_mandir}/man8/genrandom.8* %{_mandir}/man8/nsec3hash.8* -%{_mandir}/man8/isc-hmac-fixup.8* %{_mandir}/man8/named-checkzone.8* %{_mandir}/man8/named-compilezone.8* %{_sysconfdir}/trusted-key.key From cc967eb09ec2018084f6c09ad717a89f08f09af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 24 Jul 2019 14:28:06 +0200 Subject: [PATCH 10/79] Enable GeoLite2 support Make GeoIP support controlled by bcond, defaults to off now. Instead enable GeoLite2 support. --- bind.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bind.spec b/bind.spec index 149e8c2..46c9a43 100644 --- a/bind.spec +++ b/bind.spec @@ -25,6 +25,10 @@ %bcond_with BDB # skip DLZ for now %bcond_with DLZ +# Legacy GeoIP support +%bcond_with GEOIP +# New MaxMind GeoLite support +%bcond_without GEOIP2 # Support for builds without threads removed. DHCP no longer needs it anyway. %bcond_with EXPORT_LIBS # Legacy GeoIP support @@ -402,6 +406,12 @@ Requires: json-c-devel%{?_isa} %if %{with DNSTAP} Requires: fstrm-devel%{?_isa} protobuf-c-devel%{?_isa} %endif +%if %{with GEOIP} +Requires: GeoIP-devel%{?_isa} +%endif +%if %{with GEOIP2} +Requires: libmaxminddb-devel%{?_isa} +%endif %description lite-devel The bind-lite-devel package contains lite version of the header @@ -1597,6 +1607,7 @@ fi; %changelog * Wed Jan 08 2020 Petr Menšík - 32:9.14.4-1 - Update to 9.14.4 +- Add GeoLite2 support * Wed Jan 08 2020 Petr Menšík - 32:9.14.0-1 - Update to 9.14.0, disabled SDB and DLZ From a6454b966c54dc482d2fdc554a09c44ded84e763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 18 Oct 2019 13:24:50 +0200 Subject: [PATCH 11/79] Update to 9.14.7 Rebase to new sources 14.5: A SipHash 2-4 based DNS Cookie (RFC 7873) algorithm has been added. --- bind-9.14.4.tar.gz.asc | 16 ---------------- bind-9.14.7.tar.gz.asc | 16 ++++++++++++++++ bind.spec | 13 ++++++++----- 3 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 bind-9.14.4.tar.gz.asc create mode 100644 bind-9.14.7.tar.gz.asc diff --git a/bind-9.14.4.tar.gz.asc b/bind-9.14.4.tar.gz.asc deleted file mode 100644 index 46eb6f8..0000000 --- a/bind-9.14.4.tar.gz.asc +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABAgAdFiEErj+seWcR7Fn8AHqkdLtrmky7PTgFAl0u4wkACgkQdLtrmky7 -PThVjxAAgSBMHHL5U/vjlK1ZaNdOlwdG2b48+IYu3TkOnFHoAoX0Zkt12xgdWdHi -ChL645zHeCo16a7OY40wcDhmSa9lIB+M7D7SNNhFAp0Ta2DGKy3mvSloTup/XDeJ -cdb7rOQdvh70nf+YV4NKADP/QvQdAmMOEhNIZzAW2u+LOCcJwVAlaN1cMt2GEYLM -0qhKynPKNWcotA9RnCH3K2eNPT4u8X6MyU1XqA+JHJvwFLwJq6xpV8l7IfHEnK5l -6nhul6IlYAclHtFEw4rADQScQE8Zg2PXtb8Ajn/ml2nXbSjluprAWgHd8aUl2/gV -VZVzGI9ZaZD9a2Vkj9pJcNKWMcGk0tlBME5Sv9BIwx8jna66kze9z0AhaziwDgnV -4Ur+xYo784FzSXoxhwvSQlvbs18TZHTx9vYTg2xUIFO2bjIfdAY2oe2Hegr8u9mj -tCxnOJYE+xLJaj3CsPEoPwDcyV11Swka6+jqsA8ngVb99Y/tct8+BDd6zgjRQaSG -7ETk6Hi09QFAMe2YPy+BwcHhk05SD784Cvs3KH9W7x0uFVIdc7xVs+vwe+5SH/Q3 -IPCKfhk0k4A/dmjYSmKvzkT5UyIdt/VqVYuVFmMFLqs3Xf0F1KUt/3fJJJfGhaOp -tflZWGpR6Gou7TY/kMM35yGz9HnZ5uSWAOUhEQAHG1uKck49GjA= -=DwY1 ------END PGP SIGNATURE----- diff --git a/bind-9.14.7.tar.gz.asc b/bind-9.14.7.tar.gz.asc new file mode 100644 index 0000000..1134ae1 --- /dev/null +++ b/bind-9.14.7.tar.gz.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABAgAdFiEErj+seWcR7Fn8AHqkdLtrmky7PTgFAl2WMpEACgkQdLtrmky7 +PTh/sg//QbNRAQvADQfwF1PPo+JxB+3WzQ9oJAWeHbOoiubwkUwO9xE+BEnTNd5o +oM1lSLqFxNykOTaoeJlqPftPod1cxo7lSzkwflugGyB/59wliCpqCg053YV4x9mO +QggvA/E50+0FI/Om/7v4GHGADu/JE83FovOueWAB0LgqfDSD6QFcNFF9sUJJ4P7r +FcEXSWj8QbrHMWBKncZUOpD2ECotvtrYmi0DTHl1XfigESDQpWtsnTFuabCCsvkh +ch9wQRplAes2Mf/aS5tl1y0QKKBFuEjtGiTdgrDl6o9GLnx6CueX5saZehu2EVkr +fq2vEYUC2lRQSjuxSMMJ3L0TGUcl7+ixlAIISS2K9L5Xx7MhBXt/EH5KiKPfsEet +3EH+DhxV5uXjDU7MgvREnxT+ssV23e0HWTz4tVVQ9LpvYmWPIgLcSOhHCc57yoQF +c46V0f69dMWbMAlQ93EZSG274ZvpIszpK8+3hGI3/TuDFFgiQJeJJBFVtYJMle69 +3mEEclfzO7fBiXZFec6nVx2309bL64bafN7zszPKXl4XgoefOfD0v0eWqQT4fxfm +dnGC0qMqSZs5F+d0fISV5JUUNYzt9PZjvnzqLLGOeTF6l3/n9G1mmNsXcxJ1OEIF +6qh1oO7JTPjt0MFhKac4QjNQi/Bnp25O3I/PRyWZCbiwXkyvyQU= +=ZT7s +-----END PGP SIGNATURE----- diff --git a/bind.spec b/bind.spec index 46c9a43..92240f7 100644 --- a/bind.spec +++ b/bind.spec @@ -64,15 +64,15 @@ # # lib*.so.X versions of selected libraries -%global sover_dns 1309 -%global sover_isc 1308 +%global sover_dns 1310 +%global sover_isc 1309 %global sover_irs 1301 %global sover_isccfg 1302 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.14.4 +Version: 9.14.7 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -1269,6 +1269,7 @@ fi; %endif %files +# TODO: Move from lib/bind to lib/named, as used by upstream %{_libdir}/bind %{_libdir}/named %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/named @@ -1284,7 +1285,6 @@ fi; %{_sbindir}/named %{_sbindir}/rndc* %{_libexecdir}/generate-rndc-key.sh -%{_libdir}/named/filter-aaaa.so %{_mandir}/man1/mdig.1* %{_mandir}/man1/named-rrchecker.1* %{_mandir}/man5/named.conf.5* @@ -1346,7 +1346,7 @@ fi; %files libs %{_libdir}/libbind9.so.1302* %{_libdir}/libisccc.so.1302* -%{_libdir}/libns.so.1306* +%{_libdir}/libns.so.1307* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* @@ -1605,6 +1605,9 @@ fi; %changelog +* Wed Jan 08 2020 Petr Menšík - 32:9.14.7-1 +- Update to 9.14.7 + * Wed Jan 08 2020 Petr Menšík - 32:9.14.4-1 - Update to 9.14.4 - Add GeoLite2 support From 6a048cc0b6733ef198764bbe38a7ba1d271f0bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 18 Oct 2019 22:35:56 +0200 Subject: [PATCH 12/79] Tweaks to PKCS11 support Current build has PKCS11 enabled for both variants, because USE_PKCS11 is configured in config.h. --- bind-9.14-config-pkcs11.patch | 119 +++++++++++++++++++ bind-9.14-disable-isc-pkcs11.patch | 180 +++++++++++++++++++++++++++++ bind.spec | 10 +- 3 files changed, 307 insertions(+), 2 deletions(-) create mode 100644 bind-9.14-config-pkcs11.patch create mode 100644 bind-9.14-disable-isc-pkcs11.patch diff --git a/bind-9.14-config-pkcs11.patch b/bind-9.14-config-pkcs11.patch new file mode 100644 index 0000000..4559fe5 --- /dev/null +++ b/bind-9.14-config-pkcs11.patch @@ -0,0 +1,119 @@ +From 0427e970f0294cadf4dff04021f41e751c713e3c Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Fri, 18 Oct 2019 21:30:52 +0200 +Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h + +Building two variants with the same common code requires to unset +USE_PKCS11 on part of build. That is not possible with config.h value. +Move it as normal define to CDEFINES. +--- + bin/confgen/Makefile.in | 2 +- + bin/dig/Makefile.in | 2 +- + bin/dnssec/Makefile.in | 2 +- + bin/named/Makefile.in | 2 +- + configure.ac | 8 ++++++-- + lib/dns/Makefile.in | 2 +- + lib/ns/Makefile.in | 2 +- + 7 files changed, 12 insertions(+), 8 deletions(-) + +diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in +index dc3a7f6..1e0fe0e 100644 +--- a/bin/confgen/Makefile.in ++++ b/bin/confgen/Makefile.in +@@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ + CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \ + ${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} + +-CDEFINES = ++CDEFINES = @USE_PKCS11@ + CWARNINGS = + + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ +diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in +index 0601939..2317ec0 100644 +--- a/bin/dig/Makefile.in ++++ b/bin/dig/Makefile.in +@@ -21,7 +21,7 @@ CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \ + ${BIND9_INCLUDES} ${ISC_INCLUDES} \ + ${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@ + +-CDEFINES = -DVERSION=\"${VERSION}\" ++CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ + CWARNINGS = + + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ +diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in +index 321058b..1dad340 100644 +--- a/bin/dnssec/Makefile.in ++++ b/bin/dnssec/Makefile.in +@@ -17,7 +17,7 @@ VERSION=@BIND9_VERSION@ + + CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ + +-CDEFINES = -DVERSION=\"${VERSION}\" ++CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ + CWARNINGS = + + DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in +index eecfa76..e5b0d4b 100644 +--- a/bin/named/Makefile.in ++++ b/bin/named/Makefile.in +@@ -49,7 +49,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ + ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ + +-CDEFINES = @CONTRIB_DLZ@ ++CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ + + CWARNINGS = + +diff --git a/configure.ac b/configure.ac +index da6de97..6d4cdcc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -963,9 +963,13 @@ AS_CASE([$enable_native_pkcs11], + AC_SUBST([PKCS11_TEST]) + AC_SUBST([PKCS11_TOOLS]) + ++USE_PKCS11= ++USE_OPENSSL= + AS_CASE([$CRYPTO], +- [pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])], +- [AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])]) ++ [pkcs11],[USE_PKCS11='-DUSE_PKCS11'], ++ [USE_OPENSSL='-DUSE_OPENSSL']) ++AC_SUBST(USE_PKCS11) ++AC_SUBST(USE_OPENSSL) + + # preparation for automake + # AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"]) +diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in +index 60c87a8..9125b10 100644 +--- a/lib/dns/Makefile.in ++++ b/lib/dns/Makefile.in +@@ -30,7 +30,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ + ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + +-CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} ++CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ + + CWARNINGS = + +diff --git a/lib/ns/Makefile.in b/lib/ns/Makefile.in +index a14728d..58d731a 100644 +--- a/lib/ns/Makefile.in ++++ b/lib/ns/Makefile.in +@@ -24,7 +24,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/ns -Iinclude \ + ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + +-CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" ++CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" + + CWARNINGS = + +-- +2.20.1 + diff --git a/bind-9.14-disable-isc-pkcs11.patch b/bind-9.14-disable-isc-pkcs11.patch new file mode 100644 index 0000000..b8ee475 --- /dev/null +++ b/bind-9.14-disable-isc-pkcs11.patch @@ -0,0 +1,180 @@ +From f354e06035a6661b29f665890933c9d0108cd3e5 Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Fri, 18 Oct 2019 21:55:19 +0200 +Subject: [PATCH] Do not define ISC_PKCS11_INCLUDES + +isc library is no longer different. Just dns library is different. +Do not try to use isc-pkcs11 library for no reason. +--- + bin/dnssec-pkcs11/Makefile.in | 8 ++++---- + bin/named-pkcs11/Makefile.in | 10 +++++----- + bin/pkcs11/Makefile.in | 6 +++--- + configure.ac | 15 --------------- + lib/Makefile.in | 2 +- + lib/dns-pkcs11/tests/Makefile.in | 4 ++-- + make/includes.in | 6 ------ + 7 files changed, 15 insertions(+), 36 deletions(-) + +diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in +index 5067ee1..54b9f10 100644 +--- a/bin/dnssec-pkcs11/Makefile.in ++++ b/bin/dnssec-pkcs11/Makefile.in +@@ -15,17 +15,17 @@ VERSION=@BIND9_VERSION@ + + @BIND9_MAKE_INCLUDES@ + +-CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ ++CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ + + CDEFINES = -DVERSION=\"${VERSION}\" + CWARNINGS = + + DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ +-ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ ++ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ + + DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ +-ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ ++ISCDEPLIBS = ../../lib/isc/libisc.@A@ + + DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} + +diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in +index 416e12e..a0e8314 100644 +--- a/bin/named-pkcs11/Makefile.in ++++ b/bin/named-pkcs11/Makefile.in +@@ -43,9 +43,9 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ + DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ + + CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ +- ${NS_INCLUDES} ${DNS_PKCS11_INCLUDES} \ ++ ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} \ + ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ +- ${ISC_PKCS11_INCLUDES} ${DLZDRIVER_INCLUDES} \ ++ ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ + ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ + +@@ -56,15 +56,15 @@ CWARNINGS = + DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ + ISCCCLIBS = ../../lib/isccc/libisccc.@A@ +-ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ +-ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ ++ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ + BIND9LIBS = ../../lib/bind9/libbind9.@A@ + NSLIBS = ../../lib/ns/libns.@A@ + + DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ + ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ + ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@ +-ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ ++ISCDEPLIBS = ../../lib/isc/libisc.@A@ + BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ + NSDEPLIBS = ../../lib/ns/libns.@A@ + +diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in +index 0e542f3..96aec05 100644 +--- a/bin/pkcs11/Makefile.in ++++ b/bin/pkcs11/Makefile.in +@@ -13,13 +13,13 @@ top_srcdir = @top_srcdir@ + + @BIND9_MAKE_INCLUDES@ + +-CINCLUDES = ${ISC_PKCS11_INCLUDES} ++CINCLUDES = ${ISC_INCLUDES} + + CDEFINES = + +-ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ ++ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ + +-ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ ++ISCDEPLIBS = ../../lib/isc/libisc.@A@ + + DEPLIBS = ${ISCDEPLIBS} + +diff --git a/configure.ac b/configure.ac +index 6d4cdcc..39c1d95 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2535,7 +2535,6 @@ if test "X$srcdir" != "X"; then + BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" + BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" + BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" +- BIND9_ISC_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc-pkcs11/include" + BIND9_DNS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns-pkcs11/include" + BIND9_NS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns-pkcs11/include" + else +@@ -3114,20 +3113,6 @@ AC_CONFIG_FILES([ + lib/isc/unix/include/Makefile + lib/isc/unix/include/isc/Makefile + lib/isc/unix/include/pkcs11/Makefile +- lib/isc-pkcs11/pthreads/Makefile +- lib/isc-pkcs11/pthreads/include/Makefile +- lib/isc-pkcs11/pthreads/include/isc/Makefile +- lib/isc-pkcs11/Makefile +- lib/isc-pkcs11/include/Makefile +- lib/isc-pkcs11/include/isc/Makefile +- lib/isc-pkcs11/include/isc/platform.h +- lib/isc-pkcs11/include/pk11/Makefile +- lib/isc-pkcs11/include/pkcs11/Makefile +- lib/isc-pkcs11/tests/Makefile +- lib/isc-pkcs11/unix/Makefile +- lib/isc-pkcs11/unix/include/Makefile +- lib/isc-pkcs11/unix/include/isc/Makefile +- lib/isc-pkcs11/unix/include/pkcs11/Makefile + lib/isccc/Makefile + lib/isccc/include/Makefile + lib/isccc/include/isccc/Makefile +diff --git a/lib/Makefile.in b/lib/Makefile.in +index 439d748..3f655e8 100644 +--- a/lib/Makefile.in ++++ b/lib/Makefile.in +@@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@ + # Attempt to disable parallel processing. + .NOTPARALLEL: + .NO_PARALLEL: +-SUBDIRS = isc isc-pkcs11 isccc dns dns-pkcs11 ns isccfg bind9 irs samples ++SUBDIRS = isc isccc dns dns-pkcs11 ns isccfg bind9 irs samples + TARGETS = + + @BIND9_MAKE_RULES@ +diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in +index 9f78596..ac187c9 100644 +--- a/lib/dns-pkcs11/tests/Makefile.in ++++ b/lib/dns-pkcs11/tests/Makefile.in +@@ -19,8 +19,8 @@ CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} \ + @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ + CDEFINES = -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" + +-ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ +-ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ ++ISCLIBS = ../../isc/libisc.@A@ ++ISCDEPLIBS = ../../isc/libisc.@A@ + DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ + DNSDEPLIBS = ../libdns-pkcs11.@A@ + +diff --git a/make/includes.in b/make/includes.in +index 6e6572b..7b17738 100644 +--- a/make/includes.in ++++ b/make/includes.in +@@ -40,12 +40,6 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ + TEST_INCLUDES = \ + -I${top_srcdir}/lib/tests/include + +-ISC_PKCS11_INCLUDES = @BIND9_ISC_PKCS11_BUILDINCLUDE@ \ +- -I${top_srcdir}/lib/isc-pkcs11 \ +- -I${top_srcdir}/lib/isc-pkcs11/include \ +- -I${top_srcdir}/lib/isc-pkcs11/unix/include \ +- -I${top_srcdir}/lib/isc-pkcs11/pthreads/include +- + DNS_PKCS11_INCLUDES = @BIND9_DNS_PKCS11_BUILDINCLUDE@ \ + -I${top_srcdir}/lib/dns-pkcs11/include + +-- +2.20.1 + diff --git a/bind.spec b/bind.spec index 92240f7..df6cc92 100644 --- a/bind.spec +++ b/bind.spec @@ -126,15 +126,19 @@ Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch Patch131:bind-9.9.1-P2-multlib-conflict.patch Patch133:bind99-rh640538.patch +# Make PKCS11 used only for pkcs11 parts +Patch135:bind-9.14-config-pkcs11.patch # Fedora specific patch to distribute native-pkcs#11 functionality Patch136:bind-9.10-dist-native-pkcs11.patch +# Do not use isc-pkcs11. +# FIXME: should be part of Patch136 +Patch138:bind-9.14-disable-isc-pkcs11.patch +Patch149:bind-9.11-kyua-pkcs11.patch # [ISC-Bugs #42525] non-portable use of strlcat in contrib/sdb/ldap/zone2ldap.c # introduced by https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=fc9f0ac5778f78003a7acc957a23711811fec122 Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch -# [ISC-Bugs #46853] commit cb616c6d5c2ece1fac37fa6e0bca2b53d4043098 ISC 4851 -Patch149:bind-9.11-kyua-pkcs11.patch # Avoid conflicts with OpenSSL PKCS11 engine Patch150:bind-9.11-engine-pkcs11.patch Patch153:bind-9.11-export-suffix.patch @@ -581,11 +585,13 @@ are used for building ISC DHCP. %patch187 -p1 -b .oot-gen %if %{with PKCS11} +%patch135 -p1 -b .config-pkcs11 cp -r bin/named{,-pkcs11} cp -r bin/dnssec{,-pkcs11} cp -r lib/isc{,-pkcs11} cp -r lib/dns{,-pkcs11} %patch136 -p1 -b .dist_pkcs11 +%patch138 -p1 -b .no-isc-pkcs11 %patch149 -p1 -b .kyua-pkcs11 %patch150 -p1 -b .engine-pkcs11 %endif From b4a5bc525b86ea50bbfe298b3e226ecd12518062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Sat, 19 Oct 2019 01:56:53 +0200 Subject: [PATCH 13/79] Create place for documenting changes in upstream --- Changes.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Changes.md diff --git a/Changes.md b/Changes.md new file mode 100644 index 0000000..91e17b4 --- /dev/null +++ b/Changes.md @@ -0,0 +1,12 @@ += Changes in BIND9 package = + +== 9.14 == + +- single thread support removed. Cannot provide bind-export-libs for DHCP +- lwres support completely removed. Both daemon and library +- common parts of daemon moved into libns shared library +- introduced plugin for filtering aaaa responses +- some SDB utilities no longer supported + +=== 9.14.7 === +[notes](https://downloads.isc.org/isc/bind9/9.14.7/RELEASE-NOTES-bind-9.14.7.html) From 05dbc8892854153c60e3b4097cf7b3c99970569b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Sat, 19 Oct 2019 01:51:12 +0200 Subject: [PATCH 14/79] Iterative update, not working properly Fixed PKCS#11 used everywhere. Just custom system to use PKCS11 on part of built tools. FIXME: unit tests not passing, something broken inside. --- bind-9.10-dist-native-pkcs11.patch | 380 ++++++++++++++++------------- bind-9.11-kyua-pkcs11.patch | 68 +----- bind-9.14-config-pkcs11.patch | 61 +++-- bind-9.14-disable-isc-pkcs11.patch | 180 -------------- bind.spec | 5 +- 5 files changed, 275 insertions(+), 419 deletions(-) delete mode 100644 bind-9.14-disable-isc-pkcs11.patch diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index c255fab..c1b479a 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -11,34 +11,56 @@ index 9ad7f62..094775a 100644 @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ plugins tests TARGETS = +diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in +index 1e0fe0e..dc3a7f6 100644 +--- a/bin/confgen/Makefile.in ++++ b/bin/confgen/Makefile.in +@@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ + CINCLUDES = -I${srcdir}/include ${ISC_INCLUDES} ${ISCCC_INCLUDES} \ + ${ISCCFG_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} + +-CDEFINES = @USE_PKCS11@ ++CDEFINES = + CWARNINGS = + + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ +diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in +index 2317ec0..0601939 100644 +--- a/bin/dig/Makefile.in ++++ b/bin/dig/Makefile.in +@@ -21,7 +21,7 @@ CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \ + ${BIND9_INCLUDES} ${ISC_INCLUDES} \ + ${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@ + +-CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ ++CDEFINES = -DVERSION=\"${VERSION}\" + CWARNINGS = + + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index 321058b..5067ee1 100644 +index 1dad340..ffac64e 100644 --- a/bin/dnssec-pkcs11/Makefile.in +++ b/bin/dnssec-pkcs11/Makefile.in -@@ -15,17 +15,17 @@ VERSION=@BIND9_VERSION@ +@@ -15,16 +15,16 @@ VERSION=@BIND9_VERSION@ @BIND9_MAKE_INCLUDES@ -CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ -+CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ ++CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ - CDEFINES = -DVERSION=\"${VERSION}\" + CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ CWARNINGS = -DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ --ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ --ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -+ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ + ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ --ISCDEPLIBS = ../../lib/isc/libisc.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ -+ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ + ISCDEPLIBS = ../../lib/isc/libisc.@A@ DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} - @@ -34,11 +34,11 @@ LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@ NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@ @@ -131,47 +153,57 @@ index 321058b..5067ee1 100644 for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done clean distclean:: +diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in +index 1dad340..321058b 100644 +--- a/bin/dnssec/Makefile.in ++++ b/bin/dnssec/Makefile.in +@@ -17,7 +17,7 @@ VERSION=@BIND9_VERSION@ + + CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ + +-CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ ++CDEFINES = -DVERSION=\"${VERSION}\" + CWARNINGS = + + DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index eecfa76..416e12e 100644 +index e5b0d4b..b739869 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in -@@ -43,9 +43,9 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ +@@ -43,7 +43,7 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${NS_INCLUDES} ${DNS_INCLUDES} \ -+ ${NS_INCLUDES} ${DNS_PKCS11_INCLUDES} \ ++ ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} \ ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ -- ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ -+ ${ISC_PKCS11_INCLUDES} ${DLZDRIVER_INCLUDES} \ + ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ - -@@ -53,18 +53,18 @@ CDEFINES = @CONTRIB_DLZ@ +@@ -53,37 +53,37 @@ CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ CWARNINGS = -DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCLIBS = ../../lib/isccc/libisccc.@A@ --ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ --ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -+ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ + ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ BIND9LIBS = ../../lib/bind9/libbind9.@A@ - NSLIBS = ../../lib/ns/libns.@A@ +-NSLIBS = ../../lib/ns/libns.@A@ ++NSLIBS = ../../lib/ns-pkcs11/libns-pkcs11.@A@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@ --ISCDEPLIBS = ../../lib/isc/libisc.@A@ -+ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ + ISCDEPLIBS = ../../lib/isc/libisc.@A@ BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ - NSDEPLIBS = ../../lib/ns/libns.@A@ +-NSDEPLIBS = ../../lib/ns/libns.@A@ ++NSDEPLIBS = ../../lib/ns-pkcs11/libns-pkcs11.@A@ -@@ -73,17 +73,17 @@ DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ + DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ + ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS} LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \ @@ -247,32 +279,24 @@ index eecfa76..416e12e 100644 @DLZ_DRIVER_RULES@ -diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index 96aec05..0e542f3 100644 ---- a/bin/pkcs11/Makefile.in -+++ b/bin/pkcs11/Makefile.in -@@ -13,13 +13,13 @@ top_srcdir = @top_srcdir@ +diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in +index e5b0d4b..eecfa76 100644 +--- a/bin/named/Makefile.in ++++ b/bin/named/Makefile.in +@@ -49,7 +49,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ + ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ - @BIND9_MAKE_INCLUDES@ +-CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ ++CDEFINES = @CONTRIB_DLZ@ --CINCLUDES = ${ISC_INCLUDES} -+CINCLUDES = ${ISC_PKCS11_INCLUDES} - - CDEFINES = - --ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ - --ISCDEPLIBS = ../../lib/isc/libisc.@A@ -+ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ - - DEPLIBS = ${ISCDEPLIBS} + CWARNINGS = diff --git a/configure.ac b/configure.ac -index 29106cb..3dff344 100644 +index 6cce3bb..d80ae31 100644 --- a/configure.ac +++ b/configure.ac -@@ -1267,12 +1267,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1276,12 +1276,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" @@ -287,37 +311,34 @@ index 29106cb..3dff344 100644 # # was --with-lmdb specified? -@@ -2542,6 +2544,9 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) +@@ -2522,6 +2524,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) AC_SUBST(BIND9_NS_BUILDINCLUDE) AC_SUBST(BIND9_BIND9_BUILDINCLUDE) AC_SUBST(BIND9_IRS_BUILDINCLUDE) -+AC_SUBST(BIND9_ISC_PKCS11_BUILDINCLUDE) +AC_SUBST(BIND9_DNS_PKCS11_BUILDINCLUDE) +AC_SUBST(BIND9_NS_PKCS11_BUILDINCLUDE) if test "X$srcdir" != "X"; then BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" -@@ -2550,6 +2555,9 @@ if test "X$srcdir" != "X"; then +@@ -2530,6 +2534,8 @@ if test "X$srcdir" != "X"; then BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" -+ BIND9_ISC_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc-pkcs11/include" + BIND9_DNS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns-pkcs11/include" + BIND9_NS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns-pkcs11/include" else BIND9_ISC_BUILDINCLUDE="" BIND9_ISCCC_BUILDINCLUDE="" -@@ -2558,6 +2566,9 @@ else +@@ -2538,6 +2544,8 @@ else BIND9_NS_BUILDINCLUDE="" BIND9_BIND9_BUILDINCLUDE="" BIND9_IRS_BUILDINCLUDE="" -+ BIND9_ISC_PKCS11_BUILDINCLUDE="" + BIND9_DNS_PKCS11_BUILDINCLUDE="" + BIND9_NS_PKCS11_BUILDINCLUDE="" fi AC_SUBST_FILE(BIND9_MAKE_INCLUDES) -@@ -3021,8 +3032,11 @@ AC_CONFIG_FILES([ +@@ -3001,8 +3009,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile @@ -329,7 +350,7 @@ index 29106cb..3dff344 100644 bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile -@@ -3095,6 +3109,10 @@ AC_CONFIG_FILES([ +@@ -3075,6 +3086,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -340,29 +361,19 @@ index 29106cb..3dff344 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -3115,6 +3133,20 @@ AC_CONFIG_FILES([ - lib/isc/unix/include/Makefile - lib/isc/unix/include/isc/Makefile - lib/isc/unix/include/pkcs11/Makefile -+ lib/isc-pkcs11/pthreads/Makefile -+ lib/isc-pkcs11/pthreads/include/Makefile -+ lib/isc-pkcs11/pthreads/include/isc/Makefile -+ lib/isc-pkcs11/Makefile -+ lib/isc-pkcs11/include/Makefile -+ lib/isc-pkcs11/include/isc/Makefile -+ lib/isc-pkcs11/include/isc/platform.h -+ lib/isc-pkcs11/include/pk11/Makefile -+ lib/isc-pkcs11/include/pkcs11/Makefile -+ lib/isc-pkcs11/tests/Makefile -+ lib/isc-pkcs11/unix/Makefile -+ lib/isc-pkcs11/unix/include/Makefile -+ lib/isc-pkcs11/unix/include/isc/Makefile -+ lib/isc-pkcs11/unix/include/pkcs11/Makefile - lib/isccc/Makefile - lib/isccc/include/Makefile - lib/isccc/include/isccc/Makefile +@@ -3107,6 +3122,10 @@ AC_CONFIG_FILES([ + lib/ns/include/Makefile + lib/ns/include/ns/Makefile + lib/ns/tests/Makefile ++ lib/ns-pkcs11/Makefile ++ lib/ns-pkcs11/include/Makefile ++ lib/ns-pkcs11/include/ns/Makefile ++ lib/ns-pkcs11/tests/Makefile + lib/samples/Makefile + lib/samples/Makefile-postinstall + unit/unittest.sh diff --git a/lib/Makefile.in b/lib/Makefile.in -index ffa2d5a..439d748 100644 +index ffa2d5a..6fbc192 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@ @@ -370,36 +381,28 @@ index ffa2d5a..439d748 100644 .NOTPARALLEL: .NO_PARALLEL: -SUBDIRS = isc isccc dns ns isccfg bind9 irs samples -+SUBDIRS = isc isc-pkcs11 isccc dns dns-pkcs11 ns isccfg bind9 irs samples ++SUBDIRS = isc isccc dns dns-pkcs11 ns ns-pkcs11 isccfg bind9 irs samples TARGETS = @BIND9_MAKE_RULES@ diff --git a/lib/dns-pkcs11/Makefile.in b/lib/dns-pkcs11/Makefile.in -index 60c87a8..50da232 100644 +index 9125b10..593270d 100644 --- a/lib/dns-pkcs11/Makefile.in +++ b/lib/dns-pkcs11/Makefile.in -@@ -26,17 +26,17 @@ VERSION=@BIND9_VERSION@ +@@ -26,11 +26,11 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ -CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ -- ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ +CINCLUDES = -I. -I${top_srcdir}/lib/dns-pkcs11 -Iinclude ${DNS_PKCS11_INCLUDES} \ -+ ${ISC_PKCS11_INCLUDES} ${MAXMINDDB_CFLAGS} \ + ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ - CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} +-CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ ++CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_PKCS11@ -DUSE_OPENSSL=0 CWARNINGS = --ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ - --ISCDEPLIBS = ../../lib/isc/libisc.@A@ -+ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ - - LIBS = ${MAXMINDDB_LIBS} @LIBS@ - @@ -138,15 +138,15 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -420,13 +423,7 @@ index 60c87a8..50da232 100644 include: gen ${MAKE} include/dns/enumtype.h -@@ -172,27 +172,27 @@ code.h: gen - ./gen -s ${srcdir} > code.h || { rm -f $@ ; exit 1; } - - gen: gen.c -- ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \ -+ ${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc-pkcs11/include \ - ${LFS_CFLAGS} ${LFS_LDFLAGS} \ +@@ -177,22 +177,22 @@ gen: gen.c ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \ ${BUILD_LIBS} ${LFS_LIBS} @@ -454,100 +451,155 @@ index 60c87a8..50da232 100644 rm -f gen code.h include/dns/enumtype.h include/dns/enumclass.h rm -f include/dns/rdatastruct.h rm -f dnstap.pb-c.c dnstap.pb-c.h -diff --git a/lib/isc-pkcs11/Makefile.in b/lib/isc-pkcs11/Makefile.in -index ed87279..3171b48 100644 ---- a/lib/isc-pkcs11/Makefile.in -+++ b/lib/isc-pkcs11/Makefile.in -@@ -20,7 +20,7 @@ VERSION=@BIND9_VERSION@ - CINCLUDES = -I${srcdir}/unix/include \ - -I${srcdir}/pthreads/include \ - -I./include \ -- -I${srcdir}/include ${DNS_INCLUDES} @OPENSSL_INCLUDES@ -+ -I${srcdir}/include ${DNS_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ - CDEFINES = +diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in +index 0e91523..9351c3f 100644 +--- a/lib/dns-pkcs11/tests/Makefile.in ++++ b/lib/dns-pkcs11/tests/Makefile.in +@@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ + + @BIND9_MAKE_INCLUDES@ + +-CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \ ++CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ + @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +-CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\"" ++CDEFINES = @USE_PKCS11@ -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" + + ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ + ISCDEPLIBS = ../../isc/libisc.@A@ +-DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSDEPLIBS = ../libdns.@A@ ++DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ++DNSDEPLIBS = ../libdns-pkcs11.@A@ + + LIBS = @LIBS@ @CMOCKA_LIBS@ + +diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in +index 9125b10..70644d8 100644 +--- a/lib/dns/Makefile.in ++++ b/lib/dns/Makefile.in +@@ -30,7 +30,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ + ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + +-CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ ++CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ + CWARNINGS = -@@ -94,40 +94,40 @@ version.@O@: version.c +diff --git a/lib/ns-pkcs11/Makefile.in b/lib/ns-pkcs11/Makefile.in +index 58d731a..47b4b98 100644 +--- a/lib/ns-pkcs11/Makefile.in ++++ b/lib/ns-pkcs11/Makefile.in +@@ -20,8 +20,8 @@ VERSION=@BIND9_VERSION@ + + USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ + +-CINCLUDES = -I. -I${top_srcdir}/lib/ns -Iinclude \ +- ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ ++CINCLUDES = -I. -I${top_srcdir}/lib/ns-pkcs11 -Iinclude \ ++ ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + + CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" +@@ -32,9 +32,9 @@ ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ + + ISCDEPLIBS = ../../lib/isc/libisc.@A@ + +-DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ + +-DNSDEPLIBS = ../../lib/dns/libdns.@A@ ++DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ + + LIBS = @LIBS@ + +@@ -66,28 +66,28 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c --libisc.@SA@: ${OBJS} ${SYMTBLOBJS} -+libisc-pkcs11.@SA@: ${OBJS} ${SYMTBLOBJS} - ${AR} ${ARFLAGS} $@ ${OBJS} ${SYMTBLOBJS} - ${RANLIB} $@ - --libisc-nosymtbl.@SA@: ${OBJS} -+libisc-pkcs11-nosymtbl.@SA@: ${OBJS} +-libns.@SA@: ${OBJS} ++libns-pkcs11.@SA@: ${OBJS} ${AR} ${ARFLAGS} $@ ${OBJS} ${RANLIB} $@ --libisc.la: ${OBJS} ${SYMTBLOBJS} -+libisc-pkcs11.la: ${OBJS} ${SYMTBLOBJS} +-libns.la: ${OBJS} ++libns-pkcs11.la: ${OBJS} ${LIBTOOL_MODE_LINK} \ -- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc.la -rpath ${libdir} \ -+ ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc-pkcs11.la -rpath ${libdir} \ +- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libns.la -rpath ${libdir} \ ++ ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libns-pkcs11.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ - ${OBJS} ${SYMTBLOBJS} ${LIBS} +- ${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS} ++ ${OBJS} ${ISCLIBS} @DNS_CRYPTO_PK11_LIBS@ ${LIBS} --libisc-nosymtbl.la: ${OBJS} -+libisc-pkcs11-nosymtbl.la: ${OBJS} - ${LIBTOOL_MODE_LINK} \ -- ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc-nosymtbl.la -rpath ${libdir} \ -+ ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libisc-pkcs11-nosymtbl.la -rpath ${libdir} \ - -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ - ${OBJS} ${LIBS} - --timestamp: libisc.@A@ libisc-nosymtbl.@A@ -+timestamp: libisc-pkcs11.@A@ libisc-pkcs11-nosymtbl.@A@ +-timestamp: libns.@A@ ++timestamp: libns-pkcs11.@A@ touch timestamp --testdirs: libisc.@A@ libisc-nosymtbl.@A@ -+testdirs: libisc-pkcs11.@A@ libisc-pkcs11-nosymtbl.@A@ - installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir} install:: timestamp installdirs -- ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libisc.@A@ ${DESTDIR}${libdir} -+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libisc-pkcs11.@A@ ${DESTDIR}${libdir} +- ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libns.@A@ \ ++ ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libns-pkcs11.@A@ \ + ${DESTDIR}${libdir} uninstall:: -- ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${libdir}/libisc.@A@ -+ ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${libdir}/libisc-pkcs11.@A@ +- ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${libdir}/libns.@A@ ++ ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${libdir}/libns-pkcs11.@A@ clean distclean:: -- rm -f libisc.@A@ libisc-nosymtbl.@A@ libisc.la \ -- libisc-nosymtbl.la timestamp -+ rm -f libisc-pkcs11.@A@ libisc-pkcs11-nosymtbl.@A@ libisc-pkcs11.la \ -+ libisc-pkcs11-nosymtbl.la timestamp -diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in -index 5735829..7e62737 100644 ---- a/lib/isc-pkcs11/tests/Makefile.in -+++ b/lib/isc-pkcs11/tests/Makefile.in -@@ -18,7 +18,7 @@ VERSION=@BIND9_VERSION@ - CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ - CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\"" +- rm -f libns.@A@ timestamp ++ rm -f libns-pkcs11.@A@ timestamp +diff --git a/lib/ns-pkcs11/tests/Makefile.in b/lib/ns-pkcs11/tests/Makefile.in +index ffd8f41..4a6cb1b 100644 +--- a/lib/ns-pkcs11/tests/Makefile.in ++++ b/lib/ns-pkcs11/tests/Makefile.in +@@ -15,16 +15,16 @@ VERSION=@BIND9_VERSION@ --ISCLIBS = ../libisc.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../libisc-pkcs11.@A@ @OPENSSL_LIBS@ - ISCDEPLIBS = ../libisc.@A@ + @BIND9_MAKE_INCLUDES@ + +-CINCLUDES = -I. -Iinclude ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ ++CINCLUDES = -I. -Iinclude ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ + @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ +-CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" ++CDEFINES = @USE_PKCS11@ -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" + + ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ + ISCDEPLIBS = ../../isc/libisc.@A@ +-DNSLIBS = ../../dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSDEPLIBS = ../../dns/libdns.@A@ +-NSLIBS = ../libns.@A@ +-NSDEPLIBS = ../libns.@A@ ++DNSLIBS = ../../dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ++DNSDEPLIBS = ../../dns-pkcs11/libdns-pkcs11.@A@ ++NSLIBS = ../libns-pkcs11.@A@ ++NSDEPLIBS = ../libns-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ + +diff --git a/lib/ns/Makefile.in b/lib/ns/Makefile.in +index 58d731a..a14728d 100644 +--- a/lib/ns/Makefile.in ++++ b/lib/ns/Makefile.in +@@ -24,7 +24,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/ns -Iinclude \ + ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ + @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + +-CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" ++CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" + + CWARNINGS = + diff --git a/make/includes.in b/make/includes.in -index 48cdaf7..6e6572b 100644 +index 48cdaf7..7b17738 100644 --- a/make/includes.in +++ b/make/includes.in -@@ -39,3 +39,16 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ +@@ -39,3 +39,10 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ TEST_INCLUDES = \ -I${top_srcdir}/lib/tests/include + -+ISC_PKCS11_INCLUDES = @BIND9_ISC_PKCS11_BUILDINCLUDE@ \ -+ -I${top_srcdir}/lib/isc-pkcs11 \ -+ -I${top_srcdir}/lib/isc-pkcs11/include \ -+ -I${top_srcdir}/lib/isc-pkcs11/unix/include \ -+ -I${top_srcdir}/lib/isc-pkcs11/pthreads/include -+ +DNS_PKCS11_INCLUDES = @BIND9_DNS_PKCS11_BUILDINCLUDE@ \ + -I${top_srcdir}/lib/dns-pkcs11/include + diff --git a/bind-9.11-kyua-pkcs11.patch b/bind-9.11-kyua-pkcs11.patch index 95e9843..ea9a51a 100644 --- a/bind-9.11-kyua-pkcs11.patch +++ b/bind-9.11-kyua-pkcs11.patch @@ -1,4 +1,4 @@ -From f0ce2b4855b70f1fb04394b35626c37ebb0a8c75 Mon Sep 17 00:00:00 2001 +From 1241f2005d08673c28a595c5a6cd61350b95a929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 2 Jan 2018 18:13:07 +0100 Subject: [PATCH] Fix pkcs11 variants atf tests @@ -7,18 +7,16 @@ Add dns-pkcs11 tests Makefile to configure Add pkcs11 Kyuafile, fix dh_test to pass in pkcs11 mode --- - configure.ac | 1 + - lib/Kyuafile | 2 ++ - lib/dns-pkcs11/tests/Makefile.in | 12 ++++++------ - lib/dns-pkcs11/tests/dh_test.c | 3 ++- - lib/isc-pkcs11/tests/Makefile.in | 6 +++--- - 5 files changed, 14 insertions(+), 10 deletions(-) + configure.ac | 1 + + lib/Kyuafile | 2 ++ + lib/dns-pkcs11/tests/dh_test.c | 3 ++- + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 3dff344..424a542 100644 +index d80ae31..0fb9328 100644 --- a/configure.ac +++ b/configure.ac -@@ -3113,6 +3113,7 @@ AC_CONFIG_FILES([ +@@ -3090,6 +3090,7 @@ AC_CONFIG_FILES([ lib/dns-pkcs11/include/Makefile lib/dns-pkcs11/include/dns/Makefile lib/dns-pkcs11/include/dst/Makefile @@ -27,7 +25,7 @@ index 3dff344..424a542 100644 lib/irs/include/Makefile lib/irs/include/irs/Makefile diff --git a/lib/Kyuafile b/lib/Kyuafile -index 39ce986..dcfb139 100644 +index 39ce986..037e5ef 100644 --- a/lib/Kyuafile +++ b/lib/Kyuafile @@ -2,8 +2,10 @@ syntax(2) @@ -37,40 +35,15 @@ index 39ce986..dcfb139 100644 +include('dns-pkcs11/Kyuafile') include('irs/Kyuafile') include('isc/Kyuafile') -+include('isc-pkcs11/Kyuafile') include('isccc/Kyuafile') include('isccfg/Kyuafile') include('ns/Kyuafile') -diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index eb297c9..144d6b2 100644 ---- a/lib/dns-pkcs11/tests/Makefile.in -+++ b/lib/dns-pkcs11/tests/Makefile.in -@@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ - - @BIND9_MAKE_INCLUDES@ - --CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \ -+CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} \ - @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ --CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\"" -+CDEFINES = -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" - --ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ --ISCDEPLIBS = ../../isc/libisc.@A@ --DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ --DNSDEPLIBS = ../libdns.@A@ -+ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ -+ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ -+DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSDEPLIBS = ../libdns-pkcs11.@A@ - - LIBS = @LIBS@ @CMOCKA_LIBS@ - ++include('ns-pkcs11/Kyuafile') diff --git a/lib/dns-pkcs11/tests/dh_test.c b/lib/dns-pkcs11/tests/dh_test.c -index d83d9f5..d5bda29 100644 +index 934e8fd..658d1af 100644 --- a/lib/dns-pkcs11/tests/dh_test.c +++ b/lib/dns-pkcs11/tests/dh_test.c -@@ -85,7 +85,8 @@ dh_computesecret(void **state) { +@@ -87,7 +87,8 @@ dh_computesecret(void **state) { result = dst_key_computesecret(key, key, &buf); assert_int_equal(result, DST_R_NOTPRIVATEKEY); result = key->func->computesecret(key, key, &buf); @@ -80,25 +53,6 @@ index d83d9f5..d5bda29 100644 dst_key_free(&key); } -diff --git a/lib/isc-pkcs11/tests/Makefile.in b/lib/isc-pkcs11/tests/Makefile.in -index 7e62737..e91cd67 100644 ---- a/lib/isc-pkcs11/tests/Makefile.in -+++ b/lib/isc-pkcs11/tests/Makefile.in -@@ -15,11 +15,11 @@ VERSION=@BIND9_VERSION@ - - @BIND9_MAKE_INCLUDES@ - --CINCLUDES = -I. -Iinclude ${ISC_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ --CDEFINES = -DTESTS="\"${top_builddir}/lib/isc/tests/\"" -+CINCLUDES = -I. -Iinclude ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ -+CDEFINES = -DTESTS="\"${top_builddir}/lib/isc-pkcs11/tests/\"" - - ISCLIBS = ../libisc-pkcs11.@A@ @OPENSSL_LIBS@ --ISCDEPLIBS = ../libisc.@A@ -+ISCDEPLIBS = ../libisc-pkcs11.@A@ - - LIBS = @LIBS@ @CMOCKA_LIBS@ - -- 2.20.1 diff --git a/bind-9.14-config-pkcs11.patch b/bind-9.14-config-pkcs11.patch index 4559fe5..cf73a1c 100644 --- a/bind-9.14-config-pkcs11.patch +++ b/bind-9.14-config-pkcs11.patch @@ -1,4 +1,4 @@ -From 0427e970f0294cadf4dff04021f41e751c713e3c Mon Sep 17 00:00:00 2001 +From 233d3784d04bee37b772f391da8726f0cd7b223e Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 18 Oct 2019 21:30:52 +0200 Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h @@ -7,14 +7,15 @@ Building two variants with the same common code requires to unset USE_PKCS11 on part of build. That is not possible with config.h value. Move it as normal define to CDEFINES. --- - bin/confgen/Makefile.in | 2 +- - bin/dig/Makefile.in | 2 +- - bin/dnssec/Makefile.in | 2 +- - bin/named/Makefile.in | 2 +- - configure.ac | 8 ++++++-- - lib/dns/Makefile.in | 2 +- - lib/ns/Makefile.in | 2 +- - 7 files changed, 12 insertions(+), 8 deletions(-) + bin/confgen/Makefile.in | 2 +- + bin/dig/Makefile.in | 2 +- + bin/dnssec/Makefile.in | 2 +- + bin/named/Makefile.in | 2 +- + configure.ac | 8 ++++++-- + lib/dns/Makefile.in | 2 +- + lib/dns/dst_internal.h | 12 +++++++++--- + lib/ns/Makefile.in | 2 +- + 8 files changed, 21 insertions(+), 11 deletions(-) diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in index dc3a7f6..1e0fe0e 100644 @@ -69,20 +70,20 @@ index eecfa76..e5b0d4b 100644 CWARNINGS = diff --git a/configure.ac b/configure.ac -index da6de97..6d4cdcc 100644 +index 80039b7..6cce3bb 100644 --- a/configure.ac +++ b/configure.ac @@ -963,9 +963,13 @@ AS_CASE([$enable_native_pkcs11], AC_SUBST([PKCS11_TEST]) AC_SUBST([PKCS11_TOOLS]) -+USE_PKCS11= -+USE_OPENSSL= ++USE_PKCS11='-DUSE_PKCS11=0' ++USE_OPENSSL='-DUSE_OPENSSL=0' AS_CASE([$CRYPTO], - [pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])], - [AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])]) -+ [pkcs11],[USE_PKCS11='-DUSE_PKCS11'], -+ [USE_OPENSSL='-DUSE_OPENSSL']) ++ [pkcs11],[USE_PKCS11='-DUSE_PKCS11=1'], ++ [USE_OPENSSL='-DUSE_OPENSSL=1']) +AC_SUBST(USE_PKCS11) +AC_SUBST(USE_OPENSSL) @@ -101,6 +102,38 @@ index 60c87a8..9125b10 100644 CWARNINGS = +diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h +index bfa28f0..d3ff613 100644 +--- a/lib/dns/dst_internal.h ++++ b/lib/dns/dst_internal.h +@@ -40,6 +40,13 @@ + #include + #include + ++#ifndef USE_OPENSSL ++#define USE_OPENSSL 1 ++#endif ++#ifndef USE_PKCS11 ++#define USE_PKCS11 0 ++#endif ++ + #if USE_PKCS11 + #include + #include +@@ -99,11 +106,10 @@ struct dst_key { + void *generic; + gss_ctx_id_t gssctx; + DH *dh; +-#if USE_OPENSSL +- EVP_PKEY *pkey; +-#endif + #if USE_PKCS11 + pk11_object_t *pkey; ++#else ++ EVP_PKEY *pkey; + #endif + dst_hmac_key_t *hmac_key; + } keydata; /*%< pointer to key in crypto pkg fmt */ diff --git a/lib/ns/Makefile.in b/lib/ns/Makefile.in index a14728d..58d731a 100644 --- a/lib/ns/Makefile.in diff --git a/bind-9.14-disable-isc-pkcs11.patch b/bind-9.14-disable-isc-pkcs11.patch deleted file mode 100644 index b8ee475..0000000 --- a/bind-9.14-disable-isc-pkcs11.patch +++ /dev/null @@ -1,180 +0,0 @@ -From f354e06035a6661b29f665890933c9d0108cd3e5 Mon Sep 17 00:00:00 2001 -From: Petr Mensik -Date: Fri, 18 Oct 2019 21:55:19 +0200 -Subject: [PATCH] Do not define ISC_PKCS11_INCLUDES - -isc library is no longer different. Just dns library is different. -Do not try to use isc-pkcs11 library for no reason. ---- - bin/dnssec-pkcs11/Makefile.in | 8 ++++---- - bin/named-pkcs11/Makefile.in | 10 +++++----- - bin/pkcs11/Makefile.in | 6 +++--- - configure.ac | 15 --------------- - lib/Makefile.in | 2 +- - lib/dns-pkcs11/tests/Makefile.in | 4 ++-- - make/includes.in | 6 ------ - 7 files changed, 15 insertions(+), 36 deletions(-) - -diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index 5067ee1..54b9f10 100644 ---- a/bin/dnssec-pkcs11/Makefile.in -+++ b/bin/dnssec-pkcs11/Makefile.in -@@ -15,17 +15,17 @@ VERSION=@BIND9_VERSION@ - - @BIND9_MAKE_INCLUDES@ - --CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} @OPENSSL_INCLUDES@ -+CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ - - CDEFINES = -DVERSION=\"${VERSION}\" - CWARNINGS = - - DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ --ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ --ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ -+ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ - - DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ --ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ -+ISCDEPLIBS = ../../lib/isc/libisc.@A@ - - DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} - -diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index 416e12e..a0e8314 100644 ---- a/bin/named-pkcs11/Makefile.in -+++ b/bin/named-pkcs11/Makefile.in -@@ -43,9 +43,9 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ - DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ - - CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ -- ${NS_INCLUDES} ${DNS_PKCS11_INCLUDES} \ -+ ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} \ - ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ -- ${ISC_PKCS11_INCLUDES} ${DLZDRIVER_INCLUDES} \ -+ ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ - ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ - -@@ -56,15 +56,15 @@ CWARNINGS = - DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ - ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ - ISCCCLIBS = ../../lib/isccc/libisccc.@A@ --ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ --ISCNOSYMLIBS = ../../lib/isc-pkcs11/libisc-pkcs11-nosymtbl.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ -+ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ - BIND9LIBS = ../../lib/bind9/libbind9.@A@ - NSLIBS = ../../lib/ns/libns.@A@ - - DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ - ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ - ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@ --ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ -+ISCDEPLIBS = ../../lib/isc/libisc.@A@ - BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ - NSDEPLIBS = ../../lib/ns/libns.@A@ - -diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index 0e542f3..96aec05 100644 ---- a/bin/pkcs11/Makefile.in -+++ b/bin/pkcs11/Makefile.in -@@ -13,13 +13,13 @@ top_srcdir = @top_srcdir@ - - @BIND9_MAKE_INCLUDES@ - --CINCLUDES = ${ISC_PKCS11_INCLUDES} -+CINCLUDES = ${ISC_INCLUDES} - - CDEFINES = - --ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ @OPENSSL_LIBS@ -+ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ - --ISCDEPLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@ -+ISCDEPLIBS = ../../lib/isc/libisc.@A@ - - DEPLIBS = ${ISCDEPLIBS} - -diff --git a/configure.ac b/configure.ac -index 6d4cdcc..39c1d95 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2535,7 +2535,6 @@ if test "X$srcdir" != "X"; then - BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" - BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" - BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" -- BIND9_ISC_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc-pkcs11/include" - BIND9_DNS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/dns-pkcs11/include" - BIND9_NS_PKCS11_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns-pkcs11/include" - else -@@ -3114,20 +3113,6 @@ AC_CONFIG_FILES([ - lib/isc/unix/include/Makefile - lib/isc/unix/include/isc/Makefile - lib/isc/unix/include/pkcs11/Makefile -- lib/isc-pkcs11/pthreads/Makefile -- lib/isc-pkcs11/pthreads/include/Makefile -- lib/isc-pkcs11/pthreads/include/isc/Makefile -- lib/isc-pkcs11/Makefile -- lib/isc-pkcs11/include/Makefile -- lib/isc-pkcs11/include/isc/Makefile -- lib/isc-pkcs11/include/isc/platform.h -- lib/isc-pkcs11/include/pk11/Makefile -- lib/isc-pkcs11/include/pkcs11/Makefile -- lib/isc-pkcs11/tests/Makefile -- lib/isc-pkcs11/unix/Makefile -- lib/isc-pkcs11/unix/include/Makefile -- lib/isc-pkcs11/unix/include/isc/Makefile -- lib/isc-pkcs11/unix/include/pkcs11/Makefile - lib/isccc/Makefile - lib/isccc/include/Makefile - lib/isccc/include/isccc/Makefile -diff --git a/lib/Makefile.in b/lib/Makefile.in -index 439d748..3f655e8 100644 ---- a/lib/Makefile.in -+++ b/lib/Makefile.in -@@ -15,7 +15,7 @@ top_srcdir = @top_srcdir@ - # Attempt to disable parallel processing. - .NOTPARALLEL: - .NO_PARALLEL: --SUBDIRS = isc isc-pkcs11 isccc dns dns-pkcs11 ns isccfg bind9 irs samples -+SUBDIRS = isc isccc dns dns-pkcs11 ns isccfg bind9 irs samples - TARGETS = - - @BIND9_MAKE_RULES@ -diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index 9f78596..ac187c9 100644 ---- a/lib/dns-pkcs11/tests/Makefile.in -+++ b/lib/dns-pkcs11/tests/Makefile.in -@@ -19,8 +19,8 @@ CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_PKCS11_INCLUDES} \ - @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ - CDEFINES = -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" - --ISCLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ --ISCDEPLIBS = ../../isc-pkcs11/libisc-pkcs11.@A@ -+ISCLIBS = ../../isc/libisc.@A@ -+ISCDEPLIBS = ../../isc/libisc.@A@ - DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ - DNSDEPLIBS = ../libdns-pkcs11.@A@ - -diff --git a/make/includes.in b/make/includes.in -index 6e6572b..7b17738 100644 ---- a/make/includes.in -+++ b/make/includes.in -@@ -40,12 +40,6 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ - TEST_INCLUDES = \ - -I${top_srcdir}/lib/tests/include - --ISC_PKCS11_INCLUDES = @BIND9_ISC_PKCS11_BUILDINCLUDE@ \ -- -I${top_srcdir}/lib/isc-pkcs11 \ -- -I${top_srcdir}/lib/isc-pkcs11/include \ -- -I${top_srcdir}/lib/isc-pkcs11/unix/include \ -- -I${top_srcdir}/lib/isc-pkcs11/pthreads/include -- - DNS_PKCS11_INCLUDES = @BIND9_DNS_PKCS11_BUILDINCLUDE@ \ - -I${top_srcdir}/lib/dns-pkcs11/include - --- -2.20.1 - diff --git a/bind.spec b/bind.spec index df6cc92..538202b 100644 --- a/bind.spec +++ b/bind.spec @@ -131,8 +131,6 @@ Patch135:bind-9.14-config-pkcs11.patch # Fedora specific patch to distribute native-pkcs#11 functionality Patch136:bind-9.10-dist-native-pkcs11.patch # Do not use isc-pkcs11. -# FIXME: should be part of Patch136 -Patch138:bind-9.14-disable-isc-pkcs11.patch Patch149:bind-9.11-kyua-pkcs11.patch # [ISC-Bugs #42525] non-portable use of strlcat in contrib/sdb/ldap/zone2ldap.c @@ -588,10 +586,9 @@ are used for building ISC DHCP. %patch135 -p1 -b .config-pkcs11 cp -r bin/named{,-pkcs11} cp -r bin/dnssec{,-pkcs11} -cp -r lib/isc{,-pkcs11} cp -r lib/dns{,-pkcs11} +cp -r lib/ns{,-pkcs11} %patch136 -p1 -b .dist_pkcs11 -%patch138 -p1 -b .no-isc-pkcs11 %patch149 -p1 -b .kyua-pkcs11 %patch150 -p1 -b .engine-pkcs11 %endif From b626a2bfa5066c4fcc35676657b454539b06b199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 26 Mar 2020 21:46:02 +0100 Subject: [PATCH 15/79] Compilable 9.16.1 package Updated from 9.14 to 9.16.1. Disabled SIGCHASE, since it no longer exists. Disabled PKCS11 native build for now Disabled EXPORT_LIBS No longer ships isc-config.sh, missing it. --- .gitignore | 2 + bind-9.11-feature-test-named.patch | 16 +++--- bind-9.11-fips-tests.patch | 46 ++++++++-------- bind-9.11-pk11.patch | 13 ----- bind-9.11-rh1410433.patch | 15 +++--- bind-9.11-rh1666814.patch | 29 +++++----- bind-9.11-unit-disable-random.patch | 29 ---------- bind-9.9.1-P2-multlib-conflict.patch | 41 -------------- bind.spec | 55 +++++++++---------- bind93-rh490837.patch | 80 +++++++--------------------- bind97-rh645544.patch | 20 +++---- sources | 3 +- 12 files changed, 109 insertions(+), 240 deletions(-) delete mode 100644 bind-9.11-pk11.patch delete mode 100644 bind-9.11-unit-disable-random.patch delete mode 100644 bind-9.9.1-P2-multlib-conflict.patch diff --git a/.gitignore b/.gitignore index 2084547..6cad3d9 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,5 @@ bind-9.7.2b1.tar.gz /bind-9.11.13.tar.gz.asc /bind-9.11.14.tar.gz /bind-9.11.14.tar.gz.asc +/bind-9.16.1.tar.xz +/bind-9.16.1.tar.xz.asc \ No newline at end of file diff --git a/bind-9.11-feature-test-named.patch b/bind-9.11-feature-test-named.patch index 61c31ea..1c1e63d 100644 --- a/bind-9.11-feature-test-named.patch +++ b/bind-9.11-feature-test-named.patch @@ -1,4 +1,4 @@ -From 36e3d1b08f697190b259a8421472ec16b52315b5 Mon Sep 17 00:00:00 2001 +From df27b2a23a195f844687c424a9117d4da14bc6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 30 Jan 2019 14:37:17 +0100 Subject: [PATCH] Create feature-test in source directory @@ -12,19 +12,19 @@ compile feature-test for each of them this way. 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 4e8006d..eecfa76 100644 +index dd25774..cb187e5 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in -@@ -83,7 +83,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -87,7 +87,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix -TARGETS = named@EXEEXT@ +TARGETS = named@EXEEXT@ feature-test@EXEEXT@ - GEOIPLINKOBJS = geoip.@O@ GEOIP2LINKOBJS = geoip.@O@ -@@ -154,6 +154,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} + +@@ -156,6 +156,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} @@ -41,10 +41,10 @@ index 4e8006d..eecfa76 100644 docclean manclean maintainer-clean:: diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index c713d96..20366e5 100644 +index 0d83fdf..be4123b 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -34,7 +34,7 @@ DELV=$TOP/bin/delv/delv +@@ -37,7 +37,7 @@ DELV=$TOP/bin/delv/delv DIG=$TOP/bin/dig/dig DNSTAPREAD=$TOP/bin/tools/dnstap-read DSFROMKEY=$TOP/bin/dnssec/dnssec-dsfromkey @@ -54,5 +54,5 @@ index c713d96..20366e5 100644 IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey JOURNALPRINT=$TOP/bin/tools/named-journalprint -- -2.20.1 +2.21.1 diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index f11fc5b..9f25c90 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From 11d42f5d851881fd559a716df78a18dba1d6975d Mon Sep 17 00:00:00 2001 +From 3f9d05b72f725defd1452fd3d4b8ef3192e96c0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -549,10 +549,10 @@ index 21be03e..e57c308 100644 }; diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf -index d627d2a..9d0322a 100644 +index 2eb2850..9e6913d 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf -@@ -157,6 +157,6 @@ dyndb "name" "library.so" { +@@ -197,6 +197,6 @@ dyndb "name" "library.so" { system; }; key "mykey" { @@ -561,19 +561,19 @@ index d627d2a..9d0322a 100644 secret "qwertyuiopasdfgh"; }; diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c -index ff92ad2..746e022 100644 +index 204d612..684fab6 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c -@@ -19,6 +19,7 @@ +@@ -14,6 +14,7 @@ + #include + #include + ++#include + #include #include #include - #include -+#include - #include - - #ifdef WIN32 -@@ -168,6 +169,19 @@ main(int argc, char **argv) { - #endif +@@ -158,6 +159,19 @@ main(int argc, char **argv) { + #endif /* ifdef DLZ_FILESYSTEM */ } + if (strcmp(argv[1], "--md5") == 0) { @@ -618,7 +618,7 @@ index 2976bfc..256d846 100644 }; diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh -index fb2eb74..0e45424 100644 +index d54ab0d..ba38177 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -212,16 +212,16 @@ ret=0 @@ -685,10 +685,10 @@ index 5d70114..6c4b55a 100644 $DDNSCONFGEN -q -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key $DDNSCONFGEN -q -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh -index b73d178..f573905 100755 +index 72a282a..5d42e04 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh -@@ -708,7 +708,14 @@ fi +@@ -715,7 +715,14 @@ fi n=`expr $n + 1` ret=0 echo_i "check TSIG key algorithms ($n)" @@ -704,7 +704,7 @@ index b73d178..f573905 100755 $NSUPDATE -k ns1/${alg}.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add ${alg}.keytests.nil. 600 A 10.10.10.3 -@@ -716,7 +723,7 @@ send +@@ -723,7 +730,7 @@ send END done sleep 2 @@ -714,10 +714,10 @@ index b73d178..f573905 100755 done if [ $ret -ne 0 ]; then diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh -index cb64dd9..c9b2447 100644 +index 6b539d1..4d7eaa2 100644 --- a/bin/tests/system/rndc/setup.sh +++ b/bin/tests/system/rndc/setup.sh -@@ -35,7 +35,7 @@ make_key () { +@@ -33,7 +33,7 @@ make_key () { sed 's/allow { 10.53.0.4/allow { any/' >> ns4/named.conf } @@ -727,10 +727,10 @@ index cb64dd9..c9b2447 100644 make_key 3 ${EXTRAPORT3} hmac-sha224 make_key 4 ${EXTRAPORT4} hmac-sha256 diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh -index 7cbe2c7..b8cc6a0 100644 +index 2af855a..36cd1aa 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh -@@ -356,15 +356,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi +@@ -348,15 +348,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi status=`expr $status + $ret` n=`expr $n + 1` @@ -907,10 +907,10 @@ index ea42b4d..08676da 100644 }; diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh -index b0694bb..9adae82 100644 +index 3b0d7b3..cc1ae3e 100644 --- a/bin/tests/system/upforwd/tests.sh +++ b/bin/tests/system/upforwd/tests.sh -@@ -68,7 +68,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi +@@ -66,7 +66,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi echo_i "updating zone (signed) ($n)" ret=0 @@ -920,5 +920,5 @@ index b0694bb..9adae82 100644 update add updated.example. 600 A 10.10.10.1 update add updated.example. 600 TXT Foo -- -2.20.1 +2.21.1 diff --git a/bind-9.11-pk11.patch b/bind-9.11-pk11.patch deleted file mode 100644 index fd75a6c..0000000 --- a/bind-9.11-pk11.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/isc/include/pk11/internal.h b/lib/isc/include/pk11/internal.h -index aa8907a..603712a 100644 ---- a/lib/isc/include/pk11/internal.h -+++ b/lib/isc/include/pk11/internal.h -@@ -13,6 +13,8 @@ - #ifndef PK11_INTERNAL_H - #define PK11_INTERNAL_H 1 - -+#include -+ - /*! \file pk11/internal.h */ - - ISC_LANG_BEGINDECLS diff --git a/bind-9.11-rh1410433.patch b/bind-9.11-rh1410433.patch index d307620..10f1dd2 100644 --- a/bind-9.11-rh1410433.patch +++ b/bind-9.11-rh1410433.patch @@ -1,16 +1,13 @@ diff --git a/lib/dns/dyndb.c b/lib/dns/dyndb.c -index 15561ce..e4449b0 100644 +index fdc8ea5..d638777 100644 --- a/lib/dns/dyndb.c +++ b/lib/dns/dyndb.c -@@ -133,8 +133,11 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname, +@@ -131,7 +131,7 @@ load_library(isc_mem_t *mctx, const char *filename, const char *instname, instname, filename); - flags = RTLD_NOW|RTLD_LOCAL; -+#if 0 -+ /* Shared global namespace is required for dns-pkcs11 library */ - #if defined(RTLD_DEEPBIND) && !__SANITIZE_ADDRESS__ + flags = RTLD_NOW | RTLD_LOCAL; +-#if defined(RTLD_DEEPBIND) && !__SANITIZE_ADDRESS__ ++#if 0 && defined(RTLD_DEEPBIND) && !__SANITIZE_ADDRESS__ flags |= RTLD_DEEPBIND; -+#endif - #endif + #endif /* if defined(RTLD_DEEPBIND) && !__SANITIZE_ADDRESS__ */ - handle = dlopen(filename, flags); diff --git a/bind-9.11-rh1666814.patch b/bind-9.11-rh1666814.patch index ea1df5d..e66a5ab 100644 --- a/bind-9.11-rh1666814.patch +++ b/bind-9.11-rh1666814.patch @@ -1,37 +1,38 @@ -From 3bb29f45604ac6890f4ea5cdcbd1a62e6dad14a7 Mon Sep 17 00:00:00 2001 +From a1a4730c1f02cd85680cf7608ac81e0db59ee522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Jan 2019 16:27:33 +0100 -Subject: [PATCH 2/2] Fix possible crash when loading corrupted file +Subject: [PATCH] Fix possible crash when loading corrupted file Some values passes internal triggers by coincidence. Fix the check and check also first_node_offset before even passing it further. --- - lib/dns/rbt.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) + lib/dns/rbt.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c -index 62d0826..b029b7d 100644 +index ef6441b..404fd6d 100644 --- a/lib/dns/rbt.c +++ b/lib/dns/rbt.c -@@ -787,7 +787,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n, - return (ISC_R_SUCCESS); +@@ -754,7 +754,7 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n, + } - CONFIRM((void *) n >= base); -- CONFIRM((char *) n - (char *) base <= (int) nodemax); -+ CONFIRM((size_t)((char *) n - (char *) base) <= nodemax); + CONFIRM((void *)n >= base); +- CONFIRM((char *)n - (char *)base <= (int)nodemax); ++ CONFIRM((size_t)((char *)n - (char *)base) <= (int)nodemax); CONFIRM(DNS_RBTNODE_VALID(n)); dns_name_init(&nodename, NULL); -@@ -939,7 +939,8 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize, - rbt->root = (dns_rbtnode_t *)((char *)base_address + - header_offset + header->first_node_offset); +@@ -911,7 +911,9 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize, + rbt->root = (dns_rbtnode_t *)((char *)base_address + header_offset + + header->first_node_offset); - if ((header->nodecount * sizeof(dns_rbtnode_t)) > filesize) { + if ((header->nodecount * sizeof(dns_rbtnode_t)) > filesize + || header->first_node_offset > filesize) { ++ result = ISC_R_INVALIDFILE; goto cleanup; } -- -2.20.1 +2.21.1 diff --git a/bind-9.11-unit-disable-random.patch b/bind-9.11-unit-disable-random.patch deleted file mode 100644 index dbd0cb6..0000000 --- a/bind-9.11-unit-disable-random.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 605d1575414c67f5e7eefeaae9dd2d0820c082dc Mon Sep 17 00:00:00 2001 -From: Petr Mensik -Date: Thu, 21 Feb 2019 22:42:27 +0100 -Subject: [PATCH] Disable random_test - -It fails too often on some architecture, failing the whole build along. -Because it runs two times for pkcs11 and normal build and any of -subtests can occasionally fail, stop it. - -It can be used again by defining 'unstable' variable in Kyuafile. ---- - lib/isc/tests/Kyuafile | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/isc/tests/Kyuafile b/lib/isc/tests/Kyuafile -index e2b2498..df2741e 100644 ---- a/lib/isc/tests/Kyuafile -+++ b/lib/isc/tests/Kyuafile -@@ -18,6 +18,7 @@ tap_test_program{name='parse_test'} - tap_test_program{name='pool_test'} - tap_test_program{name='queue_test'} - tap_test_program{name='radix_test'} -+-- tap_test_program{name='random_test', required_configs='unstable'} - tap_test_program{name='regex_test'} - tap_test_program{name='result_test'} - tap_test_program{name='safe_test'} --- -2.20.1 - diff --git a/bind-9.9.1-P2-multlib-conflict.patch b/bind-9.9.1-P2-multlib-conflict.patch deleted file mode 100644 index 1de1e04..0000000 --- a/bind-9.9.1-P2-multlib-conflict.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git a/isc-config.sh.in b/isc-config.sh.in -index 40f9bba..e446da2 100644 ---- a/isc-config.sh.in -+++ b/isc-config.sh.in -@@ -13,7 +13,18 @@ prefix=@prefix@ - exec_prefix=@exec_prefix@ - exec_prefix_set= - includedir=@includedir@ --libdir=@libdir@ -+arch=$(uname -m) -+ -+case $arch in -+ x86_64 | amd64 | sparc64 | s390x | ppc64) -+ libdir=/usr/lib64 -+ sec_libdir=/usr/lib -+ ;; -+ * ) -+ libdir=/usr/lib -+ sec_libdir=/usr/lib64 -+ ;; -+esac - - usage() - { -@@ -128,6 +139,16 @@ if test x"$echo_libs" = x"true"; then - if test x"${exec_prefix_set}" = x"true"; then - libs="-L${exec_prefix}/lib" - else -+ if [ ! -x $libdir/libisc.so ] ; then -+ if [ ! -x $sec_libdir/libisc.so ] ; then -+ echo "Error: ISC libs not found in $libdir" -+ if [ -d $sec_libdir ] ; then -+ echo "Error: ISC libs not found in $sec_libdir" -+ fi -+ exit 1 -+ fi -+ libdir=$sec_libdir -+ fi - libs="-L${libdir}" - fi - if test x"$libirs" = x"true" ; then diff --git a/bind.spec b/bind.spec index 538202b..7668ede 100644 --- a/bind.spec +++ b/bind.spec @@ -16,7 +16,7 @@ %bcond_without GSSTSIG # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles -%bcond_without PKCS11 +%bcond_with PKCS11 %bcond_without DEVEL %bcond_without LMDB %bcond_without JSON @@ -62,24 +62,27 @@ # Visit https://bugzilla.redhat.com/show_bug.cgi?id=1540300 %undefine _strict_symbol_defs_build # +# significant changes: +# no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1310 -%global sover_isc 1309 -%global sover_irs 1301 -%global sover_isccfg 1302 +%global sover_dns 1601 +%global sover_isc 1601 +%global sover_irs 1600 +%global sover_isccfg 1600 + Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.14.7 +Version: 9.16.1 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # -Source: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.gz +Source: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz Source1: named.sysconfig -Source2: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.gz.asc +Source2: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz.asc Source3: named.logrotate Source4: https://downloads.isc.org/isc/pgpkeys/codesign2019.txt Source7: bind-9.3.1rc1-sdb_tools-Makefile.in @@ -124,7 +127,6 @@ Patch101:bind-96-old-api.patch Patch106:bind93-rh490837.patch Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch -Patch131:bind-9.9.1-P2-multlib-conflict.patch Patch133:bind99-rh640538.patch # Make PKCS11 used only for pkcs11 parts Patch135:bind-9.14-config-pkcs11.patch @@ -141,7 +143,6 @@ Patch140:bind-9.11-rh1410433.patch Patch150:bind-9.11-engine-pkcs11.patch Patch153:bind-9.11-export-suffix.patch Patch154:bind-9.11-oot-manual.patch -Patch155:bind-9.11-pk11.patch # FIXME: needs review. Should not be required #Patch156:bind-9.11-fips-code.patch Patch157:bind-9.11-fips-tests.patch @@ -151,9 +152,6 @@ Patch157:bind-9.11-fips-tests.patch #Patch159:bind-9.11-rt46047.patch # https://gitlab.isc.org/isc-projects/bind9/issues/819 Patch164:bind-9.11-rh1666814.patch -# random_test fails too often by random, disable it -# not present on 9.14.0 -Patch168:bind-9.11-unit-disable-random.patch #Patch169:bind-9.11-feature-test-dlz.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch @@ -209,6 +207,7 @@ BuildRequires: python3-devel BuildRequires: python3-ply BuildRequires: findutils sed BuildRequires: gnupg2 +BuildRequires: libuv-devel %if %{with SDB} BuildRequires: openldap-devel, libpq-devel, sqlite-devel, mariadb-connector-c-devel %endif @@ -551,11 +550,11 @@ are used for building ISC DHCP. %patch106 -p1 -b .rh490837 %patch112 -p1 -b .rh645544 %patch130 -p1 -b .libdb -%patch131 -p1 -b .multlib-conflict %patch140 -p1 -b .rh1410433 +%if %{with EXPORT_LIBS} %patch153 -p1 -b .export_suffix +%endif %patch154 -p1 -b .oot-man -%patch155 -p1 -b .pk11-internal #%patch156 -p1 -b .fips-code %patch157 -p1 -b .fips-tests #%patch158 -p1 -b .rt31459 @@ -564,7 +563,6 @@ are used for building ISC DHCP. #%patch161 -p1 -b .host-idn-disable #%patch163 -p1 -b .rh1663318 %patch164 -p1 -b .rh1666814 -%patch168 -p1 -b .random_test-disable #%patch169 -p1 -b .featuretest-dlz %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant @@ -654,7 +652,6 @@ CFLAGS="$CFLAGS $RPM_OPT_FLAGS" CFLAGS+=" -O1 -fsanitize=thread -fPIE -pie" %endif export CFLAGS -export CPPFLAGS="$CPPFLAGS -DDIG_SIGCHASE" export STD_CDEFINES="$CPPFLAGS" @@ -775,7 +772,6 @@ popd # build %systemtest_prepare_build build %if %{with EXPORT_LIBS} -cp isc-config.sh.1 isc-export-config.sh.1 ## Create export libs ## mkdir -p export-libs @@ -812,12 +808,9 @@ export LIBDIR_SUFFIX ## FIXME this should be in patch instead of SED'ing ## but do we really like/want to patch generated files? -mv isc-config.sh isc-export-config.sh sed -i \ -e '/^SUBDIRS =/s/.*/SUBDIRS = make lib/i' \ --e 's/isc-config.sh/isc-export-config.sh/g' \ --e 's/bind9-config/bind9-export-config/g' \ Makefile sed -i -e \ @@ -987,6 +980,11 @@ install -m 644 %{SOURCE45} ${RPM_BUILD_ROOT}%{_unitdir} %if %{with PKCS11} install -m 644 %{SOURCE47} ${RPM_BUILD_ROOT}%{_unitdir} +%else +# Not packaged without PKCS11 +find ${RPM_BUILD_ROOT}%{_includedir}/bind9/pk11 ${RPM_BUILD_ROOT}%{_includedir}/bind9/pkcs11 \ + -name '*.h' \! -name site.h -delete + %endif mkdir -p ${RPM_BUILD_ROOT}%{_libexecdir} @@ -1043,9 +1041,7 @@ find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; %if !%{with DEVEL} rm -f ${RPM_BUILD_ROOT}/%{_libdir}/bind9/*so rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/bind9 -rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man1/isc-config.sh.1* rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man3/lwres* -rm -f ${RPM_BUILD_ROOT}/%{_bindir}/isc-config.sh %endif # SDB manpages @@ -1347,9 +1343,9 @@ fi; %endif %files libs -%{_libdir}/libbind9.so.1302* -%{_libdir}/libisccc.so.1302* -%{_libdir}/libns.so.1307* +%{_libdir}/libbind9.so.1600* +%{_libdir}/libisccc.so.1600* +%{_libdir}/libns.so.1601* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* @@ -1411,10 +1407,6 @@ fi; %{_includedir}/bind9/bind9 %{_includedir}/bind9/isccc %{_includedir}/bind9/ns -%{_mandir}/man1/isc-config.sh.1* -%{_mandir}/man1/bind9-config.1* -%{_bindir}/isc-config.sh -%{_bindir}/bind9-config %endif %files lite-devel @@ -1608,6 +1600,9 @@ fi; %changelog +* Thu Mar 26 2020 Petr Menšík - 32:9.16.1-1 +- Update to 9.16.1 + * Wed Jan 08 2020 Petr Menšík - 32:9.14.7-1 - Update to 9.14.7 diff --git a/bind93-rh490837.patch b/bind93-rh490837.patch index 6390c2f..4b32b4d 100644 --- a/bind93-rh490837.patch +++ b/bind93-rh490837.patch @@ -1,78 +1,34 @@ -diff --git a/lib/isc/include/isc/stdio.h b/lib/isc/include/isc/stdio.h -index 1f44b5a..a3625f9 100644 ---- a/lib/isc/include/isc/stdio.h -+++ b/lib/isc/include/isc/stdio.h -@@ -69,6 +69,9 @@ isc_stdio_sync(FILE *f); - * direct counterpart in the stdio library. - */ - -+isc_result_t -+isc_stdio_fgetc(FILE *f, int *ret); -+ - ISC_LANG_ENDDECLS - - #endif /* ISC_STDIO_H */ diff --git a/lib/isc/lex.c b/lib/isc/lex.c -index ca5fe6d..b0152eb 100644 +index cd44fe3..5b7c539 100644 --- a/lib/isc/lex.c +++ b/lib/isc/lex.c -@@ -433,15 +433,11 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { - if (source->is_file) { - stream = source->input; +@@ -27,6 +27,8 @@ + #include + #include --#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) -- c = getc_unlocked(stream); --#else -- c = getc(stream); --#endif -- if (c == EOF) { -- if (ferror(stream)) { -- source->result = ISC_R_IOERROR; -- result = source->result; -+ result = isc_stdio_fgetc(stream, &c); ++#include "../errno2result.h" + -+ if (result != ISC_R_SUCCESS) { -+ if (result != ISC_R_EOF) { -+ source->result = result; + typedef struct inputsource { + isc_result_t result; + bool is_file; +@@ -422,7 +424,7 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) { + #endif /* if defined(HAVE_FLOCKFILE) && defined(HAVE_GETC_UNLOCKED) */ + if (c == EOF) { + if (ferror(stream)) { +- source->result = ISC_R_IOERROR; ++ source->result = isc__errno2result(errno); + result = source->result; goto done; } - source->at_eof = true; diff --git a/lib/isc/unix/errno2result.c b/lib/isc/unix/errno2result.c -index d72d56f..4287ff3 100644 +index e3e2644..5e58600 100644 --- a/lib/isc/unix/errno2result.c +++ b/lib/isc/unix/errno2result.c -@@ -42,6 +42,7 @@ isc___errno2result(int posixerrno, bool dolog, - case EINVAL: /* XXX sometimes this is not for files */ +@@ -37,6 +37,7 @@ isc___errno2result(int posixerrno, bool dolog, const char *file, + case EINVAL: /* XXX sometimes this is not for files */ case ENAMETOOLONG: case EBADF: + case EISDIR: return (ISC_R_INVALIDFILE); case ENOENT: return (ISC_R_FILENOTFOUND); -diff --git a/lib/isc/unix/stdio.c b/lib/isc/unix/stdio.c -index d2b1dda..79630b2 100644 ---- a/lib/isc/unix/stdio.c -+++ b/lib/isc/unix/stdio.c -@@ -141,3 +141,22 @@ isc_stdio_sync(FILE *f) { - return (isc__errno2result(errno)); - } - -+isc_result_t -+isc_stdio_fgetc(FILE *f, int *ret) { -+ int r; -+ isc_result_t result = ISC_R_SUCCESS; -+ -+#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED) -+ r = fgetc_unlocked(f); -+#else -+ r = fgetc(f); -+#endif -+ -+ if (r == EOF) -+ result = ferror(f) ? isc__errno2result(errno) : ISC_R_EOF; -+ -+ *ret = r; -+ -+ return result; -+} -+ diff --git a/bind97-rh645544.patch b/bind97-rh645544.patch index 282fa2f..e7f67d8 100644 --- a/bind97-rh645544.patch +++ b/bind97-rh645544.patch @@ -1,31 +1,31 @@ diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c -index 2a6e69c..b2f8cec 100644 +index 51bc368..20a17b9 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c -@@ -1676,7 +1676,7 @@ log_edns(fetchctx_t *fctx) { +@@ -1754,7 +1754,7 @@ log_edns(fetchctx_t *fctx) { */ dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_EDNS_DISABLED, - DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, + DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(1), - "success resolving '%s' (in '%s'?) after %s", - fctx->info, domainbuf, fctx->reason); + "success resolving '%s' (in '%s'?) after %s", fctx->info, + domainbuf, fctx->reason); } -@@ -5084,7 +5084,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) { +@@ -5275,7 +5275,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) { dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, - DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO, + DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(1), - "lame server resolving '%s' (in '%s'?): %s", - namebuf, domainbuf, addrbuf); + "lame server resolving '%s' (in '%s'?): %s", namebuf, + domainbuf, addrbuf); } -@@ -5111,7 +5111,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) { +@@ -5302,7 +5302,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) { } isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, - DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, + DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(1), - "DNS format error from %s resolving %s%s%s: %s", - nsbuf, fctx->info, clmsg, clbuf, msgbuf); + "DNS format error from %s resolving %s%s%s: %s", nsbuf, + fctx->info, clmsg, clbuf, msgbuf); } diff --git a/sources b/sources index 62a9471..e1955e4 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (bind-9.14.4.tar.gz) = f5f4dc9b6a1d60838b59ce57ad37dc1e51fa26719aa203405a73850780f06bdc6ecea71c762efd464f946bdcce5a7c324de98caea36d2fe2781cce116fcd4932 +SHA512 (bind-9.16.1.tar.xz) = 9a1e8987f312b09a16c2ee0fd1d1eb8e4951b8dbcf3c0d51a1a1fb179a261028239ab2bebc3e559592cc766de57a26ba37b27621a0c5e1711d36c2416f0a0c26 +SHA512 (bind-9.16.1.tar.xz.asc) = fb9967033a0f8efbc05537ce4f3b315607ff06805b415303cf338afab303ca0f146a4d8049e7166971969b87064aa480a72c41d2c0ab1a8f3165e2049ccc4cb0 From 78968700e2db035bb347989f1390342a61b17765 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 10:27:25 +0100 Subject: [PATCH 16/79] Fix tsig system test During rebase, custom md5 part gone missing. --- bind-9.11-fips-tests.patch | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index 9f25c90..7ee915b 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From 3f9d05b72f725defd1452fd3d4b8ef3192e96c0b Mon Sep 17 00:00:00 2001 +From 303aae42064a4f6245f9c519953a5e6dd67510c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -86,11 +86,13 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/rndc/setup.sh | 2 +- bin/tests/system/rndc/tests.sh | 23 ++++--- bin/tests/system/tsig/ns1/named.conf.in | 10 +-- + bin/tests/system/tsig/ns1/rndc5.conf.in | 10 +++ bin/tests/system/tsig/setup.sh | 5 ++ bin/tests/system/tsig/tests.sh | 67 ++++++++++++------- bin/tests/system/upforwd/ns1/named.conf.in | 2 +- bin/tests/system/upforwd/tests.sh | 2 +- - 32 files changed, 151 insertions(+), 107 deletions(-) + 33 files changed, 161 insertions(+), 107 deletions(-) + create mode 100644 bin/tests/system/tsig/ns1/rndc5.conf.in diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in index 0ea6502..026db3f 100644 @@ -788,6 +790,22 @@ index fbf30c6..f61657d 100644 key "sha1-trunc" { secret "FrSt77yPTFx6hTs4i2tKLB9LmE0="; +diff --git a/bin/tests/system/tsig/ns1/rndc5.conf.in b/bin/tests/system/tsig/ns1/rndc5.conf.in +new file mode 100644 +index 0000000..0682194 +--- /dev/null ++++ b/bin/tests/system/tsig/ns1/rndc5.conf.in +@@ -0,0 +1,10 @@ ++# Conditionally included when support for MD5 is available ++key "md5" { ++ secret "97rnFx24Tfna4mHPfgnerA=="; ++ algorithm hmac-md5; ++}; ++ ++key "md5-trunc" { ++ secret "97rnFx24Tfna4mHPfgnerA=="; ++ algorithm hmac-md5-80; ++}; diff --git a/bin/tests/system/tsig/setup.sh b/bin/tests/system/tsig/setup.sh index b3e0450..90a6ce4 100644 --- a/bin/tests/system/tsig/setup.sh From 814547323ea4824aed15582d8fbcebd379f6966b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 12:30:39 +0100 Subject: [PATCH 17/79] Update patches after rebase --- bind-9.11-fips-disable.patch | 86 +- bind-9.11-json-c.patch | 50 - bind-9.11-oot-gen.patch | 47 - bind-9.11-rh1732883.patch | 194 -- bind-9.11-rh1736762-5.patch | 59 - bind-9.11-rh1736762-6.patch | 159 -- bind-9.11-rh1736762-7.patch | 77 - bind-9.11-rh1736762-8.patch | 38 - bind-9.11-serve-stale-dbfix.patch | 42 - bind-9.11-serve-stale.patch | 3858 ----------------------------- bind.spec | 23 +- 11 files changed, 17 insertions(+), 4616 deletions(-) delete mode 100644 bind-9.11-json-c.patch delete mode 100644 bind-9.11-oot-gen.patch delete mode 100644 bind-9.11-rh1732883.patch delete mode 100644 bind-9.11-rh1736762-5.patch delete mode 100644 bind-9.11-rh1736762-6.patch delete mode 100644 bind-9.11-rh1736762-7.patch delete mode 100644 bind-9.11-rh1736762-8.patch delete mode 100644 bind-9.11-serve-stale-dbfix.patch delete mode 100644 bind-9.11-serve-stale.patch diff --git a/bind-9.11-fips-disable.patch b/bind-9.11-fips-disable.patch index afe9564..c01d914 100644 --- a/bind-9.11-fips-disable.patch +++ b/bind-9.11-fips-disable.patch @@ -1,4 +1,4 @@ -From 83b889c238282b210f874a3ad81bb56299767495 Mon Sep 17 00:00:00 2001 +From 2b0dce163a119f5f62eb4428b485f7575f321d6f Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Mon, 5 Aug 2019 11:54:03 +0200 Subject: [PATCH] Allow explicit disabling of autodisabled MD5 @@ -9,16 +9,16 @@ RSAMD5 is included in security policy, it fails to start, because that algorithm is not recognized. Allow it disabled, but fail on any other usage. --- - bin/named/server.c | 4 ++-- - lib/bind9/check.c | 4 ++++ - lib/dns/rcode.c | 33 +++++++++++++++------------------ - 3 files changed, 21 insertions(+), 20 deletions(-) + bin/named/server.c | 4 ++-- + lib/bind9/check.c | 4 ++++ + lib/dns/rcode.c | 1 + + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c -index 5b57371..51702ab 100644 +index ee23f10..22a5c01 100644 --- a/bin/named/server.c +++ b/bin/named/server.c -@@ -1547,12 +1547,12 @@ disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) { +@@ -1689,12 +1689,12 @@ disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) { r.length = strlen(r.base); result = dns_secalg_fromtext(&alg, &r); @@ -30,14 +30,14 @@ index 5b57371..51702ab 100644 } - if (result != ISC_R_SUCCESS) { + if (result != ISC_R_SUCCESS && result != ISC_R_DISABLED) { - cfg_obj_log(cfg_listelt_value(element), - ns_g_lctx, ISC_LOG_ERROR, - "invalid algorithm"); + cfg_obj_log(cfg_listelt_value(element), named_g_lctx, + ISC_LOG_ERROR, "invalid algorithm"); + CHECK(result); diff --git a/lib/bind9/check.c b/lib/bind9/check.c -index e0803d4..8023784 100644 +index f49a346..dbf9ddb 100644 --- a/lib/bind9/check.c +++ b/lib/bind9/check.c -@@ -302,6 +302,10 @@ disabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) { +@@ -317,6 +317,10 @@ disabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) { r.length = strlen(r.base); tresult = dns_secalg_fromtext(&alg, &r); @@ -49,18 +49,10 @@ index e0803d4..8023784 100644 cfg_obj_log(cfg_listelt_value(element), logctx, ISC_LOG_ERROR, "invalid algorithm '%s'", diff --git a/lib/dns/rcode.c b/lib/dns/rcode.c -index f51d548..c49b8d1 100644 +index 327248e..78adf63 100644 --- a/lib/dns/rcode.c +++ b/lib/dns/rcode.c -@@ -126,7 +126,6 @@ - #endif - - #define SECALGNAMES \ -- MD5_SECALGNAMES \ - DH_SECALGNAMES \ - DSA_SECALGNAMES \ - { DNS_KEYALG_ECC, "ECC", 0 }, \ -@@ -178,6 +177,7 @@ static struct tbl rcodes[] = { RCODENAMES ERCODENAMES }; +@@ -152,6 +152,7 @@ static struct tbl rcodes[] = { RCODENAMES ERCODENAMES }; static struct tbl tsigrcodes[] = { RCODENAMES TSIGRCODENAMES }; static struct tbl certs[] = { CERTNAMES }; static struct tbl secalgs[] = { SECALGNAMES }; @@ -68,54 +60,6 @@ index f51d548..c49b8d1 100644 static struct tbl secprotos[] = { SECPROTONAMES }; static struct tbl hashalgs[] = { HASHALGNAMES }; static struct tbl dsdigests[] = { DSDIGESTNAMES }; -@@ -358,33 +358,30 @@ dns_cert_totext(dns_cert_t cert, isc_buffer_t *target) { - return (dns_mnemonic_totext(cert, target, certs)); - } - --static inline struct tbl * --secalgs_tbl_start() { -- struct tbl *algs = secalgs; -- --#ifndef PK11_MD5_DISABLE -- if (!isc_md5_available()) { -- while (algs->name != NULL && -- algs->value == DNS_KEYALG_RSAMD5) -- ++algs; -- } --#endif -- return algs; --} -- - isc_result_t - dns_secalg_fromtext(dns_secalg_t *secalgp, isc_textregion_t *source) { - unsigned int value; -+ isc_result_t result; - -- RETERR(dns_mnemonic_fromtext(&value, source, -- secalgs_tbl_start(), 0xff)); -+ result = dns_mnemonic_fromtext(&value, source, -+ secalgs, 0xff); -+ if (result != ISC_R_SUCCESS) { -+ result = dns_mnemonic_fromtext(&value, source, -+ md5_secalgs, 0xff); -+ if (result != ISC_R_SUCCESS) { -+ return (result); -+ } else if (!isc_md5_available()) { -+ *secalgp = value; -+ return (ISC_R_DISABLED); -+ } -+ } - *secalgp = value; - return (ISC_R_SUCCESS); - } - - isc_result_t - dns_secalg_totext(dns_secalg_t secalg, isc_buffer_t *target) { -- return (dns_mnemonic_totext(secalg, target, secalgs_tbl_start())); -+ return (dns_mnemonic_totext(secalg, target, secalgs)); - } - - void -- -2.20.1 +2.21.1 diff --git a/bind-9.11-json-c.patch b/bind-9.11-json-c.patch deleted file mode 100644 index 95e5597..0000000 --- a/bind-9.11-json-c.patch +++ /dev/null @@ -1,50 +0,0 @@ -From cb6d2019766a6c8c5516fd8859cedf0052f03293 Mon Sep 17 00:00:00 2001 -From: Petr Mensik -Date: Thu, 25 Jul 2019 11:37:57 +0200 -Subject: [PATCH] Skip support of jsoncpp - -Bind cannot be compiled when jsoncpp-devel is installed. Remove support -for jsoncpp, use only json-c-devel. Bind 9.15 has already support for ---with-json-c, do not yet introduce it. ---- - configure.ac | 17 ++--------------- - 1 file changed, 2 insertions(+), 15 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 6d05337..5ce83b5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2594,15 +2594,7 @@ case "$use_libjson" in - auto|yes) - for d in /usr /usr/local /opt/local - do -- if test -f "${d}/include/json/json.h" -- then -- if test ${d} != /usr -- then -- libjson_cflags="-I ${d}/include" -- LIBS="$LIBS -L${d}/lib" -- fi -- have_libjson="yes" -- elif test -f "${d}/include/json-c/json.h" -+ if test -f "${d}/include/json-c/json.h" - then - if test ${d} != /usr - then -@@ -2615,12 +2607,7 @@ case "$use_libjson" in - done - ;; - *) -- if test -f "${use_libjson}/include/json/json.h" -- then -- libjson_cflags="-I${use_libjson}/include" -- LIBS="$LIBS -L${use_libjson}/lib" -- have_libjson="yes" -- elif test -f "${use_libjson}/include/json-c/json.h" -+ if test -f "${use_libjson}/include/json-c/json.h" - then - libjson_cflags="-I${use_libjson}/include" - LIBS="$LIBS -L${use_libjson}/lib" --- -2.20.1 - diff --git a/bind-9.11-oot-gen.patch b/bind-9.11-oot-gen.patch deleted file mode 100644 index 9a7f991..0000000 --- a/bind-9.11-oot-gen.patch +++ /dev/null @@ -1,47 +0,0 @@ -From cb654ddde5953cab9dfde7173ea1ed14b51c3727 Mon Sep 17 00:00:00 2001 -From: Mark Andrews -Date: Sun, 22 Dec 2019 21:51:21 +0000 -Subject: [PATCH] Merge branch - '1530-lib-dns-gen-c-29-26-fatal-error-isc-platform-h-no-such-file-or-directory-v9_11' - into 'v9_11' - -Resolve "lib/dns/gen.c:29:26: fatal error: isc/platform.h: No such file or directory" - -See merge request isc-projects/bind9!2794 - -(cherry picked from commit 335ab375d6a0227fb362722acad22f2a5b75d8b7) ---- - lib/dns/gen.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/lib/dns/gen.c b/lib/dns/gen.c -index 81bc7ada1d..5fbdc3bfd3 100644 ---- a/lib/dns/gen.c -+++ b/lib/dns/gen.c -@@ -26,18 +26,18 @@ - - #include - --#include -- - #include -+#include - #include - #include --#include - #include - #include - #include - #include --#include --#include -+ -+#ifndef PATH_MAX -+#define PATH_MAX 1024 -+#endif - - #ifdef WIN32 - #include "gen-win32.h" --- -2.21.0 - diff --git a/bind-9.11-rh1732883.patch b/bind-9.11-rh1732883.patch deleted file mode 100644 index 14bf265..0000000 --- a/bind-9.11-rh1732883.patch +++ /dev/null @@ -1,194 +0,0 @@ -From 6010876e561b4345e569ffd11eaec9ea52725817 Mon Sep 17 00:00:00 2001 -From: Pavel Zhukov -Date: Wed, 24 Jul 2019 17:15:55 +0200 -Subject: [PATCH] Detect system time jumps - -In case if system time was changed backward it's possible to have ip -address dropped by the kernel due to lifetime expirity. Try to detect -this situation using either monotonic time or saved timestamp and execute -go_reboot() procedure to request lease extention ---- - lib/isc/include/isc/result.h | 3 ++- - lib/isc/include/isc/util.h | 3 +++ - lib/isc/result.c | 2 ++ - lib/isc/unix/app.c | 39 +++++++++++++++++++++++++++++---- - lib/isc/unix/include/isc/time.h | 20 +++++++++++++++++ - lib/isc/unix/time.c | 22 +++++++++++++++++++ - 6 files changed, 84 insertions(+), 5 deletions(-) - -diff --git a/lib/isc/include/isc/result.h b/lib/isc/include/isc/result.h -index 0389efa..149cde5 100644 ---- a/lib/isc/include/isc/result.h -+++ b/lib/isc/include/isc/result.h -@@ -89,7 +89,8 @@ - #define ISC_R_DISCFULL 67 /*%< disc full */ - #define ISC_R_DEFAULT 68 /*%< default */ - #define ISC_R_IPV4PREFIX 69 /*%< IPv4 prefix */ --#define ISC_R_NRESULTS 70 -+#define ISC_R_TIMESHIFTED 70 /*%< system time changed */ -+#define ISC_R_NRESULTS 71 - - ISC_LANG_BEGINDECLS - -diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h -index 973c348..8160dd3 100644 ---- a/lib/isc/include/isc/util.h -+++ b/lib/isc/include/isc/util.h -@@ -289,6 +289,9 @@ extern void mock_assert(const int result, const char* const expression, - * Time - */ - #define TIME_NOW(tp) RUNTIME_CHECK(isc_time_now((tp)) == ISC_R_SUCCESS) -+#ifdef CLOCK_BOOTTIME -+#define TIME_MONOTONIC(tp) RUNTIME_CHECK(isc_time_boottime((tp)) == ISC_R_SUCCESS) -+#endif - - /*% - * Alignment -diff --git a/lib/isc/result.c b/lib/isc/result.c -index a9db132..7c04831 100644 ---- a/lib/isc/result.c -+++ b/lib/isc/result.c -@@ -105,6 +105,7 @@ static const char *description[ISC_R_NRESULTS] = { - "disc full", /*%< 67 */ - "default", /*%< 68 */ - "IPv4 prefix", /*%< 69 */ -+ "time changed", /*%< 70 */ - }; - - static const char *identifier[ISC_R_NRESULTS] = { -@@ -178,6 +179,7 @@ static const char *identifier[ISC_R_NRESULTS] = { - "ISC_R_DISCFULL", - "ISC_R_DEFAULT", - "ISC_R_IPV4PREFIX", -+ "ISC_R_TIMESHIFTED", - }; - - #define ISC_RESULT_RESULTSET 2 -diff --git a/lib/isc/unix/app.c b/lib/isc/unix/app.c -index a6e9882..52eb3e0 100644 ---- a/lib/isc/unix/app.c -+++ b/lib/isc/unix/app.c -@@ -442,15 +442,48 @@ isc__app_ctxonrun(isc_appctx_t *ctx0, isc_mem_t *mctx, isc_task_t *task, - static isc_result_t - evloop(isc__appctx_t *ctx) { - isc_result_t result; -+ isc_time_t now; -+#ifdef CLOCK_BOOTTIME -+ isc_time_t monotonic; -+ uint64_t diff = 0; -+#else -+ isc_time_t prev; -+ TIME_NOW(&prev); -+#endif -+ -+ - - while (!ctx->want_shutdown) { - int n; -- isc_time_t when, now; -+ isc_time_t when; - struct timeval tv, *tvp; - isc_socketwait_t *swait; - bool readytasks; - bool call_timer_dispatch = false; -- -+ uint64_t us; -+ -+#ifdef CLOCK_BOOTTIME -+ // TBD macros for following three lines -+ TIME_NOW(&now); -+ TIME_MONOTONIC(&monotonic); -+ INSIST(now.seconds > monotonic.seconds) -+ us = isc_time_microdiff (&now, &monotonic); -+ if (us < diff){ -+ us = diff - us; -+ if (us > 1000000){ // ignoring shifts less than one second -+ return ISC_R_TIMESHIFTED; -+ }; -+ diff = isc_time_microdiff (&now, &monotonic); -+ } else { -+ diff = isc_time_microdiff (&now, &monotonic); -+ // not implemented -+ } -+#else -+ TIME_NOW(&now); -+ if (isc_time_compare (&now, &prev) < 0) -+ return ISC_R_TIMESHIFTED; -+ TIME_NOW(&prev); -+#endif - /* - * Check the reload (or suspend) case first for exiting the - * loop as fast as possible in case: -@@ -475,8 +508,6 @@ evloop(isc__appctx_t *ctx) { - if (result != ISC_R_SUCCESS) - tvp = NULL; - else { -- uint64_t us; -- - TIME_NOW(&now); - us = isc_time_microdiff(&when, &now); - if (us == 0) -diff --git a/lib/isc/unix/include/isc/time.h b/lib/isc/unix/include/isc/time.h -index b864c29..5dd43c9 100644 ---- a/lib/isc/unix/include/isc/time.h -+++ b/lib/isc/unix/include/isc/time.h -@@ -132,6 +132,26 @@ isc_time_isepoch(const isc_time_t *t); - *\li 't' is a valid pointer. - */ - -+#ifdef CLOCK_BOOTTIME -+isc_result_t -+isc_time_boottime(isc_time_t *t); -+/*%< -+ * Set 't' to monotonic time from previous boot -+ * it's not affected by system time change. It also -+ * includes the time system was suspended -+ * -+ * Requires: -+ *\li 't' is a valid pointer. -+ * -+ * Returns: -+ * -+ *\li Success -+ *\li Unexpected error -+ * Getting the time from the system failed. -+ */ -+#endif /* CLOCK_BOOTTIME */ -+ -+ - isc_result_t - isc_time_now(isc_time_t *t); - /*%< -diff --git a/lib/isc/unix/time.c b/lib/isc/unix/time.c -index 8edc9df..fe0bb91 100644 ---- a/lib/isc/unix/time.c -+++ b/lib/isc/unix/time.c -@@ -498,3 +498,25 @@ isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len) { - t->nanoseconds / NS_PER_MS); - } - } -+ -+ -+#ifdef CLOCK_BOOTTIME -+isc_result_t -+isc_time_boottime(isc_time_t *t) { -+ struct timespec ts; -+ -+ char strbuf[ISC_STRERRORSIZE]; -+ -+ if (clock_gettime (CLOCK_BOOTTIME, &ts) != 0){ -+ isc__strerror(errno, strbuf, sizeof(strbuf)); -+ UNEXPECTED_ERROR(__FILE__, __LINE__, "%s", strbuf); -+ return (ISC_R_UNEXPECTED); -+ } -+ -+ t->seconds = ts.tv_sec; -+ t->nanoseconds = ts.tv_nsec; -+ -+ return (ISC_R_SUCCESS); -+ -+}; -+#endif --- -2.20.1 - diff --git a/bind-9.11-rh1736762-5.patch b/bind-9.11-rh1736762-5.patch deleted file mode 100644 index e14efca..0000000 --- a/bind-9.11-rh1736762-5.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 6257d829c9d7e71ac51bcdc6b5b981c7a19200e2 Mon Sep 17 00:00:00 2001 -From: Mark Andrews -Date: Mon, 25 Nov 2019 05:46:55 +0000 -Subject: [PATCH] Merge branch - '1373-threadsanitizer-data-race-rbtdb-c-5193-in-detachnode' into 'master' - -Resolve "ThreadSanitizer: data race rbtdb.c:5193 in detachnode" - -Closes #1373 - -See merge request isc-projects/bind9!2598 ---- - lib/dns/include/dns/rbt.h | 22 +++++++++------------- - 1 file changed, 9 insertions(+), 13 deletions(-) - -diff --git a/lib/dns/include/dns/rbt.h b/lib/dns/include/dns/rbt.h -index 67ac3e4d8a..a084bd6193 100644 ---- a/lib/dns/include/dns/rbt.h -+++ b/lib/dns/include/dns/rbt.h -@@ -49,10 +49,7 @@ ISC_LANG_BEGINDECLS - - #define DNS_RBT_USEMAGIC 1 - --/* -- * These should add up to 30. -- */ --#define DNS_RBT_LOCKLENGTH 10 -+#define DNS_RBT_LOCKLENGTH (sizeof(((dns_rbtnode_t *)0)->locknum)*8) - #define DNS_RBT_REFLENGTH 20 - - #define DNS_RBTNODE_MAGIC ISC_MAGIC('R','B','N','O') -@@ -159,16 +156,15 @@ struct dns_rbtnode { - * separate region of memory. - */ - void *data; -- unsigned int :0; /* start of bitfields c/o node lock */ -- unsigned int dirty:1; -- unsigned int wild:1; -- unsigned int locknum:DNS_RBT_LOCKLENGTH; --#ifndef DNS_RBT_USEISCREFCOUNT -- unsigned int references:DNS_RBT_REFLENGTH; --#endif -- unsigned int :0; /* end of bitfields c/o node lock */ -+ uint8_t :0; /* start of bitfields c/o node lock */ -+ uint8_t dirty:1; -+ uint8_t wild:1; -+ uint8_t :0; /* end of bitfields c/o node lock */ -+ uint16_t locknum; /* note that this is not in the bitfield */ - #ifdef DNS_RBT_USEISCREFCOUNT -- isc_refcount_t references; /* note that this is not in the bitfield */ -+ isc_refcount_t references; -+#else -+ unsigned int references:DNS_RBT_REFLENGTH; - #endif - /*@}*/ - }; --- -2.21.0 - diff --git a/bind-9.11-rh1736762-6.patch b/bind-9.11-rh1736762-6.patch deleted file mode 100644 index abc36f0..0000000 --- a/bind-9.11-rh1736762-6.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 638561615c37e8eace986e268811335c12d1b6a1 Mon Sep 17 00:00:00 2001 -From: Mark Andrews -Date: Thu, 12 Dec 2019 20:41:44 +1100 -Subject: [PATCH] give zspill its own lock - -(cherry picked from commit a52189e8e67a20097539fe3e6f7da4e4c01dc340) ---- - lib/dns/resolver.c | 45 +++++++++++++++++++++++++++++---------------- - 1 file changed, 29 insertions(+), 16 deletions(-) - -diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c -index 9f65c0596a..04367f82c6 100644 ---- a/lib/dns/resolver.c -+++ b/lib/dns/resolver.c -@@ -460,20 +460,21 @@ struct dns_resolver { - isc_mutex_t lock; - isc_mutex_t nlock; - isc_mutex_t primelock; -+ isc_mutex_t zspill_lock; - dns_rdataclass_t rdclass; - isc_socketmgr_t * socketmgr; - isc_timermgr_t * timermgr; - isc_taskmgr_t * taskmgr; - dns_view_t * view; -- bool frozen; -+ bool frozen; - unsigned int options; - dns_dispatchmgr_t * dispatchmgr; - dns_dispatchset_t * dispatches4; -- bool exclusivev4; -+ bool exclusivev4; - dns_dispatchset_t * dispatches6; - isc_dscp_t querydscp4; - isc_dscp_t querydscp6; -- bool exclusivev6; -+ bool exclusivev6; - unsigned int nbuckets; - fctxbucket_t * buckets; - zonebucket_t * dbuckets; -@@ -492,7 +493,7 @@ struct dns_resolver { - unsigned int spillatmax; - unsigned int spillatmin; - isc_timer_t * spillattimer; -- bool zero_no_soa_ttl; -+ bool zero_no_soa_ttl; - unsigned int query_timeout; - unsigned int maxdepth; - unsigned int maxqueries; -@@ -502,14 +503,16 @@ struct dns_resolver { - unsigned int retryinterval; /* in milliseconds */ - unsigned int nonbackofftries; - -+ /* Locked by lock. */ -+ unsigned int zspill; /* fetches-per-zone */ -+ - /* Locked by lock. */ - unsigned int references; -- bool exiting; -+ bool exiting; - isc_eventlist_t whenshutdown; - unsigned int activebuckets; -- bool priming; -+ bool priming; - unsigned int spillat; /* clients-per-query */ -- unsigned int zspill; /* fetches-per-zone */ - - dns_badcache_t * badcache; /* Bad cache. */ - -@@ -1257,7 +1260,7 @@ fcount_incr(fetchctx_t *fctx, bool force) { - isc_result_t result = ISC_R_SUCCESS; - zonebucket_t *dbucket; - fctxcount_t *counter; -- unsigned int bucketnum, spill; -+ unsigned int bucketnum; - - REQUIRE(fctx != NULL); - REQUIRE(fctx->res != NULL); -@@ -1266,10 +1269,6 @@ fcount_incr(fetchctx_t *fctx, bool force) { - bucketnum = dns_name_fullhash(&fctx->domain, false) - % RES_DOMAIN_BUCKETS; - -- LOCK(&fctx->res->lock); -- spill = fctx->res->zspill; -- UNLOCK(&fctx->res->lock); -- - dbucket = &fctx->res->dbuckets[bucketnum]; - - LOCK(&dbucket->lock); -@@ -1297,6 +1296,12 @@ fcount_incr(fetchctx_t *fctx, bool force) { - ISC_LIST_APPEND(dbucket->list, counter, link); - } - } else { -+ unsigned int spill; -+ -+ LOCK(&fctx->res->zspill_lock); -+ spill = fctx->res->zspill; -+ UNLOCK(&fctx->res->zspill_lock); -+ - if (!force && spill != 0 && counter->count >= spill) { - counter->dropped++; - fcount_logspill(fctx, counter); -@@ -8811,6 +8816,7 @@ destroy(dns_resolver_t *res) { - - INSIST(res->nfctx == 0); - -+ DESTROYLOCK(&res->zspill_lock); - DESTROYLOCK(&res->primelock); - DESTROYLOCK(&res->nlock); - DESTROYLOCK(&res->lock); -@@ -9089,10 +9095,14 @@ dns_resolver_create(dns_view_t *view, - if (result != ISC_R_SUCCESS) - goto cleanup_nlock; - -+ result = isc_mutex_init(&res->zspill_lock); -+ if (result != ISC_R_SUCCESS) -+ goto cleanup_primelock; -+ - task = NULL; - result = isc_task_create(taskmgr, 0, &task); - if (result != ISC_R_SUCCESS) -- goto cleanup_primelock; -+ goto cleanup_zspill_lock; - isc_task_setname(task, "resolver_task", NULL); - - result = isc_timer_create(timermgr, isc_timertype_inactive, NULL, NULL, -@@ -9100,7 +9110,7 @@ dns_resolver_create(dns_view_t *view, - &res->spillattimer); - isc_task_detach(&task); - if (result != ISC_R_SUCCESS) -- goto cleanup_primelock; -+ goto cleanup_zspill_lock; - - #if USE_ALGLOCK - result = isc_rwlock_init(&res->alglock, 0, 0); -@@ -9133,6 +9143,9 @@ dns_resolver_create(dns_view_t *view, - isc_timer_detach(&res->spillattimer); - #endif - -+ cleanup_zspill_lock: -+ DESTROYLOCK(&res->zspill_lock); -+ - cleanup_primelock: - DESTROYLOCK(&res->primelock); - -@@ -10275,9 +10288,9 @@ dns_resolver_setfetchesperzone(dns_resolver_t *resolver, uint32_t clients) - { - REQUIRE(VALID_RESOLVER(resolver)); - -- LOCK(&resolver->lock); -+ LOCK(&resolver->zspill_lock); - resolver->zspill = clients; -- UNLOCK(&resolver->lock); -+ UNLOCK(&resolver->zspill_lock); - } - - --- -2.21.0 - diff --git a/bind-9.11-rh1736762-7.patch b/bind-9.11-rh1736762-7.patch deleted file mode 100644 index 38617a2..0000000 --- a/bind-9.11-rh1736762-7.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 23a6775f62deeee63e9f7927be387fecf23a8074 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= -Date: Tue, 10 Dec 2019 10:02:09 +0100 -Subject: [PATCH] Ensure all zone_settimer() calls are done on locked zone - -(cherry picked from commit cf48e8eb326f824170f2069e5d5c33992b1783a4) -(cherry picked from commit 3bac7e98074643ff62582545e5840e4195517b07) ---- - lib/dns/zone.c | 9 +++++---- - 1 file changed, 5 insertions(+), 4 deletions(-) - -diff --git a/lib/dns/zone.c b/lib/dns/zone.c -index e8cff77588..db837aae50 100644 ---- a/lib/dns/zone.c -+++ b/lib/dns/zone.c -@@ -10291,7 +10291,9 @@ zone_maintenance(dns_zone_t *zone) { - default: - break; - } -+ LOCK_ZONE(zone); - zone_settimer(zone, &now); -+ UNLOCK_ZONE(zone); - } - - void -@@ -13081,6 +13083,7 @@ zone_settimer(dns_zone_t *zone, isc_time_t *now) { - isc_result_t result; - - REQUIRE(DNS_ZONE_VALID(zone)); -+ REQUIRE(LOCKED_ZONE(zone)); - ENTER; - - if (DNS_ZONE_FLAG(zone, DNS_ZONEFLG_EXITING)) -@@ -18405,6 +18408,7 @@ zone_rekey(dns_zone_t *zone) { - UNLOCK_ZONE(zone); - } - -+ LOCK_ZONE(zone); - isc_time_settoepoch(&zone->refreshkeytime); - - /* -@@ -18416,11 +18420,9 @@ zone_rekey(dns_zone_t *zone) { - isc_time_t timethen; - isc_stdtime_t then; - -- LOCK_ZONE(zone); - DNS_ZONE_TIME_ADD(&timenow, zone->refreshkeyinterval, - &timethen); - zone->refreshkeytime = timethen; -- UNLOCK_ZONE(zone); - - for (key = ISC_LIST_HEAD(dnskeys); - key != NULL; -@@ -18431,12 +18433,10 @@ zone_rekey(dns_zone_t *zone) { - continue; - - DNS_ZONE_TIME_ADD(&timenow, then - now, &timethen); -- LOCK_ZONE(zone); - if (isc_time_compare(&timethen, - &zone->refreshkeytime) < 0) { - zone->refreshkeytime = timethen; - } -- UNLOCK_ZONE(zone); - } - - zone_settimer(zone, &timenow); -@@ -18444,6 +18444,7 @@ zone_rekey(dns_zone_t *zone) { - isc_time_formattimestamp(&zone->refreshkeytime, timebuf, 80); - dns_zone_log(zone, ISC_LOG_INFO, "next key event: %s", timebuf); - } -+ UNLOCK_ZONE(zone); - - done: - dns_diff_clear(&diff); --- -2.21.0 - diff --git a/bind-9.11-rh1736762-8.patch b/bind-9.11-rh1736762-8.patch deleted file mode 100644 index f04a98a..0000000 --- a/bind-9.11-rh1736762-8.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 7e844b093b0442bdc5cdc5aefd56fdc05f9be88f Mon Sep 17 00:00:00 2001 -From: Mark Andrews -Date: Thu, 12 Dec 2019 19:17:39 +1100 -Subject: [PATCH] acquire task lock before calling push_readyq for task->flags - access - -(cherry picked from commit 7c94d2cd7dfaa3f04cd86ad9ed97e8366a774a4c) ---- - lib/isc/task.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/lib/isc/task.c b/lib/isc/task.c -index 329604a465..f9c4354bd2 100644 ---- a/lib/isc/task.c -+++ b/lib/isc/task.c -@@ -473,7 +473,9 @@ task_ready(isc__task_t *task) { - XTRACE("task_ready"); - - LOCK(&manager->lock); -+ LOCK(&task->lock); - push_readyq(manager, task); -+ UNLOCK(&task->lock); - #ifdef USE_WORKER_THREADS - if (manager->mode == isc_taskmgrmode_normal || has_privilege) - SIGNAL(&manager->work_available); -@@ -1263,7 +1265,9 @@ dispatch(isc__taskmgr_t *manager) { - * might even hurt rather than help. - */ - #ifdef USE_WORKER_THREADS -+ LOCK(&task->lock); - push_readyq(manager, task); -+ UNLOCK(&task->lock); - #else - ENQUEUE(new_ready_tasks, task, ready_link); - if ((task->flags & TASK_F_PRIVILEGED) != 0) --- -2.21.0 - diff --git a/bind-9.11-serve-stale-dbfix.patch b/bind-9.11-serve-stale-dbfix.patch deleted file mode 100644 index 7091871..0000000 --- a/bind-9.11-serve-stale-dbfix.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 20848d8284951481051f6ebdeb8128c05c7e82e2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Mon, 11 Nov 2019 16:56:52 +0100 -Subject: [PATCH] Move stale_ttl from middle to the end - -bind-dyndb-ldap is using rdataset structure. Do not modify its body, -move stale_ttl to the end. Make it binary compatible. ---- - lib/dns/include/dns/rdataset.h | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h -index 97071ed496..a0c6afe624 100644 ---- a/lib/dns/include/dns/rdataset.h -+++ b/lib/dns/include/dns/rdataset.h -@@ -137,11 +137,6 @@ struct dns_rdataset { - dns_rdataclass_t rdclass; - dns_rdatatype_t type; - dns_ttl_t ttl; -- /* -- * Stale ttl is used to see how long this RRset can still be used -- * to serve to clients, after the TTL has expired. -- */ -- dns_ttl_t stale_ttl; - dns_trust_t trust; - dns_rdatatype_t covers; - -@@ -178,6 +173,11 @@ struct dns_rdataset { - void * private7; - /*@}*/ - -+ /* -+ * Stale ttl is used to see how long this RRset can still be used -+ * to serve to clients, after the TTL has expired. -+ */ -+ dns_ttl_t stale_ttl; - }; - - /*! --- -2.20.1 - diff --git a/bind-9.11-serve-stale.patch b/bind-9.11-serve-stale.patch deleted file mode 100644 index 6baa4a7..0000000 --- a/bind-9.11-serve-stale.patch +++ /dev/null @@ -1,3858 +0,0 @@ -From 3829de3d5caba113d5a8560c5ff0d2a32b57a7fc Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Thu, 7 Nov 2019 14:31:03 +0100 -Subject: [PATCH] Implement serve-stale in 9.11 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Squashed commit of the following: - -commit 32f47f36e545223b2a4757588d7bd4af8c5f5760 -Author: Petr Menšík -Date: Tue Sep 3 18:45:54 2019 +0200 - - convert serve_stale to db_test - - Manual checkout from commit e8f61dd315c5d1c88915bb79361182241e42e47a. - Use test modified for cmocka, including serve-stale tests. - -commit 071eb1fb0786f6d614955813d99c3caabff33383 -Author: Michał Kępień -Date: Fri Apr 27 09:13:26 2018 +0200 - - Detect recursion loops during query processing - - Interrupt query processing when query_recurse() attempts to ask the same - name servers for the same QNAME/QTYPE tuple for two times in a row as - this indicates that query processing may be stuck for an indeterminate - period of time, e.g. due to interactions between features able to - restart query_lookup(). - - (cherry picked from commit 46bb4dd124ed031d4c219d1e37a3c6322092e30c) - -commit c12090bc361c7fa4522ace73899e778e44e9b295 -Author: Petr Menšík -Date: Mon Sep 2 11:12:32 2019 +0200 - - Fix test name used in whole test-suite - - Correct name is serve-stale - -commit ff4d826f295d268a248ca06941d65c903e1b405c -Author: Petr Menšík -Date: Fri Aug 30 17:43:28 2019 +0200 - - Clean files in more generic rules - -commit 8d81ed15eda9a2a11e1433d1fdddacfc772708b6 -Author: Petr Menšík -Date: Thu Aug 29 21:27:57 2019 +0200 - - [rt46602] Pass port numbers to tests via environment variables - - Manually applied commit f5d8f079008b648d2e343543e66dd728054c6101 - -commit 94fafa477891576286def8c4041ad127734af2d1 -Author: Tony Finch -Date: Tue Apr 10 16:17:57 2018 +0100 - - Move serve-stale logging to its own category, so that its verbosity can be curtailed. - - (cherry picked from commit 4b442c309dfb2c8880b19af4133047655bb734df) - -commit e0c884bee98c3d2533dfaa667f58c6a80d8a3a00 -Author: Michał Kępień -Date: Fri Apr 27 09:13:26 2018 +0200 - - Prevent check_stale_header() from leaking rdataset headers - - check_stale_header() fails to update the pointer to the previous header - while processing rdataset headers eligible for serve-stale, thus - enabling rdataset headers to be leaked (i.e. disassociated from a node - and left on the relevant TTL heap) while iterating through a node. This - can lead to several different assertion failures. Add the missing - pointer update. - - (cherry picked from commit 391fac1fc8d2e470287b5cc4344b3adb90c6f54a) - -commit d724cc1d80ee8d46113eaf82549d49636739b67c -Author: Matthijs Mekking -Date: Thu Jan 24 10:24:44 2019 +0100 - - Print in dump-file stale ttl - - This change makes rndc dumpdb correctly print the "; stale" line. - It also provides extra information on how long this data may still - be served to clients (in other words how long the stale RRset may - still be used). - - (cherry picked from commit 924ebc605db798e2a383ee5eaaebad739e7c789c) - -commit 625da4bd4590ac6108bb30eddd23ceffb245ae49 -Author: Michał Kępień -Date: Mon Oct 22 15:26:45 2018 +0200 - - Check serve-stale behavior with a cold cache - - Ensure that serve-stale works as expected when returning stale answers - is enabled, the authoritative server does not respond, and there is no - cached answer available. - - (cherry picked from commit 27cfe83a388147edfa0451b28c06c746912ea684) - -commit d67ae10461c409fdafdbbe64f857db2552b71059 -Author: Michał Kępień -Date: Mon Oct 22 15:26:45 2018 +0200 - - Check TTL of stale answers - - Make sure that stale answers returned when the serve-stale feature is - enabled have a TTL matching the value of the stale-answer-ttl setting. - - (cherry picked from commit 893ab37ce78c658215bd3a019f25afe795b37d5a) - -commit 50459107805e68e4a63a8e497bf58ef3ce013ddb -Author: Michał Kępień -Date: Mon Jul 9 14:35:12 2018 +0200 - - Do not use Net::DNS::Nameserver in the "serve-stale" system test - - Net::DNS versions older than 0.67 respond to queries sent to a - Net::DNS::Nameserver even if its ReplyHandler returns undef. This makes - the "serve-stale" system test fail as it takes advantage of the newer - behavior. Since the latest Net::DNS version available with stock - RHEL/CentOS 6 packages is 0.65 and we officially support that operating - system, bin/tests/system/serve-stale/ans2/ans.pl should behave - consistently for various Net::DNS versions. Ensure that by reworking it - so that it does not use Net::DNS::Nameserver. - - (cherry picked from commit c4209418a50c09142375f7edadca731c526f3d3a) - -commit 4b5befc714bb386bd245b1c14ce3bce5ae6fb5fa -Author: Petr Menšík -Date: Tue Jun 5 21:38:29 2018 +0200 - - Fix server-stale requirement, skip without Time::HiRes - - (cherry picked from commit 7a0c7bf9c8e6a724e52635eed213ad25b9504e66) - -commit 5ce51a3a7e5ef3087c4d022e3fca42fb2fd0c996 -Author: Ondřej Surý -Date: Wed Oct 18 13:01:14 2017 +0200 - - [rt46602] Update server-stale test to run on port passed from run.sh script - - (cherry picked from commit f83ebd34b9555a5a834c58146035173bcbd01dda) - -commit 3954a9bf3437f6fab050294a7f2f954a23d161ec -Author: Ondřej Surý -Date: Wed Oct 18 14:18:59 2017 +0200 - - [rt46602] Add serve-stale working files to .gitignore - - (cherry picked from commit cba162e70e7fac43435a606106841a69ce468526) - -commit 112aa21f5fa875494820e4d1eb70e41e10e1aae7 -Author: Mark Andrews -Date: Thu Oct 12 15:33:47 2017 +1100 - - test for Net::DNS::Nameserver - - (cherry picked from commit 5b60d0608ac2852753180b762d1917163f9dc315) - -commit 9d610e46af8a636f44914cee4cf8b2016054db1e -Author: Mark Andrews -Date: Thu Oct 12 15:19:45 2017 +1100 - - add Net::DNS prerequiste test - - (cherry picked from commit fa644181f51559da3e3913acd72dbc3f6d916e71) - -commit e4ea7ba88d9a9a0c79579400c68a5dabe03e8572 -Author: Mark Andrews -Date: Wed Sep 6 19:26:10 2017 +1000 - - add quotes arount $send_response - - (cherry picked from commit 023ab19634b287543169e9b7b5259f3126cd60ff) - -commit 0af0c5d33c2de34da164571288b650282c6be10a -Author: Mark Andrews -Date: Thu Nov 23 16:11:49 2017 +1100 - - initalise serve_stale_ttl - - (cherry picked from commit 2f4e0e5a81278f59037bf06ae99ff52245cd57e9) - -commit fbadd90ee81863d617c4c319d5f0079b877fe102 -Author: Evan Hunt -Date: Thu Sep 14 11:48:21 2017 -0700 - - [master] add thanks to APNIC and add missing note for serve-stale - -commit deb8adaa59955970b9d2f2fe58060a3cbf08312b -Author: Mark Andrews -Date: Wed Sep 6 12:16:10 2017 +1000 - - silence 'staleanswersok' may be used uninitialized in this function warning. [RT #14147 - -commit 0e2d03823768dc545015e6ce309777210f4a9f85 -Author: Petr Menšík -Date: Thu Aug 29 19:57:58 2019 +0200 - - More fixes to merge - -commit 360e25ffe7623ea0a2eec49395001f4940967776 -Author: Mark Andrews -Date: Wed Sep 6 09:58:29 2017 +1000 - - 4700. [func] Serving of stale answers is now supported. This - allows named to provide stale cached answers when - the authoritative server is under attack. - See max-stale-ttl, stale-answer-enable, - stale-answer-ttl. [RT #44790] - -Signed-off-by: Petr Menšík ---- - bin/named/config.c | 9 +- - bin/named/control.c | 2 + - bin/named/include/named/control.h | 1 + - bin/named/include/named/log.h | 1 + - bin/named/include/named/query.h | 15 + - bin/named/include/named/server.h | 13 +- - bin/named/log.c | 1 + - bin/named/query.c | 164 +++++- - bin/named/server.c | 177 +++++- - bin/named/statschannel.c | 6 + - bin/rndc/rndc.c | 2 + - bin/rndc/rndc.docbook | 19 + - bin/tests/system/chain/prereq.sh | 7 + - bin/tests/system/conf.sh.in | 2 +- - bin/tests/system/dyndb/driver/db.c | 2 + - bin/tests/system/serve-stale/.gitignore | 11 + - bin/tests/system/serve-stale/ans2/ans.pl.in | 178 ++++++ - bin/tests/system/serve-stale/clean.sh | 15 + - .../system/serve-stale/ns1/named1.conf.in | 35 ++ - .../system/serve-stale/ns1/named2.conf.in | 35 ++ - bin/tests/system/serve-stale/ns1/root.db | 5 + - .../system/serve-stale/ns3/named.conf.in | 35 ++ - bin/tests/system/serve-stale/prereq.sh | 38 ++ - bin/tests/system/serve-stale/setup.sh | 13 + - bin/tests/system/serve-stale/tests.sh | 536 ++++++++++++++++++ - doc/arm/Bv9ARM-book.xml | 69 ++- - doc/arm/logging-categories.xml | 11 + - doc/arm/notes-rh-changes.xml | 14 +- - doc/misc/options | 10 + - lib/bind9/check.c | 78 ++- - lib/dns/cache.c | 38 +- - lib/dns/db.c | 22 + - lib/dns/ecdb.c | 4 +- - lib/dns/include/dns/cache.h | 21 + - lib/dns/include/dns/db.h | 35 ++ - lib/dns/include/dns/rdataset.h | 11 + - lib/dns/include/dns/resolver.h | 43 +- - lib/dns/include/dns/types.h | 6 + - lib/dns/include/dns/view.h | 3 + - lib/dns/master.c | 14 +- - lib/dns/masterdump.c | 23 + - lib/dns/rbtdb.c | 207 ++++++- - lib/dns/resolver.c | 78 ++- - lib/dns/sdb.c | 4 +- - lib/dns/sdlz.c | 4 +- - lib/dns/tests/db_test.c | 198 ++++++- - lib/dns/view.c | 3 + - lib/isccfg/namedconf.c | 5 + - 48 files changed, 2121 insertions(+), 102 deletions(-) - create mode 100644 bin/tests/system/serve-stale/.gitignore - create mode 100644 bin/tests/system/serve-stale/ans2/ans.pl.in - create mode 100644 bin/tests/system/serve-stale/clean.sh - create mode 100644 bin/tests/system/serve-stale/ns1/named1.conf.in - create mode 100644 bin/tests/system/serve-stale/ns1/named2.conf.in - create mode 100644 bin/tests/system/serve-stale/ns1/root.db - create mode 100644 bin/tests/system/serve-stale/ns3/named.conf.in - create mode 100644 bin/tests/system/serve-stale/prereq.sh - create mode 100644 bin/tests/system/serve-stale/setup.sh - create mode 100755 bin/tests/system/serve-stale/tests.sh - -diff --git a/bin/named/config.c b/bin/named/config.c -index 63da4b0..b598f9b 100644 ---- a/bin/named/config.c -+++ b/bin/named/config.c -@@ -182,13 +182,14 @@ options {\n\ - #ifdef HAVE_LMDB - " lmdb-mapsize 32M;\n" - #endif --" max-acache-size 16M;\n\ -- max-cache-size 90%;\n\ -+" max-cache-size 90%;\n\ -+ max-acache-size 16M;\n\ - max-cache-ttl 604800; /* 1 week */\n\ - max-clients-per-query 100;\n\ - max-ncache-ttl 10800; /* 3 hours */\n\ - max-recursion-depth 7;\n\ - max-recursion-queries 75;\n\ -+ max-stale-ttl 604800; /* 1 week */\n\ - message-compression yes;\n\ - # min-roots ;\n\ - minimal-any false;\n\ -@@ -203,10 +204,14 @@ options {\n\ - request-expire true;\n\ - request-ixfr true;\n\ - require-server-cookie no;\n\ -+ resolver-nonbackoff-tries 3;\n\ -+ resolver-retry-interval 800; /* in milliseconds */\n\ - # rfc2308-type1 ;\n\ - root-key-sentinel yes;\n\ - servfail-ttl 1;\n\ - # sortlist \n\ -+ stale-answer-enable false;\n\ -+ stale-answer-ttl 1; /* 1 second */\n\ - # topology \n\ - transfer-format many-answers;\n\ - v6-bias 50;\n\ -diff --git a/bin/named/control.c b/bin/named/control.c -index df23c26..8b79850 100644 ---- a/bin/named/control.c -+++ b/bin/named/control.c -@@ -282,6 +282,8 @@ ns_control_docommand(isccc_sexpr_t *message, bool readonly, - result = ns_server_validation(ns_g_server, lex, text); - } else if (command_compare(command, NS_COMMAND_ZONESTATUS)) { - result = ns_server_zonestatus(ns_g_server, lex, text); -+ } else if (command_compare(command, NS_COMMAND_SERVESTALE)) { -+ result = ns_server_servestale(ns_g_server, lex, text); - } else { - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_CONTROL, ISC_LOG_WARNING, -diff --git a/bin/named/include/named/control.h b/bin/named/include/named/control.h -index 8705fdd..1634154 100644 ---- a/bin/named/include/named/control.h -+++ b/bin/named/include/named/control.h -@@ -69,6 +69,7 @@ - #define NS_COMMAND_MKEYS "managed-keys" - #define NS_COMMAND_DNSTAPREOPEN "dnstap-reopen" - #define NS_COMMAND_DNSTAP "dnstap" -+#define NS_COMMAND_SERVESTALE "serve-stale" - - isc_result_t - ns_controls_create(ns_server_t *server, ns_controls_t **ctrlsp); -diff --git a/bin/named/include/named/log.h b/bin/named/include/named/log.h -index 56bfcd4..cd8db60 100644 ---- a/bin/named/include/named/log.h -+++ b/bin/named/include/named/log.h -@@ -32,6 +32,7 @@ - #define NS_LOGCATEGORY_UPDATE_SECURITY (&ns_g_categories[6]) - #define NS_LOGCATEGORY_QUERY_ERRORS (&ns_g_categories[7]) - #define NS_LOGCATEGORY_TAT (&ns_g_categories[8]) -+#define NS_LOGCATEGORY_SERVE_STALE (&ns_g_categories[9]) - - /* - * Backwards compatibility. -diff --git a/bin/named/include/named/query.h b/bin/named/include/named/query.h -index 9661f56..445b578 100644 ---- a/bin/named/include/named/query.h -+++ b/bin/named/include/named/query.h -@@ -35,6 +35,18 @@ typedef struct ns_dbversion { - ISC_LINK(struct ns_dbversion) link; - } ns_dbversion_t; - -+/*% -+ * nameserver recursion parameters, to uniquely identify a recursion -+ * query; this is used to detect a recursion loop -+ */ -+typedef struct ns_query_recparam { -+ dns_rdatatype_t qtype; -+ dns_name_t * qname; -+ dns_fixedname_t fqname; -+ dns_name_t * qdomain; -+ dns_fixedname_t fqdomain; -+} ns_query_recparam_t; -+ - /*% nameserver query structure */ - struct ns_query { - unsigned int attributes; -@@ -63,6 +75,7 @@ struct ns_query { - unsigned int dns64_aaaaoklen; - unsigned int dns64_options; - unsigned int dns64_ttl; -+ - struct { - dns_db_t * db; - dns_zone_t * zone; -@@ -76,6 +89,8 @@ struct ns_query { - bool authoritative; - bool is_zone; - } redirect; -+ -+ ns_query_recparam_t recparam; - dns_keytag_t root_key_sentinel_keyid; - bool root_key_sentinel_is_ta; - bool root_key_sentinel_not_ta; -diff --git a/bin/named/include/named/server.h b/bin/named/include/named/server.h -index c92922e..588bf2d 100644 ---- a/bin/named/include/named/server.h -+++ b/bin/named/include/named/server.h -@@ -226,7 +226,10 @@ enum { - - dns_nsstatscounter_reclimitdropped = 58, - -- dns_nsstatscounter_max = 59 -+ dns_nsstatscounter_trystale = 59, -+ dns_nsstatscounter_usedstale = 60, -+ -+ dns_nsstatscounter_max = 61 - }; - - /*% -@@ -765,4 +768,12 @@ ns_server_mkeys(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text); - isc_result_t - ns_server_dnstap(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text); - -+ -+/*% -+ * Control whether stale answers are served or not when configured in -+ * named.conf. -+ */ -+isc_result_t -+ns_server_servestale(ns_server_t *server, isc_lex_t *lex, -+ isc_buffer_t **text); - #endif /* NAMED_SERVER_H */ -diff --git a/bin/named/log.c b/bin/named/log.c -index 3aa25e9..12f178b 100644 ---- a/bin/named/log.c -+++ b/bin/named/log.c -@@ -38,6 +38,7 @@ static isc_logcategory_t categories[] = { - { "update-security", 0 }, - { "query-errors", 0 }, - { "trust-anchor-telemetry", 0 }, -+ { "serve-stale", 0 }, - { NULL, 0 } - }; - -diff --git a/bin/named/query.c b/bin/named/query.c -index 0940714..882d69c 100644 ---- a/bin/named/query.c -+++ b/bin/named/query.c -@@ -125,10 +125,14 @@ - #define REDIRECT(c) (((c)->query.attributes & \ - NS_QUERYATTR_REDIRECT) != 0) - --/*% No QNAME Proof? */ -+/*% Does the rdataset 'r' have an attached 'No QNAME Proof'? */ - #define NOQNAME(r) (((r)->attributes & \ - DNS_RDATASETATTR_NOQNAME) != 0) - -+/*% Does the rdataset 'r' contain a stale answer? */ -+#define STALE(r) (((r)->attributes & \ -+ DNS_RDATASETATTR_STALE) != 0) -+ - #ifdef WANT_QUERYTRACE - static inline void - client_trace(ns_client_t *client, int level, const char *message) { -@@ -217,6 +221,10 @@ static bool - rpz_ck_dnssec(ns_client_t *client, isc_result_t qresult, - dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset); - -+static void -+recparam_update(ns_query_recparam_t *param, dns_rdatatype_t qtype, -+ const dns_name_t *qname, const dns_name_t *qdomain); -+ - /*% - * Increment query statistics counters. - */ -@@ -470,6 +478,7 @@ query_reset(ns_client_t *client, bool everything) { - client->query.isreferral = false; - client->query.dns64_options = 0; - client->query.dns64_ttl = UINT32_MAX; -+ recparam_update(&client->query.recparam, 0, NULL, NULL); - client->query.root_key_sentinel_keyid = 0; - client->query.root_key_sentinel_is_ta = false; - client->query.root_key_sentinel_not_ta = false; -@@ -4254,6 +4263,54 @@ query_prefetch(ns_client_t *client, dns_name_t *qname, - dns_rdataset_clearprefetch(rdataset); - } - -+/*% -+ * Check whether the recursion parameters in 'param' match the current query's -+ * recursion parameters provided in 'qtype', 'qname', and 'qdomain'. -+ */ -+static bool -+recparam_match(const ns_query_recparam_t *param, dns_rdatatype_t qtype, -+ const dns_name_t *qname, const dns_name_t *qdomain) -+{ -+ REQUIRE(param != NULL); -+ -+ return (param->qtype == qtype && -+ param->qname != NULL && qname != NULL && -+ param->qdomain != NULL && qdomain != NULL && -+ dns_name_equal(param->qname, qname) && -+ dns_name_equal(param->qdomain, qdomain)); -+} -+ -+/*% -+ * Update 'param' with current query's recursion parameters provided in -+ * 'qtype', 'qname', and 'qdomain'. -+ */ -+static void -+recparam_update(ns_query_recparam_t *param, dns_rdatatype_t qtype, -+ const dns_name_t *qname, const dns_name_t *qdomain) -+{ -+ isc_result_t result; -+ -+ REQUIRE(param != NULL); -+ -+ param->qtype = qtype; -+ -+ if (qname == NULL) { -+ param->qname = NULL; -+ } else { -+ param->qname = dns_fixedname_initname(¶m->fqname); -+ result = dns_name_copy(qname, param->qname, NULL); -+ RUNTIME_CHECK(result == ISC_R_SUCCESS); -+ } -+ -+ if (qdomain == NULL) { -+ param->qdomain = NULL; -+ } else { -+ param->qdomain = dns_fixedname_initname(¶m->fqdomain); -+ result = dns_name_copy(qdomain, param->qdomain, NULL); -+ RUNTIME_CHECK(result == ISC_R_SUCCESS); -+ } -+} -+ - static isc_result_t - query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname, - dns_name_t *qdomain, dns_rdataset_t *nameservers, -@@ -4263,6 +4320,19 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname, - dns_rdataset_t *rdataset, *sigrdataset; - isc_sockaddr_t *peeraddr; - -+ /* -+ * Check recursion parameters from the previous query to see if they -+ * match. If not, update recursion parameters and proceed. -+ */ -+ if (recparam_match(&client->query.recparam, qtype, qname, qdomain)) { -+ ns_client_log(client, NS_LOGCATEGORY_CLIENT, -+ NS_LOGMODULE_QUERY, ISC_LOG_INFO, -+ "recursion loop detected"); -+ return (ISC_R_FAILURE); -+ } -+ -+ recparam_update(&client->query.recparam, qtype, qname, qdomain); -+ - if (!resuming) - inc_stats(client, dns_nsstatscounter_recursion); - -@@ -6780,6 +6850,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - int line = -1; - bool dns64_exclude, dns64, rpz; - bool nxrewrite = false; -+ bool want_stale = false; - bool redirected = false; - dns_clientinfomethods_t cm; - dns_clientinfo_t ci; -@@ -7089,6 +7160,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - type = qtype; - - restart: -+ // query_start - CTRACE(ISC_LOG_DEBUG(3), "query_find: restart"); - want_restart = false; - authoritative = false; -@@ -7233,6 +7305,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - } - - db_find: -+ // query_lookup - CTRACE(ISC_LOG_DEBUG(3), "query_find: db_find"); - /* - * We'll need some resources... -@@ -7290,6 +7363,35 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - if (!is_zone) - dns_cache_updatestats(client->view->cache, result); - -+ if (want_stale) { -+ char namebuf[DNS_NAME_FORMATSIZE]; -+ bool success; -+ -+ client->query.dboptions &= ~DNS_DBFIND_STALEOK; -+ want_stale = false; -+ -+ if (dns_rdataset_isassociated(rdataset) && -+ dns_rdataset_count(rdataset) > 0 && -+ STALE(rdataset)) { -+ rdataset->ttl = client->view->staleanswerttl; -+ success = true; -+ } else { -+ success = false; -+ } -+ -+ dns_name_format(client->query.qname, -+ namebuf, sizeof(namebuf)); -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_SERVE_STALE, -+ NS_LOGMODULE_QUERY, ISC_LOG_INFO, -+ "%s resolver failure, stale answer %s", -+ namebuf, success ? "used" : "unavailable"); -+ -+ if (!success) { -+ QUERY_ERROR(DNS_R_SERVFAIL); -+ goto cleanup; -+ } -+ } -+ - resume: - CTRACE(ISC_LOG_DEBUG(3), "query_find: resume"); - -@@ -7635,6 +7737,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - * The cache doesn't even have the root NS. Get them from - * the hints DB. - */ -+ // query_notfound - INSIST(!is_zone); - if (db != NULL) - dns_db_detach(&db); -@@ -7697,12 +7800,14 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - */ - /* FALLTHROUGH */ - case DNS_R_DELEGATION: -+ // query_delegation - authoritative = false; - if (is_zone) { - /* - * Look to see if we are authoritative for the - * child zone if the query type is DS. - */ -+ // query_zone_delegation - if (!RECURSIONOK(client) && - (options & DNS_GETDB_NOEXACT) != 0 && - qtype == dns_rdatatype_ds) { -@@ -8089,6 +8194,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - false, true); - } - } -+ // query_nxdomain - if (dns_rdataset_isassociated(rdataset)) { - /* - * If we've got a NSEC record, we need to save the -@@ -8409,7 +8515,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - /* - * If we have a zero ttl from the cache refetch it. - */ -- if (!is_zone && !resuming && rdataset->ttl == 0 && -+ // query_cname -+ if (!is_zone && !resuming && !STALE(rdataset) && rdataset->ttl == 0 && - RECURSIONOK(client)) - { - if (dns_rdataset_isassociated(rdataset)) -@@ -8627,7 +8734,11 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - "query_find: unexpected error after resuming: %s", - isc_result_totext(result)); - CTRACE(ISC_LOG_ERROR, errmsg); -- QUERY_ERROR(DNS_R_SERVFAIL); -+ if (resuming) { -+ want_stale = true; -+ } else { -+ QUERY_ERROR(DNS_R_SERVFAIL); -+ } - goto cleanup; - } - -@@ -8883,7 +8994,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - /* - * If we have a zero ttl from the cache refetch it. - */ -- if (!is_zone && !resuming && rdataset->ttl == 0 && -+ if (!is_zone && !resuming && !STALE(rdataset) && rdataset->ttl == 0 && - RECURSIONOK(client)) - { - if (dns_rdataset_isassociated(rdataset)) -@@ -8894,6 +9005,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - if (node != NULL) - dns_db_detachnode(db, &node); - -+ // query_respond - INSIST(!REDIRECT(client)); - result = query_recurse(client, qtype, - client->query.qname, -@@ -9174,6 +9286,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - dns_fixedname_name(&wildcardname), - true, false); - cleanup: -+ // query_done - CTRACE(ISC_LOG_DEBUG(3), "query_find: cleanup"); - /* - * General cleanup. -@@ -9230,6 +9343,49 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) - goto restart; - } - -+ if (want_stale) { -+ dns_ttl_t stale_ttl = 0; -+ isc_result_t result; -+ bool staleanswersok = false; -+ -+ /* -+ * Stale answers only make sense if stale_ttl > 0 but -+ * we want rndc to be able to control returning stale -+ * answers if they are configured. -+ */ -+ dns_db_attach(client->view->cachedb, &db); -+ result = dns_db_getservestalettl(db, &stale_ttl); -+ if (result == ISC_R_SUCCESS && stale_ttl > 0) { -+ switch (client->view->staleanswersok) { -+ case dns_stale_answer_yes: -+ staleanswersok = true; -+ break; -+ case dns_stale_answer_conf: -+ staleanswersok = -+ client->view->staleanswersenable; -+ break; -+ case dns_stale_answer_no: -+ staleanswersok = false; -+ break; -+ } -+ } else { -+ staleanswersok = false; -+ } -+ -+ if (staleanswersok) { -+ client->query.dboptions |= DNS_DBFIND_STALEOK; -+ inc_stats(client, dns_nsstatscounter_trystale); -+ if (client->query.fetch != NULL) -+ dns_resolver_destroyfetch( -+ &client->query.fetch); -+ goto db_find; -+ } -+ dns_db_detach(&db); -+ want_stale = false; -+ QUERY_ERROR(DNS_R_SERVFAIL); -+ goto cleanup; -+ } -+ - if (eresult != ISC_R_SUCCESS && - (!PARTIALANSWER(client) || WANTRECURSION(client) - || eresult == DNS_R_DROP)) { -diff --git a/bin/named/server.c b/bin/named/server.c -index 36e0227..73c2b47 100644 ---- a/bin/named/server.c -+++ b/bin/named/server.c -@@ -1720,7 +1720,8 @@ static bool - cache_sharable(dns_view_t *originview, dns_view_t *view, - bool new_zero_no_soattl, - unsigned int new_cleaning_interval, -- uint64_t new_max_cache_size) -+ uint64_t new_max_cache_size, -+ uint32_t new_stale_ttl) - { - /* - * If the cache cannot even reused for the same view, it cannot be -@@ -1735,6 +1736,7 @@ cache_sharable(dns_view_t *originview, dns_view_t *view, - */ - if (dns_cache_getcleaninginterval(originview->cache) != - new_cleaning_interval || -+ dns_cache_getservestalettl(originview->cache) != new_stale_ttl || - dns_cache_getcachesize(originview->cache) != new_max_cache_size) { - return (false); - } -@@ -3290,6 +3292,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - size_t max_acache_size; - size_t max_adb_size; - uint32_t lame_ttl, fail_ttl; -+ uint32_t max_stale_ttl; - dns_tsig_keyring_t *ring = NULL; - dns_view_t *pview = NULL; /* Production view */ - isc_mem_t *cmctx = NULL, *hmctx = NULL; -@@ -3318,6 +3321,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - bool old_rpz_ok = false; - isc_dscp_t dscp4 = -1, dscp6 = -1; - dns_dyndbctx_t *dctx = NULL; -+ unsigned int resolver_param; - - REQUIRE(DNS_VIEW_VALID(view)); - -@@ -3732,6 +3736,24 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - if (view->maxncachettl > 7 * 24 * 3600) - view->maxncachettl = 7 * 24 * 3600; - -+ obj = NULL; -+ result = ns_config_get(maps, "max-stale-ttl", &obj); -+ INSIST(result == ISC_R_SUCCESS); -+ max_stale_ttl = cfg_obj_asuint32(obj); -+ -+ obj = NULL; -+ result = ns_config_get(maps, "stale-answer-enable", &obj); -+ INSIST(result == ISC_R_SUCCESS); -+ view->staleanswersenable = cfg_obj_asboolean(obj); -+ -+ result = dns_viewlist_find(&ns_g_server->viewlist, view->name, -+ view->rdclass, &pview); -+ if (result == ISC_R_SUCCESS) { -+ view->staleanswersok = pview->staleanswersok; -+ dns_view_detach(&pview); -+ } else -+ view->staleanswersok = dns_stale_answer_conf; -+ - /* - * Configure the view's cache. - * -@@ -3765,7 +3787,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - nsc = cachelist_find(cachelist, cachename, view->rdclass); - if (nsc != NULL) { - if (!cache_sharable(nsc->primaryview, view, zero_no_soattl, -- cleaning_interval, max_cache_size)) { -+ cleaning_interval, max_cache_size, -+ max_stale_ttl)) { - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_SERVER, ISC_LOG_ERROR, - "views %s and %s can't share the cache " -@@ -3864,9 +3887,15 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - - dns_cache_setcleaninginterval(cache, cleaning_interval); - dns_cache_setcachesize(cache, max_cache_size); -+ dns_cache_setservestalettl(cache, max_stale_ttl); - - dns_cache_detach(&cache); - -+ obj = NULL; -+ result = ns_config_get(maps, "stale-answer-ttl", &obj); -+ INSIST(result == ISC_R_SUCCESS); -+ view->staleanswerttl = ISC_MAX(cfg_obj_asuint32(obj), 1); -+ - /* - * Resolver. - * -@@ -4055,6 +4084,21 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, - maxbits = 4096; - view->maxbits = maxbits; - -+ /* -+ * Set resolver retry parameters. -+ */ -+ obj = NULL; -+ CHECK(ns_config_get(maps, "resolver-retry-interval", &obj)); -+ resolver_param = cfg_obj_asuint32(obj); -+ if (resolver_param > 0) -+ dns_resolver_setretryinterval(view->resolver, resolver_param); -+ -+ obj = NULL; -+ CHECK(ns_config_get(maps, "resolver-nonbackoff-tries", &obj)); -+ resolver_param = cfg_obj_asuint32(obj); -+ if (resolver_param > 0) -+ dns_resolver_setnonbackofftries(view->resolver, resolver_param); -+ - /* - * Set supported DNSSEC algorithms. - */ -@@ -14434,3 +14478,132 @@ ns_server_dnstap(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) { - return (ISC_R_NOTIMPLEMENTED); - #endif - } -+ -+isc_result_t -+ns_server_servestale(ns_server_t *server, isc_lex_t *lex, -+ isc_buffer_t **text) -+{ -+ char *ptr, *classtxt, *viewtxt = NULL; -+ char msg[128]; -+ dns_rdataclass_t rdclass = dns_rdataclass_in; -+ dns_view_t *view; -+ bool found = false; -+ dns_stale_answer_t staleanswersok = dns_stale_answer_conf; -+ bool wantstatus = false; -+ isc_result_t result = ISC_R_SUCCESS; -+ -+ /* Skip the command name. */ -+ ptr = next_token(lex, text); -+ if (ptr == NULL) -+ return (ISC_R_UNEXPECTEDEND); -+ -+ ptr = next_token(lex, NULL); -+ if (ptr == NULL) -+ return (ISC_R_UNEXPECTEDEND); -+ -+ if (strcasecmp(ptr, "on") == 0 || strcasecmp(ptr, "yes") == 0) { -+ staleanswersok = dns_stale_answer_yes; -+ } else if (strcasecmp(ptr, "off") == 0 || strcasecmp(ptr, "no") == 0) { -+ staleanswersok = dns_stale_answer_no; -+ } else if (strcasecmp(ptr, "reset") == 0) { -+ staleanswersok = dns_stale_answer_conf; -+ } else if (strcasecmp(ptr, "status") == 0) { -+ wantstatus = true; -+ } else -+ return (DNS_R_SYNTAX); -+ -+ /* Look for the optional class name. */ -+ classtxt = next_token(lex, text); -+ if (classtxt != NULL) { -+ /* Look for the optional view name. */ -+ viewtxt = next_token(lex, text); -+ } -+ -+ if (classtxt != NULL) { -+ isc_textregion_t r; -+ -+ r.base = classtxt; -+ r.length = strlen(classtxt); -+ result = dns_rdataclass_fromtext(&rdclass, &r); -+ if (result != ISC_R_SUCCESS) { -+ if (viewtxt == NULL) { -+ viewtxt = classtxt; -+ classtxt = NULL; -+ result = ISC_R_SUCCESS; -+ } else { -+ snprintf(msg, sizeof(msg), -+ "unknown class '%s'", classtxt); -+ (void) putstr(text, msg); -+ goto cleanup; -+ } -+ } -+ } -+ -+ result = isc_task_beginexclusive(server->task); -+ RUNTIME_CHECK(result == ISC_R_SUCCESS); -+ -+ for (view = ISC_LIST_HEAD(server->viewlist); -+ view != NULL; -+ view = ISC_LIST_NEXT(view, link)) -+ { -+ dns_ttl_t stale_ttl = 0; -+ dns_db_t *db = NULL; -+ -+ if (classtxt != NULL && rdclass != view->rdclass) -+ continue; -+ -+ if (viewtxt != NULL && strcmp(view->name, viewtxt) != 0) -+ continue; -+ -+ if (!wantstatus) { -+ view->staleanswersok = staleanswersok; -+ found = true; -+ continue; -+ } -+ -+ db = NULL; -+ dns_db_attach(view->cachedb, &db); -+ (void)dns_db_getservestalettl(db, &stale_ttl); -+ dns_db_detach(&db); -+ if (found) -+ CHECK(putstr(text, "\n")); -+ CHECK(putstr(text, view->name)); -+ CHECK(putstr(text, ": ")); -+ switch (view->staleanswersok) { -+ case dns_stale_answer_yes: -+ if (stale_ttl > 0) -+ CHECK(putstr(text, "on (rndc)")); -+ else -+ CHECK(putstr(text, "off (not-cached)")); -+ break; -+ case dns_stale_answer_no: -+ CHECK(putstr(text, "off (rndc)")); -+ break; -+ case dns_stale_answer_conf: -+ if (view->staleanswersenable && stale_ttl > 0) -+ CHECK(putstr(text, "on")); -+ else if (view->staleanswersenable) -+ CHECK(putstr(text, "off (not-cached)")); -+ else -+ CHECK(putstr(text, "off")); -+ break; -+ } -+ if (stale_ttl > 0) { -+ snprintf(msg, sizeof(msg), -+ " (stale-answer-ttl=%u max-stale-ttl=%u)", -+ view->staleanswerttl, stale_ttl); -+ CHECK(putstr(text, msg)); -+ } -+ found = true; -+ } -+ isc_task_endexclusive(ns_g_server->task); -+ -+ if (!found) -+ result = ISC_R_NOTFOUND; -+ -+cleanup: -+ if (isc_buffer_usedlength(*text) > 0) -+ (void) putnull(text); -+ -+ return (result); -+} -diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c -index 6292bcb..fb034a7 100644 ---- a/bin/named/statschannel.c -+++ b/bin/named/statschannel.c -@@ -300,6 +300,12 @@ init_desc(void) { - SET_NSSTATDESC(reclimitdropped, - "queries dropped due to recursive client limit", - "RecLimitDropped"); -+ SET_NSSTATDESC(trystale, -+ "attempts to use stale cache data after lookup failure", -+ "QryTryStale"); -+ SET_NSSTATDESC(usedstale, -+ "successful uses of stale cache data after lookup failure", -+ "QryUsedStale"); - INSIST(i == dns_nsstatscounter_max); - - /* Initialize resolver statistics */ -diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c -index 8083654..d519983 100644 ---- a/bin/rndc/rndc.c -+++ b/bin/rndc/rndc.c -@@ -160,6 +160,8 @@ command is one of the following:\n\ - scan Scan available network interfaces for changes.\n\ - secroots [view ...]\n\ - Write security roots to the secroots file.\n\ -+ serve-stale ( yes | no | reset ) [class [view]]\n\ -+ Control whether stale answers are returned\n\ - showzone zone [class [view]]\n\ - Print a zone's configuration.\n\ - sign zone [class [view]]\n\ -diff --git a/bin/rndc/rndc.docbook b/bin/rndc/rndc.docbook -index 06b073a..6ae8e5d 100644 ---- a/bin/rndc/rndc.docbook -+++ b/bin/rndc/rndc.docbook -@@ -688,6 +688,25 @@ - - - -+ -+ serve-stale ( on | off | reset | status) class view -+ -+ -+ Enable, disable, or reset the serving of stale answers -+ as configured in named.conf. Serving of stale answers -+ will remain disabled across named.conf -+ reloads if disabled via rndc until it is reset via rndc. -+ -+ -+ Status will report whether serving of stale answers is -+ currently enabled, disabled or not configured for a -+ view. If serving of stale records is configured then -+ the values of stale-answer-ttl and max-stale-ttl are -+ reported. -+ -+ -+ -+ - - secroots - view ... - -diff --git a/bin/tests/system/chain/prereq.sh b/bin/tests/system/chain/prereq.sh -index f3f1939..9ff3f07 100644 ---- a/bin/tests/system/chain/prereq.sh -+++ b/bin/tests/system/chain/prereq.sh -@@ -48,3 +48,10 @@ else - echo_i "This test requires the Net::DNS::Nameserver library." >&2 - exit 1 - fi -+if $PERL -e 'use Net::DNS::Nameserver;' 2>/dev/null -+then -+ : -+else -+ echo "I:This test requires the Net::DNS::Nameserver library." >&2 -+ exit 1 -+fi -diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index 1e5f221..96ee63e 100644 ---- a/bin/tests/system/conf.sh.in -+++ b/bin/tests/system/conf.sh.in -@@ -128,7 +128,7 @@ PARALLELDIRS="dnssec rpzrecurse \ - reclimit redirect resolver rndc rootkeysentinel rpz \ - rrchecker rrl rrsetorder rsabigexponent runtime \ - sfcache smartsign sortlist \ -- spf staticstub statistics statschannel stub \ -+ spf serve-stale staticstub statistics statschannel stub \ - tcp tsig tsiggss \ - unknown upforwd verify views wildcard \ - xfer xferquota zero zonechecks" -diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c -index 02aa6ab..a77c7de 100644 ---- a/bin/tests/system/dyndb/driver/db.c -+++ b/bin/tests/system/dyndb/driver/db.c -@@ -629,6 +629,8 @@ static dns_dbmethods_t sampledb_methods = { - hashsize, - NULL, - NULL, -+ NULL, -+ NULL, - }; - - /* Auxiliary driver functions. */ -diff --git a/bin/tests/system/serve-stale/.gitignore b/bin/tests/system/serve-stale/.gitignore -new file mode 100644 -index 0000000..2272eef ---- /dev/null -+++ b/bin/tests/system/serve-stale/.gitignore -@@ -0,0 +1,11 @@ -+/ans2/ans.pid -+/ans2/ans.pl -+/dig.out* -+/ns1/named.conf -+/ns3/named.conf -+/ns3/root.bk -+/rndc.out* -+named.lock -+named.pid -+named.port -+named.run -diff --git a/bin/tests/system/serve-stale/ans2/ans.pl.in b/bin/tests/system/serve-stale/ans2/ans.pl.in -new file mode 100644 -index 0000000..2b39eca ---- /dev/null -+++ b/bin/tests/system/serve-stale/ans2/ans.pl.in -@@ -0,0 +1,178 @@ -+#!/usr/bin/env perl -+# -+# Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+use strict; -+use warnings; -+ -+use IO::File; -+use IO::Socket; -+use Getopt::Long; -+use Net::DNS; -+use Time::HiRes qw(usleep nanosleep); -+ -+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 $send_response = 1; -+ -+my $localaddr = "10.53.0.2"; -+my $localport = @PORT@; -+my $udpsock = IO::Socket::INET->new(LocalAddr => "$localaddr", -+ LocalPort => $localport, Proto => "udp", Reuse => 1) or die "$!"; -+ -+# -+# Delegation -+# -+my $SOA = "example 300 IN SOA . . 0 0 0 0 300"; -+my $NS = "example 300 IN NS ns.example"; -+my $A = "ns.example 300 IN A $localaddr"; -+# -+# Records to be TTL stretched -+# -+my $TXT = "data.example 1 IN TXT \"A text record with a 1 second ttl\""; -+my $negSOA = "example 1 IN SOA . . 0 0 0 0 300"; -+ -+sub reply_handler { -+ my ($qname, $qclass, $qtype) = @_; -+ my ($rcode, @ans, @auth, @add); -+ -+ print ("request: $qname/$qtype\n"); -+ STDOUT->flush(); -+ -+ # Control whether we send a response or not. -+ # We always respond to control commands. -+ if ($qname eq "enable" ) { -+ if ($qtype eq "TXT") { -+ $send_response = 1; -+ my $rr = new Net::DNS::RR("$qname 0 $qclass TXT \"$send_response\""); -+ push @ans, $rr; -+ } -+ $rcode = "NOERROR"; -+ return ($rcode, \@ans, \@auth, \@add, { aa => 1 }); -+ } elsif ($qname eq "disable" ) { -+ if ($qtype eq "TXT") { -+ $send_response = 0; -+ my $rr = new Net::DNS::RR("$qname 0 $qclass TXT \"$send_response\""); -+ push @ans, $rr; -+ } -+ $rcode = "NOERROR"; -+ return ($rcode, \@ans, \@auth, \@add, { aa => 1 }); -+ } -+ -+ # If we are not responding to queries we are done. -+ return if (!$send_response); -+ -+ # Construct the response and send it. -+ if ($qname eq "ns.example" ) { -+ if ($qtype eq "A") { -+ my $rr = new Net::DNS::RR($A); -+ push @ans, $rr; -+ } else { -+ my $rr = new Net::DNS::RR($SOA); -+ push @auth, $rr; -+ } -+ $rcode = "NOERROR"; -+ } elsif ($qname eq "example") { -+ if ($qtype eq "NS") { -+ my $rr = new Net::DNS::RR($NS); -+ push @auth, $rr; -+ $rr = new Net::DNS::RR($A); -+ push @add, $rr; -+ } elsif ($qtype eq "SOA") { -+ my $rr = new Net::DNS::RR($SOA); -+ push @ans, $rr; -+ } else { -+ my $rr = new Net::DNS::RR($SOA); -+ push @auth, $rr; -+ } -+ $rcode = "NOERROR"; -+ } elsif ($qname eq "nodata.example") { -+ my $rr = new Net::DNS::RR($negSOA); -+ push @auth, $rr; -+ $rcode = "NOERROR"; -+ } elsif ($qname eq "data.example") { -+ if ($qtype eq "TXT") { -+ my $rr = new Net::DNS::RR($TXT); -+ push @ans, $rr; -+ } else { -+ my $rr = new Net::DNS::RR($negSOA); -+ push @auth, $rr; -+ } -+ $rcode = "NOERROR"; -+ } elsif ($qname eq "nxdomain.example") { -+ my $rr = new Net::DNS::RR($negSOA); -+ push @auth, $rr; -+ $rcode = "NXDOMAIN"; -+ } else { -+ my $rr = new Net::DNS::RR($SOA); -+ push @auth, $rr; -+ $rcode = "NXDOMAIN"; -+ } -+ -+ # mark the answer as authoritive (by setting the 'aa' flag -+ return ($rcode, \@ans, \@auth, \@add, { aa => 1 }); -+} -+ -+GetOptions( -+ 'port=i' => \$localport, -+); -+ -+my $rin; -+my $rout; -+ -+for (;;) { -+ $rin = ''; -+ vec($rin, fileno($udpsock), 1) = 1; -+ -+ select($rout = $rin, undef, undef, undef); -+ -+ if (vec($rout, fileno($udpsock), 1)) { -+ my ($buf, $request, $err); -+ $udpsock->recv($buf, 512); -+ -+ if ($Net::DNS::VERSION > 0.68) { -+ $request = new Net::DNS::Packet(\$buf, 0); -+ $@ and die $@; -+ } else { -+ my $err; -+ ($request, $err) = new Net::DNS::Packet(\$buf, 0); -+ $err and die $err; -+ } -+ -+ my @questions = $request->question; -+ my $qname = $questions[0]->qname; -+ my $qclass = $questions[0]->qclass; -+ my $qtype = $questions[0]->qtype; -+ my $id = $request->header->id; -+ -+ my ($rcode, $ans, $auth, $add, $headermask) = reply_handler($qname, $qclass, $qtype); -+ -+ if (!defined($rcode)) { -+ print " Silently ignoring query\n"; -+ next; -+ } -+ -+ my $reply = Net::DNS::Packet->new(); -+ $reply->header->qr(1); -+ $reply->header->aa(1) if $headermask->{'aa'}; -+ $reply->header->id($id); -+ $reply->header->rcode($rcode); -+ $reply->push("question", @questions); -+ $reply->push("answer", @$ans) if $ans; -+ $reply->push("authority", @$auth) if $auth; -+ $reply->push("additional", @$add) if $add; -+ -+ my $num_chars = $udpsock->send($reply->data); -+ print " Sent $num_chars bytes via UDP\n"; -+ } -+} -diff --git a/bin/tests/system/serve-stale/clean.sh b/bin/tests/system/serve-stale/clean.sh -new file mode 100644 -index 0000000..2397326 ---- /dev/null -+++ b/bin/tests/system/serve-stale/clean.sh -@@ -0,0 +1,15 @@ -+# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+rm -f test.output -+rm -f dig.out.test* -+rm -f ans2/ans.pl -+rm -f ns3/root.bk -+rm -f rndc.out.test* -+rm -f ns*/named.memstats -+rm -f ns*/managed-keys.bind -+rm -f ns*/named.conf -+rm -f ns*/named.run -diff --git a/bin/tests/system/serve-stale/ns1/named1.conf.in b/bin/tests/system/serve-stale/ns1/named1.conf.in -new file mode 100644 -index 0000000..8a75a10 ---- /dev/null -+++ b/bin/tests/system/serve-stale/ns1/named1.conf.in -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ */ -+ -+key rndc_key { -+ secret "1234abcd8765"; -+ algorithm hmac-sha256; -+}; -+ -+controls { -+ inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; -+}; -+ -+options { -+ query-source address 10.53.0.1; -+ notify-source 10.53.0.1; -+ transfer-source 10.53.0.1; -+ port @PORT@; -+ pid-file "named.pid"; -+ listen-on { 10.53.0.1; }; -+ listen-on-v6 { none; }; -+ recursion yes; -+ max-stale-ttl 3600; -+ stale-answer-ttl 1; -+ stale-answer-enable yes; -+}; -+ -+zone "." { -+ type master; -+ file "root.db"; -+}; -diff --git a/bin/tests/system/serve-stale/ns1/named2.conf.in b/bin/tests/system/serve-stale/ns1/named2.conf.in -new file mode 100644 -index 0000000..072e6ec ---- /dev/null -+++ b/bin/tests/system/serve-stale/ns1/named2.conf.in -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ */ -+ -+key rndc_key { -+ secret "1234abcd8765"; -+ algorithm hmac-sha256; -+}; -+ -+controls { -+ inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; -+}; -+ -+options { -+ query-source address 10.53.0.1; -+ notify-source 10.53.0.1; -+ transfer-source 10.53.0.1; -+ port @PORT@; -+ pid-file "named.pid"; -+ listen-on { 10.53.0.1; }; -+ listen-on-v6 { none; }; -+ recursion yes; -+ max-stale-ttl 7200; -+ stale-answer-ttl 2; -+ stale-answer-enable yes; -+}; -+ -+zone "." { -+ type master; -+ file "root.db"; -+}; -diff --git a/bin/tests/system/serve-stale/ns1/root.db b/bin/tests/system/serve-stale/ns1/root.db -new file mode 100644 -index 0000000..eb9ad3e ---- /dev/null -+++ b/bin/tests/system/serve-stale/ns1/root.db -@@ -0,0 +1,5 @@ -+. 300 SOA . . 0 0 0 0 0 -+. 300 NS ns.nil. -+ns.nil. 300 A 10.53.0.1 -+example. 300 NS ns.example. -+ns.example. 300 A 10.53.0.2 -diff --git a/bin/tests/system/serve-stale/ns3/named.conf.in b/bin/tests/system/serve-stale/ns3/named.conf.in -new file mode 100644 -index 0000000..24a3293 ---- /dev/null -+++ b/bin/tests/system/serve-stale/ns3/named.conf.in -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ */ -+ -+key rndc_key { -+ secret "1234abcd8765"; -+ algorithm hmac-sha256; -+}; -+ -+controls { -+ inet 10.53.0.3 port @CONTROLPORT@ allow { any; } keys { rndc_key; }; -+}; -+ -+options { -+ query-source address 10.53.0.3; -+ notify-source 10.53.0.3; -+ transfer-source 10.53.0.3; -+ port @PORT@; -+ pid-file "named.pid"; -+ listen-on { 10.53.0.3; }; -+ listen-on-v6 { none; }; -+ recursion yes; -+ // max-stale-ttl 3600; -+ // stale-answer-ttl 3; -+}; -+ -+zone "." { -+ type slave; -+ masters { 10.53.0.1; }; -+ file "root.bk"; -+}; -diff --git a/bin/tests/system/serve-stale/prereq.sh b/bin/tests/system/serve-stale/prereq.sh -new file mode 100644 -index 0000000..a3bbef8 ---- /dev/null -+++ b/bin/tests/system/serve-stale/prereq.sh -@@ -0,0 +1,38 @@ -+#!/bin/sh -+# -+# Copyright (C) 2011, 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC") -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SYSTEMTESTTOP=.. -+. $SYSTEMTESTTOP/conf.sh -+ -+if $PERL -e 'use Net::DNS;' 2>/dev/null -+then -+ if $PERL -e 'use Net::DNS; die if ($Net::DNS::VERSION >= 0.69 && $Net::DNS::VERSION <= 0.74);' 2>/dev/null -+ then -+ : -+ else -+ echo "I:Net::DNS versions 0.69 to 0.74 have bugs that cause this test to fail: please update." >&2 -+ exit 1 -+ fi -+else -+ echo "I:This test requires the Net::DNS library." >&2 -+ exit 1 -+fi -+if $PERL -e 'use Net::DNS::Nameserver;' 2>/dev/null -+then -+ : -+else -+ echo "I:This test requires the Net::DNS::Nameserver library." >&2 -+ exit 1 -+fi -+if $PERL -e 'use Time::HiRes;' 2>/dev/null -+then -+ : -+else -+ echo "I:This test requires the Time::HiRes library." >&2 -+ exit 1 -+fi -diff --git a/bin/tests/system/serve-stale/setup.sh b/bin/tests/system/serve-stale/setup.sh -new file mode 100644 -index 0000000..690f43c ---- /dev/null -+++ b/bin/tests/system/serve-stale/setup.sh -@@ -0,0 +1,13 @@ -+#!/bin/sh -+# Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC") -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SYSTEMTESTTOP=.. -+. $SYSTEMTESTTOP/conf.sh -+ -+copy_setports ns1/named1.conf.in ns1/named.conf -+copy_setports ans2/ans.pl.in ans2/ans.pl -+copy_setports ns3/named.conf.in ns3/named.conf -diff --git a/bin/tests/system/serve-stale/tests.sh b/bin/tests/system/serve-stale/tests.sh -new file mode 100755 -index 0000000..201c996 ---- /dev/null -+++ b/bin/tests/system/serve-stale/tests.sh -@@ -0,0 +1,536 @@ -+#!/bin/sh -+# -+# Copyright (C) 2000, 2001, 2004, 2007, 2009-2016 Internet Systems Consortium, Inc. ("ISC") -+# -+# This Source Code Form is subject to the terms of the Mozilla Public -+# License, v. 2.0. If a copy of the MPL was not distributed with this -+# file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ -+SYSTEMTESTTOP=.. -+. $SYSTEMTESTTOP/conf.sh -+ -+while getopts "p:c:" flag; do -+ case "$flag" in -+ p) port=$OPTARG ;; -+ c) controlport=$OPTARG ;; -+ *) exit 1 ;; -+ esac -+done -+ -+RNDCCMD="$RNDC -c $SYSTEMTESTTOP/common/rndc.conf -p ${CONTROLPORT} -s" -+ -+echo "RNDCCMD: ${RNDCCMD}" -+ -+status=0 -+n=0 -+ -+#echo "I:check ans.pl server ($n)" -+#$DIG -p ${PORT} @10.53.0.2 example NS -+#$DIG -p ${PORT} @10.53.0.2 example SOA -+#$DIG -p ${PORT} @10.53.0.2 ns.example A -+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA -+#$DIG -p ${PORT} @10.53.0.2 txt enable -+#$DIG -p ${PORT} @10.53.0.2 txt disable -+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA -+#$DIG -p ${PORT} @10.53.0.2 txt enable -+#$DIG -p ${PORT} @10.53.0.2 ns.example AAAA -+##$DIG -p ${PORT} @10.53.0.2 data.example TXT -+#$DIG -p ${PORT} @10.53.0.2 nodata.example TXT -+#$DIG -p ${PORT} @10.53.0.2 nxdomain.example TXT -+ -+n=`expr $n + 1` -+echo "I:prime cache data.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:prime cache nodata.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:prime cache nxdomain.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:disable responses from authoritative server ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.2 txt disable > dig.out.test$n -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+sleep 1 -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: on (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale off' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale off || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example (serve-stale off) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example (serve-stale off) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example (serve-stale off) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale on' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale on || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example (serve-stale on) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example (serve-stale on) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example (serve-stale on) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale no' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale no || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example (serve-stale no) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example (serve-stale no) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example (serve-stale no) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale yes' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale yes || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example (serve-stale yes) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example (serve-stale yes) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example (serve-stale yes) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale off' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale off || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale reset' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale reset || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: on (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale data.example (serve-stale reset) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nodata.example (serve-stale reset) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check stale nxdomain.example (serve-stale reset) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.1 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc serve-stale off' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale off || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: off (rndc) (stale-answer-ttl=1 max-stale-ttl=3600)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:updating ns1/named.conf ($n)" -+ret=0 -+sed -e "s/@PORT@/${PORT}/g;s/@CONTROLPORT@/${CONTROLPORT}/g" < ns1/named2.conf.in > ns1/named.conf -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:running 'rndc reload' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 reload > rndc.out.test$n 2>&1 || ret=1 -+grep "server reload successful" rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: off (rndc) (stale-answer-ttl=2 max-stale-ttl=7200)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale > rndc.out.test$n 2>&1 && ret=1 -+grep "unexpected end of input" rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale unknown' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 serve-stale unknown > rndc.out.test$n 2>&1 && ret=1 -+grep "syntax error" rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo_i "flush cache, re-enable serve-stale and query again ($n)" -+ret=0 -+$RNDCCMD 10.53.0.1 flushtree example > rndc.out.test$n.1 2>&1 || ret=1 -+$RNDCCMD 10.53.0.1 serve-stale on > rndc.out.test$n.2 2>&1 || ret=1 -+$DIG -p ${PORT} @10.53.0.1 data.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo_i "failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+ret=0 -+$DIG -p ${PORT} @10.53.0.2 txt enable > dig.out.test$n -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "TXT.\"1\"" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:prime cache data.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:prime cache nodata.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:prime cache nxdomain.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:disable responses from authoritative server ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.2 txt disable > dig.out.test$n -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "TXT.\"0\"" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+sleep 1 -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: off (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check fail of data.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check fail of nodata.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check fail of nxdomain.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n -+grep "status: SERVFAIL" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale on' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.3 serve-stale on > rndc.out.test$n 2>&1 || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check 'rndc serve-stale status' ($n)" -+ret=0 -+$RNDCCMD 10.53.0.3 serve-stale status > rndc.out.test$n 2>&1 || ret=1 -+grep '_default: on (rndc) (stale-answer-ttl=1 max-stale-ttl=604800)' rndc.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check data.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 data.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 1," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check nodata.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nodata.example TXT > dig.out.test$n -+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+n=`expr $n + 1` -+echo "I:check nxdomain.example (max-stale-ttl default) ($n)" -+ret=0 -+$DIG -p ${PORT} @10.53.0.3 nxdomain.example TXT > dig.out.test$n -+grep "status: NXDOMAIN" dig.out.test$n > /dev/null || ret=1 -+grep "ANSWER: 0," dig.out.test$n > /dev/null || ret=1 -+grep "example.*1.*IN" dig.out.test$n > /dev/null || ret=1 -+if [ $ret != 0 ]; then echo "I:failed"; fi -+status=`expr $status + $ret` -+ -+echo "I:exit status: $status" -+[ $status -eq 0 ] || exit 1 -diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml -index 539973c..8528649 100644 ---- a/doc/arm/Bv9ARM-book.xml -+++ b/doc/arm/Bv9ARM-book.xml -@@ -4376,6 +4376,9 @@ badresp:1,adberr:0,findfail:0,valfail:0] - statement in the named.conf file: - - -+ [ max-stale-ttl number ; ] -+ [ stale-answer-enable yes_or_no ; ] -+ [ stale-answer-ttl number ; ] - - -
<command>options</command> Statement Definition and -@@ -4469,6 +4472,7 @@ badresp:1,adberr:0,findfail:0,valfail:0] - <command>dnssec-validation</command>, - <command>max-cache-ttl</command>, - <command>max-ncache-ttl</command>, -+ <command>max-stale-ttl</command>, - <command>max-cache-size</command>, and - <command>zero-no-soa-ttl</command>. - </para> -@@ -5480,7 +5484,6 @@ options { - </listitem> - </varlistentry> - -- - <varlistentry> - <term><command>max-zone-ttl</command></term> - <listitem> -@@ -5516,6 +5519,21 @@ options { - </listitem> - </varlistentry> - -+ <varlistentry> -+ <term><command>stale-answer-ttl</command></term> -+ <listitem> -+ <para> -+ Specifies the TTL to be returned on stale answers. -+ The default is 1 second. The minimal allowed is -+ also 1 second; a value of 0 will be updated silently -+ to 1 second. For stale answers to be returned -+ <option>max-stale-ttl</option> must be set to a -+ non zero value and they must not have been disabled -+ by <command>rndc</command>. -+ </para> -+ </listitem> -+ </varlistentry> -+ - <varlistentry> - <term><command>serial-update-method</command></term> - <listitem> -@@ -6275,6 +6293,22 @@ options { - </listitem> - </varlistentry> - -+ <varlistentry> -+ <term><command>serve-stale-enable</command></term> -+ <listitem> -+ <para> -+ Enable the returning of stale answers when the -+ nameservers for the zone are not answering. This -+ is off by default but can be enabled/disabled via -+ <command>rndc server-stale on</command> and -+ <command>rndc server-stale off</command> which -+ override the named.conf setting. <command>rndc -+ server-stale reset</command> will restore control -+ via named.conf. -+ </para> -+ </listitem> -+ </varlistentry> -+ - <varlistentry> - <term><command>nocookie-udp-size</command></term> - <listitem> -@@ -7483,14 +7517,20 @@ options { - <term><command>resolver-query-timeout</command></term> - <listitem> - <para> -- The amount of time in seconds that the resolver -+ The amount of time in milliseconds that the resolver - will spend attempting to resolve a recursive - query before failing. The default and minimum -- is <literal>10</literal> and the maximum is -- <literal>30</literal>. Setting it to -+ is <literal>10000</literal> and the maximum is -+ <literal>30000</literal>. Setting it to - <literal>0</literal> will result in the default - being used. - </para> -+ <para> -+ This value was originally specified in seconds. -+ Values less than or equal to 300 will be be treated -+ as seconds and converted to milliseconds before -+ applying the above limits. -+ </para> - </listitem> - </varlistentry> - </variablelist> -@@ -8976,6 +9016,27 @@ avoid-v6-udp-ports { 40000; range 50000 60000; }; - </listitem> - </varlistentry> - -+ <varlistentry> -+ <term><command>max-stale-ttl</command></term> -+ <listitem> -+ <para> -+ Sets the maximum time for which the server will -+ retain records past their normal expiry to -+ return them as stale records when the servers -+ for those records are not reachable. The default -+ is to not retain the record. -+ </para> -+ <para> -+ <command>rndc serve-stale</command> can be used -+ to disable and re-enable the serving of stale -+ records at runtime. Reloading or reconfiguring -+ <command>named</command> will not re-enable serving -+ of stale records if they have been disabled via -+ <command>rndc</command>. -+ </para> -+ </listitem> -+ </varlistentry> -+ - <varlistentry> - <term><command>min-roots</command></term> - <listitem> -diff --git a/doc/arm/logging-categories.xml b/doc/arm/logging-categories.xml -index 181def7..59f6afb 100644 ---- a/doc/arm/logging-categories.xml -+++ b/doc/arm/logging-categories.xml -@@ -311,6 +311,17 @@ - </para> - </entry> - </row> -+ <row rowsep="0"> -+ <entry colname="1"> -+ <para><command>serve-stale</command></para> -+ </entry> -+ <entry colname="2"> -+ <para> -+ Whether or not a stale answer is used -+ following a resolver failure. -+ </para> -+ </entry> -+ </row> - <row rowsep="0"> - <entry colname="1"> - <para><command>spill</command></para> -diff --git a/doc/arm/notes-rh-changes.xml b/doc/arm/notes-rh-changes.xml -index 11c3a7c..ba3c2cc 100644 ---- a/doc/arm/notes-rh-changes.xml -+++ b/doc/arm/notes-rh-changes.xml -@@ -13,6 +13,9 @@ - <section xml:id="relnotes_rh_changes"><info><title>Red Hat Specific Changes - - -+ -+ This version includes some features not present in releases by ISC. -+ - - By default, BIND now uses the random number generation functions - in the cryptographic library (i.e., OpenSSL or a PKCS#11 -@@ -37,7 +40,16 @@ - case /dev/random will be the default - entropy source. [RT #31459] [RT #46047] - -- -+ -+ When acting as a recursive resolver, named -+ can now continue returning answers whose TTLs have expired -+ when the authoritative server is under attack and unable to -+ respond. This is controlled by the -+ stale-answer-enable, -+ stale-answer-ttl and -+ max-stale-ttl options. [RT #44790] -+ -+ - -
- -diff --git a/doc/misc/options b/doc/misc/options -index e11beed..fde93c7 100644 ---- a/doc/misc/options -+++ b/doc/misc/options -@@ -225,6 +225,7 @@ options { - max-refresh-time ; - max-retry-time ; - max-rsa-exponent-size ; -+ max-stale-ttl ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; -@@ -298,7 +299,9 @@ options { - request-sit ; // obsolete - require-server-cookie ; - reserved-sockets ; -+ resolver-nonbackoff-tries ; - resolver-query-timeout ; -+ resolver-retry-interval ; - response-policy { zone [ log ] [ max-policy-ttl - ] [ policy ( cname | disabled | drop | given | no-op - | nodata | nxdomain | passthru | tcp-only ) ] [ -@@ -328,6 +331,8 @@ options { - sit-secret ; // obsolete - sortlist { ; ... }; - stacksize ( default | unlimited | ); -+ stale-answer-enable ; -+ stale-answer-ttl ; - startup-notify-rate ; - statistics-file ; - statistics-interval ; // not yet implemented -@@ -539,6 +544,7 @@ view [ ] { - max-recursion-queries ; - max-refresh-time ; - max-retry-time ; -+ max-stale-ttl ; - max-transfer-idle-in ; - max-transfer-idle-out ; - max-transfer-time-in ; -@@ -600,7 +606,9 @@ view [ ] { - request-nsid ; - request-sit ; // obsolete - require-server-cookie ; -+ resolver-nonbackoff-tries ; - resolver-query-timeout ; -+ resolver-retry-interval ; - response-policy { zone [ log ] [ max-policy-ttl - ] [ policy ( cname | disabled | drop | given | no-op - | nodata | nxdomain | passthru | tcp-only ) ] [ -@@ -655,6 +663,8 @@ view [ ] { - sig-signing-type ; - sig-validity-interval [ ]; - sortlist { ; ... }; -+ stale-answer-enable ; -+ stale-answer-ttl ; - suppress-initial-notify ; // not yet implemented - topology { ; ... }; // not implemented - transfer-format ( many-answers | one-answer ); -diff --git a/lib/bind9/check.c b/lib/bind9/check.c -index bd16aec..91cedb7 100644 ---- a/lib/bind9/check.c -+++ b/lib/bind9/check.c -@@ -99,7 +99,8 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "rrset-order: invalid class '%s'", - r.base); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - -@@ -112,7 +113,8 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "rrset-order: invalid type '%s'", - r.base); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - -@@ -126,7 +128,8 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) { - if (tresult != ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "rrset-order: invalid name '%s'", str); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - -@@ -135,14 +138,16 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) { - strcasecmp("order", cfg_obj_asstring(obj)) != 0) { - cfg_obj_log(ent, logctx, ISC_LOG_ERROR, - "rrset-order: keyword 'order' missing"); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - - obj = cfg_tuple_get(ent, "ordering"); - if (!cfg_obj_isstring(obj)) { - cfg_obj_log(ent, logctx, ISC_LOG_ERROR, - "rrset-order: missing ordering"); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } else if (strcasecmp(cfg_obj_asstring(obj), "fixed") == 0) { - #if !DNS_RDATASET_FIXED - cfg_obj_log(obj, logctx, ISC_LOG_WARNING, -@@ -154,7 +159,8 @@ check_orderent(const cfg_obj_t *ent, isc_log_t *logctx) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "rrset-order: invalid order '%s'", - cfg_obj_asstring(obj)); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - return (result); - } -@@ -174,7 +180,7 @@ check_order(const cfg_obj_t *options, isc_log_t *logctx) { - element = cfg_list_next(element)) - { - tresult = check_orderent(cfg_listelt_value(element), logctx); -- if (tresult != ISC_R_SUCCESS) -+ if (result == ISC_R_SUCCESS && tresult != ISC_R_SUCCESS) - result = tresult; - } - return (result); -@@ -204,7 +210,8 @@ check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) { - if (val > UINT16_MAX) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "port '%u' out of range", val); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - } - obj = cfg_tuple_get(alternates, "addresses"); -@@ -224,7 +231,8 @@ check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) { - if (tresult != ISC_R_SUCCESS) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "bad name '%s'", str); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = tresult; - } - obj = cfg_tuple_get(value, "port"); - if (cfg_obj_isuint32(obj)) { -@@ -232,7 +240,8 @@ check_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) { - if (val > UINT16_MAX) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "port '%u' out of range", val); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - } - } -@@ -1271,7 +1280,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "auto-dnssec may only be activated at the " - "zone level"); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - -@@ -1291,7 +1301,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - { - obj = cfg_listelt_value(element); - tresult = mustbesecure(obj, symtab, logctx, mctx); -- if (tresult != ISC_R_SUCCESS) -+ if (result == ISC_R_SUCCESS && tresult != ISC_R_SUCCESS) - result = tresult; - } - if (symtab != NULL) -@@ -1310,7 +1320,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "%s: invalid name '%s'", - server_contact[i], str); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - } -@@ -1330,7 +1341,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "disable-empty-zone: invalid name '%s'", - str); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - } - -@@ -1344,11 +1356,12 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - strlen(cfg_obj_asstring(obj)) > 1024U) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "'server-id' too big (>1024 bytes)"); -- result = ISC_R_FAILURE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_FAILURE; - } - - tresult = check_dscp(options, logctx); -- if (tresult != ISC_R_SUCCESS) -+ if (result == ISC_R_SUCCESS && tresult != ISC_R_SUCCESS) - result = tresult; - - obj = NULL; -@@ -1358,11 +1371,13 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - if (lifetime > 604800) { /* 7 days */ - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "'nta-lifetime' cannot exceed one week"); -- result = ISC_R_RANGE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } else if (lifetime == 0) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "'nta-lifetime' may not be zero"); -- result = ISC_R_RANGE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - } - -@@ -1373,7 +1388,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - if (recheck > 604800) { /* 7 days */ - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "'nta-recheck' cannot exceed one week"); -- result = ISC_R_RANGE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - - if (recheck > lifetime) -@@ -1391,7 +1407,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - if (strcasecmp(ccalg, "aes") == 0) { - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "cookie-algorithm: '%s' not supported", ccalg); -- result = ISC_R_NOTIMPLEMENTED; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_NOTIMPLEMENTED; - } - #endif - -@@ -1480,7 +1497,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - cfg_obj_log(obj, logctx, ISC_LOG_ERROR, - "%s out of range (%u < %u)", - fstrm[i].name, value, fstrm[i].min); -- result = ISC_R_RANGE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - - if (strcmp(fstrm[i].name, "fstrm-set-input-queue-size") == 0) { -@@ -1494,7 +1512,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - "%s '%u' not a power-of-2", - fstrm[i].name, - cfg_obj_asuint32(obj)); -- result = ISC_R_RANGE; -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - } - } -@@ -1512,7 +1531,8 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - "%" PRId64 "' " - "is too small", - mapsize); -- return (ISC_R_RANGE); -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } else if (mapsize > (1ULL << 40)) { /* 1 terabyte */ - cfg_obj_log(obj, logctx, - ISC_LOG_ERROR, -@@ -1520,10 +1540,20 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx, - "%" PRId64 "' " - "is too large", - mapsize); -- return (ISC_R_RANGE); -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; - } - } - -+ obj = NULL; -+ (void)cfg_map_get(options, "resolver-nonbackoff-tries", &obj); -+ if (obj != NULL && cfg_obj_asuint32(obj) == 0U) { -+ cfg_obj_log(obj, logctx, ISC_LOG_ERROR, -+ "'resolver-nonbackoff-tries' must be >= 1"); -+ if (result == ISC_R_SUCCESS) -+ result = ISC_R_RANGE; -+ } -+ - return (result); - } - -diff --git a/lib/dns/cache.c b/lib/dns/cache.c -index 4701ff8..97e427a 100644 ---- a/lib/dns/cache.c -+++ b/lib/dns/cache.c -@@ -138,6 +138,7 @@ struct dns_cache { - int db_argc; - char **db_argv; - size_t size; -+ dns_ttl_t serve_stale_ttl; - isc_stats_t *stats; - - /* Locked by 'filelock'. */ -@@ -167,9 +168,13 @@ overmem_cleaning_action(isc_task_t *task, isc_event_t *event); - - static inline isc_result_t - cache_create_db(dns_cache_t *cache, dns_db_t **db) { -- return (dns_db_create(cache->mctx, cache->db_type, dns_rootname, -- dns_dbtype_cache, cache->rdclass, -- cache->db_argc, cache->db_argv, db)); -+ isc_result_t result; -+ result = dns_db_create(cache->mctx, cache->db_type, dns_rootname, -+ dns_dbtype_cache, cache->rdclass, -+ cache->db_argc, cache->db_argv, db); -+ if (result == ISC_R_SUCCESS) -+ dns_db_setservestalettl(*db, cache->serve_stale_ttl); -+ return (result); - } - - isc_result_t -@@ -238,6 +243,7 @@ dns_cache_create3(isc_mem_t *cmctx, isc_mem_t *hmctx, isc_taskmgr_t *taskmgr, - cache->references = 1; - cache->live_tasks = 0; - cache->rdclass = rdclass; -+ cache->serve_stale_ttl = 0; - - cache->stats = NULL; - result = isc_stats_create(cmctx, &cache->stats, -@@ -1092,6 +1098,32 @@ dns_cache_getcachesize(dns_cache_t *cache) { - return (size); - } - -+void -+dns_cache_setservestalettl(dns_cache_t *cache, dns_ttl_t ttl) { -+ REQUIRE(VALID_CACHE(cache)); -+ -+ LOCK(&cache->lock); -+ cache->serve_stale_ttl = ttl; -+ UNLOCK(&cache->lock); -+ -+ (void)dns_db_setservestalettl(cache->db, ttl); -+} -+ -+dns_ttl_t -+dns_cache_getservestalettl(dns_cache_t *cache) { -+ dns_ttl_t ttl; -+ isc_result_t result; -+ -+ REQUIRE(VALID_CACHE(cache)); -+ -+ /* -+ * Could get it straight from the dns_cache_t, but use db -+ * to confirm the value that the db is really using. -+ */ -+ result = dns_db_getservestalettl(cache->db, &ttl); -+ return result == ISC_R_SUCCESS ? ttl : 0; -+} -+ - /* - * The cleaner task is shutting down; do the necessary cleanup. - */ -diff --git a/lib/dns/db.c b/lib/dns/db.c -index ee3e00d..576aa65 100644 ---- a/lib/dns/db.c -+++ b/lib/dns/db.c -@@ -1130,3 +1130,25 @@ dns_db_nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name) { - return (ISC_R_NOTIMPLEMENTED); - return ((db->methods->nodefullname)(db, node, name)); - } -+ -+isc_result_t -+dns_db_setservestalettl(dns_db_t *db, dns_ttl_t ttl) -+{ -+ REQUIRE(DNS_DB_VALID(db)); -+ REQUIRE((db->attributes & DNS_DBATTR_CACHE) != 0); -+ -+ if (db->methods->setservestalettl != NULL) -+ return ((db->methods->setservestalettl)(db, ttl)); -+ return (ISC_R_NOTIMPLEMENTED); -+} -+ -+isc_result_t -+dns_db_getservestalettl(dns_db_t *db, dns_ttl_t *ttl) -+{ -+ REQUIRE(DNS_DB_VALID(db)); -+ REQUIRE((db->attributes & DNS_DBATTR_CACHE) != 0); -+ -+ if (db->methods->getservestalettl != NULL) -+ return ((db->methods->getservestalettl)(db, ttl)); -+ return (ISC_R_NOTIMPLEMENTED); -+} -diff --git a/lib/dns/ecdb.c b/lib/dns/ecdb.c -index 47994ea..23bfe7d 100644 ---- a/lib/dns/ecdb.c -+++ b/lib/dns/ecdb.c -@@ -588,7 +588,9 @@ static dns_dbmethods_t ecdb_methods = { - NULL, /* setcachestats */ - NULL, /* hashsize */ - NULL, /* nodefullname */ -- NULL /* getsize */ -+ NULL, /* getsize */ -+ NULL, /* setservestalettl */ -+ NULL /* getservestalettl */ - }; - - static isc_result_t -diff --git a/lib/dns/include/dns/cache.h b/lib/dns/include/dns/cache.h -index 62797db..714b78e 100644 ---- a/lib/dns/include/dns/cache.h -+++ b/lib/dns/include/dns/cache.h -@@ -260,6 +260,27 @@ dns_cache_getcachesize(dns_cache_t *cache); - * Get the maximum cache size. - */ - -+void -+dns_cache_setservestalettl(dns_cache_t *cache, dns_ttl_t ttl); -+/*%< -+ * Sets the maximum length of time that cached answers may be retained -+ * past their normal TTL. Default value for the library is 0, disabling -+ * the use of stale data. -+ * -+ * Requires: -+ *\li 'cache' to be valid. -+ */ -+ -+dns_ttl_t -+dns_cache_getservestalettl(dns_cache_t *cache); -+/*%< -+ * Gets the maximum length of time that cached answers may be kept past -+ * normal expiry. -+ * -+ * Requires: -+ *\li 'cache' to be valid. -+ */ -+ - isc_result_t - dns_cache_flush(dns_cache_t *cache); - /*%< -diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h -index ae6ae36..5079053 100644 ---- a/lib/dns/include/dns/db.h -+++ b/lib/dns/include/dns/db.h -@@ -197,6 +197,8 @@ typedef struct dns_dbmethods { - dns_name_t *name); - isc_result_t (*getsize)(dns_db_t *db, dns_dbversion_t *version, - uint64_t *records, uint64_t *bytes); -+ isc_result_t (*setservestalettl)(dns_db_t *db, dns_ttl_t ttl); -+ isc_result_t (*getservestalettl)(dns_db_t *db, dns_ttl_t *ttl); - } dns_dbmethods_t; - - typedef isc_result_t -@@ -255,6 +257,7 @@ struct dns_dbonupdatelistener { - #define DNS_DBFIND_FORCENSEC3 0x0080 - #define DNS_DBFIND_ADDITIONALOK 0x0100 - #define DNS_DBFIND_NOZONECUT 0x0200 -+#define DNS_DBFIND_STALEOK 0x0400 - /*@}*/ - - /*@{*/ -@@ -1685,6 +1688,38 @@ dns_db_nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name); - * \li 'db' is a valid database - * \li 'node' and 'name' are not NULL - */ -+ -+isc_result_t -+dns_db_setservestalettl(dns_db_t *db, dns_ttl_t ttl); -+/*%< -+ * Sets the maximum length of time that cached answers may be retained -+ * past their normal TTL. Default value for the library is 0, disabling -+ * the use of stale data. -+ * -+ * Requires: -+ * \li 'db' is a valid cache database. -+ * \li 'ttl' is the number of seconds to retain data past its normal expiry. -+ * -+ * Returns: -+ * \li #ISC_R_SUCCESS -+ * \li #ISC_R_NOTIMPLEMENTED - Not supported by this DB implementation. -+ */ -+ -+isc_result_t -+dns_db_getservestalettl(dns_db_t *db, dns_ttl_t *ttl); -+/*%< -+ * Gets maximum length of time that cached answers may be kept past -+ * normal TTL expiration. -+ * -+ * Requires: -+ * \li 'db' is a valid cache database. -+ * \li 'ttl' is the number of seconds to retain data past its normal expiry. -+ * -+ * Returns: -+ * \li #ISC_R_SUCCESS -+ * \li #ISC_R_NOTIMPLEMENTED - Not supported by this DB implementation. -+ */ -+ - ISC_LANG_ENDDECLS - - #endif /* DNS_DB_H */ -diff --git a/lib/dns/include/dns/rdataset.h b/lib/dns/include/dns/rdataset.h -index 5295d8e..97071ed 100644 ---- a/lib/dns/include/dns/rdataset.h -+++ b/lib/dns/include/dns/rdataset.h -@@ -128,6 +128,7 @@ struct dns_rdataset { - unsigned int magic; /* XXX ? */ - dns_rdatasetmethods_t * methods; - ISC_LINK(dns_rdataset_t) link; -+ - /* - * XXX do we need these, or should they be retrieved by methods? - * Leaning towards the latter, since they are not frequently required -@@ -136,12 +137,19 @@ struct dns_rdataset { - dns_rdataclass_t rdclass; - dns_rdatatype_t type; - dns_ttl_t ttl; -+ /* -+ * Stale ttl is used to see how long this RRset can still be used -+ * to serve to clients, after the TTL has expired. -+ */ -+ dns_ttl_t stale_ttl; - dns_trust_t trust; - dns_rdatatype_t covers; -+ - /* - * attributes - */ - unsigned int attributes; -+ - /*% - * the counter provides the starting point in the "cyclic" order. - * The value UINT32_MAX has a special meaning of "picking up a -@@ -149,11 +157,13 @@ struct dns_rdataset { - * increment the counter. - */ - uint32_t count; -+ - /* - * This RRSIG RRset should be re-generated around this time. - * Only valid if DNS_RDATASETATTR_RESIGN is set in attributes. - */ - isc_stdtime_t resign; -+ - /*@{*/ - /*% - * These are for use by the rdataset implementation, and MUST NOT -@@ -206,6 +216,7 @@ struct dns_rdataset { - #define DNS_RDATASETATTR_OPTOUT 0x00100000 /*%< OPTOUT proof */ - #define DNS_RDATASETATTR_NEGATIVE 0x00200000 - #define DNS_RDATASETATTR_PREFETCH 0x00400000 -+#define DNS_RDATASETATTR_STALE 0x01000000 - - /*% - * _OMITDNSSEC: -diff --git a/lib/dns/include/dns/resolver.h b/lib/dns/include/dns/resolver.h -index 6da41b7..7b397cb 100644 ---- a/lib/dns/include/dns/resolver.h -+++ b/lib/dns/include/dns/resolver.h -@@ -547,9 +547,12 @@ dns_resolver_getmustbesecure(dns_resolver_t *resolver, dns_name_t *name); - - - void --dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds); -+dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int timeout); - /*%< -- * Set the length of time the resolver will work on a query, in seconds. -+ * Set the length of time the resolver will work on a query, in milliseconds. -+ * -+ * 'timeout' was originally defined in seconds, and later redefined to be in -+ * milliseconds. Values less than or equal to 300 are treated as seconds. - * - * If timeout is 0, the default timeout will be applied. - * -@@ -560,7 +563,8 @@ dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds); - unsigned int - dns_resolver_gettimeout(dns_resolver_t *resolver); - /*%< -- * Get the current length of time the resolver will work on a query, in seconds. -+ * Get the current length of time the resolver will work on a query, -+ * in milliseconds. - * - * Requires: - * \li resolver to be valid. -@@ -582,6 +586,39 @@ dns_resolver_getzeronosoattl(dns_resolver_t *resolver); - void - dns_resolver_setzeronosoattl(dns_resolver_t *resolver, bool state); - -+unsigned int -+dns_resolver_getretryinterval(dns_resolver_t *resolver); -+ -+void -+dns_resolver_setretryinterval(dns_resolver_t *resolver, unsigned int interval); -+/*%< -+ * Sets the amount of time, in millseconds, that is waited for a reply -+ * to a server before another server is tried. Interacts with the -+ * value of dns_resolver_getnonbackofftries() by trying that number of times -+ * at this interval, before doing exponential backoff and doubling the interval -+ * on each subsequent try, to a maximum of 10 seconds. Defaults to 800 ms; -+ * silently capped at 2000 ms. -+ * -+ * Requires: -+ * \li resolver to be valid. -+ * \li interval > 0. -+ */ -+ -+unsigned int -+dns_resolver_getnonbackofftries(dns_resolver_t *resolver); -+ -+void -+dns_resolver_setnonbackofftries(dns_resolver_t *resolver, unsigned int tries); -+/*%< -+ * Sets the number of failures of getting a reply from remote servers for -+ * a query before backing off by doubling the retry interval for each -+ * subsequent request sent. Defaults to 3. -+ * -+ * Requires: -+ * \li resolver to be valid. -+ * \li tries > 0. -+ */ -+ - unsigned int - dns_resolver_getoptions(dns_resolver_t *resolver); - -diff --git a/lib/dns/include/dns/types.h b/lib/dns/include/dns/types.h -index 567e8a8..7bf2b60 100644 ---- a/lib/dns/include/dns/types.h -+++ b/lib/dns/include/dns/types.h -@@ -385,6 +385,12 @@ typedef enum { - dns_updatemethod_date - } dns_updatemethod_t; - -+typedef enum { -+ dns_stale_answer_no, -+ dns_stale_answer_yes, -+ dns_stale_answer_conf -+} dns_stale_answer_t; -+ - /* - * Functions. - */ -diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h -index c849dec..647ca2a 100644 ---- a/lib/dns/include/dns/view.h -+++ b/lib/dns/include/dns/view.h -@@ -229,6 +229,9 @@ struct dns_view { - dns_dtenv_t *dtenv; /* Dnstap environment */ - dns_dtmsgtype_t dttypes; /* Dnstap message types - to log */ -+ dns_ttl_t staleanswerttl; -+ dns_stale_answer_t staleanswersok; /* rndc setting */ -+ bool staleanswersenable; /* named.conf setting */ - }; - - #define DNS_VIEW_MAGIC ISC_MAGIC('V','i','e','w') -diff --git a/lib/dns/master.c b/lib/dns/master.c -index 2a87bca..ac4bb19 100644 ---- a/lib/dns/master.c -+++ b/lib/dns/master.c -@@ -1948,12 +1948,18 @@ load_text(dns_loadctx_t *lctx) { - - if ((lctx->options & DNS_MASTER_AGETTL) != 0) { - /* -- * Adjust the TTL for $DATE. If the RR has already -- * expired, ignore it. -+ * Adjust the TTL for $DATE. If the RR has -+ * already expired, set its TTL to 0. This -+ * should be okay even if the TTL stretching -+ * feature is not in effect, because it will -+ * just be quickly expired by the cache, and the -+ * way this was written before the patch it -+ * could potentially add 0 TTLs anyway. - */ - if (lctx->ttl < ttl_offset) -- continue; -- lctx->ttl -= ttl_offset; -+ lctx->ttl = 0; -+ else -+ lctx->ttl -= ttl_offset; - } - - /* -diff --git a/lib/dns/masterdump.c b/lib/dns/masterdump.c -index 13d1a3e..873b694 100644 ---- a/lib/dns/masterdump.c -+++ b/lib/dns/masterdump.c -@@ -81,6 +81,9 @@ struct dns_master_style { - */ - #define DNS_TOTEXT_LINEBREAK_MAXLEN 100 - -+/*% Does the rdataset 'r' contain a stale answer? */ -+#define STALE(r) (((r)->attributes & DNS_RDATASETATTR_STALE) != 0) -+ - /*% - * Context structure for a masterfile dump in progress. - */ -@@ -94,6 +97,7 @@ typedef struct dns_totext_ctx { - dns_fixedname_t origin_fixname; - uint32_t current_ttl; - bool current_ttl_valid; -+ dns_ttl_t serve_stale_ttl; - } dns_totext_ctx_t; - - LIBDNS_EXTERNAL_DATA const dns_master_style_t -@@ -382,6 +386,7 @@ totext_ctx_init(const dns_master_style_t *style, dns_totext_ctx_t *ctx) { - ctx->neworigin = NULL; - ctx->current_ttl = 0; - ctx->current_ttl_valid = false; -+ ctx->serve_stale_ttl = 0; - - return (ISC_R_SUCCESS); - } -@@ -1028,6 +1033,11 @@ dump_rdatasets_text(isc_mem_t *mctx, dns_name_t *name, - (ctx->style.flags & DNS_STYLEFLAG_NCACHE) == 0) { - /* Omit negative cache entries */ - } else { -+ if (STALE(rds)) { -+ fprintf(f, "; stale (for %u more seconds)\n", -+ (rds->stale_ttl - -+ ctx->serve_stale_ttl)); -+ } - isc_result_t result = - dump_rdataset(mctx, name, rds, ctx, - buffer, f); -@@ -1496,6 +1506,16 @@ dumpctx_create(isc_mem_t *mctx, dns_db_t *db, dns_dbversion_t *version, - dns_db_attach(db, &dctx->db); - - dctx->do_date = dns_db_iscache(dctx->db); -+ if (dctx->do_date) { -+ /* -+ * Adjust the date backwards by the serve-stale TTL, if any. -+ * This is so the TTL will be loaded correctly when next -+ * started. -+ */ -+ (void)dns_db_getservestalettl(dctx->db, -+ &dctx->tctx.serve_stale_ttl); -+ dctx->now -= dctx->tctx.serve_stale_ttl; -+ } - - if (dctx->format == dns_masterformat_text && - (dctx->tctx.style.flags & DNS_STYLEFLAG_REL_OWNER) != 0) { -@@ -1555,6 +1575,9 @@ writeheader(dns_dumpctx_t *dctx) { - * it in the zone case. - */ - if (dctx->do_date) { -+ fprintf(dctx->f, -+ "; using a %d second stale ttl\n", -+ dctx->tctx.serve_stale_ttl); - result = dns_time32_totext(dctx->now, &buffer); - RUNTIME_CHECK(result == ISC_R_SUCCESS); - isc_buffer_usedregion(&buffer, &r); -diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c -index 68e6a89..d8b5c60 100644 ---- a/lib/dns/rbtdb.c -+++ b/lib/dns/rbtdb.c -@@ -488,6 +488,7 @@ typedef ISC_LIST(rdatasetheader_t) rdatasetheaderlist_t; - typedef ISC_LIST(dns_rbtnode_t) rbtnodelist_t; - - #define RDATASET_ATTR_NONEXISTENT 0x0001 -+/*%< May be potentially served as stale data. */ - #define RDATASET_ATTR_STALE 0x0002 - #define RDATASET_ATTR_IGNORE 0x0004 - #define RDATASET_ATTR_RETAIN 0x0008 -@@ -500,6 +501,8 @@ typedef ISC_LIST(dns_rbtnode_t) rbtnodelist_t; - #define RDATASET_ATTR_CASESET 0x0400 - #define RDATASET_ATTR_ZEROTTL 0x0800 - #define RDATASET_ATTR_CASEFULLYLOWER 0x1000 -+/*%< Ancient - awaiting cleanup. */ -+#define RDATASET_ATTR_ANCIENT 0x2000 - - typedef struct acache_cbarg { - dns_rdatasetadditional_t type; -@@ -550,6 +553,8 @@ struct acachectl { - (((header)->attributes & RDATASET_ATTR_ZEROTTL) != 0) - #define CASEFULLYLOWER(header) \ - (((header)->attributes & RDATASET_ATTR_CASEFULLYLOWER) != 0) -+#define ANCIENT(header) \ -+ (((header)->attributes & RDATASET_ATTR_ANCIENT) != 0) - - - #define ACTIVE(header, now) \ -@@ -609,6 +614,12 @@ typedef enum { - expire_flush - } expire_t; - -+typedef enum { -+ rdataset_ttl_fresh, -+ rdataset_ttl_stale, -+ rdataset_ttl_ancient -+} rdataset_ttl_t; -+ - typedef struct rbtdb_version { - /* Not locked */ - rbtdb_serial_t serial; -@@ -676,6 +687,12 @@ struct dns_rbtdb { - dns_dbnode_t *soanode; - dns_dbnode_t *nsnode; - -+ /* -+ * Maximum length of time to keep using a stale answer past its -+ * normal TTL expiry. -+ */ -+ dns_ttl_t serve_stale_ttl; -+ - /* - * This is a linked list used to implement the LRU cache. There will - * be node_lock_count linked lists here. Nodes in bucket 1 will be -@@ -719,6 +736,8 @@ struct dns_rbtdb { - #define RBTDB_ATTR_LOADED 0x01 - #define RBTDB_ATTR_LOADING 0x02 - -+#define KEEPSTALE(rbtdb) ((rbtdb)->serve_stale_ttl > 0) -+ - /*% - * Search Context - */ -@@ -1784,15 +1803,15 @@ rollback_node(dns_rbtnode_t *node, rbtdb_serial_t serial) { - } - - static inline void --mark_stale_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header) { -+mark_header_ancient(dns_rbtdb_t *rbtdb, rdatasetheader_t *header) { - - /* -- * If we are already stale there is nothing to do. -+ * If we are already ancient there is nothing to do. - */ -- if ((header->attributes & RDATASET_ATTR_STALE) != 0) -+ if (ANCIENT(header)) - return; - -- header->attributes |= RDATASET_ATTR_STALE; -+ header->attributes |= RDATASET_ATTR_ANCIENT; - header->node->dirty = 1; - - /* -@@ -1833,8 +1852,8 @@ clean_cache_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) { - /* - * If current is nonexistent or stale, we can clean it up. - */ -- if ((current->attributes & -- (RDATASET_ATTR_NONEXISTENT|RDATASET_ATTR_STALE)) != 0) { -+ if (NONEXISTENT(current) || ANCIENT(current) || -+ (STALE(current) && ! KEEPSTALE(rbtdb))) { - if (top_prev != NULL) - top_prev->next = current->next; - else -@@ -2079,6 +2098,80 @@ delete_node(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node) { - } - } - -+#if 0 -+static void -+clean_now_or_later(dns_rbtnode_t *node, dns_rbtdb_t *rbtdb, -+ rdatasetheader_t *header, rdatasetheader_t **header_prevp) -+{ -+ if (dns_rbtnode_refcurrent(node) == 0) { -+ isc_mem_t *mctx; -+ -+ /* -+ * header->down can be non-NULL if the refcount has just -+ * decremented to 0 but decrement_reference() has not performed -+ * clean_cache_node(), in which case we need to purge the stale -+ * headers first. -+ */ -+ mctx = rbtdb->common.mctx; -+ clean_stale_headers(rbtdb, mctx, header); -+ if (*header_prevp != NULL) -+ (*header_prevp)->next = header->next; -+ else -+ node->data = header->next; -+ free_rdataset(rbtdb, mctx, header); -+ } else { -+ header->attributes |= RDATASET_ATTR_STALE | -+ RDATASET_ATTR_ANCIENT; -+ node->dirty = 1; -+ *header_prevp = header; -+ } -+} -+ -+static rdataset_ttl_t -+check_ttl(dns_rbtnode_t *node, rbtdb_search_t *search, -+ rdatasetheader_t *header, rdatasetheader_t **header_prevp, -+ nodelock_t *lock, isc_rwlocktype_t *locktype) -+{ -+ dns_rbtdb_t *rbtdb = search->rbtdb; -+ -+ if (header->rdh_ttl > search->now) -+ return rdataset_ttl_fresh; -+ -+ /* -+ * This rdataset is stale, but perhaps still usable. -+ */ -+ if (KEEPSTALE(rbtdb) && -+ header->rdh_ttl + rbtdb->serve_stale_ttl > search->now) { -+ header->attributes |= RDATASET_ATTR_STALE; -+ /* Doesn't set dirty because it doesn't need removal. */ -+ return rdataset_ttl_stale; -+ } -+ -+ /* -+ * This rdataset is so stale it is no longer usable, even with -+ * KEEPSTALE. If no one else is using the node, we can clean it up -+ * right now, otherwise we mark it as ancient, and the node as dirty, -+ * so it will get cleaned up later. -+ */ -+ if ((header->rdh_ttl <= search->now - RBTDB_VIRTUAL) && -+ (*locktype == isc_rwlocktype_write || -+ NODE_TRYUPGRADE(lock) == ISC_R_SUCCESS)) { -+ /* -+ * We update the node's status only when we can get write -+ * access; otherwise, we leave others to this work. Periodical -+ * cleaning will eventually take the job as the last resort. -+ * We won't downgrade the lock, since other rdatasets are -+ * probably stale, too. -+ */ -+ *locktype = isc_rwlocktype_write; -+ clean_now_or_later(node, rbtdb, header, header_prevp); -+ } else -+ *header_prevp = header; -+ -+ return rdataset_ttl_ancient; -+} -+#endif -+ - /* - * Caller must be holding the node lock. - */ -@@ -3316,6 +3409,12 @@ bind_rdataset(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node, - rdataset->attributes |= DNS_RDATASETATTR_OPTOUT; - if (PREFETCH(header)) - rdataset->attributes |= DNS_RDATASETATTR_PREFETCH; -+ if (STALE(header)) { -+ rdataset->attributes |= DNS_RDATASETATTR_STALE; -+ rdataset->stale_ttl = -+ (rbtdb->serve_stale_ttl + header->rdh_ttl) - now; -+ rdataset->ttl = 0; -+ } - rdataset->private1 = rbtdb; - rdataset->private2 = node; - raw = (unsigned char *)header + sizeof(*header); -@@ -4656,6 +4755,19 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header, - #endif - - if (!ACTIVE(header, search->now)) { -+ dns_ttl_t stale = header->rdh_ttl + -+ search->rbtdb->serve_stale_ttl; -+ /* -+ * If this data is in the stale window keep it and if -+ * DNS_DBFIND_STALEOK is not set we tell the caller to -+ * skip this record. -+ */ -+ if (KEEPSTALE(search->rbtdb) && stale > search->now) { -+ header->attributes |= RDATASET_ATTR_STALE; -+ *header_prev = header; -+ return ((search->options & DNS_DBFIND_STALEOK) == 0); -+ } -+ - /* - * This rdataset is stale. If no one else is using the - * node, we can clean it up right now, otherwise we mark -@@ -4695,7 +4807,7 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header, - node->data = header->next; - free_rdataset(search->rbtdb, mctx, header); - } else { -- mark_stale_header(search->rbtdb, header); -+ mark_header_ancient(search->rbtdb, header); - *header_prev = header; - } - } else -@@ -5133,7 +5245,7 @@ cache_find(dns_db_t *db, dns_name_t *name, dns_dbversion_t *version, - &locktype, lock, &search, - &header_prev)) { - /* Do nothing. */ -- } else if (EXISTS(header) && (!STALE(header))) { -+ } else if (EXISTS(header) && !ANCIENT(header)) { - /* - * We now know that there is at least one active - * non-stale rdataset at this node. -@@ -5611,7 +5723,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) { - * refcurrent(rbtnode) must be non-zero. This is so - * because 'node' is an argument to the function. - */ -- mark_stale_header(rbtdb, header); -+ mark_header_ancient(rbtdb, header); - if (log) - isc_log_write(dns_lctx, category, module, - level, "overmem cache: stale %s", -@@ -5619,7 +5731,7 @@ expirenode(dns_db_t *db, dns_dbnode_t *node, isc_stdtime_t now) { - } else if (force_expire) { - if (! RETAIN(header)) { - set_ttl(rbtdb, header, 0); -- mark_stale_header(rbtdb, header); -+ mark_header_ancient(rbtdb, header); - } else if (log) { - isc_log_write(dns_lctx, category, module, - level, "overmem cache: " -@@ -5876,9 +5988,9 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version, - * non-zero. This is so because 'node' is an - * argument to the function. - */ -- mark_stale_header(rbtdb, header); -+ mark_header_ancient(rbtdb, header); - } -- } else if (EXISTS(header) && (!STALE(header))) { -+ } else if (EXISTS(header) && !ANCIENT(header)) { - if (header->type == matchtype) - found = header; - else if (header->type == RBTDB_RDATATYPE_NCACHEANY || -@@ -6170,7 +6282,7 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - topheader = topheader->next) - { - set_ttl(rbtdb, topheader, 0); -- mark_stale_header(rbtdb, topheader); -+ mark_header_ancient(rbtdb, topheader); - } - goto find_header; - } -@@ -6228,7 +6340,7 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - * ncache entry. - */ - set_ttl(rbtdb, topheader, 0); -- mark_stale_header(rbtdb, topheader); -+ mark_header_ancient(rbtdb, topheader); - topheader = NULL; - goto find_header; - } -@@ -6266,8 +6378,11 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - } - - /* -- * Trying to add an rdataset with lower trust to a cache DB -- * has no effect, provided that the cache data isn't stale. -+ * Trying to add an rdataset with lower trust to a cache -+ * DB has no effect, provided that the cache data isn't -+ * stale. If the cache data is stale, new lower trust -+ * data will supersede it below. Unclear what the best -+ * policy is here. - */ - if (rbtversion == NULL && trust < header->trust && - (ACTIVE(header, now) || header_nx)) { -@@ -6296,6 +6411,10 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - - if ((options & DNS_DBADD_EXACT) != 0) - flags |= DNS_RDATASLAB_EXACT; -+ /* -+ * TTL use here is irrelevant to the cache; -+ * merge is only done with zonedbs. -+ */ - if ((options & DNS_DBADD_EXACTTTL) != 0 && - newheader->rdh_ttl != header->rdh_ttl) - result = DNS_R_NOTEXACT; -@@ -6339,11 +6458,12 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - } - } - /* -- * Don't replace existing NS, A and AAAA RRsets -- * in the cache if they are already exist. This -- * prevents named being locked to old servers. -- * Don't lower trust of existing record if the -- * update is forced. -+ * Don't replace existing NS, A and AAAA RRsets in the -+ * cache if they are already exist. This prevents named -+ * being locked to old servers. Don't lower trust of -+ * existing record if the update is forced. Nothing -+ * special to be done w.r.t stale data; it gets replaced -+ * normally further down. - */ - if (IS_CACHE(rbtdb) && ACTIVE(header, now) && - header->type == dns_rdatatype_ns && -@@ -6514,10 +6634,10 @@ add32(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode, rbtdb_version_t *rbtversion, - changed->dirty = true; - if (rbtversion == NULL) { - set_ttl(rbtdb, header, 0); -- mark_stale_header(rbtdb, header); -+ mark_header_ancient(rbtdb, header); - if (sigheader != NULL) { - set_ttl(rbtdb, sigheader, 0); -- mark_stale_header(rbtdb, sigheader); -+ mark_header_ancient(rbtdb, sigheader); - } - } - if (rbtversion != NULL && !header_nx) { -@@ -8334,6 +8454,30 @@ nodefullname(dns_db_t *db, dns_dbnode_t *node, dns_name_t *name) { - return (result); - } - -+static isc_result_t -+setservestalettl(dns_db_t *db, dns_ttl_t ttl) { -+ dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db; -+ -+ REQUIRE(VALID_RBTDB(rbtdb)); -+ REQUIRE(IS_CACHE(rbtdb)); -+ -+ /* currently no bounds checking. 0 means disable. */ -+ rbtdb->serve_stale_ttl = ttl; -+ return ISC_R_SUCCESS; -+} -+ -+static isc_result_t -+getservestalettl(dns_db_t *db, dns_ttl_t *ttl) { -+ dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db; -+ -+ REQUIRE(VALID_RBTDB(rbtdb)); -+ REQUIRE(IS_CACHE(rbtdb)); -+ -+ *ttl = rbtdb->serve_stale_ttl; -+ return ISC_R_SUCCESS; -+} -+ -+ - static dns_dbmethods_t zone_methods = { - attach, - detach, -@@ -8379,7 +8523,9 @@ static dns_dbmethods_t zone_methods = { - NULL, - hashsize, - nodefullname, -- getsize -+ getsize, -+ NULL, -+ NULL - }; - - static dns_dbmethods_t cache_methods = { -@@ -8427,7 +8573,9 @@ static dns_dbmethods_t cache_methods = { - setcachestats, - hashsize, - nodefullname, -- NULL -+ NULL, -+ setservestalettl, -+ getservestalettl - }; - - isc_result_t -@@ -8698,7 +8846,7 @@ dns_rbtdb_create - rbtdb->rpzs = NULL; - rbtdb->load_rpzs = NULL; - rbtdb->rpz_num = DNS_RPZ_INVALID_NUM; -- -+ rbtdb->serve_stale_ttl = 0; - /* - * Version Initialization. - */ -@@ -9116,7 +9264,8 @@ rdatasetiter_first(dns_rdatasetiter_t *iterator) { - * rdatasets to work. - */ - if (NONEXISTENT(header) || -- (now != 0 && now > header->rdh_ttl)) -+ (now != 0 && now > header->rdh_ttl -+ + rbtdb->serve_stale_ttl)) - header = NULL; - break; - } else -@@ -10325,7 +10474,7 @@ static inline bool - need_headerupdate(rdatasetheader_t *header, isc_stdtime_t now) { - if ((header->attributes & - (RDATASET_ATTR_NONEXISTENT | -- RDATASET_ATTR_STALE | -+ RDATASET_ATTR_ANCIENT | - RDATASET_ATTR_ZEROTTL)) != 0) - return (false); - -@@ -10431,7 +10580,7 @@ expire_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header, - bool tree_locked, expire_t reason) - { - set_ttl(rbtdb, header, 0); -- mark_stale_header(rbtdb, header); -+ mark_header_ancient(rbtdb, header); - - /* - * Caller must hold the node (write) lock. -diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c -index 8db9845..9f65c05 100644 ---- a/lib/dns/resolver.c -+++ b/lib/dns/resolver.c -@@ -141,16 +141,17 @@ - #endif /* WANT_QUERYTRACE */ - - #define US_PER_SEC 1000000U -+#define US_PER_MSEC 1000U - /* - * The maximum time we will wait for a single query. - */ --#define MAX_SINGLE_QUERY_TIMEOUT 9U --#define MAX_SINGLE_QUERY_TIMEOUT_US (MAX_SINGLE_QUERY_TIMEOUT*US_PER_SEC) -+#define MAX_SINGLE_QUERY_TIMEOUT 9000U -+#define MAX_SINGLE_QUERY_TIMEOUT_US (MAX_SINGLE_QUERY_TIMEOUT*US_PER_MSEC) - - /* - * We need to allow a individual query time to complete / timeout. - */ --#define MINIMUM_QUERY_TIMEOUT (MAX_SINGLE_QUERY_TIMEOUT + 1U) -+#define MINIMUM_QUERY_TIMEOUT (MAX_SINGLE_QUERY_TIMEOUT + 1000U) - - /* The default time in seconds for the whole query to live. */ - #ifndef DEFAULT_QUERY_TIMEOUT -@@ -159,7 +160,7 @@ - - /* The maximum time in seconds for the whole query to live. */ - #ifndef MAXIMUM_QUERY_TIMEOUT --#define MAXIMUM_QUERY_TIMEOUT 30 -+#define MAXIMUM_QUERY_TIMEOUT 30000 - #endif - - /* The default maximum number of recursions to follow before giving up. */ -@@ -497,6 +498,10 @@ struct dns_resolver { - unsigned int maxqueries; - isc_result_t quotaresp[2]; - -+ /* Additions for serve-stale feature. */ -+ unsigned int retryinterval; /* in milliseconds */ -+ unsigned int nonbackofftries; -+ - /* Locked by lock. */ - unsigned int references; - bool exiting; -@@ -1620,14 +1625,12 @@ fctx_setretryinterval(fetchctx_t *fctx, unsigned int rtt) { - unsigned int seconds; - unsigned int us; - -+ us = fctx->res->retryinterval * 1000; - /* -- * We retry every .8 seconds the first two times through the address -- * list, and then we do exponential back-off. -+ * Exponential backoff after the first few tries. - */ -- if (fctx->restarts < 3) -- us = 800000; -- else -- us = (800000 << (fctx->restarts - 2)); -+ if (fctx->restarts >= fctx->res->nonbackofftries) -+ us <<= (fctx->restarts - fctx->res->nonbackofftries - 1); - - /* - * Add a fudge factor to the expected rtt based on the current -@@ -4489,7 +4492,8 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type, - /* - * Compute an expiration time for the entire fetch. - */ -- isc_interval_set(&interval, res->query_timeout, 0); -+ isc_interval_set(&interval, res->query_timeout / 1000, -+ res->query_timeout % 1000 * 1000000); - iresult = isc_time_nowplusinterval(&fctx->expires, &interval); - if (iresult != ISC_R_SUCCESS) { - UNEXPECTED_ERROR(__FILE__, __LINE__, -@@ -8977,6 +8981,8 @@ dns_resolver_create(dns_view_t *view, - res->spillattimer = NULL; - res->zspill = 0; - res->zero_no_soa_ttl = false; -+ res->retryinterval = 30000; -+ res->nonbackofftries = 3; - res->query_timeout = DEFAULT_QUERY_TIMEOUT; - res->maxdepth = DEFAULT_RECURSION_DEPTH; - res->maxqueries = DEFAULT_MAX_QUERIES; -@@ -10304,17 +10310,20 @@ dns_resolver_gettimeout(dns_resolver_t *resolver) { - } - - void --dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds) { -+dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int timeout) { - REQUIRE(VALID_RESOLVER(resolver)); - -- if (seconds == 0) -- seconds = DEFAULT_QUERY_TIMEOUT; -- if (seconds > MAXIMUM_QUERY_TIMEOUT) -- seconds = MAXIMUM_QUERY_TIMEOUT; -- if (seconds < MINIMUM_QUERY_TIMEOUT) -- seconds = MINIMUM_QUERY_TIMEOUT; -+ if (timeout <= 300) -+ timeout *= 1000; -+ -+ if (timeout == 0) -+ timeout = DEFAULT_QUERY_TIMEOUT; -+ if (timeout > MAXIMUM_QUERY_TIMEOUT) -+ timeout = MAXIMUM_QUERY_TIMEOUT; -+ if (timeout < MINIMUM_QUERY_TIMEOUT) -+ timeout = MINIMUM_QUERY_TIMEOUT; - -- resolver->query_timeout = seconds; -+ resolver->query_timeout = timeout; - } - - void -@@ -10411,3 +10420,34 @@ dns_resolver_getquotaresponse(dns_resolver_t *resolver, dns_quotatype_t which) - - return (resolver->quotaresp[which]); - } -+ -+unsigned int -+dns_resolver_getretryinterval(dns_resolver_t *resolver) { -+ REQUIRE(VALID_RESOLVER(resolver)); -+ -+ return (resolver->retryinterval); -+} -+ -+void -+dns_resolver_setretryinterval(dns_resolver_t *resolver, unsigned int interval) -+{ -+ REQUIRE(VALID_RESOLVER(resolver)); -+ REQUIRE(interval > 0); -+ -+ resolver->retryinterval = ISC_MIN(interval, 2000); -+} -+ -+unsigned int -+dns_resolver_getnonbackofftries(dns_resolver_t *resolver) { -+ REQUIRE(VALID_RESOLVER(resolver)); -+ -+ return (resolver->nonbackofftries); -+} -+ -+void -+dns_resolver_setnonbackofftries(dns_resolver_t *resolver, unsigned int tries) { -+ REQUIRE(VALID_RESOLVER(resolver)); -+ REQUIRE(tries > 0); -+ -+ resolver->nonbackofftries = tries; -+} -diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c -index d4c8c67..ee9be79 100644 ---- a/lib/dns/sdb.c -+++ b/lib/dns/sdb.c -@@ -1368,7 +1368,9 @@ static dns_dbmethods_t sdb_methods = { - NULL, /* setcachestats */ - NULL, /* hashsize */ - NULL, /* nodefullname */ -- NULL /* getsize */ -+ NULL, /* getsize */ -+ NULL, /* setservestalettl */ -+ NULL /* getservestalettl */ - }; - - static isc_result_t -diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c -index 0b9620c..331992e 100644 ---- a/lib/dns/sdlz.c -+++ b/lib/dns/sdlz.c -@@ -1336,7 +1336,9 @@ static dns_dbmethods_t sdlzdb_methods = { - NULL, /* setcachestats */ - NULL, /* hashsize */ - NULL, /* nodefullname */ -- NULL /* getsize */ -+ NULL, /* getsize */ -+ NULL, /* setservestalettl */ -+ NULL /* getservestalettl */ - }; - - /* -diff --git a/lib/dns/tests/db_test.c b/lib/dns/tests/db_test.c -index 35cf21d..bf39545 100644 ---- a/lib/dns/tests/db_test.c -+++ b/lib/dns/tests/db_test.c -@@ -28,8 +28,9 @@ - - #include - #include --#include - #include -+#include -+#include - - #include "dnstest.h" - -@@ -76,7 +77,7 @@ getoriginnode_test(void **state) { - assert_int_equal(result, ISC_R_SUCCESS); - - result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_zone, -- dns_rdataclass_in, 0, NULL, &db); -+ dns_rdataclass_in, 0, NULL, &db); - assert_int_equal(result, ISC_R_SUCCESS); - - result = dns_db_getoriginnode(db, &node); -@@ -91,6 +92,197 @@ getoriginnode_test(void **state) { - isc_mem_detach(&mymctx); - } - -+/* test getservestalettl and setservestalettl */ -+static void -+getsetservestalettl_test(void **state) { -+ dns_db_t *db = NULL; -+ isc_mem_t *mymctx = NULL; -+ isc_result_t result; -+ dns_ttl_t ttl; -+ -+ UNUSED(state); -+ -+ result = isc_mem_create(0, 0, &mymctx); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_cache, -+ dns_rdataclass_in, 0, NULL, &db); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ ttl = 5000; -+ result = dns_db_getservestalettl(db, &ttl); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ assert_int_equal(ttl, 0); -+ -+ ttl = 6 * 3600; -+ result = dns_db_setservestalettl(db, ttl); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ ttl = 5000; -+ result = dns_db_getservestalettl(db, &ttl); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ assert_int_equal(ttl, 6 * 3600); -+ -+ dns_db_detach(&db); -+ isc_mem_detach(&mymctx); -+} -+ -+/* check DNS_DBFIND_STALEOK works */ -+static void -+dns_dbfind_staleok_test(void **state) { -+ dns_db_t *db = NULL; -+ dns_dbnode_t *node = NULL; -+ dns_fixedname_t example_fixed; -+ dns_fixedname_t found_fixed; -+ dns_name_t *example; -+ dns_name_t *found; -+ dns_rdatalist_t rdatalist; -+ dns_rdataset_t rdataset; -+ int count; -+ int pass; -+ isc_mem_t *mymctx = NULL; -+ isc_result_t result; -+ unsigned char data[] = { 0x0a, 0x00, 0x00, 0x01 }; -+ -+ UNUSED(state); -+ -+ result = isc_mem_create(0, 0, &mymctx); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ result = dns_db_create(mymctx, "rbt", dns_rootname, dns_dbtype_cache, -+ dns_rdataclass_in, 0, NULL, &db); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ example = dns_fixedname_initname(&example_fixed); -+ found = dns_fixedname_initname(&found_fixed); -+ -+ result = dns_name_fromstring(example, "example", 0, NULL); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ /* -+ * Pass 0: default; no stale processing permitted. -+ * Pass 1: stale processing for 1 second. -+ * Pass 2: stale turned off after being on. -+ */ -+ for (pass = 0; pass < 3; pass++) { -+ dns_rdata_t rdata = DNS_RDATA_INIT; -+ -+ /* 10.0.0.1 */ -+ rdata.data = data; -+ rdata.length = 4; -+ rdata.rdclass = dns_rdataclass_in; -+ rdata.type = dns_rdatatype_a; -+ -+ dns_rdatalist_init(&rdatalist); -+ rdatalist.ttl = 2; -+ rdatalist.type = dns_rdatatype_a; -+ rdatalist.rdclass = dns_rdataclass_in; -+ ISC_LIST_APPEND(rdatalist.rdata, &rdata, link); -+ -+ switch (pass) { -+ case 0: -+ /* default: stale processing off */ -+ break; -+ case 1: -+ /* turn on stale processing */ -+ result = dns_db_setservestalettl(db, 1); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ break; -+ case 2: -+ /* turn off stale processing */ -+ result = dns_db_setservestalettl(db, 0); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ break; -+ } -+ -+ dns_rdataset_init(&rdataset); -+ result = dns_rdatalist_tordataset(&rdatalist, &rdataset); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ result = dns_db_findnode(db, example, true, &node); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ result = dns_db_addrdataset(db, node, NULL, 0, &rdataset, 0, -+ NULL); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ dns_db_detachnode(db, &node); -+ dns_rdataset_disassociate(&rdataset); -+ -+ result = dns_db_find(db, example, NULL, dns_rdatatype_a, -+ 0, 0, &node, found, &rdataset, NULL); -+ assert_int_equal(result, ISC_R_SUCCESS); -+ -+ /* -+ * May loop for up to 2 seconds performing non stale lookups. -+ */ -+ count = 0; -+ do { -+ count++; -+ assert_in_range(count, 0, 20); /* loop sanity */ -+ assert_int_equal(rdataset.attributes & -+ DNS_RDATASETATTR_STALE, 0); -+ assert_true(rdataset.ttl > 0); -+ dns_db_detachnode(db, &node); -+ dns_rdataset_disassociate(&rdataset); -+ -+ usleep(100000); /* 100 ms */ -+ -+ result = dns_db_find(db, example, NULL, -+ dns_rdatatype_a, 0, 0, -+ &node, found, &rdataset, NULL); -+ } while (result == ISC_R_SUCCESS); -+ -+ assert_int_equal(result, ISC_R_NOTFOUND); -+ -+ /* -+ * Check whether we can get stale data. -+ */ -+ result = dns_db_find(db, example, NULL, dns_rdatatype_a, -+ DNS_DBFIND_STALEOK, 0, -+ &node, found, &rdataset, NULL); -+ switch (pass) { -+ case 0: -+ assert_int_equal(result, ISC_R_NOTFOUND); -+ break; -+ case 1: -+ /* -+ * Should loop for 1 second with stale lookups then -+ * stop. -+ */ -+ count = 0; -+ do { -+ count++; -+ assert_in_range(count, 0, 49); /* loop sanity */ -+ assert_int_equal(result, ISC_R_SUCCESS); -+ assert_int_equal(rdataset.ttl, 0); -+ assert_int_equal(rdataset.attributes & -+ DNS_RDATASETATTR_STALE, -+ DNS_RDATASETATTR_STALE); -+ dns_db_detachnode(db, &node); -+ dns_rdataset_disassociate(&rdataset); -+ -+ usleep(100000); /* 100 ms */ -+ -+ result = dns_db_find(db, example, NULL, -+ dns_rdatatype_a, -+ DNS_DBFIND_STALEOK, -+ 0, &node, found, -+ &rdataset, NULL); -+ } while (result == ISC_R_SUCCESS); -+ assert_in_range(count, 1, 10); -+ assert_int_equal(result, ISC_R_NOTFOUND); -+ break; -+ case 2: -+ assert_int_equal(result, ISC_R_NOTFOUND); -+ break; -+ } -+ } -+ -+ dns_db_detach(&db); -+ isc_mem_detach(&mymctx); -+} -+ - /* database class */ - static void - class_test(void **state) { -@@ -213,6 +405,8 @@ int - main(void) { - const struct CMUnitTest tests[] = { - cmocka_unit_test(getoriginnode_test), -+ cmocka_unit_test(getsetservestalettl_test), -+ cmocka_unit_test(dns_dbfind_staleok_test), - cmocka_unit_test_setup_teardown(class_test, - _setup, _teardown), - cmocka_unit_test_setup_teardown(dbtype_test, -diff --git a/lib/dns/view.c b/lib/dns/view.c -index a1a4301..abf6a4c 100644 ---- a/lib/dns/view.c -+++ b/lib/dns/view.c -@@ -229,6 +229,9 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, - view->flush = false; - view->dlv = NULL; - view->maxudp = 0; -+ view->staleanswerttl = 1; -+ view->staleanswersok = dns_stale_answer_conf; -+ view->staleanswersenable = false; - view->nocookieudp = 0; - view->maxbits = 0; - view->v4_aaaa = dns_aaaa_ok; -diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c -index 7bad989..bbf4b45 100644 ---- a/lib/isccfg/namedconf.c -+++ b/lib/isccfg/namedconf.c -@@ -1778,6 +1778,7 @@ view_clauses[] = { - { "max-ncache-ttl", &cfg_type_uint32, 0 }, - { "max-recursion-depth", &cfg_type_uint32, 0 }, - { "max-recursion-queries", &cfg_type_uint32, 0 }, -+ { "max-stale-ttl", &cfg_type_ttlval, 0 }, - { "max-udp-size", &cfg_type_uint32, 0 }, - { "message-compression", &cfg_type_boolean, 0 }, - { "min-roots", &cfg_type_uint32, CFG_CLAUSEFLAG_NOTIMP }, -@@ -1806,7 +1807,9 @@ view_clauses[] = { - { "request-nsid", &cfg_type_boolean, 0 }, - { "request-sit", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE }, - { "require-server-cookie", &cfg_type_boolean, 0 }, -+ { "resolver-nonbackoff-tries", &cfg_type_uint32, 0 }, - { "resolver-query-timeout", &cfg_type_uint32, 0 }, -+ { "resolver-retry-interval", &cfg_type_uint32, 0 }, - { "response-policy", &cfg_type_rpz, 0 }, - { "rfc2308-type1", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI }, - { "root-delegation-only", &cfg_type_optional_exclude, 0 }, -@@ -1815,6 +1818,8 @@ view_clauses[] = { - { "send-cookie", &cfg_type_boolean, 0 }, - { "servfail-ttl", &cfg_type_ttlval, 0 }, - { "sortlist", &cfg_type_bracketed_aml, 0 }, -+ { "stale-answer-enable", &cfg_type_boolean, 0 }, -+ { "stale-answer-ttl", &cfg_type_ttlval, 0 }, - { "suppress-initial-notify", &cfg_type_boolean, CFG_CLAUSEFLAG_NYI }, - { "topology", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_NOTIMP }, - { "transfer-format", &cfg_type_transferformat, 0 }, --- -2.21.0 - diff --git a/bind.spec b/bind.spec index 7668ede..a525f1c 100644 --- a/bind.spec +++ b/bind.spec @@ -156,19 +156,9 @@ Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch -Patch173:bind-9.11-rh1732883.patch # Make sure jsonccp-devel does not interfere -Patch174:bind-9.11-json-c.patch -Patch175:bind-9.11-fips-disable.patch +#Patch175:bind-9.11-fips-disable.patch #Patch176: bind-9.11-unit-dnstap-pkcs11.patch -Patch177: bind-9.11-serve-stale.patch -Patch178: bind-9.11-serve-stale-dbfix.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1736762 -Patch183: bind-9.11-rh1736762-5.patch -Patch184: bind-9.11-rh1736762-6.patch -Patch185: bind-9.11-rh1736762-7.patch -Patch186: bind-9.11-rh1736762-8.patch -Patch187: bind-9.11-oot-gen.patch # SDB patches Patch11: bind-9.3.2b2-sdbsrc.patch @@ -567,18 +557,9 @@ are used for building ISC DHCP. %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant %patch172 -p1 -b .test-pkcs11 -%patch173 -p1 -b .rh1732883 #%patch174 -p1 -b .unit-timer -%patch174 -p1 -b .json-c -%patch175 -p1 -b .rh1709553 +#%patch175 -p1 -b .rh1709553 #%patch176 -p1 -b .unit-dnstap -%patch177 -p1 -b .serve-stale -%patch178 -p1 -b .rh1770492 -%patch183 -p1 -b .rh1736762-5 -%patch184 -p1 -b .rh1736762-6 -%patch185 -p1 -b .rh1736762-7 -%patch186 -p1 -b .rh1736762-8 -%patch187 -p1 -b .oot-gen %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 From a6f9fe005ec983b4c5a886833fdd82255c2844c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 12:39:30 +0100 Subject: [PATCH 18/79] Remove unused 9.14 patches --- bind-9.11-fips-code.patch | 1459 ------------------------------------- bind-9.11-rt31459.patch | 375 ---------- bind-9.11-rt46047.patch | 799 -------------------- bind.spec | 21 - 4 files changed, 2654 deletions(-) delete mode 100644 bind-9.11-fips-code.patch delete mode 100644 bind-9.11-rt31459.patch delete mode 100644 bind-9.11-rt46047.patch diff --git a/bind-9.11-fips-code.patch b/bind-9.11-fips-code.patch deleted file mode 100644 index cf00104..0000000 --- a/bind-9.11-fips-code.patch +++ /dev/null @@ -1,1459 +0,0 @@ -From eff6dcb62f3cea6df0a848c2220a49bc02cb4a0e Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Thu, 2 Aug 2018 23:34:45 +0200 -Subject: [PATCH] FIPS code changes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Squashed commit of the following: - -commit b49f70ce0575b6b52a71b90fe0376dbf16f92c6b -Author: Petr Menšík -Date: Mon Jan 22 14:12:37 2018 +0100 - - Update system tests to detect MD5 disabled at runtime - -commit 80ceffee4860c24baf70bc9a8653d92731eda2e4 -Author: Petr Menšík -Date: Thu Aug 2 14:53:54 2018 +0200 - - Avoid warning about undefined parameters - -commit e4ad4363e3d1acaac58456117579f02761f38fdc -Author: Petr Menšík -Date: Wed Jun 20 19:31:19 2018 +0200 - - Fix rndc-confgen default algorithm, report true algorithm in usage. - -commit 7e629a351010cb75e0589ec361f720085675998c -Author: Petr Menšík -Date: Fri Feb 23 21:21:30 2018 +0100 - - Cleanup only if initialization was successful - -commit 2101b948c77cbcbe07eb4a1e60f3e693b2245ec6 -Author: Petr Menšík -Date: Mon Feb 5 12:19:28 2018 +0100 - - Ensure dst backend is initialized first even before hmac algorithms. - -commit 7567c7edde7519115a9ae7e20818c835d3eb1ffe -Author: Petr Menšík -Date: Mon Feb 5 12:17:54 2018 +0100 - - Skip initialization of MD5 based algorithms if not available. - -commit 5782137df6b45a6d900d5a1c250c1257227e917a -Author: Petr Menšík -Date: Mon Feb 5 10:21:27 2018 +0100 - - Change secalgs skipping to be more safe - -commit f2d78729898182d2d19d5064de1bec9b66817159 -Author: Petr Menšík -Date: Wed Jan 31 18:26:11 2018 +0100 - - Skip MD5 algorithm also in case of NULL name - -commit 32a2ad4abc7aaca1c257730319ad3c27405d3407 -Author: Petr Menšík -Date: Wed Jan 31 11:38:12 2018 +0100 - - Make MD5 behave like unknown algorithm in TSIG. - -commit 13cd3f704dce568fdf24a567be5802b58ac6007b -Author: Petr Menšík -Date: Tue Nov 28 20:14:37 2017 +0100 - - Select token with most supported functions, instead of demanding it must support all functions - - Initialize PKCS#11 always until successfully initialized - -commit a71df74abdca4fe63bcdf542b81a109cf1f495b4 -Author: Petr Menšík -Date: Mon Jan 22 16:17:44 2018 +0100 - - Handle MD5 unavailability from DST - -commit dd82cb263efa2753d3ee772972726ea08bcc639b -Author: Petr Menšík -Date: Mon Jan 22 14:11:16 2018 +0100 - - Check runtime flag from library and applications, fail gracefully. - -commit c7b2f87f07ecae75b821a908e29f08a42371e32e -Author: Petr Menšík -Date: Mon Jan 22 08:39:08 2018 +0100 - - Modify libraries to use isc_md5_available() if PK11_MD5_DISABLE is not - defined. - TODO: pk11.c should accept slot without MD5 support. - -commit 0b8e470ec636b9e350b5ec3203eb2b4091415fde -Author: Petr Menšík -Date: Mon Jan 22 07:21:04 2018 +0100 - - Add runtime detection whether MD5 is useable. ---- - bin/confgen/keygen.c | 10 +++- - bin/confgen/rndc-confgen.c | 32 ++++--------- - bin/dig/dig.c | 7 +-- - bin/dig/dighost.c | 14 ++++-- - bin/dnssec/dnssec-keygen.c | 14 ++++++ - bin/named/config.c | 25 +++++++++- - bin/nsupdate/nsupdate.c | 24 ++++++---- - bin/rndc/rndc.c | 3 +- - bin/tests/optional/hash_test.c | 78 ++++++++++++++++--------------- - bin/tests/system/tkey/keycreate.c | 3 ++ - bin/tests/system/tkey/keydelete.c | 17 ++++--- - lib/bind9/check.c | 10 ++++ - lib/dns/dst_api.c | 23 ++++++--- - lib/dns/dst_internal.h | 3 +- - lib/dns/dst_parse.c | 18 +++++-- - lib/dns/hmac_link.c | 18 ++----- - lib/dns/opensslrsa_link.c | 6 +++ - lib/dns/pkcs11rsa_link.c | 33 +++++++++++-- - lib/dns/rcode.c | 21 ++++++++- - lib/dns/tests/rsa_test.c | 4 ++ - lib/dns/tests/tsig_test.c | 1 + - lib/dns/tkey.c | 9 ++++ - lib/dns/tsec.c | 8 +++- - lib/dns/tsig.c | 17 ++++--- - lib/isc/include/isc/md5.h | 3 ++ - lib/isc/md5.c | 59 +++++++++++++++++++++++ - lib/isc/pk11.c | 44 +++++++++++------ - lib/isc/tests/hash_test.c | 9 ++++ - lib/isccc/cc.c | 42 +++++++++++------ - 29 files changed, 400 insertions(+), 155 deletions(-) - -diff --git a/bin/confgen/keygen.c b/bin/confgen/keygen.c -index 8931ad5..5015abb 100644 ---- a/bin/confgen/keygen.c -+++ b/bin/confgen/keygen.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -73,7 +74,7 @@ alg_fromtext(const char *name) { - p = &name[5]; - - #ifndef PK11_MD5_DISABLE -- if (strcasecmp(p, "md5") == 0) -+ if (strcasecmp(p, "md5") == 0 && isc_md5_available()) - return DST_ALG_HMACMD5; - #endif - if (strcasecmp(p, "sha1") == 0) -@@ -132,6 +133,13 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg, - switch (alg) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_HMACMD5: -+ if (!isc_md5_available()) { -+ fatal("unsupported algorithm %d\n", alg); -+ } else if (keysize < 1 || keysize > 512) { -+ fatal("keysize %d out of range (must be 1-512)\n", -+ keysize); -+ } -+ break; - #endif - case DST_ALG_HMACSHA1: - case DST_ALG_HMACSHA224: -diff --git a/bin/confgen/rndc-confgen.c b/bin/confgen/rndc-confgen.c -index 5ca3d76..6b7790a 100644 ---- a/bin/confgen/rndc-confgen.c -+++ b/bin/confgen/rndc-confgen.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -63,7 +64,7 @@ const char *progname; - - bool verbose = false; - --const char *keyfile, *keydef; -+const char *keyfile, *keydef, *algdef; - - ISC_PLATFORM_NORETURN_PRE static void - usage(int status) ISC_PLATFORM_NORETURN_POST; -@@ -71,13 +72,12 @@ usage(int status) ISC_PLATFORM_NORETURN_POST; - static void - usage(int status) { - --#ifndef PK11_MD5_DISABLE - fprintf(stderr, "\ - Usage:\n\ - %s [-a] [-b bits] [-c keyfile] [-k keyname] [-p port] [-r randomfile] \ - [-s addr] [-t chrootdir] [-u user]\n\ - -a: generate just the key clause and write it to keyfile (%s)\n\ -- -A alg: algorithm (default hmac-md5)\n\ -+ -A alg: algorithm (default %s)\n\ - -b bits: from 1 through 512, default 256; total length of the secret\n\ - -c keyfile: specify an alternate key file (requires -a)\n\ - -k keyname: the name as it will be used in named.conf and rndc.conf\n\ -@@ -86,24 +86,7 @@ Usage:\n\ - -s addr: the address to which rndc should connect\n\ - -t chrootdir: write a keyfile in chrootdir as well (requires -a)\n\ - -u user: set the keyfile owner to \"user\" (requires -a)\n", -- progname, keydef); --#else -- fprintf(stderr, "\ --Usage:\n\ -- %s [-a] [-b bits] [-c keyfile] [-k keyname] [-p port] [-r randomfile] \ --[-s addr] [-t chrootdir] [-u user]\n\ -- -a: generate just the key clause and write it to keyfile (%s)\n\ -- -A alg: algorithm (default hmac-sha256)\n\ -- -b bits: from 1 through 512, default 256; total length of the secret\n\ -- -c keyfile: specify an alternate key file (requires -a)\n\ -- -k keyname: the name as it will be used in named.conf and rndc.conf\n\ -- -p port: the port named will listen on and rndc will connect to\n\ -- -r randomfile: source of random data (use \"keyboard\" for key timing)\n\ -- -s addr: the address to which rndc should connect\n\ -- -t chrootdir: write a keyfile in chrootdir as well (requires -a)\n\ -- -u user: set the keyfile owner to \"user\" (requires -a)\n", -- progname, keydef); --#endif -+ progname, keydef, algdef); - - exit (status); - } -@@ -139,11 +122,12 @@ main(int argc, char **argv) { - progname = program; - - keyname = DEFAULT_KEYNAME; --#ifndef PK11_MD5_DISABLE -- alg = DST_ALG_HMACMD5; --#else - alg = DST_ALG_HMACSHA256; -+#ifndef PK11_MD5_DISABLE -+ if (isc_md5_available()) -+ alg = DST_ALG_HMACMD5; - #endif -+ algdef = alg_totext(alg); - serveraddr = DEFAULT_SERVER; - port = DEFAULT_PORT; - -diff --git a/bin/dig/dig.c b/bin/dig/dig.c -index 706299e..aaf22e7 100644 ---- a/bin/dig/dig.c -+++ b/bin/dig/dig.c -@@ -20,6 +20,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -1774,10 +1775,10 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, - ptr = ptr2; - ptr2 = ptr3; - } else { --#ifndef PK11_MD5_DISABLE -- hmacname = DNS_TSIG_HMACMD5_NAME; --#else - hmacname = DNS_TSIG_HMACSHA256_NAME; -+#ifndef PK11_MD5_DISABLE -+ if (isc_md5_available()) -+ hmacname = DNS_TSIG_HMACMD5_NAME; - #endif - digestbits = 0; - } -diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c -index 93e5b40..afd2700 100644 ---- a/bin/dig/dighost.c -+++ b/bin/dig/dighost.c -@@ -80,6 +80,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1246,9 +1247,10 @@ parse_hmac(const char *hmac) { - digestbits = 0; - - #ifndef PK11_MD5_DISABLE -- if (strcasecmp(buf, "hmac-md5") == 0) { -+ if (strcasecmp(buf, "hmac-md5") == 0 && isc_md5_available()) { - hmacname = DNS_TSIG_HMACMD5_NAME; -- } else if (strncasecmp(buf, "hmac-md5-", 9) == 0) { -+ } else if (strncasecmp(buf, "hmac-md5-", 9) == 0 && -+ isc_md5_available()) { - hmacname = DNS_TSIG_HMACMD5_NAME; - digestbits = parse_bits(&buf[9], "digest-bits [0..128]", 128); - } else -@@ -1368,7 +1370,13 @@ setup_file_key(void) { - switch (dst_key_alg(dstkey)) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_HMACMD5: -- hmacname = DNS_TSIG_HMACMD5_NAME; -+ if (isc_md5_available()) { -+ hmacname = DNS_TSIG_HMACMD5_NAME; -+ } else { -+ printf(";; Couldn't create key %s: bad algorithm\n", -+ keynametext); -+ goto failure; -+ } - break; - #endif - case DST_ALG_HMACSHA1: -diff --git a/bin/dnssec/dnssec-keygen.c b/bin/dnssec/dnssec-keygen.c -index 1476d0d..f5c9316 100644 ---- a/bin/dnssec/dnssec-keygen.c -+++ b/bin/dnssec/dnssec-keygen.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -562,6 +563,19 @@ main(int argc, char **argv) { - "\"-a RSAMD5\"\n"); - INSIST(freeit == NULL); - return (1); -+ } else if (strcasecmp(algname, "HMAC-MD5") == 0) { -+ if (isc_md5_available()) { -+ alg = DST_ALG_HMACMD5; -+ } else { -+ fprintf(stderr, -+ "The use of HMAC-MD5 was disabled\n"); -+ return (1); -+ } -+ } else if (strcasecmp(algname, "RSAMD5") == 0 && -+ !isc_md5_available()) { -+ fprintf(stderr, "The use of RSAMD5 was disabled\n"); -+ INSIST(freeit == NULL); -+ return (1); - } else if (strcasecmp(algname, "HMAC-MD5") == 0) { - alg = DST_ALG_HMACMD5; - #else -diff --git a/bin/named/config.c b/bin/named/config.c -index 32c454a..dff826b 100644 ---- a/bin/named/config.c -+++ b/bin/named/config.c -@@ -18,6 +18,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -974,6 +975,21 @@ ns_config_getkeyalgorithm(const char *str, dns_name_t **name, - return (ns_config_getkeyalgorithm2(str, name, NULL, digestbits)); - } - -+static inline int -+algorithms_start() { -+#ifndef PK11_MD5_DISABLE -+ if (!isc_md5_available()) { -+ int i = 0; -+ while (algorithms[i].str != NULL && -+ algorithms[i].hmac == hmacmd5) { -+ i++; -+ } -+ return i; -+ } -+#endif -+ return 0; -+} -+ - isc_result_t - ns_config_getkeyalgorithm2(const char *str, dns_name_t **name, - unsigned int *typep, uint16_t *digestbits) -@@ -983,7 +999,7 @@ ns_config_getkeyalgorithm2(const char *str, dns_name_t **name, - uint16_t bits; - isc_result_t result; - -- for (i = 0; algorithms[i].str != NULL; i++) { -+ for (i = algorithms_start(); algorithms[i].str != NULL; i++) { - len = strlen(algorithms[i].str); - if (strncasecmp(algorithms[i].str, str, len) == 0 && - (str[len] == '\0' || -@@ -1006,7 +1022,12 @@ ns_config_getkeyalgorithm2(const char *str, dns_name_t **name, - if (name != NULL) { - switch (algorithms[i].hmac) { - #ifndef PK11_MD5_DISABLE -- case hmacmd5: *name = dns_tsig_hmacmd5_name; break; -+ case hmacmd5: -+ if (isc_md5_available()) { -+ *name = dns_tsig_hmacmd5_name; break; -+ } else { -+ return (ISC_R_NOTFOUND); -+ } - #endif - case hmacsha1: *name = dns_tsig_hmacsha1_name; break; - case hmacsha224: *name = dns_tsig_hmacsha224_name; break; -diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c -index de60313..bbb3936 100644 ---- a/bin/nsupdate/nsupdate.c -+++ b/bin/nsupdate/nsupdate.c -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -477,9 +478,10 @@ parse_hmac(dns_name_t **hmac, const char *hmacstr, size_t len, - strlcpy(buf, hmacstr, ISC_MIN(len + 1, sizeof(buf))); - - #ifndef PK11_MD5_DISABLE -- if (strcasecmp(buf, "hmac-md5") == 0) { -+ if (strcasecmp(buf, "hmac-md5") == 0 && isc_md5_available()) { - *hmac = DNS_TSIG_HMACMD5_NAME; -- } else if (strncasecmp(buf, "hmac-md5-", 9) == 0) { -+ } else if (strncasecmp(buf, "hmac-md5-", 9) == 0 && -+ isc_md5_available()) { - *hmac = DNS_TSIG_HMACMD5_NAME; - result = isc_parse_uint16(&digestbits, &buf[9], 10); - if (result != ISC_R_SUCCESS || digestbits > 128) { -@@ -592,10 +594,10 @@ setup_keystr(void) { - exit(1); - } - } else { --#ifndef PK11_MD5_DISABLE -- hmacname = DNS_TSIG_HMACMD5_NAME; --#else - hmacname = DNS_TSIG_HMACSHA256_NAME; -+#ifndef PK11_MD5_DISABLE -+ if (isc_md5_available()) -+ hmacname = DNS_TSIG_HMACMD5_NAME; - #endif - name = keystr; - n = s; -@@ -732,7 +734,8 @@ setup_keyfile(isc_mem_t *mctx, isc_log_t *lctx) { - switch (dst_key_alg(dstkey)) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_HMACMD5: -- hmacname = DNS_TSIG_HMACMD5_NAME; -+ if (isc_md5_available()) -+ hmacname = DNS_TSIG_HMACMD5_NAME; - break; - #endif - case DST_ALG_HMACSHA1: -@@ -1637,12 +1640,13 @@ evaluate_key(char *cmdline) { - return (STATUS_SYNTAX); - } - namestr = n + 1; -- } else --#ifndef PK11_MD5_DISABLE -- hmacname = DNS_TSIG_HMACMD5_NAME; --#else -+ } else { - hmacname = DNS_TSIG_HMACSHA256_NAME; -+#ifndef PK11_MD5_DISABLE -+ if (isc_md5_available()) -+ hmacname = DNS_TSIG_HMACMD5_NAME; - #endif -+ } - - isc_buffer_init(&b, namestr, strlen(namestr)); - isc_buffer_add(&b, strlen(namestr)); -diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c -index 9eb0ce0..8083654 100644 ---- a/bin/rndc/rndc.c -+++ b/bin/rndc/rndc.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -636,7 +637,7 @@ parse_config(isc_mem_t *mctx, isc_log_t *log, const char *keyname, - algorithmstr = cfg_obj_asstring(algorithmobj); - - #ifndef PK11_MD5_DISABLE -- if (strcasecmp(algorithmstr, "hmac-md5") == 0) -+ if (strcasecmp(algorithmstr, "hmac-md5") == 0 && isc_md5_available()) - algorithm = ISCCC_ALG_HMACMD5; - else - #endif -diff --git a/bin/tests/optional/hash_test.c b/bin/tests/optional/hash_test.c -index bf2891a..b5f0a1c 100644 ---- a/bin/tests/optional/hash_test.c -+++ b/bin/tests/optional/hash_test.c -@@ -90,43 +90,47 @@ main(int argc, char **argv) { - print_digest(s, "sha224", digest, ISC_SHA224_DIGESTLENGTH/4); - - #ifndef PK11_MD5_DISABLE -- s = "abc"; -- isc_md5_init(&md5); -- memmove(buffer, s, strlen(s)); -- isc_md5_update(&md5, buffer, strlen(s)); -- isc_md5_final(&md5, digest); -- print_digest(s, "md5", digest, 4); -- -- /* -- * The 3 HMAC-MD5 examples from RFC2104 -- */ -- s = "Hi There"; -- memset(key, 0x0b, 16); -- isc_hmacmd5_init(&hmacmd5, key, 16); -- memmove(buffer, s, strlen(s)); -- isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -- isc_hmacmd5_sign(&hmacmd5, digest); -- print_digest(s, "hmacmd5", digest, 4); -- -- s = "what do ya want for nothing?"; -- strlcpy((char *)key, "Jefe", sizeof(key)); -- isc_hmacmd5_init(&hmacmd5, key, 4); -- memmove(buffer, s, strlen(s)); -- isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -- isc_hmacmd5_sign(&hmacmd5, digest); -- print_digest(s, "hmacmd5", digest, 4); -- -- s = "\335\335\335\335\335\335\335\335\335\335" -- "\335\335\335\335\335\335\335\335\335\335" -- "\335\335\335\335\335\335\335\335\335\335" -- "\335\335\335\335\335\335\335\335\335\335" -- "\335\335\335\335\335\335\335\335\335\335"; -- memset(key, 0xaa, 16); -- isc_hmacmd5_init(&hmacmd5, key, 16); -- memmove(buffer, s, strlen(s)); -- isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -- isc_hmacmd5_sign(&hmacmd5, digest); -- print_digest(s, "hmacmd5", digest, 4); -+ if (isc_md5_available()) { -+ s = "abc"; -+ isc_md5_init(&md5); -+ memmove(buffer, s, strlen(s)); -+ isc_md5_update(&md5, buffer, strlen(s)); -+ isc_md5_final(&md5, digest); -+ print_digest(s, "md5", digest, 4); -+ -+ /* -+ * The 3 HMAC-MD5 examples from RFC2104 -+ */ -+ s = "Hi There"; -+ memset(key, 0x0b, 16); -+ isc_hmacmd5_init(&hmacmd5, key, 16); -+ memmove(buffer, s, strlen(s)); -+ isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -+ isc_hmacmd5_sign(&hmacmd5, digest); -+ print_digest(s, "hmacmd5", digest, 4); -+ -+ s = "what do ya want for nothing?"; -+ strlcpy((char *)key, "Jefe", sizeof(key)); -+ isc_hmacmd5_init(&hmacmd5, key, 4); -+ memmove(buffer, s, strlen(s)); -+ isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -+ isc_hmacmd5_sign(&hmacmd5, digest); -+ print_digest(s, "hmacmd5", digest, 4); -+ -+ s = "\335\335\335\335\335\335\335\335\335\335" -+ "\335\335\335\335\335\335\335\335\335\335" -+ "\335\335\335\335\335\335\335\335\335\335" -+ "\335\335\335\335\335\335\335\335\335\335" -+ "\335\335\335\335\335\335\335\335\335\335"; -+ memset(key, 0xaa, 16); -+ isc_hmacmd5_init(&hmacmd5, key, 16); -+ memmove(buffer, s, strlen(s)); -+ isc_hmacmd5_update(&hmacmd5, buffer, strlen(s)); -+ isc_hmacmd5_sign(&hmacmd5, digest); -+ print_digest(s, "hmacmd5", digest, 4); -+ } else { -+ fprintf(stderr, "Skipping disabled MD5 algorithm\n"); -+ } - #endif - - /* -diff --git a/bin/tests/system/tkey/keycreate.c b/bin/tests/system/tkey/keycreate.c -index 5a00f86..653c951 100644 ---- a/bin/tests/system/tkey/keycreate.c -+++ b/bin/tests/system/tkey/keycreate.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -142,6 +143,8 @@ sendquery(isc_task_t *task, isc_event_t *event) { - static char keystr[] = "0123456789ab"; - - isc_event_free(&event); -+ if (!isc_md5_available()) -+ CHECK("MD5 was disabled", ISC_R_NOTIMPLEMENTED); - - result = ISC_R_FAILURE; - if (inet_pton(AF_INET, "10.53.0.1", &inaddr) != 1) -diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c -index bde66a4..70a40c3 100644 ---- a/bin/tests/system/tkey/keydelete.c -+++ b/bin/tests/system/tkey/keydelete.c -@@ -225,12 +225,17 @@ main(int argc, char **argv) { - result = dst_key_fromnamedfile(keyname, NULL, type, mctx, &dstkey); - CHECK("dst_key_fromnamedfile", result); - #ifndef PK11_MD5_DISABLE -- result = dns_tsigkey_createfromkey(dst_key_name(dstkey), -- DNS_TSIG_HMACMD5_NAME, -- dstkey, true, NULL, 0, 0, -- mctx, ring, &tsigkey); -- dst_key_free(&dstkey); -- CHECK("dns_tsigkey_createfromkey", result); -+ if (isc_md5_available()) { -+ result = dns_tsigkey_createfromkey(dst_key_name(dstkey), -+ DNS_TSIG_HMACMD5_NAME, -+ dstkey, true, NULL, 0, 0, -+ mctx, ring, &tsigkey); -+ dst_key_free(&dstkey); -+ CHECK("dns_tsigkey_createfromkey", result); -+ } else { -+ dst_key_free(&dstkey); -+ CHECK("MD5 was disabled", ISC_R_NOTIMPLEMENTED); -+ } - #else - dst_key_free(&dstkey); - CHECK("MD5 was disabled", ISC_R_NOTIMPLEMENTED); -diff --git a/lib/bind9/check.c b/lib/bind9/check.c -index ec0ab6d..e0803d4 100644 ---- a/lib/bind9/check.c -+++ b/lib/bind9/check.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -2618,6 +2619,15 @@ bind9_check_key(const cfg_obj_t *key, isc_log_t *logctx) { - } - - algorithm = cfg_obj_asstring(algobj); -+#ifndef PK11_MD5_DISABLE -+ /* Skip hmac-md5* algorithms */ -+ if (!isc_md5_available() && -+ strncasecmp(algorithm, "hmac-md5", 8) == 0) { -+ cfg_obj_log(algobj, logctx, ISC_LOG_ERROR, -+ "disabled algorithm '%s'", algorithm); -+ return (ISC_R_DISABLED); -+ } -+#endif - for (i = 0; algorithms[i].name != NULL; i++) { - len = strlen(algorithms[i].name); - if (strncasecmp(algorithms[i].name, algorithm, len) == 0 && -diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c -index e3c47a9..320c0f8 100644 ---- a/lib/dns/dst_api.c -+++ b/lib/dns/dst_api.c -@@ -192,6 +192,12 @@ dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx, - dst_result_register(); - - memset(dst_t_func, 0, sizeof(dst_t_func)); -+ -+#ifdef OPENSSL -+ RETERR(dst__openssl_init(engine)); -+#elif PKCS11CRYPTO -+ RETERR(dst__pkcs11_init(mctx, engine)); -+#endif - #ifndef PK11_MD5_DISABLE - RETERR(dst__hmacmd5_init(&dst_t_func[DST_ALG_HMACMD5])); - #endif -@@ -201,7 +207,6 @@ dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx, - RETERR(dst__hmacsha384_init(&dst_t_func[DST_ALG_HMACSHA384])); - RETERR(dst__hmacsha512_init(&dst_t_func[DST_ALG_HMACSHA512])); - #ifdef OPENSSL -- RETERR(dst__openssl_init(engine)); - #ifndef PK11_MD5_DISABLE - RETERR(dst__opensslrsa_init(&dst_t_func[DST_ALG_RSAMD5], - DST_ALG_RSAMD5)); -@@ -235,14 +240,18 @@ dst_lib_init2(isc_mem_t *mctx, isc_entropy_t *ectx, - RETERR(dst__openssleddsa_init(&dst_t_func[DST_ALG_ED448])); - #endif - #elif PKCS11CRYPTO -- RETERR(dst__pkcs11_init(mctx, engine)); - #ifndef PK11_MD5_DISABLE -- RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSAMD5])); -+ RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSAMD5], -+ DST_ALG_RSAMD5)); - #endif -- RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA1])); -- RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_NSEC3RSASHA1])); -- RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA256])); -- RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA512])); -+ RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA1], -+ DST_ALG_RSASHA1)); -+ RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_NSEC3RSASHA1], -+ DST_ALG_NSEC3RSASHA1)); -+ RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA256], -+ DST_ALG_RSASHA256)); -+ RETERR(dst__pkcs11rsa_init(&dst_t_func[DST_ALG_RSASHA512], -+ DST_ALG_RSASHA512)); - #ifndef PK11_DSA_DISABLE - RETERR(dst__pkcs11dsa_init(&dst_t_func[DST_ALG_DSA])); - RETERR(dst__pkcs11dsa_init(&dst_t_func[DST_ALG_NSEC3DSA])); -diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h -index 6ee796c..3e55d44 100644 ---- a/lib/dns/dst_internal.h -+++ b/lib/dns/dst_internal.h -@@ -250,7 +250,8 @@ isc_result_t dst__hmacsha384_init(struct dst_func **funcp); - isc_result_t dst__hmacsha512_init(struct dst_func **funcp); - isc_result_t dst__opensslrsa_init(struct dst_func **funcp, - unsigned char algorithm); --isc_result_t dst__pkcs11rsa_init(struct dst_func **funcp); -+isc_result_t dst__pkcs11rsa_init(struct dst_func **funcp, -+ unsigned char algorithm); - #ifndef PK11_DSA_DISABLE - isc_result_t dst__openssldsa_init(struct dst_func **funcp); - isc_result_t dst__pkcs11dsa_init(struct dst_func **funcp); -diff --git a/lib/dns/dst_parse.c b/lib/dns/dst_parse.c -index f31c33d..87023a6 100644 ---- a/lib/dns/dst_parse.c -+++ b/lib/dns/dst_parse.c -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -396,6 +397,10 @@ check_data(const dst_private_t *priv, const unsigned int alg, - switch (alg) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_RSAMD5: -+ if (isc_md5_available()) -+ return (check_rsa(priv, external)); -+ else -+ return (DST_R_UNSUPPORTEDALG); - #endif - case DST_ALG_RSASHA1: - case DST_ALG_NSEC3RSASHA1: -@@ -421,7 +426,10 @@ check_data(const dst_private_t *priv, const unsigned int alg, - return (check_eddsa(priv, external)); - #ifndef PK11_MD5_DISABLE - case DST_ALG_HMACMD5: -- return (check_hmac_md5(priv, old)); -+ if (isc_md5_available()) -+ return (check_hmac_md5(priv, old)); -+ else -+ return (DST_R_UNSUPPORTEDALG); - #endif - case DST_ALG_HMACSHA1: - return (check_hmac_sha(priv, HMACSHA1_NTAGS, alg)); -@@ -640,11 +648,13 @@ dst__privstruct_parse(dst_key_t *key, unsigned int alg, isc_lex_t *lex, - } - - #ifdef PK11_MD5_DISABLE -- check = check_data(priv, alg == DST_ALG_RSA ? DST_ALG_RSASHA1 : alg, -- true, external); -+ if (alg == DST_ALG_RSA) -+ alg = DST_ALG_RSASHA1; - #else -- check = check_data(priv, alg, true, external); -+ if (!isc_md5_available() && alg == DST_ALG_RSA) -+ alg = DST_ALG_RSASHA1; - #endif -+ check = check_data(priv, alg, true, external); - if (check < 0) { - ret = DST_R_INVALIDPRIVATEKEY; - goto fail; -diff --git a/lib/dns/hmac_link.c b/lib/dns/hmac_link.c -index 3b6579b..4bdce2f 100644 ---- a/lib/dns/hmac_link.c -+++ b/lib/dns/hmac_link.c -@@ -340,20 +340,10 @@ static dst_func_t hmacmd5_functions = { - - isc_result_t - dst__hmacmd5_init(dst_func_t **funcp) { --#ifdef HAVE_FIPS_MODE -- /* -- * Problems from OpenSSL are likely from FIPS mode -- */ -- int fips_mode = FIPS_mode(); -- -- if (fips_mode != 0) { -- UNEXPECTED_ERROR(__FILE__, __LINE__, -- "FIPS mode is %d: MD5 is only supported " -- "if the value is 0.\n" -- "Please disable either FIPS mode or MD5.", -- fips_mode); -- } --#endif -+ -+ /* Intentionally skip initialization */ -+ if (!isc_md5_available()) -+ return (ISC_R_SUCCESS); - - #if PK11_FLAVOR != PK11_UTIMACO_FLAVOR - /* -diff --git a/lib/dns/opensslrsa_link.c b/lib/dns/opensslrsa_link.c -index ec35f50..c80fabe 100644 ---- a/lib/dns/opensslrsa_link.c -+++ b/lib/dns/opensslrsa_link.c -@@ -1812,6 +1812,12 @@ dst__opensslrsa_init(dst_func_t **funcp, unsigned char algorithm) { - - if (*funcp == NULL) { - switch (algorithm) { -+#ifndef PK11_MD5_DISABLE -+ case DST_ALG_RSAMD5: -+ if (isc_md5_available()) -+ *funcp = &opensslrsa_functions; -+ break; -+#endif - case DST_ALG_RSASHA256: - #if defined(HAVE_EVP_SHA256) || !USE_EVP - *funcp = &opensslrsa_functions; -diff --git a/lib/dns/pkcs11rsa_link.c b/lib/dns/pkcs11rsa_link.c -index 096c1a8..6c280bf 100644 ---- a/lib/dns/pkcs11rsa_link.c -+++ b/lib/dns/pkcs11rsa_link.c -@@ -96,10 +96,15 @@ pkcs11rsa_createctx_sign(dst_key_t *key, dst_context_t *dctx) { - #endif - - /* -- * Reject incorrect RSA key lengths. -+ * Reject incorrect RSA key lengths or disabled algorithms. - */ - switch (dctx->key->key_alg) { - case DST_ALG_RSAMD5: -+#ifndef PK11_MD5_DISABLE -+ if (!isc_md5_available()) -+ return (ISC_R_FAILURE); -+#endif -+ /* FALLTHROUGH */ - case DST_ALG_RSASHA1: - case DST_ALG_NSEC3RSASHA1: - /* From RFC 3110 */ -@@ -641,6 +646,9 @@ pkcs11rsa_createctx(dst_key_t *key, dst_context_t *dctx) { - switch (key->key_alg) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_RSAMD5: -+ if (!isc_md5_available()) -+ return (ISC_R_FAILURE); -+ - mech.mechanism = CKM_MD5; - break; - #endif -@@ -799,6 +807,9 @@ pkcs11rsa_sign(dst_context_t *dctx, isc_buffer_t *sig) { - switch (key->key_alg) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_RSAMD5: -+ if (!isc_md5_available()) -+ return (ISC_R_FAILURE); -+ - der = md5_der; - derlen = sizeof(md5_der); - hashlen = ISC_MD5_DIGESTLENGTH; -@@ -1024,6 +1035,9 @@ pkcs11rsa_verify(dst_context_t *dctx, const isc_region_t *sig) { - switch (key->key_alg) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_RSAMD5: -+ if (!isc_md5_available()) -+ return (ISC_R_FAILURE); -+ - der = md5_der; - derlen = sizeof(md5_der); - hashlen = ISC_MD5_DIGESTLENGTH; -@@ -2231,11 +2245,22 @@ static dst_func_t pkcs11rsa_functions = { - }; - - isc_result_t --dst__pkcs11rsa_init(dst_func_t **funcp) { -+dst__pkcs11rsa_init(dst_func_t **funcp, unsigned char algorithm) { - REQUIRE(funcp != NULL); - -- if (*funcp == NULL) -- *funcp = &pkcs11rsa_functions; -+ if (*funcp == NULL) { -+ switch (algorithm) { -+#ifndef PK11_MD5_DISABLE -+ case DST_ALG_RSAMD5: -+ if (isc_md5_available()) -+ *funcp = &pkcs11rsa_functions; -+ break; -+#endif -+ default: -+ *funcp = &pkcs11rsa_functions; -+ break; -+ } -+ } - return (ISC_R_SUCCESS); - } - -diff --git a/lib/dns/rcode.c b/lib/dns/rcode.c -index 9c42c50..f51d548 100644 ---- a/lib/dns/rcode.c -+++ b/lib/dns/rcode.c -@@ -16,6 +16,7 @@ - #include - - #include -+#include - #include - #include - #include -@@ -357,17 +358,33 @@ dns_cert_totext(dns_cert_t cert, isc_buffer_t *target) { - return (dns_mnemonic_totext(cert, target, certs)); - } - -+static inline struct tbl * -+secalgs_tbl_start() { -+ struct tbl *algs = secalgs; -+ -+#ifndef PK11_MD5_DISABLE -+ if (!isc_md5_available()) { -+ while (algs->name != NULL && -+ algs->value == DNS_KEYALG_RSAMD5) -+ ++algs; -+ } -+#endif -+ return algs; -+} -+ - isc_result_t - dns_secalg_fromtext(dns_secalg_t *secalgp, isc_textregion_t *source) { - unsigned int value; -- RETERR(dns_mnemonic_fromtext(&value, source, secalgs, 0xff)); -+ -+ RETERR(dns_mnemonic_fromtext(&value, source, -+ secalgs_tbl_start(), 0xff)); - *secalgp = value; - return (ISC_R_SUCCESS); - } - - isc_result_t - dns_secalg_totext(dns_secalg_t secalg, isc_buffer_t *target) { -- return (dns_mnemonic_totext(secalg, target, secalgs)); -+ return (dns_mnemonic_totext(secalg, target, secalgs_tbl_start())); - } - - void -diff --git a/lib/dns/tests/rsa_test.c b/lib/dns/tests/rsa_test.c -index f9ac6d0..241e17e 100644 ---- a/lib/dns/tests/rsa_test.c -+++ b/lib/dns/tests/rsa_test.c -@@ -27,6 +27,7 @@ - #define UNIT_TESTING - #include - -+#include - #include - #include - -@@ -248,6 +249,8 @@ isc_rsa_verify_test(void **state) { - /* RSAMD5 */ - - #ifndef PK11_MD5_DISABLE -+ if (isc_md5_available()) { -+ /* wrong indentation is kept for diff minimization */ - key->key_alg = DST_ALG_RSAMD5; - - ret = dst_context_create3(key, mctx, DNS_LOGCATEGORY_DNSSEC, -@@ -265,6 +268,7 @@ isc_rsa_verify_test(void **state) { - assert_int_equal(ret, ISC_R_SUCCESS); - - dst_context_destroy(&ctx); -+ } - #endif - - /* RSASHA256 */ -diff --git a/lib/dns/tests/tsig_test.c b/lib/dns/tests/tsig_test.c -index 11d011a..feb2068 100644 ---- a/lib/dns/tests/tsig_test.c -+++ b/lib/dns/tests/tsig_test.c -@@ -25,6 +25,7 @@ - #define UNIT_TESTING - #include - -+#include - #include - #include - #include -diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c -index 89cfc79..d07364a 100644 ---- a/lib/dns/tkey.c -+++ b/lib/dns/tkey.c -@@ -245,6 +245,9 @@ compute_secret(isc_buffer_t *shared, isc_region_t *queryrandomness, - unsigned char digests[32]; - unsigned int i; - -+ if (!isc_md5_available()) -+ return (ISC_R_NOTIMPLEMENTED); -+ - isc_buffer_usedregion(shared, &r); - - /* -@@ -321,6 +324,12 @@ process_dhtkey(dns_message_t *msg, dns_name_t *signer, dns_name_t *name, - } - - #ifndef PK11_MD5_DISABLE -+ if (!isc_md5_available()) { -+ tkey_log("process_dhtkey: MD5 was disabled"); -+ tkeyout->error = dns_tsigerror_badalg; -+ return (ISC_R_SUCCESS); -+ } -+ - if (!dns_name_equal(&tkeyin->algorithm, DNS_TSIG_HMACMD5_NAME)) { - tkey_log("process_dhtkey: algorithms other than " - "hmac-md5 are not supported"); -diff --git a/lib/dns/tsec.c b/lib/dns/tsec.c -index 9d8ead4..0c82f65 100644 ---- a/lib/dns/tsec.c -+++ b/lib/dns/tsec.c -@@ -11,6 +11,7 @@ - - #include - -+#include - #include - #include - -@@ -63,7 +64,12 @@ dns_tsec_create(isc_mem_t *mctx, dns_tsectype_t type, dst_key_t *key, - switch (dst_key_alg(key)) { - #ifndef PK11_MD5_DISABLE - case DST_ALG_HMACMD5: -- algname = dns_tsig_hmacmd5_name; -+ if (isc_md5_available()) { -+ algname = dns_tsig_hmacmd5_name; -+ } else { -+ isc_mem_put(mctx, tsec, sizeof(*tsec)); -+ return (DNS_R_BADALG); -+ } - break; - #endif - case DST_ALG_HMACSHA1: -diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c -index 58c1104..00ee1e1 100644 ---- a/lib/dns/tsig.c -+++ b/lib/dns/tsig.c -@@ -273,7 +273,8 @@ dns_tsigkey_createfromkey(dns_name_t *name, dns_name_t *algorithm, - (void)dns_name_downcase(&tkey->name, &tkey->name, NULL); - - #ifndef PK11_MD5_DISABLE -- if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME)) { -+ if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME) && -+ isc_md5_available()) { - tkey->algorithm = DNS_TSIG_HMACMD5_NAME; - if (dstkey != NULL && dst_key_alg(dstkey) != DST_ALG_HMACMD5) { - ret = DNS_R_BADALG; -@@ -499,7 +500,8 @@ destroyring(dns_tsig_keyring_t *ring) { - static unsigned int - dst_alg_fromname(dns_name_t *algorithm) { - #ifndef PK11_MD5_DISABLE -- if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME)) { -+ if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME) && -+ isc_md5_available()) { - return (DST_ALG_HMACMD5); - } else - #endif -@@ -683,7 +685,8 @@ dns_tsigkey_create(dns_name_t *name, dns_name_t *algorithm, - REQUIRE(secret != NULL); - - #ifndef PK11_MD5_DISABLE -- if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME)) { -+ if (dns_name_equal(algorithm, DNS_TSIG_HMACMD5_NAME) && -+ isc_md5_available()) { - if (secret != NULL) { - isc_buffer_t b; - -@@ -1291,7 +1294,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg, - return (ret); - if ( - #ifndef PK11_MD5_DISABLE -- alg == DST_ALG_HMACMD5 || -+ (alg == DST_ALG_HMACMD5 && isc_md5_available()) || - #endif - alg == DST_ALG_HMACSHA1 || - alg == DST_ALG_HMACSHA224 || alg == DST_ALG_HMACSHA256 || -@@ -1460,7 +1463,7 @@ dns_tsig_verify(isc_buffer_t *source, dns_message_t *msg, - - if ( - #ifndef PK11_MD5_DISABLE -- alg == DST_ALG_HMACMD5 || -+ (alg == DST_ALG_HMACMD5 && isc_md5_available()) || - #endif - alg == DST_ALG_HMACSHA1 || - alg == DST_ALG_HMACSHA224 || alg == DST_ALG_HMACSHA256 || -@@ -1601,7 +1604,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { - goto cleanup_querystruct; - if ( - #ifndef PK11_MD5_DISABLE -- alg == DST_ALG_HMACMD5 || -+ (alg == DST_ALG_HMACMD5 && isc_md5_available()) || - #endif - alg == DST_ALG_HMACSHA1 || - alg == DST_ALG_HMACSHA224 || -@@ -1780,7 +1783,7 @@ tsig_verify_tcp(isc_buffer_t *source, dns_message_t *msg) { - goto cleanup_context; - if ( - #ifndef PK11_MD5_DISABLE -- alg == DST_ALG_HMACMD5 || -+ (alg == DST_ALG_HMACMD5 && isc_md5_available()) || - #endif - alg == DST_ALG_HMACSHA1 || - alg == DST_ALG_HMACSHA224 || -diff --git a/lib/isc/include/isc/md5.h b/lib/isc/include/isc/md5.h -index 4d29398..e3f5cec 100644 ---- a/lib/isc/include/isc/md5.h -+++ b/lib/isc/include/isc/md5.h -@@ -91,6 +91,9 @@ isc_md5_final(isc_md5_t *ctx, unsigned char *digest); - bool - isc_md5_check(bool testing); - -+bool -+isc_md5_available(void); -+ - ISC_LANG_ENDDECLS - - #endif /* !PK11_MD5_DISABLE */ -diff --git a/lib/isc/md5.c b/lib/isc/md5.c -index 249f3da..628a414 100644 ---- a/lib/isc/md5.c -+++ b/lib/isc/md5.c -@@ -37,6 +37,7 @@ - - #include - #include -+#include - #include - #include - #include -@@ -54,6 +55,9 @@ - #define EVP_MD_CTX_free(ptr) EVP_MD_CTX_cleanup(ptr) - #endif - -+static isc_once_t available_once = ISC_ONCE_INIT; -+static bool available = false; -+ - void - isc_md5_init(isc_md5_t *ctx) { - ctx->ctx = EVP_MD_CTX_new(); -@@ -85,8 +89,33 @@ isc_md5_final(isc_md5_t *ctx, unsigned char *digest) { - ctx->ctx = NULL; - } - -+static void -+do_detect_available() { -+ isc_md5_t local; -+ isc_md5_t *ctx = &local; -+ unsigned char digest[ISC_MD5_DIGESTLENGTH]; -+ -+ ctx->ctx = EVP_MD_CTX_new(); -+ RUNTIME_CHECK(ctx->ctx != NULL); -+ available = (EVP_DigestInit(ctx->ctx, EVP_md5()) == 1); -+ if (available) -+ (void)EVP_DigestFinal(ctx->ctx, digest, NULL); -+ EVP_MD_CTX_free(ctx->ctx); -+ ctx->ctx = NULL; -+} -+ -+bool -+isc_md5_available() { -+ RUNTIME_CHECK(isc_once_do(&available_once, do_detect_available) -+ == ISC_R_SUCCESS); -+ return available; -+} -+ - #elif PKCS11CRYPTO - -+static isc_once_t available_once = ISC_ONCE_INIT; -+static bool available = false; -+ - void - isc_md5_init(isc_md5_t *ctx) { - CK_RV rv; -@@ -129,6 +158,31 @@ isc_md5_final(isc_md5_t *ctx, unsigned char *digest) { - pk11_return_session(ctx); - } - -+static void -+do_detect_available() { -+ isc_md5_t local; -+ isc_md5_t *ctx = &local; -+ CK_RV rv; -+ CK_MECHANISM mech = { CKM_MD5, NULL, 0 }; -+ -+ if (pk11_get_session(ctx, OP_DIGEST, true, false, -+ false, NULL, 0) == ISC_R_SUCCESS) -+ { -+ rv = pkcs_C_DigestInit(ctx->session, &mech); -+ isc_md5_invalidate(ctx); -+ available = (rv == CKR_OK); -+ } else { -+ available = false; -+ } -+} -+ -+bool -+isc_md5_available() { -+ RUNTIME_CHECK(isc_once_do(&available_once, do_detect_available) -+ == ISC_R_SUCCESS); -+ return available; -+} -+ - #else - - static void -@@ -338,6 +392,11 @@ isc_md5_final(isc_md5_t *ctx, unsigned char *digest) { - memmove(digest, ctx->buf, 16); - isc_safe_memwipe(ctx, sizeof(*ctx)); /* In case it's sensitive */ - } -+ -+bool -+isc_md5_available() { -+ return true; -+} - #endif - - /* -diff --git a/lib/isc/pk11.c b/lib/isc/pk11.c -index 0d5b009..7809e7b 100644 ---- a/lib/isc/pk11.c -+++ b/lib/isc/pk11.c -@@ -197,8 +197,6 @@ pk11_initialize(isc_mem_t *mctx, const char *engine) { - UNLOCK(&alloclock); - if (initialized) { - goto unlock; -- } else { -- initialized = true; - } - - ISC_LIST_INIT(tokens); -@@ -238,6 +236,7 @@ pk11_initialize(isc_mem_t *mctx, const char *engine) { - } - #endif - #endif /* PKCS11CRYPTO */ -+ initialized = true; - unlock: - UNLOCK(&sessionlock); - return (result); -@@ -589,6 +588,8 @@ scan_slots(void) { - pk11_token_t *token; - unsigned int i; - bool bad; -+ unsigned int best_rsa_algorithms = 0; -+ unsigned int best_digest_algorithms = 0; - - slotCount = 0; - PK11_FATALCHECK(pkcs_C_GetSlotList, (CK_FALSE, NULL_PTR, &slotCount)); -@@ -601,6 +602,8 @@ scan_slots(void) { - PK11_FATALCHECK(pkcs_C_GetSlotList, (CK_FALSE, slotList, &slotCount)); - - for (i = 0; i < slotCount; i++) { -+ unsigned int rsa_algorithms = 0; -+ unsigned int digest_algorithms = 0; - slot = slotList[i]; - PK11_TRACE2("slot#%u=0x%lx\n", i, slot); - -@@ -640,11 +643,12 @@ scan_slots(void) { - if ((rv != CKR_OK) || - ((mechInfo.flags & CKF_SIGN) == 0) || - ((mechInfo.flags & CKF_VERIFY) == 0)) { --#if !defined(PK11_MD5_DISABLE) && !defined(PK11_RSA_PKCS_REPLACE) -- bad = true; --#endif - PK11_TRACEM(CKM_MD5_RSA_PKCS); - } -+#if !defined(PK11_MD5_DISABLE) && !defined(PK11_RSA_PKCS_REPLACE) -+ else -+ ++rsa_algorithms; -+#endif - rv = pkcs_C_GetMechanismInfo(slot, CKM_SHA1_RSA_PKCS, - &mechInfo); - if ((rv != CKR_OK) || -@@ -687,8 +691,14 @@ scan_slots(void) { - if (bad) - goto try_dsa; - token->operations |= 1 << OP_RSA; -- if (best_rsa_token == NULL) -+ if (best_rsa_token == NULL) { - best_rsa_token = token; -+ best_rsa_algorithms = rsa_algorithms; -+ } else if (rsa_algorithms > best_rsa_algorithms) { -+ pk11_mem_put(best_rsa_token, sizeof(*best_rsa_token)); -+ best_rsa_token = token; -+ best_rsa_algorithms = rsa_algorithms; -+ } - - try_dsa: - bad = false; -@@ -756,11 +766,12 @@ scan_slots(void) { - bad = false; - rv = pkcs_C_GetMechanismInfo(slot, CKM_MD5, &mechInfo); - if ((rv != CKR_OK) || ((mechInfo.flags & CKF_DIGEST) == 0)) { --#ifndef PK11_MD5_DISABLE -- bad = true; --#endif - PK11_TRACEM(CKM_MD5); - } -+#ifndef PK11_MD5_DISABLE -+ else -+ ++digest_algorithms; -+#endif - rv = pkcs_C_GetMechanismInfo(slot, CKM_SHA_1, &mechInfo); - if ((rv != CKR_OK) || ((mechInfo.flags & CKF_DIGEST) == 0)) { - bad = true; -@@ -788,11 +799,12 @@ scan_slots(void) { - } - rv = pkcs_C_GetMechanismInfo(slot, CKM_MD5_HMAC, &mechInfo); - if ((rv != CKR_OK) || ((mechInfo.flags & CKF_SIGN) == 0)) { --#if !defined(PK11_MD5_DISABLE) && !defined(PK11_MD5_HMAC_REPLACE) -- bad = true; --#endif - PK11_TRACEM(CKM_MD5_HMAC); - } -+#if !defined(PK11_MD5_DISABLE) && !defined(PK11_MD5_HMAC_REPLACE) -+ else -+ ++digest_algorithms; -+#endif - rv = pkcs_C_GetMechanismInfo(slot, CKM_SHA_1_HMAC, &mechInfo); - if ((rv != CKR_OK) || ((mechInfo.flags & CKF_SIGN) == 0)) { - #ifndef PK11_SHA_1_HMAC_REPLACE -@@ -830,8 +842,14 @@ scan_slots(void) { - } - if (!bad) { - token->operations |= 1 << OP_DIGEST; -- if (digest_token == NULL) -+ if (digest_token == NULL) { - digest_token = token; -+ best_digest_algorithms = digest_algorithms; -+ } else if (digest_algorithms > best_digest_algorithms) { -+ pk11_mem_put(digest_token, sizeof(*digest_token)); -+ digest_token = token; -+ best_digest_algorithms = digest_algorithms; -+ } - } - - /* ECDSA requires digest */ -diff --git a/lib/isc/tests/hash_test.c b/lib/isc/tests/hash_test.c -index 31ced94..421131e 100644 ---- a/lib/isc/tests/hash_test.c -+++ b/lib/isc/tests/hash_test.c -@@ -775,6 +775,9 @@ isc_md5_test(void **state) { - - UNUSED(state); - -+ if (!isc_md5_available()) -+ return; -+ - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the -@@ -1630,6 +1633,9 @@ isc_hmacmd5_test(void **state) { - - UNUSED(state); - -+ if (!isc_md5_available()) -+ return; -+ - /* - * These are the various test vectors. All of these are passed - * through the hash function and the results are compared to the -@@ -1940,6 +1946,9 @@ static void - md5_check_test(void **state) { - UNUSED(state); - -+ if (!isc_md5_available()) -+ return; -+ - assert_true(isc_md5_check(false)); - assert_false(isc_md5_check(true)); - -diff --git a/lib/isccc/cc.c b/lib/isccc/cc.c -index c2740cb..c314d76 100644 ---- a/lib/isccc/cc.c -+++ b/lib/isccc/cc.c -@@ -272,11 +272,15 @@ sign(unsigned char *data, unsigned int length, unsigned char *hmac, - switch (algorithm) { - #ifndef PK11_MD5_DISABLE - case ISCCC_ALG_HMACMD5: -- isc_hmacmd5_init(&ctx.hmd5, secret->rstart, -- REGION_SIZE(*secret)); -- isc_hmacmd5_update(&ctx.hmd5, data, length); -- isc_hmacmd5_sign(&ctx.hmd5, digest); -- source.rend = digest + ISC_MD5_DIGESTLENGTH; -+ if (isc_md5_available()) { -+ isc_hmacmd5_init(&ctx.hmd5, secret->rstart, -+ REGION_SIZE(*secret)); -+ isc_hmacmd5_update(&ctx.hmd5, data, length); -+ isc_hmacmd5_sign(&ctx.hmd5, digest); -+ source.rend = digest + ISC_MD5_DIGESTLENGTH; -+ } else { -+ return (ISC_R_FAILURE); -+ } - break; - #endif - -@@ -350,14 +354,18 @@ isccc_cc_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer, - { - unsigned int hmac_base, signed_base; - isc_result_t result; -+ const bool md5 = (algorithm == ISCCC_ALG_HMACMD5); - - #ifndef PK11_MD5_DISABLE -+ if (md5 && !isc_md5_available()) -+ return (ISC_R_NOTIMPLEMENTED); -+ - result = isc_buffer_reserve(buffer, -- 4 + ((algorithm == ISCCC_ALG_HMACMD5) ? -+ 4 + ((md5) ? - sizeof(auth_hmd5) : - sizeof(auth_hsha))); - #else -- if (algorithm == ISCCC_ALG_HMACMD5) -+ if (md5) - return (ISC_R_NOTIMPLEMENTED); - result = isc_buffer_reserve(buffer, 4 + sizeof(auth_hsha)); - #endif -@@ -376,7 +384,7 @@ isccc_cc_towire(isccc_sexpr_t *alist, isc_buffer_t **buffer, - * we know what it is. - */ - #ifndef PK11_MD5_DISABLE -- if (algorithm == ISCCC_ALG_HMACMD5) { -+ if (md5) { - hmac_base = (*buffer)->used + HMD5_OFFSET; - isc_buffer_putmem(*buffer, - auth_hmd5, sizeof(auth_hmd5)); -@@ -442,7 +450,7 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, - if (!isccc_alist_alistp(_auth)) - return (ISC_R_FAILURE); - #ifndef PK11_MD5_DISABLE -- if (algorithm == ISCCC_ALG_HMACMD5) -+ if (algorithm == ISCCC_ALG_HMACMD5 && isc_md5_available()) - hmac = isccc_alist_lookup(_auth, "hmd5"); - else - #endif -@@ -457,12 +465,16 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length, - switch (algorithm) { - #ifndef PK11_MD5_DISABLE - case ISCCC_ALG_HMACMD5: -- isc_hmacmd5_init(&ctx.hmd5, secret->rstart, -- REGION_SIZE(*secret)); -- isc_hmacmd5_update(&ctx.hmd5, data, length); -- isc_hmacmd5_sign(&ctx.hmd5, digest); -- source.rend = digest + ISC_MD5_DIGESTLENGTH; -- break; -+ if (isc_md5_available()) { -+ isc_hmacmd5_init(&ctx.hmd5, secret->rstart, -+ REGION_SIZE(*secret)); -+ isc_hmacmd5_update(&ctx.hmd5, data, length); -+ isc_hmacmd5_sign(&ctx.hmd5, digest); -+ source.rend = digest + ISC_MD5_DIGESTLENGTH; -+ break; -+ } else { -+ return (ISC_R_FAILURE); -+ } - #endif - - case ISCCC_ALG_HMACSHA1: --- -2.20.1 - diff --git a/bind-9.11-rt31459.patch b/bind-9.11-rt31459.patch deleted file mode 100644 index 587fc28..0000000 --- a/bind-9.11-rt31459.patch +++ /dev/null @@ -1,375 +0,0 @@ -From 31612e4f76eeb07d0fffa33814ce5edef04b286a Mon Sep 17 00:00:00 2001 -From: Evan Hunt -Date: Tue, 12 Sep 2017 19:05:46 -0700 -Subject: [PATCH] rebased rt31459c - -[rt31459d] update the newer tools - -[rt31459d] setup entropy in dns_lib_init() - -[rt31459d] silence compiler warning - -DNS_OPENSSL_LIBS -> DST_OPENSSL_LIBS - -Include new unit test ---- - bin/tests/system/pipelined/pipequeries.c | 1 + - bin/tests/system/pipelined/tests.sh | 4 +- - bin/tests/system/tkey/keycreate.c | 1 + - bin/tests/system/tkey/keydelete.c | 1 + - bin/tests/system/tkey/tests.sh | 8 +- - configure | 97 ++++++++++-------------- - lib/dns/include/dst/dst.h | 8 ++ - lib/dns/lib.c | 1 + - lib/dns/tests/Makefile.in | 5 ++ - lib/isc/include/isc/types.h | 2 + - win32utils/Configure | 4 +- - 11 files changed, 66 insertions(+), 66 deletions(-) - -diff --git a/bin/tests/system/pipelined/pipequeries.c b/bin/tests/system/pipelined/pipequeries.c -index 74de833..4fac3cb 100644 ---- a/bin/tests/system/pipelined/pipequeries.c -+++ b/bin/tests/system/pipelined/pipequeries.c -@@ -205,6 +205,7 @@ sendqueries(isc_task_t *task, isc_event_t *event) { - - int - main(int argc, char *argv[]) { -+ char *randomfile = NULL; - isc_sockaddr_t bind_any; - struct in_addr inaddr; - isc_result_t result; -diff --git a/bin/tests/system/pipelined/tests.sh b/bin/tests/system/pipelined/tests.sh -index 61f1ff7..ed1302a 100644 ---- a/bin/tests/system/pipelined/tests.sh -+++ b/bin/tests/system/pipelined/tests.sh -@@ -19,7 +19,7 @@ status=0 - - echo_i "check pipelined TCP queries" - ret=0 --$PIPEQUERIES -p ${PORT} < input > raw || ret=1 -+$PIPEQUERIES -p ${PORT} -r $RANDFILE < input > raw || ret=1 - awk '{ print $1 " " $5 }' < raw > output - sort < output > output-sorted - $DIFF ref output-sorted || { ret=1 ; echo_i "diff sorted failed"; } -@@ -43,7 +43,7 @@ status=`expr $status + $ret` - - echo_i "check keep-response-order" - ret=0 --$PIPEQUERIES -p ${PORT} ++ < inputb > rawb || ret=1 -+$PIPEQUERIES -p ${PORT} -r $RANDFILE ++ < inputb > rawb || ret=1 - awk '{ print $1 " " $5 }' < rawb > outputb - $DIFF refb outputb || ret=1 - if [ $ret != 0 ]; then echo_i "failed"; fi -diff --git a/bin/tests/system/tkey/keycreate.c b/bin/tests/system/tkey/keycreate.c -index c39f6a4..b29a3cb 100644 ---- a/bin/tests/system/tkey/keycreate.c -+++ b/bin/tests/system/tkey/keycreate.c -@@ -195,6 +195,7 @@ sendquery(isc_task_t *task, isc_event_t *event) { - int - main(int argc, char *argv[]) { - char *ourkeyname; -+ char *randomfile; - isc_taskmgr_t *taskmgr; - isc_timermgr_t *timermgr; - isc_socketmgr_t *socketmgr; -diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c -index 547e8d0..efcea1d 100644 ---- a/bin/tests/system/tkey/keydelete.c -+++ b/bin/tests/system/tkey/keydelete.c -@@ -136,6 +136,7 @@ sendquery(isc_task_t *task, isc_event_t *event) { - int - main(int argc, char **argv) { - char *keyname; -+ char *randomfile; - isc_taskmgr_t *taskmgr; - isc_timermgr_t *timermgr; - isc_socketmgr_t *socketmgr; -diff --git a/bin/tests/system/tkey/tests.sh b/bin/tests/system/tkey/tests.sh -index a293d32..51ed2cb 100644 ---- a/bin/tests/system/tkey/tests.sh -+++ b/bin/tests/system/tkey/tests.sh -@@ -31,7 +31,7 @@ for owner in . foo.example. - do - echo "I:creating new key using owner name \"$owner\"" - ret=0 -- keyname=`$KEYCREATE $dhkeyname $owner` || ret=1 -+ keyname=`$KEYCREATE -r $RANDFILE $dhkeyname $owner` || ret=1 - if [ $ret != 0 ]; then - echo "I:failed" - status=`expr $status + $ret` -@@ -53,7 +53,7 @@ do - - echo "I:deleting new key" - ret=0 -- $KEYDELETE $keyname || ret=1 -+ $KEYDELETE -r $RANDFILE $keyname || ret=1 - if [ $ret != 0 ]; then - echo "I:failed" - fi -@@ -73,7 +73,7 @@ done - - echo "I:creating new key using owner name bar.example." - ret=0 --keyname=`$KEYCREATE $dhkeyname bar.example.` || ret=1 -+keyname=`$KEYCREATE -r $RANDFILE $dhkeyname bar.example.` || ret=1 - if [ $ret != 0 ]; then - echo "I:failed" - status=`expr $status + $ret` -@@ -114,7 +114,7 @@ status=`expr $status + $ret` - - echo "I:recreating the bar.example. key" - ret=0 --keyname=`$KEYCREATE $dhkeyname bar.example.` || ret=1 -+keyname=`$KEYCREATE -r $RANDFILE $dhkeyname bar.example.` || ret=1 - if [ $ret != 0 ]; then - echo "I:failed" - status=`expr $status + $ret` -diff --git a/configure b/configure -index 4c97c8c..1e047bd 100755 ---- a/configure -+++ b/configure -@@ -632,6 +632,7 @@ ac_includes_default="\ - - ac_subst_vars='LTLIBOBJS - LIBOBJS -+LIBDIR_SUFFIX - BUILD_LIBS - BUILD_LDFLAGS - BUILD_CPPFLAGS -@@ -20509,6 +20510,30 @@ fi - # - dlzdir='${DLZ_DRIVER_DIR}' - -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target libdir" >&5 -+$as_echo_n "checking for target libdir... " >&6; } -+if test "$cross_compiling" = yes; then : -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "cannot run test program while cross compiling -+See \`config.log' for more details" "$LINENO" 5; } -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+int main(void) {exit((sizeof(void *) == 8) ? 0 : 1);} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ target_lib=lib64 -+else -+ target_lib=lib -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"$target_lib\"" >&5 -+$as_echo "\"$target_lib\"" >&6; } -+ - # - # Private autoconf macro to simplify configuring drivers: - # -@@ -20839,11 +20864,11 @@ $as_echo "no" >&6; } - $as_echo "using mysql with libs ${mysql_lib} and includes ${mysql_include}" >&6; } - ;; - *) -- if test -d "$use_dlz_mysql/lib/mysql" -+ if test -d $use_dlz_mysql/${target_lib}/mysql - then -- mysql_lib="$use_dlz_mysql/lib/mysql" -+ mysql_lib=$use_dlz_mysql/${target_lib}/mysql - else -- mysql_lib="$use_dlz_mysql/lib" -+ mysql_lib=$use_dlz_mysql/${target_lib} - fi - - CONTRIB_DLZ="$CONTRIB_DLZ -DDLZ_MYSQL" -@@ -20928,7 +20953,7 @@ $as_echo "" >&6; } - # Check other locations for includes. - # Order is important (sigh). - -- bdb_incdirs="/db53 /db51 /db48 /db47 /db46 /db45 /db44 /db43 /db42 /db41 /db4 /db" -+ bdb_incdirs="/db53 /db51 /db48 /db47 /db46 /db45 /db44 /db43 /db42 /db41 /db4 /libdb /db" - # include a blank element first - for d in "" $bdb_incdirs - do -@@ -20953,57 +20978,9 @@ $as_echo "" >&6; } - bdb_libnames="db53 db-5.3 db51 db-5.1 db48 db-4.8 db47 db-4.7 db46 db-4.6 db45 db-4.5 db44 db-4.4 db43 db-4.3 db42 db-4.2 db41 db-4.1 db" - for d in $bdb_libnames - do -- if test "$dd" = "/usr" -- then -- as_ac_Lib=`$as_echo "ac_cv_lib_$d''_db_create" | $as_tr_sh` --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for db_create in -l$d" >&5 --$as_echo_n "checking for db_create in -l$d... " >&6; } --if eval \${$as_ac_Lib+:} false; then : -- $as_echo_n "(cached) " >&6 --else -- ac_check_lib_save_LIBS=$LIBS --LIBS="-l$d $LIBS" --cat confdefs.h - <<_ACEOF >conftest.$ac_ext --/* end confdefs.h. */ -- --/* Override any GCC internal prototype to avoid an error. -- Use char because int might match the return type of a GCC -- builtin and then its argument prototype would still apply. */ --#ifdef __cplusplus --extern "C" --#endif --char db_create (); --int --main () --{ --return db_create (); -- ; -- return 0; --} --_ACEOF --if ac_fn_c_try_link "$LINENO"; then : -- eval "$as_ac_Lib=yes" --else -- eval "$as_ac_Lib=no" --fi --rm -f core conftest.err conftest.$ac_objext \ -- conftest$ac_exeext conftest.$ac_ext --LIBS=$ac_check_lib_save_LIBS --fi --eval ac_res=\$$as_ac_Lib -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 --$as_echo "$ac_res" >&6; } --if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -- dlz_bdb_libs="-l${d}" --fi -- -- if test $dlz_bdb_libs != "yes" -- then -- break -- fi -- elif test -f "$dd/lib/lib${d}.so" -+ if test -f "$dd/${target_lib}/lib${d}.so" - then -- dlz_bdb_libs="-L${dd}/lib -l${d}" -+ dlz_bdb_libs="-L${dd}/${target_lib}/libdb -l${d}" - break - fi - done -@@ -21162,10 +21139,10 @@ $as_echo "no" >&6; } - DLZ_DRIVER_INCLUDES="$DLZ_DRIVER_INCLUDES -I$use_dlz_ldap/include" - DLZ_DRIVER_LDAP_INCLUDES="-I$use_dlz_ldap/include" - fi -- if test -n "-L$use_dlz_ldap/lib -lldap -llber" -+ if test -n "-L$use_dlz_ldap/${target_lib} -lldap -llber" - then -- DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L$use_dlz_ldap/lib -lldap -llber" -- DLZ_DRIVER_LDAP_LIBS="-L$use_dlz_ldap/lib -lldap -llber" -+ DLZ_DRIVER_LIBS="$DLZ_DRIVER_LIBS -L$use_dlz_ldap/${target_lib} -lldap -llber" -+ DLZ_DRIVER_LDAP_LIBS="-L$use_dlz_ldap/${target_lib} -lldap -llber" - fi - - -@@ -21251,11 +21228,11 @@ fi - odbcdirs="/usr /usr/local /usr/pkg" - for d in $odbcdirs - do -- if test -f $d/include/sql.h -a -f $d/lib/libodbc.a -+ if test -f $d/include/sql.h -a -f $d/${target_lib}/libodbc.a - then - use_dlz_odbc=$d - dlz_odbc_include="-I$use_dlz_odbc/include" -- dlz_odbc_libs="-L$use_dlz_odbc/lib -lodbc" -+ dlz_odbc_libs="-L$use_dlz_odbc/${target_lib} -lodbc" - break - fi - done -@@ -21530,6 +21507,8 @@ DNS_CRYPTO_LIBS="$NEWFLAGS" - - - -+ -+ - # - # Commands to run at the end of config.status. - # Don't just put these into configure, it won't work right if somebody -diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h -index 3146d88..3f7ac4d 100644 ---- a/lib/dns/include/dst/dst.h -+++ b/lib/dns/include/dst/dst.h -@@ -153,6 +153,14 @@ dst_lib_destroy(void); - * Releases all resources allocated by DST. - */ - -+isc_result_t -+dst_random_getdata(void *data, unsigned int length, -+ unsigned int *returned, unsigned int flags); -+/*%< -+ * \brief Return data from the crypto random generator. -+ * Specialization of isc_entropy_getdata(). -+ */ -+ - bool - dst_algorithm_supported(unsigned int alg); - /*%< -diff --git a/lib/dns/lib.c b/lib/dns/lib.c -index 5fccb57..1f627c4 100644 ---- a/lib/dns/lib.c -+++ b/lib/dns/lib.c -@@ -51,6 +51,7 @@ static unsigned int references = 0; - static void - initialize(void) { - isc_result_t result; -+ isc_entropy_t *ectx = NULL; - - REQUIRE(initialize_done == false); - -diff --git a/lib/dns/tests/Makefile.in b/lib/dns/tests/Makefile.in -index 7b35b93..c5befff 100644 ---- a/lib/dns/tests/Makefile.in -+++ b/lib/dns/tests/Makefile.in -@@ -259,6 +259,11 @@ zt_test@EXEEXT@: zt_test.@O@ dnstest.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} - ${LDFLAGS} -o $@ zt_test.@O@ dnstest.@O@ \ - ${DNSLIBS} ${ISCLIBS} ${LIBS} - -+dstrandom_test@EXEEXT@: dstrandom_test.@O@ ${ISCDEPLIBS} ${DNSDEPLIBS} -+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ -+ dstrandom_test.@O@ ${DNSLIBS} \ -+ ${ISCLIBS} ${ISCPK11LIBS} ${LIBS} -+ - unit:: - sh ${top_builddir}/unit/unittest.sh - -diff --git a/lib/isc/include/isc/types.h b/lib/isc/include/isc/types.h -index f8e5ae6..d0dc9b5 100644 ---- a/lib/isc/include/isc/types.h -+++ b/lib/isc/include/isc/types.h -@@ -82,6 +82,8 @@ typedef struct isc_time isc_time_t; /*%< Time */ - typedef struct isc_timer isc_timer_t; /*%< Timer */ - typedef struct isc_timermgr isc_timermgr_t; /*%< Timer Manager */ - -+typedef isc_result_t (*isc_entropy_getdata_t)(void *, unsigned int, -+ unsigned int *, unsigned int); - typedef void (*isc_taskaction_t)(isc_task_t *, isc_event_t *); - typedef int (*isc_sockfdwatch_t)(isc_task_t *, isc_socket_t *, void *, int); - -diff --git a/win32utils/Configure b/win32utils/Configure -index 9731b0c..0b7bc6e 100644 ---- a/win32utils/Configure -+++ b/win32utils/Configure -@@ -353,7 +353,8 @@ my @allcond = (@substcond, "NOTYET", "NOLONGER"); - - # enable-xxx/disable-xxx - --my @enablelist = ("developer", -+my @enablelist = ("crypto-rand", -+ "developer", - "fixed-rrset", - "intrinsics", - "isc-spnego", -@@ -2929,6 +2930,7 @@ exit 0; - # --enable-developer partially supported - # --enable-newstats (9.9/9.9sub only) - # --enable-native-pkcs11 supported -+# --enable-crypto-rand supported - # --enable-openssl-version-check included without a way to disable it - # --enable-openssl-hash supported - # --enable-threads included without a way to disable it --- -2.20.1 - diff --git a/bind-9.11-rt46047.patch b/bind-9.11-rt46047.patch deleted file mode 100644 index 8f413f6..0000000 --- a/bind-9.11-rt46047.patch +++ /dev/null @@ -1,799 +0,0 @@ -From 5a465424f5249ceaf0547ab90361a16eb08f7a2b Mon Sep 17 00:00:00 2001 -From: Evan Hunt -Date: Thu, 28 Sep 2017 10:09:22 -0700 -Subject: [PATCH] completed and corrected the crypto-random change - -4724. [func] By default, BIND now uses the random number - functions provided by the crypto library (i.e., - OpenSSL or a PKCS#11 provider) as a source of - randomness rather than /dev/random. This is - suitable for virtual machine environments - which have limited entropy pools and lack - hardware random number generators. - - This can be overridden by specifying another - entropy source via the "random-device" option - in named.conf, or via the -r command line option; - however, for functions requiring full cryptographic - strength, such as DNSSEC key generation, this - cannot be overridden. In particular, the -r - command line option no longer has any effect on - dnssec-keygen. - - This can be disabled by building with - "configure --disable-crypto-rand". - [RT #31459] [RT #46047] ---- - bin/confgen/keygen.c | 12 +++--- - bin/dnssec/dnssec-keygen.docbook | 24 +++++++---- - bin/dnssec/dnssectool.c | 12 +++--- - bin/named/client.c | 3 +- - bin/named/config.c | 4 +- - bin/named/controlconf.c | 19 +++++--- - bin/named/include/named/server.h | 2 + - bin/named/interfacemgr.c | 1 + - bin/named/query.c | 1 + - bin/named/server.c | 52 ++++++++++++++-------- - bin/nsupdate/nsupdate.c | 4 +- - bin/tests/system/pipelined/pipequeries.c | 4 +- - bin/tests/system/tkey/keycreate.c | 4 +- - bin/tests/system/tkey/keydelete.c | 5 +-- - doc/arm/Bv9ARM-book.xml | 55 +++++++++++++++++------- - doc/arm/notes-rh-changes.xml | 43 ++++++++++++++++++ - doc/arm/notes.xml | 1 + - lib/dns/dst_api.c | 4 +- - lib/dns/include/dst/dst.h | 14 +++++- - lib/dns/openssl_link.c | 3 +- - lib/isc/include/isc/entropy.h | 50 +++++++++++++++------ - lib/isc/include/isc/random.h | 28 +++++++----- - lib/isccfg/namedconf.c | 2 +- - 23 files changed, 241 insertions(+), 106 deletions(-) - create mode 100644 doc/arm/notes-rh-changes.xml - -diff --git a/bin/confgen/keygen.c b/bin/confgen/keygen.c -index 295e16f..0f79aa8 100644 ---- a/bin/confgen/keygen.c -+++ b/bin/confgen/keygen.c -@@ -161,17 +161,15 @@ generate_key(isc_mem_t *mctx, const char *randomfile, dns_secalg_t alg, - - DO("create entropy context", isc_entropy_create(mctx, &ectx)); - -- if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) { -- randomfile = NULL; -- open_keyboard = ISC_ENTROPY_KEYBOARDYES; -- } - #ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -+ if (randomfile == NULL) { - isc_entropy_usehook(ectx, true); - } - #endif -+ if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) { -+ randomfile = NULL; -+ open_keyboard = ISC_ENTROPY_KEYBOARDYES; -+ } - DO("start entropy source", isc_entropy_usebestsource(ectx, - &entropy_source, - randomfile, -diff --git a/bin/dnssec/dnssec-keygen.docbook b/bin/dnssec/dnssec-keygen.docbook -index 0ae6b41..4562430 100644 ---- a/bin/dnssec/dnssec-keygen.docbook -+++ b/bin/dnssec/dnssec-keygen.docbook -@@ -348,15 +348,23 @@ - -r randomdev - - -- Specifies the source of randomness. If the operating -- system does not provide a /dev/random -- or equivalent device, the default source of randomness -- is keyboard input. randomdev -- specifies -+ Specifies a source of randomness. Normally, when generating -+ DNSSEC keys, this option has no effect; the random number -+ generation function provided by the cryptographic library will -+ be used. -+ -+ -+ If that behavior is disabled at compile time, however, -+ the specified file will be used as entropy source -+ for key generation. randomdev is - the name of a character device or file containing random -- data to be used instead of the default. The special value -- keyboard indicates that keyboard -- input should be used. -+ data to be used. The special value keyboard -+ indicates that keyboard input should be used. -+ -+ -+ The default is /dev/random if the -+ operating system provides it or an equivalent device; -+ if not, the default source of randomness is keyboard input. - - - -diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c -index 31a99e7..38c83ed 100644 ---- a/bin/dnssec/dnssectool.c -+++ b/bin/dnssec/dnssectool.c -@@ -241,18 +241,16 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - ISC_LIST_INIT(sources); - } - -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ if (randomfile == NULL) { -+ isc_entropy_usehook(*ectx, true); -+ } -+#endif - if (randomfile != NULL && strcmp(randomfile, "keyboard") == 0) { - usekeyboard = ISC_ENTROPY_KEYBOARDYES; - randomfile = NULL; - } - --#ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -- isc_entropy_usehook(*ectx, true); -- } --#endif - result = isc_entropy_usebestsource(*ectx, &source, randomfile, - usekeyboard); - -diff --git a/bin/named/client.c b/bin/named/client.c -index 50fa2cd..524d9a3 100644 ---- a/bin/named/client.c -+++ b/bin/named/client.c -@@ -1762,7 +1762,8 @@ ns_client_addopt(ns_client_t *client, dns_message_t *message, - - isc_buffer_init(&buf, cookie, sizeof(cookie)); - isc_stdtime_get(&now); -- isc_random_get(&nonce); -+ nonce = ((isc_rng_random(ns_g_server->rngctx) << 16) | -+ isc_rng_random(ns_g_server->rngctx)); - - compute_cookie(client, now, nonce, ns_g_server->secret, &buf); - -diff --git a/bin/named/config.c b/bin/named/config.c -index dbdff64..63da4b0 100644 ---- a/bin/named/config.c -+++ b/bin/named/config.c -@@ -98,7 +98,9 @@ options {\n\ - # pid-file \"" NS_LOCALSTATEDIR "/run/named/named.pid\"; /* or /lwresd.pid */\n\ - port 53;\n\ - prefetch 2 9;\n" --#ifdef PATH_RANDOMDEV -+#if defined(ISC_PLATFORM_CRYPTORANDOM) -+" random-device none;\n" -+#elif defined(PATH_RANDOMDEV) - " random-device \"" PATH_RANDOMDEV "\";\n" - #endif - " recursing-file \"named.recursing\";\n\ -diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c -index d955c2f..40621f2 100644 ---- a/bin/named/controlconf.c -+++ b/bin/named/controlconf.c -@@ -325,9 +325,10 @@ log_invalid(isccc_ccmsg_t *ccmsg, isc_result_t result) { - - static void - control_recvmessage(isc_task_t *task, isc_event_t *event) { -- controlconnection_t *conn; -- controllistener_t *listener; -- controlkey_t *key; -+ controlconnection_t *conn = NULL; -+ controllistener_t *listener = NULL; -+ ns_server_t *server = NULL; -+ controlkey_t *key = NULL; - isccc_sexpr_t *request = NULL; - isccc_sexpr_t *response = NULL; - uint32_t algorithm; -@@ -338,16 +339,17 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) { - isc_buffer_t *text; - isc_result_t result; - isc_result_t eresult; -- isccc_sexpr_t *_ctrl; -+ isccc_sexpr_t *_ctrl = NULL; - isccc_time_t sent; - isccc_time_t exp; - uint32_t nonce; -- isccc_sexpr_t *data; -+ isccc_sexpr_t *data = NULL; - - REQUIRE(event->ev_type == ISCCC_EVENT_CCMSG); - - conn = event->ev_arg; - listener = conn->listener; -+ server = listener->controls->server; - algorithm = DST_ALG_UNKNOWN; - secret.rstart = NULL; - text = NULL; -@@ -458,8 +460,11 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) { - * Establish nonce. - */ - if (conn->nonce == 0) { -- while (conn->nonce == 0) -- isc_random_get(&conn->nonce); -+ while (conn->nonce == 0) { -+ uint16_t r1 = isc_rng_random(server->rngctx); -+ uint16_t r2 = isc_rng_random(server->rngctx); -+ conn->nonce = (r1 << 16) | r2; -+ } - eresult = ISC_R_SUCCESS; - } else - eresult = ns_control_docommand(request, listener->readonly, &text); -diff --git a/bin/named/include/named/server.h b/bin/named/include/named/server.h -index 7ee8f66..8982d26 100644 ---- a/bin/named/include/named/server.h -+++ b/bin/named/include/named/server.h -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -134,6 +135,7 @@ struct ns_server { - char * lockfile; - - uint16_t transfer_tcp_message_size; -+ isc_rng_t * rngctx; - }; - - struct ns_altsecret { -diff --git a/bin/named/interfacemgr.c b/bin/named/interfacemgr.c -index 9dea7c1..272d300 100644 ---- a/bin/named/interfacemgr.c -+++ b/bin/named/interfacemgr.c -@@ -17,6 +17,7 @@ - - #include - #include -+#include - #include - #include - #include -diff --git a/bin/named/query.c b/bin/named/query.c -index c9e5469..0940714 100644 ---- a/bin/named/query.c -+++ b/bin/named/query.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include - #include -diff --git a/bin/named/server.c b/bin/named/server.c -index 36fc047..3c1eec0 100644 ---- a/bin/named/server.c -+++ b/bin/named/server.c -@@ -8208,21 +8208,32 @@ load_configuration(const char *filename, ns_server_t *server, - * Open the source of entropy. - */ - if (first_time) { -+ const char *randomdev = NULL; -+ int level = ISC_LOG_ERROR; - obj = NULL; - result = ns_config_get(maps, "random-device", &obj); -- if (result != ISC_R_SUCCESS) { -+ if (result == ISC_R_SUCCESS) { -+ if (!cfg_obj_isvoid(obj)) { -+ level = ISC_LOG_INFO; -+ randomdev = cfg_obj_asstring(obj); -+ } -+ } -+ if (randomdev == NULL) { -+#ifdef ISC_PLATFORM_CRYPTORANDOM -+ isc_entropy_usehook(ns_g_entropy, true); -+#else -+ if ((obj != NULL) && !cfg_obj_isvoid(obj)) -+ level = ISC_LOG_INFO; - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, -- NS_LOGMODULE_SERVER, ISC_LOG_INFO, -+ NS_LOGMODULE_SERVER, level, - "no source of entropy found"); -+ if ((obj == NULL) || cfg_obj_isvoid(obj)) { -+ CHECK(ISC_R_FAILURE); -+ } -+#endif - } else { -- const char *randomdev = cfg_obj_asstring(obj); --#ifdef ISC_PLATFORM_CRYPTORANDOM -- if (strcmp(randomdev, ISC_PLATFORM_CRYPTORANDOM) == 0) -- isc_entropy_usehook(ns_g_entropy, true); --#else -- int level = ISC_LOG_ERROR; - result = isc_entropy_createfilesource(ns_g_entropy, -- randomdev); -+ randomdev); - #ifdef PATH_RANDOMDEV - if (ns_g_fallbackentropy != NULL) { - level = ISC_LOG_INFO; -@@ -8233,8 +8244,8 @@ load_configuration(const char *filename, ns_server_t *server, - NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_SERVER, - level, -- "could not open entropy source " -- "%s: %s", -+ "could not open " -+ "entropy source %s: %s", - randomdev, - isc_result_totext(result)); - } -@@ -8254,7 +8265,6 @@ load_configuration(const char *filename, ns_server_t *server, - } - isc_entropy_detach(&ns_g_fallbackentropy); - } --#endif - #endif - } - -@@ -9022,6 +9032,7 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) { - server->in_roothints = NULL; - server->blackholeacl = NULL; - server->keepresporder = NULL; -+ server->rngctx = NULL; - - /* Must be first. */ - CHECKFATAL(dst_lib_init2(ns_g_mctx, ns_g_entropy, -@@ -9048,6 +9059,9 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) { - CHECKFATAL(dns_tkeyctx_create(ns_g_mctx, ns_g_entropy, - &server->tkeyctx), - "creating TKEY context"); -+ server->rngctx = NULL; -+ CHECKFATAL(isc_rng_create(ns_g_mctx, ns_g_entropy, &server->rngctx), -+ "creating random numbers context"); - - /* - * Setup the server task, which is responsible for coordinating -@@ -9254,7 +9268,8 @@ ns_server_destroy(ns_server_t **serverp) { - - if (server->zonemgr != NULL) - dns_zonemgr_detach(&server->zonemgr); -- -+ if (server->rngctx != NULL) -+ isc_rng_detach(&server->rngctx); - if (server->tkeyctx != NULL) - dns_tkeyctx_destroy(&server->tkeyctx); - -@@ -13230,10 +13245,10 @@ newzone_cfgctx_destroy(void **cfgp) { - - static isc_result_t - generate_salt(unsigned char *salt, size_t saltlen) { -- int i, n; -+ size_t i, n; - union { - unsigned char rnd[256]; -- uint32_t rnd32[64]; -+ uint16_t rnd16[128]; - } rnd; - unsigned char text[512 + 1]; - isc_region_t r; -@@ -13243,9 +13258,10 @@ generate_salt(unsigned char *salt, size_t saltlen) { - if (saltlen > 256U) - return (ISC_R_RANGE); - -- n = (int) (saltlen + sizeof(uint32_t) - 1) / sizeof(uint32_t); -- for (i = 0; i < n; i++) -- isc_random_get(&rnd.rnd32[i]); -+ n = (saltlen + sizeof(uint16_t) - 1) / sizeof(uint16_t); -+ for (i = 0; i < n; i++) { -+ rnd.rnd16[i] = isc_rng_random(ns_g_server->rngctx); -+ } - - memmove(salt, rnd.rnd, saltlen); - -diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c -index 0286987..0376377 100644 ---- a/bin/nsupdate/nsupdate.c -+++ b/bin/nsupdate/nsupdate.c -@@ -283,9 +283,7 @@ setup_entropy(isc_mem_t *mctx, const char *randomfile, isc_entropy_t **ectx) { - } - - #ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -+ if (randomfile == NULL) { - isc_entropy_usehook(*ectx, true); - } - #endif -diff --git a/bin/tests/system/pipelined/pipequeries.c b/bin/tests/system/pipelined/pipequeries.c -index f0a6ff2..55064f6 100644 ---- a/bin/tests/system/pipelined/pipequeries.c -+++ b/bin/tests/system/pipelined/pipequeries.c -@@ -280,9 +280,7 @@ main(int argc, char *argv[]) { - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); - #ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -+ if (randomfile == NULL) { - isc_entropy_usehook(ectx, true); - } - #endif -diff --git a/bin/tests/system/tkey/keycreate.c b/bin/tests/system/tkey/keycreate.c -index fe8698e..937fcc3 100644 ---- a/bin/tests/system/tkey/keycreate.c -+++ b/bin/tests/system/tkey/keycreate.c -@@ -255,9 +255,7 @@ main(int argc, char *argv[]) { - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); - #ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -+ if (randomfile == NULL) { - isc_entropy_usehook(ectx, true); - } - #endif -diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c -index 2146f9b..64b8e74 100644 ---- a/bin/tests/system/tkey/keydelete.c -+++ b/bin/tests/system/tkey/keydelete.c -@@ -171,6 +171,7 @@ main(int argc, char **argv) { - randomfile = argv[2]; - argv += 2; - argc -= 2; -+ POST(argc); - } - keyname = argv[1]; - -@@ -182,9 +183,7 @@ main(int argc, char **argv) { - ectx = NULL; - RUNCHECK(isc_entropy_create(mctx, &ectx)); - #ifdef ISC_PLATFORM_CRYPTORANDOM -- if (randomfile != NULL && -- strcmp(randomfile, ISC_PLATFORM_CRYPTORANDOM) == 0) { -- randomfile = NULL; -+ if (randomfile == NULL) { - isc_entropy_usehook(ectx, true); - } - #endif -diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml -index 33e06e6..539973c 100644 ---- a/doc/arm/Bv9ARM-book.xml -+++ b/doc/arm/Bv9ARM-book.xml -@@ -5076,22 +5076,45 @@ badresp:1,adberr:0,findfail:0,valfail:0] - random-device - - -- The source of entropy to be used by the server. Entropy is -- primarily needed -- for DNSSEC operations, such as TKEY transactions and dynamic -- update of signed -- zones. This options specifies the device (or file) from which -- to read -- entropy. If this is a file, operations requiring entropy will -- fail when the -- file has been exhausted. If not specified, the default value -- is -- /dev/random -- (or equivalent) when present, and none otherwise. The -- random-device option takes -- effect during -- the initial configuration load at server startup time and -- is ignored on subsequent reloads. -+ Specifies a source of entropy to be used by the server. -+ This is a device or file from which to read entropy. -+ If it is a file, operations requiring entropy -+ will fail when the file has been exhausted. -+ -+ -+ Entropy is needed for cryptographic operations such as -+ TKEY transactions, dynamic update of signed zones, and -+ generation of TSIG session keys. It is also used for -+ seeding and stirring the pseudo-random number generator, -+ which is used for less critical functions requiring -+ randomness such as generation of DNS message transaction -+ ID's. -+ -+ -+ If random-device is not specified, or -+ if it is set to none, entropy will be -+ read from the random number generation function supplied -+ by the cryptographic library with which BIND was linked -+ (i.e. OpenSSL or a PKCS#11 provider). -+ -+ -+ The random-device option takes -+ effect during the initial configuration load at server -+ startup time and is ignored on subsequent reloads. -+ -+ -+ If BIND is built with -+ configure --disable-crypto-rand, then -+ entropy is not sourced from the -+ cryptographic library. In this case, if -+ random-device is not specified, the -+ default value is the system random device, -+ /dev/random or the equivalent. -+ This default can be overridden with -+ configure --with-randomdev. -+ If no system random device exists, then no entropy source -+ will be configured, and named will only -+ be able to use pseudo-random numbers. - - - -diff --git a/doc/arm/notes-rh-changes.xml b/doc/arm/notes-rh-changes.xml -new file mode 100644 -index 0000000..11c3a7c ---- /dev/null -+++ b/doc/arm/notes-rh-changes.xml -@@ -0,0 +1,43 @@ -+ -+ -+ -+
Red Hat Specific Changes -+ -+ -+ -+ By default, BIND now uses the random number generation functions -+ in the cryptographic library (i.e., OpenSSL or a PKCS#11 -+ provider) as a source of high-quality randomness rather than -+ /dev/random. This is suitable for virtual -+ machine environments, which may have limited entropy pools and -+ lack hardware random number generators. -+ -+ -+ This can be overridden by specifying another entropy source via -+ the random-device option in -+ named.conf, or via the -r -+ command line option. However, for functions requiring full -+ cryptographic strength, such as DNSSEC key generation, this -+ cannot be overridden. In particular, the -+ -r command line option no longer has any -+ effect on dnssec-keygen. -+ -+ -+ This can be disabled by building with -+ configure --disable-crypto-rand, in which -+ case /dev/random will be the default -+ entropy source. [RT #31459] [RT #46047] -+ -+ -+ -+
-+ -diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml -index b16dab6..763ff7e 100644 ---- a/doc/arm/notes.xml -+++ b/doc/arm/notes.xml -@@ -36,6 +36,7 @@ - - - -+ - - - -diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c -index 1614afa..0f52df9 100644 ---- a/lib/dns/dst_api.c -+++ b/lib/dns/dst_api.c -@@ -2017,10 +2017,12 @@ dst__entropy_getdata(void *buf, unsigned int len, bool pseudo) { - else - flags |= ISC_ENTROPY_BLOCKING; - #ifdef ISC_PLATFORM_CRYPTORANDOM -+ /* get entropy directly from crypto provider */ - return (dst_random_getdata(buf, len, NULL, flags)); - #else -+ /* get entropy from entropy source or hook function */ - return (isc_entropy_getdata(dst_entropy_pool, buf, len, NULL, flags)); --#endif -+#endif /* ISC_PLATFORM_CRYPTORANDOM */ - #endif /* PKCS11CRYPTO */ - } - -diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h -index 6813c96..665574d 100644 ---- a/lib/dns/include/dst/dst.h -+++ b/lib/dns/include/dst/dst.h -@@ -163,8 +163,18 @@ isc_result_t - dst_random_getdata(void *data, unsigned int length, - unsigned int *returned, unsigned int flags); - /*%< -- * \brief Return data from the crypto random generator. -- * Specialization of isc_entropy_getdata(). -+ * Gets random data from the random generator provided by the -+ * crypto library, if BIND was built with --enable-crypto-rand. -+ * -+ * See isc_entropy_getdata() for parameter usage. Normally when -+ * this function is available, it will be set up as a hook in the -+ * entropy context, so that isc_entropy_getdata() is a front-end to -+ * this function. -+ * -+ * Returns: -+ * \li ISC_R_SUCCESS on success -+ * \li ISC_R_NOTIMPLEMENTED if BIND is built with --disable-crypto-rand -+ * \li DST_R_OPENSSLFAILURE, DST_R_CRYPTOFAILURE, or other codes on error - */ - - bool -diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c -index 6849732..e00a0e4 100644 ---- a/lib/dns/openssl_link.c -+++ b/lib/dns/openssl_link.c -@@ -484,7 +484,8 @@ dst__openssl_getengine(const char *engine) { - - isc_result_t - dst_random_getdata(void *data, unsigned int length, -- unsigned int *returned, unsigned int flags) { -+ unsigned int *returned, unsigned int flags) -+{ - #ifdef ISC_PLATFORM_CRYPTORANDOM - #ifndef DONT_REQUIRE_DST_LIB_INIT - INSIST(dst__memory_pool != NULL); -diff --git a/lib/isc/include/isc/entropy.h b/lib/isc/include/isc/entropy.h -index 632166a..c7cb17d 100644 ---- a/lib/isc/include/isc/entropy.h -+++ b/lib/isc/include/isc/entropy.h -@@ -9,8 +9,6 @@ - * information regarding copyright ownership. - */ - --/* $Id: entropy.h,v 1.35 2009/10/19 02:37:08 marka Exp $ */ -- - #ifndef ISC_ENTROPY_H - #define ISC_ENTROPY_H 1 - -@@ -191,9 +189,8 @@ isc_entropy_createcallbacksource(isc_entropy_t *ent, - /*!< - * \brief Create an entropy source that is polled via a callback. - * -- * This would -- * be used when keyboard input is used, or a GUI input method. It can -- * also be used to hook in any external entropy source. -+ * This would be used when keyboard input is used, or a GUI input method. -+ * It can also be used to hook in any external entropy source. - * - * Samples are added via isc_entropy_addcallbacksample(), below. - * _addcallbacksample() is the only function which may be called from -@@ -234,15 +231,32 @@ isc_result_t - isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, - unsigned int *returned, unsigned int flags); - /*!< -- * \brief Extract data from the entropy pool. This may load the pool from various -- * sources. -+ * \brief Get random data from entropy pool 'ent'. -+ * -+ * If a hook has been set up using isc_entropy_sethook() and -+ * isc_entropy_usehook(), then the hook function will be called to get -+ * random data. -+ * -+ * Otherwise, randomness is extracted from the entropy pool set up in BIND. -+ * This may cause the pool to be loaded from various sources. Ths is done -+ * by stirring the pool and returning a part of hash as randomness. -+ * (Note that no secrets are given away here since parts of the hash are -+ * XORed together before returning.) -+ * -+ * 'flags' may contain ISC_ENTROPY_GOODONLY, ISC_ENTROPY_PARTIAL, or -+ * ISC_ENTROPY_BLOCKING. These will be honored if the hook function is -+ * not in use. If it is, the flags will be passed to the hook function -+ * but it may ignore them. - * -- * Do this by stiring the pool and returning a part of hash as randomness. -- * Note that no secrets are given away here since parts of the hash are -- * xored together before returned. -+ * Up to 'length' bytes of randomness are retrieved and copied into 'data'. -+ * (If 'returned' is not NULL, and the number of bytes copied is less than -+ * 'length' - which may happen if ISC_ENTROPY_PARTIAL was used - then the -+ * number of bytes copied will be stored in *returned.) - * -- * Honor the request from the caller to only return good data, any data, -- * etc. -+ * Returns: -+ * \li ISC_R_SUCCESS on success -+ * \li ISC_R_NOENTROPY if entropy pool is empty -+ * \li other error codes are possible when a hook is in use - */ - - void -@@ -307,13 +321,21 @@ isc_entropy_usebestsource(isc_entropy_t *ectx, isc_entropysource_t **source, - void - isc_entropy_usehook(isc_entropy_t *ectx, bool onoff); - /*!< -- * \brief Mark/unmark the given entropy structure as being hooked. -+ * \brief Configure entropy context 'ectx' to use the hook function -+ * -+ * Sets the entropy context to call the hook function for random number -+ * generation, if such a function has been configured via -+ * isc_entropy_sethook(), whenever isc_entropy_getdata() is called. - */ - - void - isc_entropy_sethook(isc_entropy_getdata_t myhook); - /*!< -- * \brief Set the getdata hook (e.g., for a crypto random generator). -+ * \brief Set the hook function. -+ * -+ * The hook function is a global value: only one hook function -+ * can be set in the system. Individual entropy contexts may be -+ * configured to use it, or not, by calling isc_entropy_usehook(). - */ - - ISC_LANG_ENDDECLS -diff --git a/lib/isc/include/isc/random.h b/lib/isc/include/isc/random.h -index f8aed34..17c551b 100644 ---- a/lib/isc/include/isc/random.h -+++ b/lib/isc/include/isc/random.h -@@ -9,8 +9,6 @@ - * information regarding copyright ownership. - */ - --/* $Id: random.h,v 1.20 2009/01/17 23:47:43 tbox Exp $ */ -- - #ifndef ISC_RANDOM_H - #define ISC_RANDOM_H 1 - -@@ -21,13 +19,23 @@ - #include - - /*! \file isc/random.h -- * \brief Implements a random state pool which will let the caller return a -- * series of possibly non-reproducible random values. -+ * \brief Implements pseudo random number generators. -+ * -+ * Two pseudo-random number generators are implemented, in isc_random_* -+ * and isc_rng_*. Neither one is very strong; they should not be used -+ * in cryptography functions. -+ * -+ * isc_random_* is based on arc4random if it is available on the system. -+ * Otherwise it is based on the posix srand() and rand() functions. -+ * It is useful for jittering values a bit here and there, such as -+ * timeouts, etc, but should not be relied upon to generate -+ * unpredictable sequences (for example, when choosing transaction IDs). - * -- * Note that the -- * strength of these numbers is not all that high, and should not be -- * used in cryptography functions. It is useful for jittering values -- * a bit here and there, such as timeouts, etc. -+ * isc_rng_* is based on ChaCha20, and is seeded and stirred from the -+ * system entropy source. It is stronger than isc_random_* and can -+ * be used for generating unpredictable sequences. It is still not as -+ * good as using system entropy directly (see entropy.h) and should not -+ * be used for cryptographic functions such as key generation. - */ - - ISC_LANG_BEGINDECLS -@@ -115,8 +123,8 @@ isc_rng_random(isc_rng_t *rngctx); - uint16_t - isc_rng_uniformrandom(isc_rng_t *rngctx, uint16_t upper_bound); - /*%< -- * Returns a uniformly distributed pseudo random 16-bit unsigned -- * integer. -+ * Returns a uniformly distributed pseudo-random 16-bit unsigned integer -+ * less than 'upper_bound'. - */ - - ISC_LANG_ENDDECLS -diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c -index 03890a3..7bad989 100644 ---- a/lib/isccfg/namedconf.c -+++ b/lib/isccfg/namedconf.c -@@ -1109,7 +1109,7 @@ options_clauses[] = { - { "pid-file", &cfg_type_qstringornone, 0 }, - { "port", &cfg_type_uint32, 0 }, - { "querylog", &cfg_type_boolean, 0 }, -- { "random-device", &cfg_type_qstring, 0 }, -+ { "random-device", &cfg_type_qstringornone, 0 }, - { "recursing-file", &cfg_type_qstring, 0 }, - { "recursive-clients", &cfg_type_uint32, 0 }, - { "reserved-sockets", &cfg_type_uint32, 0 }, --- -2.20.1 - diff --git a/bind.spec b/bind.spec index a525f1c..e96b5a3 100644 --- a/bind.spec +++ b/bind.spec @@ -143,22 +143,11 @@ Patch140:bind-9.11-rh1410433.patch Patch150:bind-9.11-engine-pkcs11.patch Patch153:bind-9.11-export-suffix.patch Patch154:bind-9.11-oot-manual.patch -# FIXME: needs review. Should not be required -#Patch156:bind-9.11-fips-code.patch Patch157:bind-9.11-fips-tests.patch -# [RT #31459] commit 06a8051d2476fb526fe6960832209392c763a9af -#Patch158:bind-9.11-rt31459.patch -# [RT #46047] commit 24172bd2eeba91441ab1c65d2717b0692309244a ISC 4724 -#Patch159:bind-9.11-rt46047.patch -# https://gitlab.isc.org/isc-projects/bind9/issues/819 Patch164:bind-9.11-rh1666814.patch -#Patch169:bind-9.11-feature-test-dlz.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch -# Make sure jsonccp-devel does not interfere -#Patch175:bind-9.11-fips-disable.patch -#Patch176: bind-9.11-unit-dnstap-pkcs11.patch # SDB patches Patch11: bind-9.3.2b2-sdbsrc.patch @@ -545,21 +534,11 @@ are used for building ISC DHCP. %patch153 -p1 -b .export_suffix %endif %patch154 -p1 -b .oot-man -#%patch156 -p1 -b .fips-code %patch157 -p1 -b .fips-tests -#%patch158 -p1 -b .rt31459 -#%patch159 -p1 -b .rt46047 -#%patch160 -p1 -b .rh1624100 -#%patch161 -p1 -b .host-idn-disable -#%patch163 -p1 -b .rh1663318 %patch164 -p1 -b .rh1666814 -#%patch169 -p1 -b .featuretest-dlz %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant %patch172 -p1 -b .test-pkcs11 -#%patch174 -p1 -b .unit-timer -#%patch175 -p1 -b .rh1709553 -#%patch176 -p1 -b .unit-dnstap %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 From 80d0367669fae192e5b7cdde317ef59bb3d24a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 12:53:49 +0100 Subject: [PATCH 19/79] Remove GEOIP and EXPORT_LIBS Most recent release is no longer able to statisfy export libs and geoip legacy. Remove its support from GeoIP. --- bind-9.11-export-suffix.patch | 39 -------- bind.spec | 175 +--------------------------------- 2 files changed, 1 insertion(+), 213 deletions(-) delete mode 100644 bind-9.11-export-suffix.patch diff --git a/bind-9.11-export-suffix.patch b/bind-9.11-export-suffix.patch deleted file mode 100644 index 8703747..0000000 --- a/bind-9.11-export-suffix.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index c1bfd62..7c5ad51 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5333,6 +5333,8 @@ AC_SUBST(BUILD_CPPFLAGS) - AC_SUBST(BUILD_LDFLAGS) - AC_SUBST(BUILD_LIBS) - -+AC_SUBST(LIBDIR_SUFFIX) -+ - # - # Commands to run at the end of config.status. - # Don't just put these into configure, it won't work right if somebody -diff --git a/isc-config.sh.in b/isc-config.sh.in -index b5e94ed..d2857e0 100644 ---- a/isc-config.sh.in -+++ b/isc-config.sh.in -@@ -13,16 +13,17 @@ prefix=@prefix@ - exec_prefix=@exec_prefix@ - exec_prefix_set= - includedir=@includedir@ -+libdir_suffix=@LIBDIR_SUFFIX@ - arch=$(uname -m) - - case $arch in - x86_64 | amd64 | sparc64 | s390x | ppc64) -- libdir=/usr/lib64 -- sec_libdir=/usr/lib -+ libdir=/usr/lib64${libdir_suffix} -+ sec_libdir=/usr/lib${libdir_suffix} - ;; - * ) -- libdir=/usr/lib -- sec_libdir=/usr/lib64 -+ libdir=/usr/lib${libdir_suffix} -+ sec_libdir=/usr/lib64${libdir_suffix} - ;; - esac - diff --git a/bind.spec b/bind.spec index e96b5a3..b9a7e1e 100644 --- a/bind.spec +++ b/bind.spec @@ -29,8 +29,6 @@ %bcond_with GEOIP # New MaxMind GeoLite support %bcond_without GEOIP2 -# Support for builds without threads removed. DHCP no longer needs it anyway. -%bcond_with EXPORT_LIBS # Legacy GeoIP support %bcond_with GEOIP # New MaxMind GeoLite support @@ -141,7 +139,6 @@ Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch # Avoid conflicts with OpenSSL PKCS11 engine Patch150:bind-9.11-engine-pkcs11.patch -Patch153:bind-9.11-export-suffix.patch Patch154:bind-9.11-oot-manual.patch Patch157:bind-9.11-fips-tests.patch Patch164:bind-9.11-rh1666814.patch @@ -485,39 +482,6 @@ BuildArch: noarch %description -n python3-bind This package provides a module which allows commands to be sent to rndc directly from Python programs. -%if %{with EXPORT_LIBS} -%package export-libs -Summary: ISC libs for DHCP application -%if 0%{?fedora} >= 1 -Obsoletes: bind99-libs < 9.9.11-4 -Provides: bind99-libs = 9.9.11-4 -# This subpackage will not use shared license, but distribute its own -%endif - -%description export-libs -BIND (Berkeley Internet Name Domain) is an implementation of the DNS -(Domain Name System) protocols. This package set contains only export -version of BIND libraries, that are used for building ISC DHCP. - -%package export-devel -Summary: Header files and libraries needed for BIND export libraries -Requires: %{name}-export-libs%{?_isa} = %{epoch}:%{version}-%{release} -Requires: openssl-devel -Requires: libcap-devel - -%if 0%{?fedora} >= 1 -Obsoletes: bind99-devel < 9.9.11-4 -# To prevent linking against wrong set of libraries, -# do not coexist with bind99-devel -Conflicts: bind99-devel -%endif - -%description export-devel -This package contains export version of the header files and libraries -required for development with ISC BIND. These headers and libraries -are used for building ISC DHCP. -%endif - %prep %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE0}' %setup -q -n %{name}-%{BINDVERSION} @@ -530,9 +494,6 @@ are used for building ISC DHCP. %patch112 -p1 -b .rh645544 %patch130 -p1 -b .libdb %patch140 -p1 -b .rh1410433 -%if %{with EXPORT_LIBS} -%patch153 -p1 -b .export_suffix -%endif %patch154 -p1 -b .oot-man %patch157 -p1 -b .fips-tests %patch164 -p1 -b .rh1666814 @@ -645,7 +606,7 @@ export LIBDIR_SUFFIX --with-geoip \ %endif %if %{with GEOIP2} - --with-geoip2 \ + --with-maxminddb \ %endif %if %{with PKCS11} --enable-native-pkcs11 \ @@ -731,78 +692,6 @@ popd # build %unit_prepare_build build %systemtest_prepare_build build -%if %{with EXPORT_LIBS} - -## Create export libs ## -mkdir -p export-libs -pushd export-libs -LIBDIR_SUFFIX=%{_export_dir} -export LIBDIR_SUFFIX -## minimal subset of options to make clients aka dhcp working -%{configure} \ - --with-libtool \ - --disable-static \ - --disable-epoll \ - --disable-kqueue \ - --libdir=%{_libdir}%{_export_dir} \ - --includedir=%{_includedir}%{_export_dir}/ \ - --disable-threads \ -%if %{with GSSTSIG} - --with-gssapi=yes \ - --disable-isc-spnego \ -%endif -%if %{with UNITTEST} - --with-cmocka \ -%endif - --enable-fixed-rrset \ - --disable-rpz-nsip \ - --disable-rpz-nsdname \ - --without-lmdb \ - --without-libxml2 \ - --without-libjson \ - --without-zlib \ - --without-dlopen \ - --enable-full-report - -## We don't want to build other libs than -export twice -## FIXME this should be in patch instead of SED'ing -## but do we really like/want to patch generated files? - - -sed -i \ --e '/^SUBDIRS =/s/.*/SUBDIRS = make lib/i' \ -Makefile - -sed -i -e \ -"/^SUBDIRS =/s/.*/SUBDIRS = %{bind_export_libs}/i" \ -lib/Makefile - -for lib in %{bind_export_libs} -do - find . -name Makefile -exec sed "s/lib${lib}\./lib${lib}-export\./g" -i {} \; - sed -e "s/-l${lib}\([^[:alpha:]]\)/-l${lib}-export\1/g" \ - -e "s/lib${lib}\./lib${lib}-export\./g" \ - -i isc-export-config.sh -done; - -make %{?_smp_mflags} -popd - -# export library unit tests -%unit_prepare_build export-libs -# Test just compiled libraries -for lib in %{bind_export_libs} -do - sed -e "s,^\s*include(.*${lib}/.*,-- use &," \ - -i export-libs/lib/Kyuafile -done - -sed -e "/^\s*include(/ d" -e 's/^-- use //' \ - -i export-libs/lib/Kyuafile - -## End of export libs -%endif - %check %if %{with PKCS11} # Tests require initialization of pkcs11 token @@ -822,17 +711,6 @@ export TSAN_OPTIONS="log_exe_name=true log_path=ThreadSanitizer exitcode=0" exit $e; fi; popd - - %if %{with EXPORT_LIBS} - pushd export-libs - make unit - e=$? - if [ "$e" -ne 0 ]; then - echo "ERROR: this build of BIND export-libs failed 'make unit'. Aborting." - exit $e; - fi; - popd - %endif ## End of UNITTEST %endif @@ -911,17 +789,6 @@ pushd build make DESTDIR=${RPM_BUILD_ROOT} install popd -%if %{with EXPORT_LIBS} -pushd export-libs -make DESTDIR=${RPM_BUILD_ROOT} install -mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/ld.so.conf.d -echo "%{_libdir}/%{_export_dir}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}-export-%{_arch}.conf -cp -fp config.h ${RPM_BUILD_ROOT}/%{_includedir}%{_export_dir} -rm -rf ${RPM_BUILD_ROOT}/%{_includedir}%{_export_dir}/pkcs11/ -rm -f ${RPM_BUILD_ROOT}/%{_includedir}%{_export_dir}/pk11/{constants,internal,pk11,result}.h -popd -%endif - # Remove unwanted files rm -f ${RPM_BUILD_ROOT}/etc/bind.keys @@ -1163,14 +1030,6 @@ fi %ldconfig_scriptlets pkcs11-libs %endif -%if %{with EXPORT_LIBS} -%post export-libs -p /sbin/ldconfig -%end - -%postun export-libs -p /sbin/ldconfig -%end -%endif - # Fix permissions on existing device files on upgrade %define chroot_fix_devices() \ if [ $1 -gt 1 ]; then \ @@ -1488,38 +1347,6 @@ fi; %{_libdir}/libisc-pkcs11.so %endif -%if %{with EXPORT_LIBS} -%files export-libs -%dir %{_libdir}/%{_export_dir} -%{_libdir}/%{_export_dir}/libdns-export.so.%{sover_dns}* -%{_libdir}/%{_export_dir}/libirs-export.so.%{sover_irs}* -%{_libdir}/%{_export_dir}/libisc-export.so.%{sover_isc}* -%{_libdir}/%{_export_dir}/libisccfg-export.so.%{sover_isccfg}* -%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-export-%{_arch}.conf -# This subpackage has to distribute its own license. Do not conflict with -# other subpackages of different version -%license COPYRIGHT - -%files export-devel -%{_libdir}/%{_export_dir}/libdns-export.so -%{_libdir}/%{_export_dir}/libirs-export.so -%{_libdir}/%{_export_dir}/libisc-export.so -%{_libdir}/%{_export_dir}/libisccfg-export.so -%dir %{_includedir}/%{_export_dir} -%{_includedir}/%{_export_dir}/dns -%{_includedir}/%{_export_dir}/dst -%{_includedir}/%{_export_dir}/irs -%{_includedir}/%{_export_dir}/isc -%dir %{_includedir}/%{_export_dir}/pk11 -%{_includedir}/%{_export_dir}/pk11/site.h -%{_includedir}/%{_export_dir}/isccfg -%{_includedir}/%{_export_dir}/config.h -%{_mandir}/man1/isc-export-config.sh.1* -%{_mandir}/man1/bind9-export-config.1* -%attr(0755,root,root) %{_bindir}/isc-export-config.sh -%{_bindir}/bind9-export-config -%endif - %if %{with DLZ} && %{with BDB} %files dlz-bdb %if %{with SDB} From 15cfc8b4024d11bb292f1fea0774afb24dddf544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 13:25:10 +0100 Subject: [PATCH 20/79] Disable GEOIP and compile on s390x without SDB --- bind.spec | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/bind.spec b/bind.spec index b9a7e1e..aa3ca96 100644 --- a/bind.spec +++ b/bind.spec @@ -25,12 +25,6 @@ %bcond_with BDB # skip DLZ for now %bcond_with DLZ -# Legacy GeoIP support -%bcond_with GEOIP -# New MaxMind GeoLite support -%bcond_without GEOIP2 -# Legacy GeoIP support -%bcond_with GEOIP # New MaxMind GeoLite support %bcond_without GEOIP2 %if 0%{?fedora} >= 28 @@ -212,9 +206,6 @@ BuildRequires: lmdb-devel %if %{with JSON} BuildRequires: json-c-devel %endif -%if %{with GEOIP} -BuildRequires: GeoIP-devel -%endif %if %{with GEOIP2} BuildRequires: libmaxminddb-devel %endif @@ -383,9 +374,6 @@ Requires: json-c-devel%{?_isa} %if %{with DNSTAP} Requires: fstrm-devel%{?_isa} protobuf-c-devel%{?_isa} %endif -%if %{with GEOIP} -Requires: GeoIP-devel%{?_isa} -%endif %if %{with GEOIP2} Requires: libmaxminddb-devel%{?_isa} %endif @@ -545,9 +533,14 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools # Sparc and s390 arches need to use -fPIE %ifarch sparcv9 sparc64 s390 s390x -for i in bin/named{,-sdb}/{,unix}/Makefile.in; do +for i in bin/named/{,unix}/Makefile.in; do sed -i 's|fpie|fPIE|g' $i done +%if %{with SDB} +for i in bin/named-sdb/{,unix}/Makefile.in; do + sed -i 's|fpie|fPIE|g' $i +done +%endif %endif :; @@ -602,9 +595,6 @@ export LIBDIR_SUFFIX --includedir=%{_includedir}/bind9 \ --with-tuning=large \ --with-libidn2 \ -%if %{with GEOIP} - --with-geoip \ -%endif %if %{with GEOIP2} --with-maxminddb \ %endif From fcefdeb1292175c93755ab05233688e4d52d700d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 27 Mar 2020 16:06:37 +0100 Subject: [PATCH 21/79] Disable SDB and its patches, enable DLZ SDB is no longer part of bind distribution. Do not try to compile static linked version named-sdb. But DLZ modules work, enable them without tools. --- bind-9.3.2b2-sdbsrc.patch | 230 -------------------------------------- bind-96-old-api.patch | 23 ---- bind.spec | 8 +- 3 files changed, 2 insertions(+), 259 deletions(-) delete mode 100644 bind-9.3.2b2-sdbsrc.patch delete mode 100644 bind-96-old-api.patch diff --git a/bind-9.3.2b2-sdbsrc.patch b/bind-9.3.2b2-sdbsrc.patch deleted file mode 100644 index 46e183c..0000000 --- a/bind-9.3.2b2-sdbsrc.patch +++ /dev/null @@ -1,230 +0,0 @@ -diff --git a/contrib/sdb/bdb/bdb.c b/contrib/sdb/bdb/bdb.c -index 23594bb..b3c6619 100644 ---- a/contrib/sdb/bdb/bdb.c -+++ b/contrib/sdb/bdb/bdb.c -@@ -43,7 +43,7 @@ - #include - #include - --#include -+#include "bdb.h" - #include - #include - -diff --git a/contrib/sdb/ldap/zone2ldap.c b/contrib/sdb/ldap/zone2ldap.c -index 07c89bc..23dd873 100644 ---- a/contrib/sdb/ldap/zone2ldap.c -+++ b/contrib/sdb/ldap/zone2ldap.c -@@ -63,16 +63,16 @@ typedef struct LDAP_INFO - ldap_info; - - /* usage Info */ --void usage (); -+void usage (void); - - /* Add to the ldap dit */ - void add_ldap_values (ldap_info * ldinfo); - - /* Init an ldap connection */ --void init_ldap_conn (); -+void init_ldap_conn (void); - - /* Ldap error checking */ --void ldap_result_check (char *msg, char *dn, int err); -+void ldap_result_check (const char *msg, char *dn, int err); - - /* Put a hostname into a char ** array */ - char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags); -@@ -88,7 +88,7 @@ void add_to_rr_list (char *dn, char *name, char *type, char *data, - unsigned int ttl, unsigned int flags); - - /* Error checking */ --void isc_result_check (isc_result_t res, char *errorstr); -+void isc_result_check (isc_result_t res, const char *errorstr); - - /* Generate LDIF Format files */ - void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, -@@ -97,11 +97,17 @@ void generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, - /* head pointer to the list */ - ldap_info *ldap_info_base = NULL; - -+ldap_info * -+locate_by_dn (char *dn); -+void -+init_ldap_conn (); -+void usage(); -+ - char *argzone, *ldapbase, *binddn, *bindpw = NULL; --char *ldapsystem = "localhost"; --static char *objectClasses[] = -+const char *ldapsystem = "localhost"; -+static const char *objectClasses[] = - { "top", "dNSZone", NULL }; --static char *topObjectClasses[] = { "top", NULL }; -+static const char *topObjectClasses[] = { "top", NULL }; - LDAP *conn; - unsigned int debug = 0; - -@@ -128,7 +134,7 @@ main (int argc, char **argv) - LDAPMod *base_attrs[2]; - LDAPMod base; - isc_buffer_t buff; -- char *zonefile; -+ char *zonefile=0L; - char fullbasedn[1024]; - char *ctmp; - dns_fixedname_t fixedzone, fixedname; -@@ -304,9 +310,9 @@ main (int argc, char **argv) - if ((*ctmp == ',') || (ctmp == &basedn[0])) - { - base.mod_op = LDAP_MOD_ADD; -- base.mod_type = "objectClass"; -- base.mod_values = topObjectClasses; -- base_attrs[0] = &base; -+ base.mod_type = (char*)"objectClass"; -+ base.mod_values = (char**)topObjectClasses; -+ base_attrs[0] = (void*)&base; - base_attrs[1] = NULL; - - if (ldapbase) -@@ -363,7 +369,7 @@ main (int argc, char **argv) - * I should probably rename this function, as not to cause any - * confusion with the isc* routines. Will exit on error. */ - void --isc_result_check (isc_result_t res, char *errorstr) -+isc_result_check (isc_result_t res, const char *errorstr) - { - if (res != ISC_R_SUCCESS) - { -@@ -470,20 +476,20 @@ add_to_rr_list (char *dn, char *name, char *type, - if (tmp->attrs == (LDAPMod **) NULL) - fatal("calloc"); - -- for (i = 0; i < flags; i++) -+ for (i = 0; i < (int)flags; i++) - { - tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod)); - if (tmp->attrs[i] == (LDAPMod *) NULL) - fatal("malloc"); - } - tmp->attrs[0]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[0]->mod_type = "objectClass"; -+ tmp->attrs[0]->mod_type = (char*)"objectClass"; - - if (flags == DNS_OBJECT) -- tmp->attrs[0]->mod_values = objectClasses; -+ tmp->attrs[0]->mod_values = (char**)objectClasses; - else - { -- tmp->attrs[0]->mod_values = topObjectClasses; -+ tmp->attrs[0]->mod_values = (char**)topObjectClasses; - tmp->attrs[1] = NULL; - tmp->attrcnt = 2; - tmp->next = ldap_info_base; -@@ -492,7 +498,7 @@ add_to_rr_list (char *dn, char *name, char *type, - } - - tmp->attrs[1]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[1]->mod_type = "relativeDomainName"; -+ tmp->attrs[1]->mod_type = (char*)"relativeDomainName"; - tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2); - - if (tmp->attrs[1]->mod_values == (char **)NULL) -@@ -521,7 +527,7 @@ add_to_rr_list (char *dn, char *name, char *type, - fatal("strdup"); - - tmp->attrs[3]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[3]->mod_type = "dNSTTL"; -+ tmp->attrs[3]->mod_type = (char*)"dNSTTL"; - tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2); - - if (tmp->attrs[3]->mod_values == (char **)NULL) -@@ -535,7 +541,7 @@ add_to_rr_list (char *dn, char *name, char *type, - fatal("strdup"); - - tmp->attrs[4]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[4]->mod_type = "zoneName"; -+ tmp->attrs[4]->mod_type = (char*)"zoneName"; - tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2); - - if (tmp->attrs[4]->mod_values == (char **)NULL) -@@ -648,7 +654,7 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags) - zname = ++tmp; - } - else -- hnamebuff = "@"; -+ hnamebuff = (char*)"@"; - } - else - { -@@ -727,12 +733,12 @@ init_ldap_conn () - } - - result = ldap_simple_bind_s (conn, binddn, bindpw); -- ldap_result_check ("ldap_simple_bind_s", "LDAP Bind", result); -+ ldap_result_check ("ldap_simple_bind_s", (char*)"LDAP Bind", result); - } - - /* Like isc_result_check, only for LDAP */ - void --ldap_result_check (char *msg, char *dn, int err) -+ldap_result_check (const char *msg, char *dn, int err) - { - if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS)) - { -diff --git a/contrib/sdb/pgsql/pgsqldb.c b/contrib/sdb/pgsql/pgsqldb.c -index 50d3cba..516eb9f 100644 ---- a/contrib/sdb/pgsql/pgsqldb.c -+++ b/contrib/sdb/pgsql/pgsqldb.c -@@ -23,7 +23,7 @@ - #include - #include - --#include -+#include - - #include - #include -diff --git a/contrib/sdb/pgsql/zonetodb.c b/contrib/sdb/pgsql/zonetodb.c -index b8f5912..ff2d135 100644 ---- a/contrib/sdb/pgsql/zonetodb.c -+++ b/contrib/sdb/pgsql/zonetodb.c -@@ -37,7 +37,7 @@ - #include - #include - --#include -+#include - - /* - * Generate a PostgreSQL table from a zone. -@@ -54,6 +54,9 @@ char *dbname, *dbtable; - char str[10240]; - - void -+closeandexit(int status); -+ -+void - closeandexit(int status) { - if (conn != NULL) - PQfinish(conn); -@@ -61,6 +64,9 @@ closeandexit(int status) { - } - - void -+check_result(isc_result_t result, const char *message); -+ -+void - check_result(isc_result_t result, const char *message) { - if (result != ISC_R_SUCCESS) { - fprintf(stderr, "%s: %s\n", message, -@@ -84,7 +90,8 @@ quotestring(const unsigned char *source, unsigned char *dest) { - } - *dest++ = 0; - } -- -+void -+addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata); - void - addrdata(dns_name_t *name, dns_ttl_t ttl, dns_rdata_t *rdata) { - unsigned char namearray[DNS_NAME_MAXTEXT + 1]; diff --git a/bind-96-old-api.patch b/bind-96-old-api.patch deleted file mode 100644 index d181d3e..0000000 --- a/bind-96-old-api.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up bind-9.6.0b1/contrib/sdb/ldap/ldapdb.c.old-api bind-9.6.0b1/contrib/sdb/ldap/ldapdb.c ---- bind-9.6.0b1/contrib/sdb/ldap/ldapdb.c.old-api 2008-11-24 13:28:13.000000000 +0100 -+++ bind-9.6.0b1/contrib/sdb/ldap/ldapdb.c 2008-11-24 13:28:23.000000000 +0100 -@@ -25,6 +25,7 @@ - /* Using LDAPv3 by default, change this if you want v2 */ - #ifndef LDAPDB_LDAP_VERSION - #define LDAPDB_LDAP_VERSION 3 -+#define LDAP_DEPRECATED 1 - #endif - - #include -diff -up bind-9.6.0b1/contrib/sdb/ldap/zone2ldap.c.old-api bind-9.6.0b1/contrib/sdb/ldap/zone2ldap.c ---- bind-9.6.0b1/contrib/sdb/ldap/zone2ldap.c.old-api 2008-11-24 13:29:05.000000000 +0100 -+++ bind-9.6.0b1/contrib/sdb/ldap/zone2ldap.c 2008-11-24 13:29:14.000000000 +0100 -@@ -13,6 +13,8 @@ - * ditched dNSDomain2 schema support. Version 0.3-ALPHA - */ - -+#define LDAP_DEPRECATED 1 -+ - #include - #include - #include diff --git a/bind.spec b/bind.spec index aa3ca96..941eb4b 100644 --- a/bind.spec +++ b/bind.spec @@ -24,7 +24,7 @@ # TODO: mysql is not well suported without SDB. %bcond_with BDB # skip DLZ for now -%bcond_with DLZ +%bcond_without DLZ # New MaxMind GeoLite support %bcond_without GEOIP2 %if 0%{?fedora} >= 28 @@ -115,7 +115,6 @@ Source49: named-chroot.files Patch10: bind-9.5-PIE.patch Patch16: bind-9.3.2-redhat_doc.patch Patch72: bind-9.5-dlz-64bit.patch -Patch101:bind-96-old-api.patch Patch106:bind93-rh490837.patch Patch112:bind97-rh645544.patch Patch130:bind-9.9.1-P2-dlz-libdb.patch @@ -141,7 +140,6 @@ Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch # SDB patches -Patch11: bind-9.3.2b2-sdbsrc.patch Patch12: bind-9.10-sdb.patch # needs inpection @@ -501,10 +499,8 @@ cp -r lib/ns{,-pkcs11} %endif %if %{with SDB} -%patch101 -p1 -b .old-api mkdir bin/named-sdb cp -r bin/named/* bin/named-sdb -%patch11 -p1 -b .sdbsrc # SDB ldap cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named-sdb # SDB postgreSQL @@ -602,8 +598,8 @@ export LIBDIR_SUFFIX --enable-native-pkcs11 \ --with-pkcs11=%{_libdir}/pkcs11/libsofthsm2.so \ %endif -%if %{with SDB} --with-dlopen=yes \ +%if %{with SDB} || %{with DLZ} --with-dlz-ldap=yes \ --with-dlz-postgres=yes \ --with-dlz-mysql=yes \ From 29036faad7203e1889c9e320aee09b21c34f8c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 1 Apr 2020 19:56:12 +0200 Subject: [PATCH 22/79] Link all used libraries to libisc Library should link all required libraries. Link all used libraries directly to libisc. Should help with dynamic linking of -lisc alone. --- bind-9.16-libisc-link.patch | 27 +++++++++++++++++++++++++++ bind.spec | 7 ++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 bind-9.16-libisc-link.patch diff --git a/bind-9.16-libisc-link.patch b/bind-9.16-libisc-link.patch new file mode 100644 index 0000000..35652df --- /dev/null +++ b/bind-9.16-libisc-link.patch @@ -0,0 +1,27 @@ +From 5ee0a7ace7588b986f41ac68f51b315fece69094 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= +Date: Wed, 1 Apr 2020 14:28:42 +0200 +Subject: [PATCH] Link all required libraries to libisc + +It would fail to link -lisc without additional libraries, which should +not be required. +--- + lib/isc/Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in +index 1b6b4466cd..e9df8d1e17 100644 +--- a/lib/isc/Makefile.in ++++ b/lib/isc/Makefile.in +@@ -81,7 +81,7 @@ SRCS = pk11.c pk11_result.c \ + symtab.c task.c taskpool.c timer.c \ + tm.c version.c + +-LIBS = ${OPENSSL_LIBS} @LIBS@ ++LIBS = ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} @LIBS@ + + # Note: the order of SUBDIRS is important. + # Attempt to disable parallel processing. +-- +2.21.1 + diff --git a/bind.spec b/bind.spec index 941eb4b..10b3495 100644 --- a/bind.spec +++ b/bind.spec @@ -68,7 +68,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.1 -Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -138,6 +138,7 @@ Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch +Patch173:bind-9.16-libisc-link.patch # SDB patches Patch12: bind-9.10-sdb.patch @@ -486,6 +487,7 @@ This package provides a module which allows commands to be sent to rndc directly %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant %patch172 -p1 -b .test-pkcs11 +%patch173 -p1 -b .link-isc %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 @@ -1373,6 +1375,9 @@ fi; %changelog +* Wed Apr 01 2020 Petr Menšík - 32:9.16.1-2 +- Link all used libraries to libisc + * Thu Mar 26 2020 Petr Menšík - 32:9.16.1-1 - Update to 9.16.1 From 74c92fb0da3c6ce36a54dc0b214f4d446420b6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 1 Apr 2020 20:17:37 +0200 Subject: [PATCH 23/79] Enable DLZ dependencies without SDB --- bind.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.spec b/bind.spec index 10b3495..a95a4cf 100644 --- a/bind.spec +++ b/bind.spec @@ -177,7 +177,7 @@ BuildRequires: python3-ply BuildRequires: findutils sed BuildRequires: gnupg2 BuildRequires: libuv-devel -%if %{with SDB} +%if %{with DLZ} BuildRequires: openldap-devel, libpq-devel, sqlite-devel, mariadb-connector-c-devel %endif %if %{with BDB} From ec5a01d972e96367da4d2b61c09beef664fa3bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 1 Apr 2020 20:25:56 +0200 Subject: [PATCH 24/79] Remove SDB sections Since 9.12 BIND no longer ships required files to create SDB version. Limited support should still be possible with DLZ modules. --- README.sdb_pgsql | 79 ----- bind-9.10-sdb.patch | 319 ----------------- bind-9.3.1rc1-sdb_tools-Makefile.in | 63 ---- bind-9.3.2b1-fix_sdb_ldap.patch | 519 ---------------------------- bind.spec | 222 +----------- dnszone.schema | 148 -------- ldap2zone.1 | 41 --- named-sdb-chroot-setup.service | 12 - named-sdb-chroot.service | 30 -- named-sdb.8 | 1 - named-sdb.service | 26 -- zone2sqlite.1 | 53 --- zonetodb.1 | 53 --- 13 files changed, 1 insertion(+), 1565 deletions(-) delete mode 100644 README.sdb_pgsql delete mode 100644 bind-9.10-sdb.patch delete mode 100644 bind-9.3.1rc1-sdb_tools-Makefile.in delete mode 100644 bind-9.3.2b1-fix_sdb_ldap.patch delete mode 100644 dnszone.schema delete mode 100644 ldap2zone.1 delete mode 100644 named-sdb-chroot-setup.service delete mode 100644 named-sdb-chroot.service delete mode 100644 named-sdb.8 delete mode 100644 named-sdb.service delete mode 100644 zone2sqlite.1 delete mode 100644 zonetodb.1 diff --git a/README.sdb_pgsql b/README.sdb_pgsql deleted file mode 100644 index c10c294..0000000 --- a/README.sdb_pgsql +++ /dev/null @@ -1,79 +0,0 @@ - PGSQL BIND SDB driver - -The postgresql BIND SDB driver is of experimental status and should not be -used for production systems. - -Usage: - -o Use the named_sdb process ( put ENABLE_SDB=yes in /etc/sysconfig/named ) - -o Edit your named.conf to contain a database zone, eg. : - -zone "pgdb.net." IN { - type master; - database "pgsql bind pgdb localhost pguser pgpasswd"; - # ^- DB name ^-Table ^-host ^-user ^-password -}; - -o Create the database zone table - The table must contain the columns "name", "rdtype", and "rdata", and - is expected to contain a properly constructed zone. The program "zonetodb" - creates such a table. - - zonetodb usage: - - zonetodb origin file dbname dbtable - - where - origin : zone origin, eg "pgdb.net." - file : master zone database file, eg. pgdb.net.db - dbname : name of postgresql database - dbtable: name of table in database - - Eg. to import this zone in the file 'pgdb.net.db' into the 'bind' database - 'pgdb' table: - ---- -#pgdb.net.db: -$TTL 1H -@ SOA localhost. root.localhost. ( 1 - 3H - 1H - 1W - 1H ) - NS localhost. -host1 A 192.168.2.1 -host2 A 192.168.2.2 -host3 A 192.168.2.3 -host4 A 192.168.2.4 -host5 A 192.168.2.5 -host6 A 192.168.2.6 -host7 A 192.168.2.7 ---- - -Issue this command as the pgsql user authorized to update the bind database: - -# zonetodb pgdb.net. pgdb.net.db bind pgdb - -will create / update the pgdb table in the 'bind' db: - -$ psql -dbind -c 'select * from pgdb;' - name | ttl | rdtype | rdata -----------------+------+--------+----------------------------------------------------- - pgdb.net | 3600 | SOA | localhost. root.localhost. 1 10800 3600 604800 3600 - pgdb.net | 3600 | NS | localhost. - host1.pgdb.net | 3600 | A | 192.168.2.1 - host2.pgdb.net | 3600 | A | 192.168.2.2 - host3.pgdb.net | 3600 | A | 192.168.2.3 - host4.pgdb.net | 3600 | A | 192.168.2.4 - host5.pgdb.net | 3600 | A | 192.168.2.5 - host6.pgdb.net | 3600 | A | 192.168.2.6 - host7.pgdb.net | 3600 | A | 192.168.2.7 -(9 rows) - -I've tested exactly the above configuration with bind-sdb-9.3.1+ and it works OK. - -NOTE: If you use pgsqldb SDB, ensure the postgresql service is started before the named - service . - -USE AT YOUR OWN RISK! diff --git a/bind-9.10-sdb.patch b/bind-9.10-sdb.patch deleted file mode 100644 index ef9a8dc..0000000 --- a/bind-9.10-sdb.patch +++ /dev/null @@ -1,319 +0,0 @@ -diff --git a/bin/Makefile.in b/bin/Makefile.in -index ce7a2da..4e6a824 100644 ---- a/bin/Makefile.in -+++ b/bin/Makefile.in -@@ -11,8 +11,8 @@ srcdir = @srcdir@ - VPATH = @srcdir@ - top_srcdir = @top_srcdir@ - --SUBDIRS = named named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools nsupdate \ -- check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ tests -+SUBDIRS = named named-sdb named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools nsupdate \ -+ check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ sdb_tools tests - TARGETS = - - @BIND9_MAKE_RULES@ -diff --git a/bin/named-sdb/Makefile.in b/bin/named-sdb/Makefile.in -index 4cfed4d..c6b42b2 100644 ---- a/bin/named-sdb/Makefile.in -+++ b/bin/named-sdb/Makefile.in -@@ -30,10 +30,10 @@ VERSION=@BIND9_VERSION@ - # - # Add database drivers here. - # --DBDRIVER_OBJS = --DBDRIVER_SRCS = -+DBDRIVER_OBJS = ldapdb.@O@ pgsqldb.@O@ sqlitedb.@O@ dirdb.@O@ -+DBDRIVER_SRCS = ldapdb.c pgsqldb.c sqlitedb.c dirdb.c - DBDRIVER_INCLUDES = --DBDRIVER_LIBS = -+DBDRIVER_LIBS = -lldap -llber -lsqlite3 -lpq - - DLZ_DRIVER_DIR = ${top_srcdir}/contrib/dlz/drivers - -@@ -80,7 +80,7 @@ NOSYMLIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - - SUBDIRS = unix - --TARGETS = named@EXEEXT@ lwresd@EXEEXT@ feature-test@EXEEXT@ -+TARGETS = named-sdb@EXEEXT@ feature-test-sdb@EXEEXT@ - - GEOIPLINKOBJS = geoip.@O@ - GEOIP2LINKOBJS = geoip.@O@ -@@ -154,7 +154,7 @@ server.@O@: server.c - -DPRODUCT=\"${PRODUCT}\" \ - -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c - --named@EXEEXT@: ${OBJS} ${DEPLIBS} -+named-sdb@EXEEXT@: ${OBJS} ${DEPLIBS} - export MAKE_SYMTABLE="yes"; \ - export BASEOBJS="${OBJS} ${UOBJS}"; \ - ${FINALBUILDCMD} -@@ -168,7 +168,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c - ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ - -c ${top_srcdir}/bin/tests/system/feature-test.c - --feature-test@EXEEXT@: feature-test.@O@ -+feature-test-sdb@EXEEXT@: feature-test.@O@ - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ - -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} - -@@ -190,8 +190,6 @@ statschannel.@O@: bind9.xsl.h - - installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} -- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5 -- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - - install-man5: named.conf.5 - ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5 -@@ -201,16 +199,11 @@ install-man8: named.8 lwresd.8 - - install-man: install-man5 install-man8 - --install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs install-man -- ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} -- (cd ${DESTDIR}${sbindir}; rm -f lwresd@EXEEXT@; @LN@ named@EXEEXT@ lwresd@EXEEXT@) -+install:: ${TARGETS} installdirs -+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-sdb@EXEEXT@ ${DESTDIR}${sbindir} - - uninstall:: -- rm -f ${DESTDIR}${mandir}/man5/named.conf.5 -- rm -f ${DESTDIR}${mandir}/man8/lwresd.8 -- rm -f ${DESTDIR}${mandir}/man8/named.8 -- rm -f ${DESTDIR}${sbindir}/lwresd@EXEEXT@ -- ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named@EXEEXT@ -+ ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-sdb@EXEEXT@ - - @DLZ_DRIVER_RULES@ - -diff --git a/bin/named-sdb/main.c b/bin/named-sdb/main.c -index 108b8d6..a943421 100644 ---- a/bin/named-sdb/main.c -+++ b/bin/named-sdb/main.c -@@ -93,6 +93,10 @@ - * Include header files for database drivers here. - */ - /* #include "xxdb.h" */ -+#include "ldapdb.h" -+#include "pgsqldb.h" -+#include "sqlitedb.h" -+#include "dirdb.h" - - #ifdef CONTRIB_DLZ - /* -@@ -1069,6 +1073,11 @@ setup(void) { - ns_main_earlyfatal("isc_app_start() failed: %s", - isc_result_totext(result)); - -+ ldapdb_clear(); -+ pgsqldb_clear(); -+ dirdb_clear(); -+ sqlitedb_clear(); -+ - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, - ISC_LOG_NOTICE, "starting %s %s%s%s ", - ns_g_product, ns_g_version, -@@ -1269,6 +1278,75 @@ setup(void) { - isc_result_totext(result)); - #endif - -+ result = ldapdb_init(); -+ if (result != ISC_R_SUCCESS) -+ { -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB ldap module initialisation failed: %s.", -+ isc_result_totext(result) -+ ); -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB ldap zone database will be unavailable." -+ ); -+ }else -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_NOTICE, "SDB ldap zone database module loaded." -+ ); -+ -+ result = pgsqldb_init(); -+ if (result != ISC_R_SUCCESS) -+ { -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB pgsql module initialisation failed: %s.", -+ isc_result_totext(result) -+ ); -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB pgsql zone database will be unavailable." -+ ); -+ }else -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_NOTICE, "SDB postgreSQL DB zone database module loaded." -+ ); -+ -+ result = sqlitedb_init(); -+ if (result != ISC_R_SUCCESS) -+ { -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB sqlite3 module initialisation failed: %s.", -+ isc_result_totext(result) -+ ); -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB sqlite3 zone database will be unavailable." -+ ); -+ }else -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_NOTICE, "SDB sqlite3 DB zone database module loaded." -+ ); -+ -+ result = dirdb_init(); -+ if (result != ISC_R_SUCCESS) -+ { -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB directory DB module initialisation failed: %s.", -+ isc_result_totext(result) -+ ); -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_ERROR, -+ "SDB directory DB zone database will be unavailable." -+ ); -+ }else -+ isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, -+ ISC_LOG_NOTICE, "SDB directory DB zone database module loaded." -+ ); -+ -+ - ns_server_create(ns_g_mctx, &ns_g_server); - - #ifdef HAVE_LIBSECCOMP -@@ -1311,6 +1389,11 @@ cleanup(void) { - - dns_name_destroy(); - -+ ldapdb_clear(); -+ pgsqldb_clear(); -+ sqlitedb_clear(); -+ dirdb_clear(); -+ - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, - ISC_LOG_NOTICE, "exiting"); - ns_log_shutdown(); -diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 4cfed4d..f4bce7b 100644 ---- a/bin/named/Makefile.in -+++ b/bin/named/Makefile.in -@@ -45,10 +45,10 @@ DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ - CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \ - ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} \ -- ${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ -+ ${MAXMINDDB_CFLAGS} \ - @DST_OPENSSL_INC@ - --CDEFINES = @CONTRIB_DLZ@ @USE_GSSAPI@ @CRYPTO@ -+CDEFINES = @USE_GSSAPI@ @CRYPTO@ - - CWARNINGS = - -@@ -72,11 +72,11 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ - - LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@ -+ @LIBS@ - - NOSYMLIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@ -+ @LIBS@ - - SUBDIRS = unix - -@@ -94,8 +94,7 @@ OBJS = builtin.@O@ client.@O@ config.@O@ control.@O@ \ - tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \ - zoneconf.@O@ \ - lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \ -- lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \ -- ${DLZDRIVER_OBJS} ${DBDRIVER_OBJS} -+ lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ - - UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@ - -@@ -113,8 +112,7 @@ SRCS = builtin.c client.c config.c control.c \ - tkeyconf.c tsigconf.c update.c xfrout.c \ - zoneconf.c \ - lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \ -- lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \ -- ${DLZDRIVER_SRCS} ${DBDRIVER_SRCS} -+ lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c - - MANPAGES = named.8 lwresd.8 named.conf.5 - -@@ -212,7 +210,5 @@ uninstall:: - rm -f ${DESTDIR}${sbindir}/lwresd@EXEEXT@ - ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named@EXEEXT@ - --@DLZ_DRIVER_RULES@ -- - named-symtbl.@O@: named-symtbl.c - ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c named-symtbl.c -diff --git a/bin/sdb_tools/Makefile.in b/bin/sdb_tools/Makefile.in -index c7e0868..95ab742 100644 ---- a/bin/sdb_tools/Makefile.in -+++ b/bin/sdb_tools/Makefile.in -@@ -32,11 +32,11 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ - LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@ - --TARGETS = zone2ldap@EXEEXT@ zonetodb@EXEEXT@ -+TARGETS = zone2ldap@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@ - --OBJS = zone2ldap.@O@ zonetodb.@O@ -+OBJS = zone2ldap.@O@ zonetodb.@O@ zone2sqlite.@O@ - --SRCS = zone2ldap.c zonetodb.c -+SRCS = zone2ldap.c zonetodb.c zone2sqlite.c - - MANPAGES = zone2ldap.1 - -@@ -50,6 +50,9 @@ zone2ldap@EXEEXT@: zone2ldap.@O@ ${DEPLIBS} - zonetodb@EXEEXT@: zonetodb.@O@ ${DEPLIBS} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS} - -+zone2sqlite@EXEEXT@: zone2sqlite.@O@ ${DEPLIBS} -+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ zone2sqlite.@O@ -lsqlite3 -lssl ${LIBS} -+ - clean distclean manclean maintainer-clean:: - rm -f ${TARGETS} ${OBJS} - -@@ -60,4 +63,5 @@ installdirs: - install:: ${TARGETS} installdirs - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb@EXEEXT@ ${DESTDIR}${sbindir} -+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2sqlite@EXEEXT@ ${DESTDIR}${sbindir} - ${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1 -diff --git a/configure.ac b/configure.ac -index f6380b1..318e533 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -5416,6 +5416,8 @@ AC_CONFIG_FILES([ - bin/named/unix/Makefile - bin/named-pkcs11/Makefile - bin/named-pkcs11/unix/Makefile -+ bin/named-sdb/Makefile -+ bin/named-sdb/unix/Makefile - bin/nsupdate/Makefile - bin/pkcs11/Makefile - bin/python/Makefile -@@ -5440,6 +5442,7 @@ AC_CONFIG_FILES([ - bin/python/isc/tests/dnskey_test.py - bin/python/isc/tests/policy_test.py - bin/rndc/Makefile -+ bin/sdb_tools/Makefile - bin/tests/Makefile - bin/tests/headerdep_test.sh - bin/tests/optional/Makefile diff --git a/bind-9.3.1rc1-sdb_tools-Makefile.in b/bind-9.3.1rc1-sdb_tools-Makefile.in deleted file mode 100644 index c7e0868..0000000 --- a/bind-9.3.1rc1-sdb_tools-Makefile.in +++ /dev/null @@ -1,63 +0,0 @@ -srcdir = @srcdir@ -VPATH = @srcdir@ -top_srcdir = @top_srcdir@ - -VERSION=@BIND9_VERSION@ - -@BIND9_MAKE_INCLUDES@ - -CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include \ - ${LWRES_INCLUDES} ${DNS_INCLUDES} ${BIND9_INCLUDES} \ - ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_INCLUDES} - -CDEFINES = -DBIND9 - -DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@ -ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ -ISCCCLIBS = ../../lib/isccc/libisccc.@A@ -ISCLIBS = ../../lib/isc/libisc.@A@ -LWRESLIBS = ../../lib/lwres/liblwres.@A@ -BIND9LIBS = ../../lib/bind9/libbind9.@A@ - -DNSDEPLIBS = ../../lib/dns/libdns.@A@ -ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ -ISCCCDEPLIBS = ../../lib/isccc/libisccc.@A@ -ISCDEPLIBS = ../../lib/isc/libisc.@A@ -LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@ -BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@ - -DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ - ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS} - -LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@ - -TARGETS = zone2ldap@EXEEXT@ zonetodb@EXEEXT@ - -OBJS = zone2ldap.@O@ zonetodb.@O@ - -SRCS = zone2ldap.c zonetodb.c - -MANPAGES = zone2ldap.1 - -EXT_CFLAGS = - -@BIND9_MAKE_RULES@ - -zone2ldap@EXEEXT@: zone2ldap.@O@ ${DEPLIBS} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zone2ldap.@O@ -lldap -llber ${LIBS} - -zonetodb@EXEEXT@: zonetodb.@O@ ${DEPLIBS} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS} - -clean distclean manclean maintainer-clean:: - rm -f ${TARGETS} ${OBJS} - -installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 - -install:: ${TARGETS} installdirs - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb@EXEEXT@ ${DESTDIR}${sbindir} - ${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1 diff --git a/bind-9.3.2b1-fix_sdb_ldap.patch b/bind-9.3.2b1-fix_sdb_ldap.patch deleted file mode 100644 index 35c8542..0000000 --- a/bind-9.3.2b1-fix_sdb_ldap.patch +++ /dev/null @@ -1,519 +0,0 @@ -diff --git a/bin/sdb_tools/Makefile.in b/bin/sdb_tools/Makefile.in -index 95ab742..6069f09 100644 ---- a/bin/sdb_tools/Makefile.in -+++ b/bin/sdb_tools/Makefile.in -@@ -32,11 +32,11 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ - LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} ${DBDRIVER_LIBS} @LIBS@ - --TARGETS = zone2ldap@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@ -+TARGETS = zone2ldap@EXEEXT@ ldap2zone@EXEEXT@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@ - --OBJS = zone2ldap.@O@ zonetodb.@O@ zone2sqlite.@O@ -+OBJS = zone2ldap.@O@ ldap2zone.@O@ zonetodb.@O@ zone2sqlite.@O@ - --SRCS = zone2ldap.c zonetodb.c zone2sqlite.c -+SRCS = zone2ldap.c ldap2zone.c zonetodb.c zone2sqlite.c - - MANPAGES = zone2ldap.1 - -@@ -53,6 +53,9 @@ zonetodb@EXEEXT@: zonetodb.@O@ ${DEPLIBS} - zone2sqlite@EXEEXT@: zone2sqlite.@O@ ${DEPLIBS} - ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ zone2sqlite.@O@ -lsqlite3 -lssl ${LIBS} - -+ldap2zone@EXEEXT@: ldap2zone.@O@ ${DEPLIBS} -+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ldap2zone.@O@ -lldap -llber ${LIBS} -+ - clean distclean manclean maintainer-clean:: - rm -f ${TARGETS} ${OBJS} - -@@ -62,6 +65,7 @@ installdirs: - - install:: ${TARGETS} installdirs - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2ldap@EXEEXT@ ${DESTDIR}${sbindir} -+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ldap2zone@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zonetodb@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} zone2sqlite@EXEEXT@ ${DESTDIR}${sbindir} - ${INSTALL_DATA} ${srcdir}/zone2ldap.1 ${DESTDIR}${mandir}/man1/zone2ldap.1 -diff --git a/bin/sdb_tools/zone2ldap.c b/bin/sdb_tools/zone2ldap.c -index aa2c711..76186b5 100644 ---- a/bin/sdb_tools/zone2ldap.c -+++ b/bin/sdb_tools/zone2ldap.c -@@ -66,6 +66,9 @@ ldap_info; - /* usage Info */ - void usage (void); - -+/* Check for existence of (and possibly add) containing dNSZone objects */ -+int lookup_dns_zones( ldap_info *ldinfo); -+ - /* Add to the ldap dit */ - void add_ldap_values (ldap_info * ldinfo); - -@@ -82,7 +85,7 @@ char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags); - int get_attr_list_size (char **tmp); - - /* Get a DN */ --char *build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag); -+char *build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag, char *zone); - - /* Add to RR list */ - void add_to_rr_list (char *dn, char *name, char *type, char *data, -@@ -104,11 +107,27 @@ void - init_ldap_conn (); - void usage(); - --char *argzone, *ldapbase, *binddn, *bindpw = NULL; --const char *ldapsystem = "localhost"; --static const char *objectClasses[] = -- { "top", "dNSZone", NULL }; --static const char *topObjectClasses[] = { "top", NULL }; -+static char *argzone, *ldapbase, *binddn, *bindpw = NULL; -+ -+/* these are needed to placate gcc4's const-ness const-ernations : */ -+static char localhost[] = "localhost"; -+static char *ldapsystem=&(localhost[0]); -+/* dnszone schema class names: */ -+static char topClass [] ="top"; -+static char dNSZoneClass[] ="dNSZone"; -+static char objectClass [] ="objectClass"; -+static char dcObjectClass[]="dcObject"; -+/* dnszone schema attribute names: */ -+static char relativeDomainName[]="relativeDomainName"; -+static char dNSTTL []="dNSTTL"; -+static char zoneName []="zoneName"; -+static char dc []="dc"; -+static char sameZone []="@"; -+/* LDAPMod mod_values: */ -+static char *objectClasses []= { &(topClass[0]), &(dNSZoneClass[0]), NULL }; -+static char *topObjectClasses []= { &(topClass[0]), &(dcObjectClass[0]), &(dNSZoneClass[0]), NULL }; -+static char *dn_buffer [64]={NULL}; -+ - LDAP *conn; - unsigned int debug = 0; - -@@ -132,12 +151,12 @@ main (int argc, char **argv) - isc_result_t result; - char *basedn; - ldap_info *tmp; -- LDAPMod *base_attrs[2]; -- LDAPMod base; -+ LDAPMod *base_attrs[5]; -+ LDAPMod base, dcBase, znBase, rdnBase; - isc_buffer_t buff; - char *zonefile=0L; - char fullbasedn[1024]; -- char *ctmp; -+ char *ctmp, *zn, *dcp[2], *znp[2], *rdn[2]; - dns_fixedname_t fixedzone, fixedname; - dns_rdataset_t rdataset; - char **dc_list; -@@ -150,7 +169,7 @@ main (int argc, char **argv) - extern char *optarg; - extern int optind, opterr, optopt; - int create_base = 0; -- int topt; -+ int topt, dcn, zdn, znlen; - - if (argc < 2) - { -@@ -158,7 +177,7 @@ main (int argc, char **argv) - exit (-1); - } - -- while ((topt = getopt (argc, argv, "D:w:b:z:f:h:?dcv")) != -1) -+ while ((topt = getopt (argc, argv, "D:Ww:b:z:f:h:?dcv")) != -1) - { - switch (topt) - { -@@ -181,6 +200,9 @@ main (int argc, char **argv) - if (bindpw == NULL) - fatal("strdup"); - break; -+ case 'W': -+ bindpw = getpass("Enter LDAP Password: "); -+ break; - case 'b': - ldapbase = strdup (optarg); - if (ldapbase == NULL) -@@ -300,27 +322,62 @@ main (int argc, char **argv) - { - if (debug) - printf ("Creating base zone DN %s\n", argzone); -- -+ - dc_list = hostname_to_dn_list (argzone, argzone, DNS_TOP); -- basedn = build_dn_from_dc_list (dc_list, 0, NO_SPEC); - -- for (ctmp = &basedn[strlen (basedn)]; ctmp >= &basedn[0]; ctmp--) -+ basedn = build_dn_from_dc_list (dc_list, 0, NO_SPEC, argzone); -+ if (debug) -+ printf ("base DN %s\n", basedn); -+ -+ for (ctmp = &basedn[strlen (basedn)], dcn=0; ctmp >= &basedn[0]; ctmp--) - { -- if ((*ctmp == ',') || (ctmp == &basedn[0])) -+ if ((*ctmp == ',') || (ctmp == &basedn[0])) - { -+ - base.mod_op = LDAP_MOD_ADD; -- base.mod_type = (char*)"objectClass"; -- base.mod_values = (char**)topObjectClasses; -+ base.mod_type = objectClass; -+ base.mod_values = topObjectClasses; - base_attrs[0] = (void*)&base; -- base_attrs[1] = NULL; -- -+ -+ dcBase.mod_op = LDAP_MOD_ADD; -+ dcBase.mod_type = dc; -+ dcp[0]=dc_list[dcn]; -+ dcp[1]=0L; -+ dcBase.mod_values=dcp; -+ base_attrs[1] = (void*)&dcBase; -+ -+ znBase.mod_op = LDAP_MOD_ADD; -+ znBase.mod_type = zoneName; -+ for( zdn = dcn, znlen = 0; zdn >= 0; zdn-- ) -+ znlen += strlen(dc_list[zdn])+1; -+ znp[0] = (char*)malloc(znlen+1); -+ znp[1] = 0L; -+ for( zdn = dcn, zn=znp[0]; zdn >= 0; zdn-- ) -+ zn+=sprintf(zn,"%s%s",dc_list[zdn], -+ ((zdn > 0) && (*(dc_list[zdn-1])!='.')) ? "." : "" -+ ); -+ -+ znBase.mod_values = znp; -+ base_attrs[2] = (void*)&znBase; -+ -+ rdnBase.mod_op = LDAP_MOD_ADD; -+ rdnBase.mod_type = relativeDomainName; -+ rdn[0] = strdup(sameZone); -+ rdn[1] = 0L; -+ rdnBase.mod_values = rdn; -+ base_attrs[3] = (void*)&rdnBase; -+ -+ dcn++; -+ -+ base.mod_values = topObjectClasses; -+ base_attrs[4] = NULL; -+ - if (ldapbase) - { - if (ctmp != &basedn[0]) - sprintf (fullbasedn, "%s,%s", ctmp + 1, ldapbase); - else -- sprintf (fullbasedn, "%s,%s", ctmp, ldapbase); -- -+ sprintf (fullbasedn, "%s,%s", ctmp, ldapbase); - } - else - { -@@ -329,8 +386,13 @@ main (int argc, char **argv) - else - sprintf (fullbasedn, "%s", ctmp); - } -+ -+ if( debug ) -+ printf("Full base dn: %s\n", fullbasedn); -+ - result = ldap_add_s (conn, fullbasedn, base_attrs); - ldap_result_check ("intial ldap_add_s", fullbasedn, result); -+ - } - - } -@@ -408,14 +470,14 @@ generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, unsigned int ttl) - isc_result_check (result, "dns_rdata_totext"); - data[isc_buffer_usedlength (&buff)] = 0; - -- dc_list = hostname_to_dn_list (name, argzone, DNS_OBJECT); -+ dc_list = hostname_to_dn_list ((char*)name, argzone, DNS_OBJECT); - len = (get_attr_list_size (dc_list) - 2); -- dn = build_dn_from_dc_list (dc_list, ttl, WI_SPEC); -+ dn = build_dn_from_dc_list (dc_list, ttl, WI_SPEC, argzone); - - if (debug) - printf ("Adding %s (%s %s) to run queue list.\n", dn, type, data); - -- add_to_rr_list (dn, dc_list[len], type, data, ttl, DNS_OBJECT); -+ add_to_rr_list (dn, dc_list[len], (char*)type, (char*)data, ttl, DNS_OBJECT); - } - - -@@ -455,7 +517,8 @@ add_to_rr_list (char *dn, char *name, char *type, - int attrlist; - char ldap_type_buffer[128]; - char charttl[64]; -- -+ char *zn; -+ int znlen; - - if ((tmp = locate_by_dn (dn)) == NULL) - { -@@ -482,13 +545,13 @@ add_to_rr_list (char *dn, char *name, char *type, - fatal("malloc"); - } - tmp->attrs[0]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[0]->mod_type = (char*)"objectClass"; -+ tmp->attrs[0]->mod_type = objectClass; - - if (flags == DNS_OBJECT) -- tmp->attrs[0]->mod_values = (char**)objectClasses; -+ tmp->attrs[0]->mod_values = objectClasses; - else - { -- tmp->attrs[0]->mod_values = (char**)topObjectClasses; -+ tmp->attrs[0]->mod_values =topObjectClasses; - tmp->attrs[1] = NULL; - tmp->attrcnt = 2; - tmp->next = ldap_info_base; -@@ -497,7 +560,7 @@ add_to_rr_list (char *dn, char *name, char *type, - } - - tmp->attrs[1]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[1]->mod_type = (char*)"relativeDomainName"; -+ tmp->attrs[1]->mod_type = relativeDomainName; - tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2); - - if (tmp->attrs[1]->mod_values == (char **)NULL) -@@ -526,7 +589,7 @@ add_to_rr_list (char *dn, char *name, char *type, - fatal("strdup"); - - tmp->attrs[3]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[3]->mod_type = (char*)"dNSTTL"; -+ tmp->attrs[3]->mod_type = dNSTTL; - tmp->attrs[3]->mod_values = (char **) calloc (sizeof (char *), 2); - - if (tmp->attrs[3]->mod_values == (char **)NULL) -@@ -539,14 +602,25 @@ add_to_rr_list (char *dn, char *name, char *type, - if (tmp->attrs[3]->mod_values[0] == NULL) - fatal("strdup"); - -+ znlen=strlen(gbl_zone); -+ if ( *(gbl_zone + (znlen-1)) == '.' ) -+ { /* ldapdb MUST search by relative zone name */ -+ zn = (char*)malloc(znlen); -+ strncpy(zn,gbl_zone,znlen-1); -+ *(zn + (znlen-1))='\0'; -+ }else -+ { -+ zn = gbl_zone; -+ } -+ - tmp->attrs[4]->mod_op = LDAP_MOD_ADD; -- tmp->attrs[4]->mod_type = (char*)"zoneName"; -+ tmp->attrs[4]->mod_type = zoneName; - tmp->attrs[4]->mod_values = (char **)calloc(sizeof(char *), 2); - - if (tmp->attrs[4]->mod_values == (char **)NULL) - fatal("calloc"); - -- tmp->attrs[4]->mod_values[0] = gbl_zone; -+ tmp->attrs[4]->mod_values[0] = zn; - tmp->attrs[4]->mod_values[1] = NULL; - - tmp->attrs[5] = NULL; -@@ -557,7 +631,7 @@ add_to_rr_list (char *dn, char *name, char *type, - else - { - -- for (i = 0; tmp->attrs[i] != NULL; i++) -+ for (i = 0; tmp->attrs[i] != NULL; i++) - { - sprintf (ldap_type_buffer, "%sRecord", type); - if (!strncmp -@@ -631,44 +705,70 @@ char ** - hostname_to_dn_list (char *hostname, char *zone, unsigned int flags) - { - char *tmp; -- static char *dn_buffer[64]; - int i = 0; -- char *zname; -- char *hnamebuff; -- -- zname = strdup (hostname); -- if (zname == NULL) -- fatal("strdup"); -- -- if (flags == DNS_OBJECT) -- { -- -- if (strlen (zname) != strlen (zone)) -- { -- tmp = &zname[strlen (zname) - strlen (zone)]; -- *--tmp = '\0'; -- hnamebuff = strdup (zname); -- if (hnamebuff == NULL) -- fatal("strdup"); -- zname = ++tmp; -- } -- else -- hnamebuff = (char*)"@"; -- } -- else -- { -- zname = zone; -- hnamebuff = NULL; -- } -- -- for (tmp = strrchr (zname, '.'); tmp != (char *) 0; -- tmp = strrchr (zname, '.')) -- { -- *tmp++ = '\0'; -- dn_buffer[i++] = tmp; -- } -- dn_buffer[i++] = zname; -- dn_buffer[i++] = hnamebuff; -+ char *hname=0L, *last=0L; -+ int hlen=strlen(hostname), zlen=(strlen(zone)); -+ -+/* printf("hostname: %s zone: %s\n",hostname, zone); */ -+ hname=0L; -+ if(flags == DNS_OBJECT) -+ { -+ if( (zone[ zlen - 1 ] == '.') && (hostname[hlen - 1] != '.') ) -+ { -+ hname=(char*)malloc(hlen + 1); -+ hlen += 1; -+ sprintf(hname, "%s.", hostname); -+ hostname = hname; -+ } -+ if(strcmp(hostname, zone) == 0) -+ { -+ if( hname == 0 ) -+ hname=strdup(hostname); -+ last = strdup(sameZone); -+ }else -+ { -+ if( (hlen < zlen) -+ ||( strcmp( hostname + (hlen - zlen), zone ) != 0) -+ ) -+ { -+ if( hname != 0 ) -+ free(hname); -+ hname=(char*)malloc( hlen + zlen + 1); -+ if( *zone == '.' ) -+ sprintf(hname, "%s%s", hostname, zone); -+ else -+ sprintf(hname,"%s",zone); -+ }else -+ { -+ if( hname == 0 ) -+ hname = strdup(hostname); -+ } -+ last = hname; -+ } -+ }else -+ { /* flags == DNS_TOP */ -+ hname = strdup(zone); -+ last = hname; -+ } -+ -+ for (tmp = strrchr (hname, '.'); tmp != (char *) 0; -+ tmp = strrchr (hname, '.')) -+ { -+ if( *( tmp + 1 ) != '\0' ) -+ { -+ *tmp = '\0'; -+ dn_buffer[i++] = ++tmp; -+ }else -+ { /* trailing '.' ! */ -+ dn_buffer[i++] = strdup("."); -+ *tmp = '\0'; -+ if( tmp == hname ) -+ break; -+ } -+ } -+ if( ( last != hname ) && (tmp != hname) ) -+ dn_buffer[i++] = hname; -+ dn_buffer[i++] = last; - dn_buffer[i] = NULL; - - return dn_buffer; -@@ -680,24 +780,32 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags) - * exception of "@"/SOA. */ - - char * --build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag) -+build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag, char *zone) - { - int size; -- int x; -+ int x, znlen; - static char dn[1024]; - char tmp[128]; -+ char zn[DNS_NAME_MAXTEXT+1]; - - bzero (tmp, sizeof (tmp)); - bzero (dn, sizeof (dn)); - size = get_attr_list_size (dc_list); -+ znlen = strlen(zone); -+ if ( *(zone + (znlen-1)) == '.' ) -+ { /* ldapdb MUST search by relative zone name */ -+ memcpy(&(zn[0]),zone,znlen-1); -+ *(zn + (znlen-1))='\0'; -+ zone = zn; -+ } - for (x = size - 2; x > 0; x--) - { - if (flag == WI_SPEC) - { - if (x == (size - 2) && (strncmp (dc_list[x], "@", 1) == 0) && (ttl)) -- sprintf (tmp, "relativeDomainName=%s + dNSTTL=%u,", dc_list[x], ttl); -+ sprintf (tmp, "zoneName=%s + relativeDomainName=%s,", zone, dc_list[x]); - else if (x == (size - 2)) -- sprintf(tmp, "relativeDomainName=%s,",dc_list[x]); -+ sprintf(tmp, "zoneName=%s + relativeDomainName=%s,", zone, dc_list[x]); - else - sprintf(tmp,"dc=%s,", dc_list[x]); - } -@@ -723,6 +831,7 @@ void - init_ldap_conn () - { - int result; -+ char ldb_tag[]="LDAP Bind"; - conn = ldap_open (ldapsystem, LDAP_PORT); - if (conn == NULL) - { -@@ -732,7 +841,7 @@ init_ldap_conn () - } - - result = ldap_simple_bind_s (conn, binddn, bindpw); -- ldap_result_check ("ldap_simple_bind_s", (char*)"LDAP Bind", result); -+ ldap_result_check ("ldap_simple_bind_s", ldb_tag , result); - } - - /* Like isc_result_check, only for LDAP */ -@@ -749,8 +858,6 @@ ldap_result_check (const char *msg, char *dn, int err) - } - } - -- -- - /* For running the ldap_info run queue. */ - void - add_ldap_values (ldap_info * ldinfo) -@@ -758,14 +865,14 @@ add_ldap_values (ldap_info * ldinfo) - int result; - char dnbuffer[1024]; - -- - if (ldapbase != NULL) - sprintf (dnbuffer, "%s,%s", ldinfo->dn, ldapbase); - else - sprintf (dnbuffer, "%s", ldinfo->dn); - - result = ldap_add_s (conn, dnbuffer, ldinfo->attrs); -- ldap_result_check ("ldap_add_s", dnbuffer, result); -+ ldap_result_check ("ldap_add_s", dnbuffer, result); -+ - } - - -@@ -776,5 +883,5 @@ void - usage () - { - fprintf (stderr, -- "zone2ldap -D [BIND DN] -w [BIND PASSWORD] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST] " -+ "zone2ldap -D [BIND DN] [-w BIND PASSWORD | -W:prompt] -b [BASE DN] -z [ZONE] -f [ZONE FILE] -h [LDAP HOST] " - "[-c Create LDAP Base structure][-d Debug Output (lots !)] \n ");} diff --git a/bind.spec b/bind.spec index a95a4cf..1b5b869 100644 --- a/bind.spec +++ b/bind.spec @@ -10,9 +10,6 @@ # bcond_without is built by default, unless --without X is passed # bcond_with is built only when --with X is passed to build %bcond_with SYSTEMTEST -# TODO: sdb tools from contrib were removed. -# Disable SDB for now -%bcond_with SDB %bcond_without GSSTSIG # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles @@ -21,7 +18,6 @@ %bcond_without LMDB %bcond_without JSON %bcond_without DNSTAP -# TODO: mysql is not well suported without SDB. %bcond_with BDB # skip DLZ for now %bcond_without DLZ @@ -38,9 +34,6 @@ %{?!bind_gid: %global bind_gid 25} %global bind_dir /var/named %global chroot_prefix %{bind_dir}/chroot -%if %{with SDB} -%global chroot_sdb_prefix %{bind_dir}/chroot_sdb -%endif %global chroot_create_directories /dev /run/named %{_localstatedir}/{log,named,tmp} \\\ %{_sysconfdir}/{crypto-policies/back-ends,pki/dnssec-keys,named} \\\ %{_libdir}/bind %{_datadir}/GeoIP @@ -77,9 +70,6 @@ Source1: named.sysconfig Source2: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz.asc Source3: named.logrotate Source4: https://downloads.isc.org/isc/pgpkeys/codesign2019.txt -Source7: bind-9.3.1rc1-sdb_tools-Makefile.in -Source8: dnszone.schema -Source12: README.sdb_pgsql Source16: named.conf # Refresh by command: dig @a.root-servers.net. +tcp +norec # or from URL @@ -90,22 +80,14 @@ Source20: named.empty Source23: named.rfc1912.zones Source25: named.conf.sample Source27: named.root.key -Source30: ldap2zone.c -Source31: ldap2zone.1 -Source32: named-sdb.8 -Source33: zonetodb.1 -Source34: zone2sqlite.1 Source35: bind.tmpfiles.d Source36: trusted-key.key Source37: named.service Source38: named-chroot.service -Source39: named-sdb.service -Source40: named-sdb-chroot.service Source41: setup-named-chroot.sh Source42: generate-rndc-key.sh Source43: named.rwtab Source44: named-chroot-setup.service -Source45: named-sdb-chroot-setup.service Source46: named-setup-rndc.service Source47: named-pkcs11.service Source48: setup-named-softhsm.sh @@ -140,12 +122,6 @@ Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch Patch173:bind-9.16-libisc-link.patch -# SDB patches -Patch12: bind-9.10-sdb.patch - -# needs inpection -Patch17: bind-9.3.2b1-fix_sdb_ldap.patch - Requires(post): systemd Requires(preun): systemd Requires(postun): systemd @@ -268,25 +244,6 @@ This a set of development files for BIND libraries (dns, isc) compiled with native PKCS#11 functionality. %endif -%if %{with SDB} -%package sdb -Summary: BIND server with database backends and DLZ support -Requires: systemd -Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} -Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} -Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} - -%description sdb -BIND (Berkeley Internet Name Domain) is an implementation of the DNS -(Domain Name System) protocols. BIND includes a DNS server (named-sdb) -which has compiled-in SDB (Simplified Database Backend) which includes -support for using alternative Zone Databases stored in an LDAP server -(ldapdb), a postgreSQL database (pgsqldb), an sqlite database (sqlitedb), -or in the filesystem (dirdb), in addition to the standard in-memory RBT -(Red Black Tree) zone database. It also includes support for DLZ -(Dynamic Loadable Zones) -%endif - %package libs-lite Summary: Libraries for working with the DNS protocol Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7 @@ -393,20 +350,6 @@ This package contains a tree of files which can be used as a chroot(2) jail for the named(8) program from the BIND package. Based on the code from Jan "Yenya" Kasprzak -%if %{with SDB} -%package sdb-chroot -Summary: A chroot runtime environment for the ISC BIND DNS server, named-sdb(8) -Prefix: %{chroot_sdb_prefix} -# grep is required due to setup-named-chroot.sh script -Requires: grep -Requires: bind-sdb%{?_isa} = %{epoch}:%{version}-%{release} - -%description sdb-chroot -This package contains a tree of files which can be used as a -chroot(2) jail for the named-sdb(8) program from the BIND package. -Based on the code from Jan "Yenya" Kasprzak -%endif - %if %{with DLZ} %if %{with BDB} @@ -500,32 +443,6 @@ cp -r lib/ns{,-pkcs11} %patch150 -p1 -b .engine-pkcs11 %endif -%if %{with SDB} -mkdir bin/named-sdb -cp -r bin/named/* bin/named-sdb -# SDB ldap -cp -fp contrib/sdb/ldap/ldapdb.[ch] bin/named-sdb -# SDB postgreSQL -cp -fp contrib/sdb/pgsql/pgsqldb.[ch] bin/named-sdb -# SDB sqlite -cp -fp contrib/sdb/sqlite/sqlitedb.[ch] bin/named-sdb -# SDB Berkeley DB - needs to be ported to DB4! -#cp -fp contrib/sdb/bdb/bdb.[ch] bin/named_sdb -# SDB dir -cp -fp contrib/sdb/dir/dirdb.[ch] bin/named-sdb -# SDB tools -mkdir -p bin/sdb_tools -cp -fp %{SOURCE30} bin/sdb_tools/ldap2zone.c -cp -fp %{SOURCE7} bin/sdb_tools/Makefile.in -#cp -fp contrib/sdb/bdb/zone2bdb.c bin/sdb_tools -cp -fp contrib/sdb/ldap/{zone2ldap.1,zone2ldap.c} bin/sdb_tools -cp -fp contrib/sdb/pgsql/zonetodb.c bin/sdb_tools -cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools -%patch12 -p1 -b .sdb -%patch17 -p1 -b .fix_sdb_ldap -%patch137 -p1 -b .strlcat_fix -%endif - %patch133 -p1 -b .rh640538 #%patch134 -p1 -b .rh669163 @@ -534,11 +451,6 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools for i in bin/named/{,unix}/Makefile.in; do sed -i 's|fpie|fPIE|g' $i done -%if %{with SDB} -for i in bin/named-sdb/{,unix}/Makefile.in; do - sed -i 's|fpie|fPIE|g' $i -done -%endif %endif :; @@ -601,7 +513,7 @@ export LIBDIR_SUFFIX --with-pkcs11=%{_libdir}/pkcs11/libsofthsm2.so \ %endif --with-dlopen=yes \ -%if %{with SDB} || %{with DLZ} +%if %{with DLZ} --with-dlz-ldap=yes \ --with-dlz-postgres=yes \ --with-dlz-mysql=yes \ @@ -756,23 +668,6 @@ popd touch ${RPM_BUILD_ROOT}/%{chroot_prefix}%{_sysconfdir}/named.conf #end chroot -#sdb-chroot -%if %{with SDB} -for D in %{chroot_create_directories} -do - mkdir -p ${RPM_BUILD_ROOT}/%{chroot_sdb_prefix}${D} -done - -# create symlink as it is on real filesystem -pushd ${RPM_BUILD_ROOT}/%{chroot_sdb_prefix}%{_localstatedir} -ln -s ../run run -popd - -# these are required to prevent them being erased during upgrade of previous -touch ${RPM_BUILD_ROOT}/%{chroot_sdb_prefix}%{_sysconfdir}/named.conf -%endif -#end sdb-chroot - pushd build make DESTDIR=${RPM_BUILD_ROOT} install popd @@ -787,12 +682,6 @@ install -m 644 %{SOURCE38} ${RPM_BUILD_ROOT}%{_unitdir} install -m 644 %{SOURCE44} ${RPM_BUILD_ROOT}%{_unitdir} install -m 644 %{SOURCE46} ${RPM_BUILD_ROOT}%{_unitdir} -%if %{with SDB} -install -m 644 %{SOURCE39} ${RPM_BUILD_ROOT}%{_unitdir} -install -m 644 %{SOURCE40} ${RPM_BUILD_ROOT}%{_unitdir} -install -m 644 %{SOURCE45} ${RPM_BUILD_ROOT}%{_unitdir} -%endif - %if %{with PKCS11} install -m 644 %{SOURCE47} ${RPM_BUILD_ROOT}%{_unitdir} %else @@ -814,11 +703,6 @@ install -m 644 %SOURCE3 ${RPM_BUILD_ROOT}/etc/logrotate.d/named mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig install -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/named install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files -%if %{with SDB} -mkdir -p ${RPM_BUILD_ROOT}/etc/openldap/schema -install -m 644 %{SOURCE8} ${RPM_BUILD_ROOT}/etc/openldap/schema/dnszone.schema -install -m 644 %{SOURCE12} contrib/sdb/pgsql/ -%endif %if %{with DLZ} pushd build @@ -859,14 +743,6 @@ rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/bind9 rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man3/lwres* %endif -# SDB manpages -%if %{with SDB} -install -m 644 %{SOURCE31} ${RPM_BUILD_ROOT}%{_mandir}/man1/ldap2zone.1 -install -m 644 %{SOURCE32} ${RPM_BUILD_ROOT}%{_mandir}/man8/named-sdb.8 -install -m 644 %{SOURCE33} ${RPM_BUILD_ROOT}%{_mandir}/man1/zonetodb.1 -install -m 644 %{SOURCE34} ${RPM_BUILD_ROOT}%{_mandir}/man1/zone2sqlite.1 -%endif - # PKCS11 versions manpages %if %{with PKCS11} pushd ${RPM_BUILD_ROOT}%{_mandir}/man8 @@ -972,20 +848,6 @@ if [ -e "%{_sysconfdir}/selinux/config" ]; then %selinux_unset_booleans -s mls %{selinuxbooleans} fi -%if %{with SDB} -%post sdb -# Initial installation -%systemd_post named-sdb.service - -%preun sdb -# Package removal, not upgrade -%systemd_preun named-sdb.service - -%postun sdb -# Package upgrade, not uninstall -%systemd_postun_with_restart named-sdb.service -%endif - %if %{with PKCS11} %post pkcs11 # Initial installation @@ -1051,29 +913,6 @@ fi; %systemd_postun_with_restart named-chroot.service -%if %{with SDB} - -%post sdb-chroot -%systemd_post named-sdb-chroot.service -%chroot_fix_devices %{chroot_sdb_prefix} -:; - -%posttrans sdb-chroot -if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then - [ -x /sbin/restorecon ] && /sbin/restorecon %{chroot_sdb_prefix}/dev/* > /dev/null 2>&1; -fi; -:; - -%preun sdb-chroot -%systemd_preun named-sdb-chroot.service -:; - -%postun sdb-chroot -# Package upgrade, not uninstall -%systemd_postun_with_restart named-sdb-chroot.service - -%endif - %files # TODO: Move from lib/bind to lib/named, as used by upstream %{_libdir}/bind @@ -1131,24 +970,6 @@ fi; %defattr(-,named,named,-) %dir /run/named -%if %{with SDB} -%files sdb -%{_unitdir}/named-sdb.service -%{_mandir}/man1/zone2ldap.1* -%{_mandir}/man1/ldap2zone.1* -%{_mandir}/man1/zonetodb.1* -%{_mandir}/man1/zone2sqlite.1* -%{_mandir}/man8/named-sdb.8* -%doc contrib/sdb/ldap/README.ldap contrib/sdb/ldap/INSTALL.ldap contrib/sdb/pgsql/README.sdb_pgsql -%dir %{_sysconfdir}/openldap/schema -%config(noreplace) %{_sysconfdir}/openldap/schema/dnszone.schema -%{_sbindir}/named-sdb -%{_sbindir}/zone2ldap -%{_sbindir}/ldap2zone -%{_sbindir}/zonetodb -%{_sbindir}/zone2sqlite -%endif - %files libs %{_libdir}/libbind9.so.1600* %{_libdir}/libisccc.so.1600* @@ -1266,44 +1087,6 @@ fi; %dir %{chroot_prefix}/run/named %{chroot_prefix}%{_localstatedir}/run -%if %{with SDB} -%files sdb-chroot -%config(noreplace) %{_sysconfdir}/named-chroot.files -%{_unitdir}/named-sdb-chroot.service -%{_unitdir}/named-sdb-chroot-setup.service -%{_libexecdir}/setup-named-chroot.sh -%defattr(0664,root,named,-) -%ghost %dev(c,1,3) %verify(not mtime) %{chroot_sdb_prefix}/dev/null -%ghost %dev(c,1,8) %verify(not mtime) %{chroot_sdb_prefix}/dev/random -%ghost %dev(c,1,9) %verify(not mtime) %{chroot_sdb_prefix}/dev/urandom -%ghost %dev(c,1,5) %verify(not mtime) %{chroot_sdb_prefix}/dev/zero -%defattr(0640,root,named,0750) -%dir %{chroot_sdb_prefix} -%dir %{chroot_sdb_prefix}/dev -%dir %{chroot_sdb_prefix}%{_sysconfdir} -%dir %{chroot_sdb_prefix}%{_sysconfdir}/named -%dir %{chroot_sdb_prefix}%{_sysconfdir}/pki -%dir %{chroot_sdb_prefix}%{_sysconfdir}/pki/dnssec-keys -%dir %{chroot_sdb_prefix}%{_sysconfdir}/crypto-policies -%dir %{chroot_sdb_prefix}%{_sysconfdir}/crypto-policies/back-ends -%dir %{chroot_sdb_prefix}%{_localstatedir} -%dir %{chroot_sdb_prefix}/run -%ghost %config(noreplace) %{chroot_sdb_prefix}%{_sysconfdir}/named.conf -%defattr(0660,root,named,01770) -%dir %{chroot_sdb_prefix}%{_localstatedir}/named -%defattr(-,root,root,-) -%dir %{chroot_sdb_prefix}/usr -%dir %{chroot_sdb_prefix}/%{_libdir} -%dir %{chroot_sdb_prefix}/%{_libdir}/bind -%dir %{chroot_sdb_prefix}/%{_datadir}/GeoIP -%defattr(0660,named,named,0770) -%dir %{chroot_sdb_prefix}%{_localstatedir}/tmp -%dir %{chroot_sdb_prefix}%{_localstatedir}/log -%defattr(-,named,named,-) -%dir %{chroot_sdb_prefix}/run/named -%{chroot_sdb_prefix}%{_localstatedir}/run -%endif - %if %{with PKCS11} %files pkcs11 %{_sbindir}/named-pkcs11 @@ -1337,9 +1120,6 @@ fi; %if %{with DLZ} && %{with BDB} %files dlz-bdb -%if %{with SDB} -%{_sbindir}/dlzbdb -%endif %{_libdir}/bind/dlz_bdbhpt_dynamic.so %doc contrib/dlz/modules/bdbhpt/testing/* %doc contrib/dlz/modules/bdbhpt/README* diff --git a/dnszone.schema b/dnszone.schema deleted file mode 100644 index cb72a3f..0000000 --- a/dnszone.schema +++ /dev/null @@ -1,148 +0,0 @@ -# A schema for storing DNS zones in LDAP -# -attributetype ( 1.3.6.1.4.1.2428.20.0.0 NAME 'dNSTTL' - DESC 'An integer denoting time to live' - EQUALITY integerMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 ) - -attributetype ( 1.3.6.1.4.1.2428.20.0.1 NAME 'dNSClass' - DESC 'The class of a resource record' - EQUALITY caseIgnoreIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.0.2 NAME 'zoneName' - DESC 'The name of a zone, i.e. the name of the highest node in the zone' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.0.3 NAME 'relativeDomainName' - DESC 'The starting labels of a domain name' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.12 NAME 'pTRRecord' - DESC 'domain name pointer, RFC 1035' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.13 NAME 'hInfoRecord' - DESC 'host information, RFC 1035' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.14 NAME 'mInfoRecord' - DESC 'mailbox or mail list information, RFC 1035' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.16 NAME 'tXTRecord' - DESC 'text string, RFC 1035' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.18 NAME 'aFSDBRecord' - DESC 'for AFS Data Base location, RFC 1183' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.24 NAME 'SigRecord' - DESC 'Signature, RFC 2535' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.25 NAME 'KeyRecord' - DESC 'Key, RFC 2535' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.28 NAME 'aAAARecord' - DESC 'IPv6 address, RFC 1886' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.29 NAME 'LocRecord' - DESC 'Location, RFC 1876' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.30 NAME 'nXTRecord' - DESC 'non-existant, RFC 2535' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.33 NAME 'sRVRecord' - DESC 'service location, RFC 2782' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.35 NAME 'nAPTRRecord' - DESC 'Naming Authority Pointer, RFC 2915' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.36 NAME 'kXRecord' - DESC 'Key Exchange Delegation, RFC 2230' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.37 NAME 'certRecord' - DESC 'certificate, RFC 2538' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.38 NAME 'a6Record' - DESC 'A6 Record Type, RFC 2874' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.39 NAME 'dNameRecord' - DESC 'Non-Terminal DNS Name Redirection, RFC 2672' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.43 NAME 'dSRecord' - DESC 'Delegation Signer, RFC 3658' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.46 NAME 'rRSIGRecord' - DESC 'RRSIG, RFC 3755' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -attributetype ( 1.3.6.1.4.1.2428.20.1.47 NAME 'nSECRecord' - DESC 'NSEC, RFC 3755' - EQUALITY caseIgnoreIA5Match - SUBSTR caseIgnoreIA5SubstringsMatch - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) - -objectclass ( 1.3.6.1.4.1.2428.20.3 NAME 'dNSZone' - SUP top STRUCTURAL - MUST ( zoneName $ relativeDomainName ) - MAY ( DNSTTL $ DNSClass $ - ARecord $ MDRecord $ MXRecord $ NSRecord $ - SOARecord $ CNAMERecord $ PTRRecord $ HINFORecord $ - MINFORecord $ TXTRecord $ SIGRecord $ KEYRecord $ - AAAARecord $ LOCRecord $ NXTRecord $ SRVRecord $ - NAPTRRecord $ KXRecord $ CERTRecord $ A6Record $ - DNAMERecord ) ) diff --git a/ldap2zone.1 b/ldap2zone.1 deleted file mode 100644 index a48c69f..0000000 --- a/ldap2zone.1 +++ /dev/null @@ -1,41 +0,0 @@ -.\" Copyright (C) 2004, 2005 Stig Venaas -.\" -.\" Permission to use, copy, modify, and 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. -.\" Manpage written by Jan Gorig -.TH ldap2zone 1 "15 March 2010" "BIND9" -.SH NAME -ldap2zone - Creates zone file from LDAP dnszone information -.SH SYNOPSIS -.B ldap2zone zone-name LDAP-URL default-ttl [serial] -.SH DESCRIPTION -ldap2zone is a tool that reads info for a zone from LDAP and constructs a standard plain ascii zone file that is written to the standard output. The LDAP information has to be stored using the dnszone schema. The schema is used by BIND with LDAP back-end. - -\fBzone-name\fR -.RS 4 -Name of the zone, eg "mydomain.net." -.RE -.PP -\fBLDAP-URL\fR -.RS 4 -LDAP URL to dnszone information -.RE -.PP -\fBdefault-ttl\fR -.RS 4 -Default TTL value to be used in zone -.RE -.PP -\fBserial\fR -.RS 4 -(optional) Program checks this number to be different than SOA serial number. -.RE - -.SH "EXIT STATUS" -Exits with 0 on success or 1 on failure. -.SH "SEE ALSO" -named(8) ldap(3) -http://www.venaas.no/dns/ldap2zone/ -.SH "COPYRIGHT" -Copyright (C) 2004, 2005 Stig Venaas diff --git a/named-sdb-chroot-setup.service b/named-sdb-chroot-setup.service deleted file mode 100644 index 5a3e173..0000000 --- a/named-sdb-chroot-setup.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Set-up/destroy chroot environment for named-sdb -BindsTo=named-sdb-chroot.service -Wants=named-setup-rndc.service -After=named-setup-rndc.service - - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/libexec/setup-named-chroot.sh /var/named/chroot_sdb on /etc/named-chroot.files -ExecStop=/usr/libexec/setup-named-chroot.sh /var/named/chroot_sdb off /etc/named-chroot.files diff --git a/named-sdb-chroot.service b/named-sdb-chroot.service deleted file mode 100644 index acf88ba..0000000 --- a/named-sdb-chroot.service +++ /dev/null @@ -1,30 +0,0 @@ -# Don't forget to add "$AddUnixListenSocket /var/named/chroot_sdb/dev/log" -# line to your /etc/rsyslog.conf file. Otherwise your logging becomes -# broken when rsyslogd daemon is restarted (due update, for example). - -[Unit] -Description=Berkeley Internet Name Domain (DNS) -Wants=nss-lookup.target -Requires=named-sdb-chroot-setup.service -Before=nss-lookup.target -After=named-sdb-chroot-setup.service -After=network.target - -[Service] -Type=forking -Environment=NAMEDCONF=/etc/named.conf -EnvironmentFile=-/etc/sysconfig/named -Environment=KRB5_KTNAME=/etc/named.keytab -PIDFile=/var/named/chroot_sdb/run/named/named.pid - -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -t /var/named/chroot_sdb -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named-sdb -u named -c ${NAMEDCONF} -t /var/named/chroot_sdb $OPTIONS - -ExecReload=/bin/sh -c 'if /usr/sbin/rndc null > /dev/null 2>&1; then /usr/sbin/rndc reload; else /bin/kill -HUP $MAINPID; fi' - -ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID' - -PrivateTmp=false - -[Install] -WantedBy=multi-user.target diff --git a/named-sdb.8 b/named-sdb.8 deleted file mode 100644 index 1e456c3..0000000 --- a/named-sdb.8 +++ /dev/null @@ -1 +0,0 @@ -.so man8/named.8.gz \ No newline at end of file diff --git a/named-sdb.service b/named-sdb.service deleted file mode 100644 index cdf3a62..0000000 --- a/named-sdb.service +++ /dev/null @@ -1,26 +0,0 @@ -[Unit] -Description=Berkeley Internet Name Domain (DNS) -Wants=nss-lookup.target -Wants=named-setup-rndc.service -Before=nss-lookup.target -After=named-setup-rndc.service -After=network.target - -[Service] -Type=forking -Environment=NAMEDCONF=/etc/named.conf -EnvironmentFile=-/etc/sysconfig/named -Environment=KRB5_KTNAME=/etc/named.keytab -PIDFile=/run/named/named.pid - -ExecStartPre=/bin/bash -c 'if [ ! "$DISABLE_ZONE_CHECKING" == "yes" ]; then /usr/sbin/named-checkconf -z "$NAMEDCONF"; else echo "Checking of zone files is disabled"; fi' -ExecStart=/usr/sbin/named-sdb -u named -c ${NAMEDCONF} $OPTIONS - -ExecReload=/bin/sh -c 'if /usr/sbin/rndc null > /dev/null 2>&1; then /usr/sbin/rndc reload; else /bin/kill -HUP $MAINPID; fi' - -ExecStop=/bin/sh -c '/usr/sbin/rndc stop > /dev/null 2>&1 || /bin/kill -TERM $MAINPID' - -PrivateTmp=true - -[Install] -WantedBy=multi-user.target diff --git a/zone2sqlite.1 b/zone2sqlite.1 deleted file mode 100644 index 6897827..0000000 --- a/zone2sqlite.1 +++ /dev/null @@ -1,53 +0,0 @@ -.\" Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") -.\" Copyright (C) 2000, 2001 Internet Software Consortium. -.\" -.\" 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. -.\" -.\" Manpage written by Jan Gorig -.TH zone2sqlite 1 "15 March 2010" "BIND9" -.SH NAME -zone2sqlite - Load BIND 9 zone file into SQLite database -.SH SYNOPSIS -.B zone2sqlite zone zonefile dbfile dbtable -.SH DESCRIPTION -zone2sqlite parses DNS zone file and creates database for use with SQLite BIND SDB driver. - -\fBzone\fR -.RS 4 -Zone origin, eg "mydomain.net." -.RE -.PP -\fBzonefile\fR -.RS 4 -Master zone database file, eg. mydomain.net.zone -.RE -.PP -\fBdbfile\fR -.RS 4 -Name of SQLite database file -.RE -.PP -\fBdbtable\fR -.RS 4 -Name of table in database -.RE - -.SH "EXIT STATUS" -Exits with 0 on success or 1 on failure. -.SH "SEE ALSO" -named(8) -.SH "COPYRIGHT" -Copyright \(co 2004, 2005, 2007\-2009 Internet Systems Consortium, Inc. ("ISC") -.br -Copyright \(co 2000, 2001 Internet Software Consortium. -.br diff --git a/zonetodb.1 b/zonetodb.1 deleted file mode 100644 index 897e74f..0000000 --- a/zonetodb.1 +++ /dev/null @@ -1,53 +0,0 @@ -.\" Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC") -.\" Copyright (C) 2000, 2001 Internet Software Consortium. -.\" -.\" 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. -.\" -.\" Manpage written by Jan Gorig -.TH zonetodb 1 "15 March 2010" "BIND9" -.SH NAME -zonetodb - Generate a PostgreSQL table from a zone. -.SH SYNOPSIS -.B zonetodb origin file dbname dbtable -.SH DESCRIPTION -zonetodb parses DNS zone file and creates table in selected database for use with PostgreSQL BIND SDB driver. - -\fBzone\fR -.RS 4 -Zone origin, eg "pgdb.net." -.RE -.PP -\fBfile\fR -.RS 4 -Master zone database file, eg. pgdb.net.db -.RE -.PP -\fBdbname\fR -.RS 4 -Name of PostgreSQL database (database must exist) -.RE -.PP -\fBdbtable\fR -.RS 4 -Name of table in database -.RE - -.SH "EXIT STATUS" -Exits with 0 on success or 1 on failure. -.SH "SEE ALSO" -named(8) -.SH "COPYRIGHT" -Copyright \(co 2004, 2005, 2007\-2009 Internet Systems Consortium, Inc. ("ISC") -.br -Copyright \(co 2000, 2001 Internet Software Consortium. -.br From 6b3788d0269b13d68183ed39a960dea126f16dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 8 Apr 2020 20:14:01 +0200 Subject: [PATCH 25/79] Provide link to merge request for lastest patch Document when it should be removed --- bind.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/bind.spec b/bind.spec index 1b5b869..e7bc694 100644 --- a/bind.spec +++ b/bind.spec @@ -120,6 +120,7 @@ Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch +# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/3323 Patch173:bind-9.16-libisc-link.patch Requires(post): systemd From 304cfaa8e056047f94d9e7c5952011edeab88b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 8 Apr 2020 20:49:02 +0200 Subject: [PATCH 26/79] Enable source verification only on Fedora builds --- bind.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bind.spec b/bind.spec index e7bc694..ee7f5ff 100644 --- a/bind.spec +++ b/bind.spec @@ -152,7 +152,9 @@ BuildRequires: selinux-policy BuildRequires: python3-devel BuildRequires: python3-ply BuildRequires: findutils sed +%if 0%{?fedora} BuildRequires: gnupg2 +%endif BuildRequires: libuv-devel %if %{with DLZ} BuildRequires: openldap-devel, libpq-devel, sqlite-devel, mariadb-connector-c-devel @@ -414,7 +416,10 @@ BuildArch: noarch This package provides a module which allows commands to be sent to rndc directly from Python programs. %prep +%if 0%{?fedora} +# RHEL does not yet support this verification %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE0}' +%endif %setup -q -n %{name}-%{BINDVERSION} # Common patches From 5e13eb8e75ab571adf595e5d3c36485bd5ebfa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 16 Apr 2020 11:10:15 +0200 Subject: [PATCH 27/79] Make spec work also on CentOS 8 Move some conditional requirements to be enabled just on Fedora. --- bind.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index ee7f5ff..f5e8686 100644 --- a/bind.spec +++ b/bind.spec @@ -17,7 +17,6 @@ %bcond_without DEVEL %bcond_without LMDB %bcond_without JSON -%bcond_without DNSTAP %bcond_with BDB # skip DLZ for now %bcond_without DLZ @@ -25,8 +24,10 @@ %bcond_without GEOIP2 %if 0%{?fedora} >= 28 %bcond_without UNITTEST +%bcond_without DNSTAP %else %bcond_with UNITTEST +%bcond_with DNSTAP %endif %bcond_with TSAN @@ -416,7 +417,7 @@ BuildArch: noarch This package provides a module which allows commands to be sent to rndc directly from Python programs. %prep -%if 0%{?fedora} +%if 0%{?gpgverify:1} # RHEL does not yet support this verification %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE0}' %endif From 1b133224fccfe9dbf531026c679ca599b2bd2cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 16 Apr 2020 11:39:29 +0200 Subject: [PATCH 28/79] Update to 9.16.2 Notes for BIND 9.16.2 Security Fixes DNS rebinding protection was ineffective when BIND 9 is configured as a forwarding DNS server. Found and responsibly reported by Tobias Klein. [GL #1574] Known Issues We have received reports that in some circumstances, receipt of an IXFR can cause the processing of queries to slow significantly. Some of these were related to RPZ processing, which has been fixed in this release (see below). Others appear to occur where there are NSEC3-related changes (such as an operator changing the NSEC3 salt used in the hash calculation). These are being investigated. [GL #1685] Feature Changes The previous DNSSEC sign statistics used lots of memory. The number of keys to track is reduced to four per zone, which should be enough for 99% of all signed zones. [GL #1179] Bug Fixes When an RPZ policy zone was updated via zone transfer and a large number of records was deleted, named could become nonresponsive for a short period while deleted names were removed from the RPZ summary database. This database cleanup is now done incrementally over a longer period of time, reducing such delays. [GL #1447] When trying to migrate an already-signed zone from auto-dnssec maintain to one based on dnssec-policy, the existing keys were immediately deleted and replaced with new ones. As the key rollover timing constraints were not being followed, it was possible that some clients would not have been able to validate responses until all old DNSSEC information had timed out from caches. BIND now looks at the time metadata of the existing keys and incorporates it into its DNSSEC policy operation. [GL #1706] --- .gitignore | 4 +++- bind-9.11-feature-test-named.patch | 6 +++--- bind-9.11-tests-variants.patch | 9 +++++---- bind-9.16-libisc-link.patch | 27 --------------------------- bind.spec | 16 ++++++++-------- sources | 4 ++-- 6 files changed, 21 insertions(+), 45 deletions(-) delete mode 100644 bind-9.16-libisc-link.patch diff --git a/.gitignore b/.gitignore index 6cad3d9..36cb37f 100644 --- a/.gitignore +++ b/.gitignore @@ -104,4 +104,6 @@ bind-9.7.2b1.tar.gz /bind-9.11.14.tar.gz /bind-9.11.14.tar.gz.asc /bind-9.16.1.tar.xz -/bind-9.16.1.tar.xz.asc \ No newline at end of file +/bind-9.16.1.tar.xz.asc +/bind-9.16.2.tar.xz +/bind-9.16.2.tar.xz.asc diff --git a/bind-9.11-feature-test-named.patch b/bind-9.11-feature-test-named.patch index 1c1e63d..c4bbe16 100644 --- a/bind-9.11-feature-test-named.patch +++ b/bind-9.11-feature-test-named.patch @@ -1,4 +1,4 @@ -From df27b2a23a195f844687c424a9117d4da14bc6dd Mon Sep 17 00:00:00 2001 +From 64f29512679fd00c89473d93d8b22017b018dd8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 30 Jan 2019 14:37:17 +0100 Subject: [PATCH] Create feature-test in source directory @@ -41,7 +41,7 @@ index dd25774..cb187e5 100644 docclean manclean maintainer-clean:: diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index 0d83fdf..be4123b 100644 +index 2317bd8..5015d5c 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -37,7 +37,7 @@ DELV=$TOP/bin/delv/delv @@ -51,8 +51,8 @@ index 0d83fdf..be4123b 100644 -FEATURETEST=$TOP/bin/tests/system/feature-test +FEATURETEST=$TOP/bin/named/feature-test FSTRM_CAPTURE=@FSTRM_CAPTURE@ + HOST=$TOP/bin/dig/host IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey - JOURNALPRINT=$TOP/bin/tools/named-journalprint -- 2.21.1 diff --git a/bind-9.11-tests-variants.patch b/bind-9.11-tests-variants.patch index 275f3cb..897691a 100644 --- a/bind-9.11-tests-variants.patch +++ b/bind-9.11-tests-variants.patch @@ -1,4 +1,4 @@ -From e706bb1dccf0b3492664c591f99f698a2a40fce7 Mon Sep 17 00:00:00 2001 +From 2faaad96a86614f2df13e65f3d3a31cc2d4155c0 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 1 Mar 2019 15:48:20 +0100 Subject: [PATCH] Make alternative named builds testable in system tests @@ -17,10 +17,10 @@ export NAMED_VARIANT=-pkcs11 DNSSEC_VARIANT=-pkcs11 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index 0f4ead0..e7831d8 100644 +index 5015d5c..331b728 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in -@@ -37,16 +37,16 @@ DDNSCONFGEN=$TOP/bin/confgen/ddns-confgen +@@ -36,17 +36,17 @@ DDNSCONFGEN=$TOP/bin/confgen/ddns-confgen DELV=$TOP/bin/delv/delv DIG=$TOP/bin/dig/dig DNSTAPREAD=$TOP/bin/tools/dnstap-read @@ -29,6 +29,7 @@ index 0f4ead0..e7831d8 100644 +DSFROMKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-dsfromkey${DNSSEC_VARIANT} +FEATURETEST=$TOP/bin/named${NAMED_VARIANT}/feature-test${NAMED_VARIANT} FSTRM_CAPTURE=@FSTRM_CAPTURE@ + HOST=$TOP/bin/dig/host -IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey +IMPORTKEY=$TOP/bin/dnssec${DNSSEC_VARIANT}/dnssec-importkey${DNSSEC_VARIANT} JOURNALPRINT=$TOP/bin/tools/named-journalprint @@ -60,5 +61,5 @@ index 0f4ead0..e7831d8 100644 VERIFY=$TOP/bin/dnssec/dnssec-verify WIRETEST=$TOP/bin/tests/wire_test -- -2.20.1 +2.21.1 diff --git a/bind-9.16-libisc-link.patch b/bind-9.16-libisc-link.patch deleted file mode 100644 index 35652df..0000000 --- a/bind-9.16-libisc-link.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 5ee0a7ace7588b986f41ac68f51b315fece69094 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Wed, 1 Apr 2020 14:28:42 +0200 -Subject: [PATCH] Link all required libraries to libisc - -It would fail to link -lisc without additional libraries, which should -not be required. ---- - lib/isc/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/isc/Makefile.in b/lib/isc/Makefile.in -index 1b6b4466cd..e9df8d1e17 100644 ---- a/lib/isc/Makefile.in -+++ b/lib/isc/Makefile.in -@@ -81,7 +81,7 @@ SRCS = pk11.c pk11_result.c \ - symtab.c task.c taskpool.c timer.c \ - tm.c version.c - --LIBS = ${OPENSSL_LIBS} @LIBS@ -+LIBS = ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} @LIBS@ - - # Note: the order of SUBDIRS is important. - # Attempt to disable parallel processing. --- -2.21.1 - diff --git a/bind.spec b/bind.spec index f5e8686..3568099 100644 --- a/bind.spec +++ b/bind.spec @@ -52,8 +52,8 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1601 -%global sover_isc 1601 +%global sover_dns 1602 +%global sover_isc 1602 %global sover_irs 1600 %global sover_isccfg 1600 @@ -61,8 +61,8 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.1 -Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Version: 9.16.2 +Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -121,8 +121,6 @@ Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch Patch172:bind-9.11-tests-pkcs11.patch -# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/3323 -Patch173:bind-9.16-libisc-link.patch Requires(post): systemd Requires(preun): systemd @@ -437,7 +435,6 @@ This package provides a module which allows commands to be sent to rndc directly %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant %patch172 -p1 -b .test-pkcs11 -%patch173 -p1 -b .link-isc %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 @@ -980,7 +977,7 @@ fi; %files libs %{_libdir}/libbind9.so.1600* %{_libdir}/libisccc.so.1600* -%{_libdir}/libns.so.1601* +%{_libdir}/libns.so.1602* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* @@ -1162,6 +1159,9 @@ fi; %changelog +* Thu Apr 16 2020 Petr Menšík - 32:9.16.2-1 +- Update to 9.16.2 + * Wed Apr 01 2020 Petr Menšík - 32:9.16.1-2 - Link all used libraries to libisc diff --git a/sources b/sources index e1955e4..863a695 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.1.tar.xz) = 9a1e8987f312b09a16c2ee0fd1d1eb8e4951b8dbcf3c0d51a1a1fb179a261028239ab2bebc3e559592cc766de57a26ba37b27621a0c5e1711d36c2416f0a0c26 -SHA512 (bind-9.16.1.tar.xz.asc) = fb9967033a0f8efbc05537ce4f3b315607ff06805b415303cf338afab303ca0f146a4d8049e7166971969b87064aa480a72c41d2c0ab1a8f3165e2049ccc4cb0 +SHA512 (bind-9.16.2.tar.xz) = fec47a0df6f91318504d57730148816ee19d7d14769d9c6f84ecd2ced9f575ea86bac2eac65886835aae99f7120495150a40923ee06a7755c6118ffb1f7f166f +SHA512 (bind-9.16.2.tar.xz.asc) = 854a5f2e82e491e74cfafb874f5cd614c9cb289e1c1bfae66ba37a881d7f8ee0acca99ff9aaddc118e8d52474121a81b627c475e432536cd99411c084479b69b From 1d9c1cf435894fbd19e440ed70c340256632bed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 16 Apr 2020 12:42:25 +0200 Subject: [PATCH 29/79] fixup! Make spec work also on CentOS 8 --- bind.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bind.spec b/bind.spec index 3568099..6d18835 100644 --- a/bind.spec +++ b/bind.spec @@ -15,7 +15,6 @@ # due to extensive changes to Makefiles %bcond_with PKCS11 %bcond_without DEVEL -%bcond_without LMDB %bcond_without JSON %bcond_with BDB # skip DLZ for now @@ -25,9 +24,11 @@ %if 0%{?fedora} >= 28 %bcond_without UNITTEST %bcond_without DNSTAP +%bcond_without LMDB %else %bcond_with UNITTEST %bcond_with DNSTAP +%bcond_with LMDB %endif %bcond_with TSAN From aaa1cdaabfb975fd8148639ed99c7776854ee59f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 24 Apr 2020 15:17:14 +0200 Subject: [PATCH 30/79] Update configuration to 9.16 Fixes warnings in default configuration file. Skip always enabled DNSSEC and use more recent trust anchor format. --- bind.spec | 5 ++++- named.conf | 1 - named.root.key | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index 6d18835..b2f8451 100644 --- a/bind.spec +++ b/bind.spec @@ -63,7 +63,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.2 -Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1160,6 +1160,9 @@ fi; %changelog +* Fri Apr 24 2020 Petr Menšík - 32:9.16.2-2 +- Remove warnings in default configuration + * Thu Apr 16 2020 Petr Menšík - 32:9.16.2-1 - Update to 9.16.2 diff --git a/named.conf b/named.conf index cea9782..c906875 100644 --- a/named.conf +++ b/named.conf @@ -30,7 +30,6 @@ options { */ recursion yes; - dnssec-enable yes; dnssec-validation yes; managed-keys-directory "/var/named/dynamic"; diff --git a/named.root.key b/named.root.key index 48449a8..647e1bd 100644 --- a/named.root.key +++ b/named.root.key @@ -1,4 +1,4 @@ -managed-keys { +trusted-anchors { # ROOT KEYS: See https://data.iana.org/root-anchors/root-anchors.xml # for current trust anchor information. # From 8b8d05ffc028047b879d72a5578106a75f4dd8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 27 Apr 2020 12:01:53 +0200 Subject: [PATCH 31/79] Update sample config to match current version --- bind.spec | 5 ++++- named.conf.sample | 51 +++++++++++++++++++---------------------------- named.root.key | 2 +- 3 files changed, 26 insertions(+), 32 deletions(-) diff --git a/bind.spec b/bind.spec index b2f8451..c45b2f1 100644 --- a/bind.spec +++ b/bind.spec @@ -63,7 +63,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.2 -Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1160,6 +1160,9 @@ fi; %changelog +* Mon Apr 27 2020 Petr Menšík - 32:9.16.2-3 +- Correct trust anchors + * Fri Apr 24 2020 Petr Menšík - 32:9.16.2-2 - Remove warnings in default configuration diff --git a/named.conf.sample b/named.conf.sample index a6cdc5e..d2ce6dd 100644 --- a/named.conf.sample +++ b/named.conf.sample @@ -63,10 +63,6 @@ options /* DNSSEC related options. See information about keys ("Trusted keys", bellow) */ - /* Enable serving of DNSSEC related data - enable on both authoritative - and recursive servers DNSSEC aware servers */ - dnssec-enable yes; - /* Enable DNSSEC validation on recursive servers */ dnssec-validation yes; @@ -182,8 +178,8 @@ view "internal" key ddns_key { - algorithm hmac-md5; - secret "use /usr/sbin/dnssec-keygen to generate TSIG keys"; + algorithm hmac-sha256; + secret "use /usr/sbin/ddns-confgen to generate TSIG keys"; }; view "external" @@ -214,39 +210,34 @@ view "external" /* Trusted keys This statement contains DNSSEC keys. If you want DNSSEC aware resolver you - have to configure at least one trusted key. + should configure at least one trusted key. Note that no key written below is valid. Especially root key because root zone is not signed yet. */ /* -trusted-keys { +trust-anchors { // Root Key -"." 257 3 3 "BNY4wrWM1nCfJ+CXd0rVXyYmobt7sEEfK3clRbGaTwSJxrGkxJWoZu6I7PzJu/ - E9gx4UC1zGAHlXKdE4zYIpRhaBKnvcC2U9mZhkdUpd1Vso/HAdjNe8LmMlnzY3 - zy2Xy4klWOADTPzSv9eamj8V18PHGjBLaVtYvk/ln5ZApjYghf+6fElrmLkdaz - MQ2OCnACR817DF4BBa7UR/beDHyp5iWTXWSi6XmoJLbG9Scqc7l70KDqlvXR3M - /lUUVRbkeg1IPJSidmK3ZyCllh4XSKbje/45SKucHgnwU5jefMtq66gKodQj+M - iA21AfUVe7u99WzTLzY3qlxDhxYQQ20FQ97S+LKUTpQcq27R7AT3/V5hRQxScI - Nqwcz4jYqZD2fQdgxbcDTClU0CRBdiieyLMNzXG3"; +. initial-key 257 3 8 "AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3 + +/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kv + ArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF + 0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+e + oZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfd + RUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwN + R1AkUTV74bU="; // Key for forward zone -example.com. 257 3 5 "AwEAAaxPMcR2x0HbQV4WeZB6oEDX+r0QM65KbhTjrW1ZaARmPhEZZe - 3Y9ifgEuq7vZ/zGZUdEGNWy+JZzus0lUptwgjGwhUS1558Hb4JKUbb - OTcM8pwXlj0EiX3oDFVmjHO444gLkBO UKUf/mC7HvfwYH/Be22GnC - lrinKJp1Og4ywzO9WglMk7jbfW33gUKvirTHr25GL7STQUzBb5Usxt - 8lgnyTUHs1t3JwCY5hKZ6CqFxmAVZP20igTixin/1LcrgX/KMEGd/b - iuvF4qJCyduieHukuY3H4XMAcR+xia2 nIUPvm/oyWR8BW/hWdzOvn - SCThlHf3xiYleDbt/o1OTQ09A0="; +example.com. static-key 257 3 8 "AwEAAZ0aqu1rJ6orJynrRfNpPmayJZoAx9Ic2/Rl9VQW + LMHyjxxem3VUSoNUIFXERQbj0A9Ogp0zDM9YIccKLRd6 + LmWiDCt7UJQxVdD+heb5Ec4qlqGmyX9MDabkvX2NvMws + UecbYBq8oXeTT9LRmCUt9KUt/WOi6DKECxoG/bWTykrX + yBR8elD+SQY43OAVjlWrVltHxgp4/rhBCvRbmdflunaP + Igu27eE2U4myDSLT8a4A0rB5uHG4PkOa9dIRs9y00M2m + Wf4lyPee7vi5few2dbayHXmieGcaAHrx76NGAABeY393 + xjlmDNcUkF1gpNWUla4fWZbbaYQzA93mLdrng+M="; + // Key for reverse zone. -2.0.192.IN-ADDRPA.NET. 257 3 5 "AQOnS4xn/IgOUpBPJ3bogzwcxOdNax071L18QqZnQQQA - VVr+iLhGTnNGp3HoWQLUIzKrJVZ3zggy3WwNT6kZo6c0 - tszYqbtvchmgQC8CzKojM/W16i6MG/ea fGU3siaOdS0 - yOI6BgPsw+YZdzlYMaIJGf4M4dyoKIhzdZyQ2bYQrjyQ - 4LB0lC7aOnsMyYKHHYeRv PxjIQXmdqgOJGq+vsevG06 - zW+1xgYJh9rCIfnm1GX/KMgxLPG2vXTD/RnLX+D3T3UL - 7HJYHJhAZD5L59VvjSPsZJHeDCUyWYrvPZesZDIRvhDD - 52SKvbheeTJUm6EhkzytNN2SN96QRk8j/iI8ib"; +2.0.192.IN-ADDRPA.NET. initial-ds 31406 8 2 "F78CF3344F72137235098ECBBD08947C2C9001C7F6A085A17F518B5D8F6B916D"; }; */ diff --git a/named.root.key b/named.root.key index 647e1bd..e76a698 100644 --- a/named.root.key +++ b/named.root.key @@ -1,4 +1,4 @@ -trusted-anchors { +trust-anchors { # ROOT KEYS: See https://data.iana.org/root-anchors/root-anchors.xml # for current trust anchor information. # From 3ef9cd3dce339bd1cc54f3f8e382ebb29f4a3206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 27 Apr 2020 12:21:58 +0200 Subject: [PATCH 32/79] Replace initial key with just digest of it Mentioned link if a file leads to XML with only checksums included. Relation between them and included key is not obvious or specified. Include initial digest, which is shorter and easier to validate. --- named.root.key | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/named.root.key b/named.root.key index e76a698..fbcb5d3 100644 --- a/named.root.key +++ b/named.root.key @@ -9,11 +9,5 @@ trust-anchors { # file as initializing keys; thereafter, the keys in the # managed key database will be trusted and maintained # automatically. - . initial-key 257 3 8 "AwEAAaz/tAm8yTn4Mfeh5eyI96WSVexTBAvkMgJzkKTOiW1vkIbzxeF3 - +/4RgWOq7HrxRixHlFlExOLAJr5emLvN7SWXgnLh4+B5xQlNVz8Og8kv - ArMtNROxVQuCaSnIDdD5LKyWbRd2n9WGe2R8PzgCmr3EgVLrjyBxWezF - 0jLHwVN8efS3rCj/EWgvIWgb9tarpVUDK/b58Da+sqqls3eNbuv7pr+e - oZG+SrDK6nWeL3c6H5Apxz7LjVc1uTIdsIXxuOLYA4/ilBmSVIzuDWfd - RUfhHdY6+cn8HFRm+2hM8AnXGXws9555KrUB5qihylGa8subX2Nn6UwN - R1AkUTV74bU="; + . initial-ds 20326 8 2 "E06D44B80B8F1D39A95C0B0D7C65D08458E880409BBC683457104237C7F8EC8D"; }; From afbbd0be5277063c24da197f42561380f1f88d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 27 Apr 2020 21:59:25 +0200 Subject: [PATCH 33/79] Add support to native PKCS11 Set of patches and changes, that fixes compilation of native PKCS11 support as subpackage. Moves definition of USE_PKCS11 from config.h to Makefiles. Defaults to off and only PKCS11 subdirectories set it to true. --- bind-9.10-dist-native-pkcs11.patch | 253 +++++++++++------------------ bind-9.11-engine-pkcs11.patch | 27 --- bind-9.14-config-pkcs11.patch | 102 ++---------- bind.spec | 9 +- 4 files changed, 114 insertions(+), 277 deletions(-) delete mode 100644 bind-9.11-engine-pkcs11.patch diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index c1b479a..b623f58 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -12,7 +12,7 @@ index 9ad7f62..094775a 100644 TARGETS = diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index 1e0fe0e..dc3a7f6 100644 +index ef3e70c..1f5165a 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ @@ -23,62 +23,56 @@ index 1e0fe0e..dc3a7f6 100644 +CDEFINES = CWARNINGS = - ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ -diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in -index 2317ec0..0601939 100644 ---- a/bin/dig/Makefile.in -+++ b/bin/dig/Makefile.in -@@ -21,7 +21,7 @@ CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \ - ${BIND9_INCLUDES} ${ISC_INCLUDES} \ - ${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@ - --CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ -+CDEFINES = -DVERSION=\"${VERSION}\" - CWARNINGS = - ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index 1dad340..ffac64e 100644 +index 7486bf0..7d791d1 100644 --- a/bin/dnssec-pkcs11/Makefile.in +++ b/bin/dnssec-pkcs11/Makefile.in -@@ -15,16 +15,16 @@ VERSION=@BIND9_VERSION@ +@@ -15,18 +15,18 @@ VERSION=@BIND9_VERSION@ @BIND9_MAKE_INCLUDES@ --CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ -+CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ +-CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \ ++CINCLUDES = ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} ${ISCCFG_INCLUDES} \ + ${OPENSSL_CFLAGS} - CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ +-CDEFINES = -DVERSION=\"${VERSION}\" -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\" ++CDEFINES = -DVERSION=\"${VERSION}\" -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\" -DUSE_PKCS11=1 CWARNINGS = -DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ - ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ - ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ + ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ + ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} -DNSDEPLIBS = ../../lib/dns/libdns.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ISCDEPLIBS = ../../lib/isc/libisc.@A@ + ISCCFGDEPLIBS = ../../lib/isccfg/libisccfg.@A@ - DEPLIBS = ${DNSDEPLIBS} ${ISCDEPLIBS} -@@ -34,11 +34,11 @@ LIBS = ${DNSLIBS} ${ISCLIBS} @LIBS@ - NOSYMLIBS = ${DNSLIBS} ${ISCNOSYMLIBS} @LIBS@ +@@ -36,12 +36,15 @@ LIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCLIBS} @LIBS@ + NOSYMLIBS = ${DNSLIBS} ${ISCCFGLIBS} ${ISCNOSYMLIBS} @LIBS@ + ++# Add suffix to all targets ++EXEEXT = -pkcs11@EXEEXT@ ++ # Alphabetically -TARGETS = dnssec-cds@EXEEXT@ dnssec-dsfromkey@EXEEXT@ \ - dnssec-importkey@EXEEXT@ dnssec-keyfromlabel@EXEEXT@ \ - dnssec-keygen@EXEEXT@ dnssec-revoke@EXEEXT@ \ - dnssec-settime@EXEEXT@ dnssec-signzone@EXEEXT@ \ - dnssec-verify@EXEEXT@ -+TARGETS = dnssec-cds-pkcs11@EXEEXT@ dnssec-dsfromkey-pkcs11@EXEEXT@ \ -+ dnssec-importkey-pkcs11@EXEEXT@ dnssec-keyfromlabel-pkcs11@EXEEXT@ \ -+ dnssec-keygen-pkcs11@EXEEXT@ dnssec-revoke-pkcs11@EXEEXT@ \ -+ dnssec-settime-pkcs11@EXEEXT@ dnssec-signzone-pkcs11@EXEEXT@ \ -+ dnssec-verify-pkcs11@EXEEXT@ ++TARGETS = dnssec-cds${EXEEXT} dnssec-dsfromkey${EXEEXT} \ ++ dnssec-importkey${EXEEXT} dnssec-keyfromlabel${EXEEXT} \ ++ dnssec-keygen${EXEEXT} dnssec-revoke${EXEEXT} \ ++ dnssec-settime${EXEEXT} dnssec-signzone${EXEEXT} \ ++ dnssec-verify${EXEEXT} OBJS = dnssectool.@O@ -@@ -61,19 +61,19 @@ MANOBJS = ${MANPAGES} ${HTMLPAGES} +@@ -64,19 +67,19 @@ MANOBJS = ${MANPAGES} ${HTMLPAGES} @BIND9_MAKE_RULES@ @@ -102,7 +96,7 @@ index 1dad340..ffac64e 100644 export BASEOBJS="dnssec-keygen.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -81,7 +81,7 @@ dnssec-signzone.@O@: dnssec-signzone.c +@@ -84,7 +87,7 @@ dnssec-signzone.@O@: dnssec-signzone.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-signzone.c @@ -111,7 +105,7 @@ index 1dad340..ffac64e 100644 export BASEOBJS="dnssec-signzone.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -89,19 +89,19 @@ dnssec-verify.@O@: dnssec-verify.c +@@ -92,19 +95,19 @@ dnssec-verify.@O@: dnssec-verify.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-verify.c @@ -135,7 +129,7 @@ index 1dad340..ffac64e 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ dnssec-importkey.@O@ ${OBJS} ${LIBS} -@@ -112,16 +112,14 @@ docclean manclean maintainer-clean:: +@@ -115,16 +118,14 @@ docclean manclean maintainer-clean:: installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} @@ -153,33 +147,36 @@ index 1dad340..ffac64e 100644 for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done clean distclean:: -diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in -index 1dad340..321058b 100644 ---- a/bin/dnssec/Makefile.in -+++ b/bin/dnssec/Makefile.in -@@ -17,7 +17,7 @@ VERSION=@BIND9_VERSION@ - - CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ - --CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ -+CDEFINES = -DVERSION=\"${VERSION}\" - CWARNINGS = - - DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index e5b0d4b..b739869 100644 +index cb187e5..1bcb249 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in -@@ -43,7 +43,7 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ - DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ +@@ -37,13 +37,14 @@ DBDRIVER_LIBS = + + DLZ_DRIVER_DIR = ${top_srcdir}/contrib/dlz/drivers + +-DLZDRIVER_OBJS = @DLZ_DRIVER_OBJS@ +-DLZDRIVER_SRCS = @DLZ_DRIVER_SRCS@ +-DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@ +-DLZDRIVER_LIBS = @DLZ_DRIVER_LIBS@ ++# Skip building on PKCS11 variant ++DLZDRIVER_OBJS = ++DLZDRIVER_SRCS = ++DLZDRIVER_INCLUDES = ++DLZDRIVER_LIBS = CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${NS_INCLUDES} ${DNS_INCLUDES} \ + ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} \ ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ - ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ -@@ -53,37 +53,37 @@ CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ + ${DBDRIVER_INCLUDES} \ +@@ -53,24 +54,24 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ + ${MAXMINDDB_CFLAGS} \ + ${ZLIB_CFLAGS} + +-CDEFINES = @CONTRIB_DLZ@ ++CDEFINES = CWARNINGS = @@ -187,8 +184,8 @@ index e5b0d4b..b739869 100644 +DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCLIBS = ../../lib/isccc/libisccc.@A@ - ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ - ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @OPENSSL_LIBS@ + ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} BIND9LIBS = ../../lib/bind9/libbind9.@A@ -NSLIBS = ../../lib/ns/libns.@A@ +NSLIBS = ../../lib/ns-pkcs11/libns-pkcs11.@A@ @@ -204,47 +201,16 @@ index e5b0d4b..b739869 100644 DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS} - - LIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \ -+ @LIBCAP_LIBS@ \ - @LIBS@ - - NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ - ${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \ -- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBCAP_LIBS@ \ -+ @LIBCAP_LIBS@ \ - @LIBS@ +@@ -87,7 +88,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix -TARGETS = named@EXEEXT@ feature-test@EXEEXT@ +TARGETS = named-pkcs11@EXEEXT@ feature-test-pkcs11@EXEEXT@ - GEOIPLINKOBJS = geoip.@O@ GEOIP2LINKOBJS = geoip.@O@ -@@ -93,8 +93,7 @@ OBJS = builtin.@O@ config.@O@ control.@O@ \ - @GEOIPLINKOBJS@ @GEOIP2LINKOBJS@ \ - log.@O@ logconf.@O@ main.@O@ \ - server.@O@ statschannel.@O@ \ -- tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ \ -- ${DLZDRIVER_OBJS} ${DBDRIVER_OBJS} -+ tkeyconf.@O@ tsigconf.@O@ zoneconf.@O@ - UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@ - -@@ -108,8 +107,7 @@ SRCS = builtin.c config.c control.c \ - @GEOIPLINKSRCS@ @GEOIP2LINKSRCS@ \ - log.c logconf.c main.c \ - server.c statschannel.c \ -- tkeyconf.c tsigconf.c zoneconf.c \ -- ${DLZDRIVER_SRCS} ${DBDRIVER_SRCS} -+ tkeyconf.c tsigconf.c zoneconf.c - - MANPAGES = named.8 named.conf.5 - -@@ -149,7 +147,7 @@ server.@O@: server.c +@@ -151,7 +152,7 @@ server.@O@: server.c -DPRODUCT=\"${PRODUCT}\" \ -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c @@ -253,7 +219,7 @@ index e5b0d4b..b739869 100644 export MAKE_SYMTABLE="yes"; \ export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} -@@ -159,7 +157,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c +@@ -161,7 +162,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -c ${top_srcdir}/bin/tests/system/feature-test.c @@ -262,7 +228,7 @@ index e5b0d4b..b739869 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} -@@ -192,13 +190,13 @@ install-man8: named.8 +@@ -194,13 +195,13 @@ install-man8: named.8 install-man: install-man5 install-man8 @@ -279,24 +245,11 @@ index e5b0d4b..b739869 100644 @DLZ_DRIVER_RULES@ -diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index e5b0d4b..eecfa76 100644 ---- a/bin/named/Makefile.in -+++ b/bin/named/Makefile.in -@@ -49,7 +49,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ - --CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ -+CDEFINES = @CONTRIB_DLZ@ - - CWARNINGS = - diff --git a/configure.ac b/configure.ac -index 6cce3bb..d80ae31 100644 +index de6a248..e95ef36 100644 --- a/configure.ac +++ b/configure.ac -@@ -1276,12 +1276,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1196,12 +1196,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" @@ -311,7 +264,7 @@ index 6cce3bb..d80ae31 100644 # # was --with-lmdb specified? -@@ -2522,6 +2524,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) +@@ -2296,6 +2298,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) AC_SUBST(BIND9_NS_BUILDINCLUDE) AC_SUBST(BIND9_BIND9_BUILDINCLUDE) AC_SUBST(BIND9_IRS_BUILDINCLUDE) @@ -320,7 +273,7 @@ index 6cce3bb..d80ae31 100644 if test "X$srcdir" != "X"; then BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" -@@ -2530,6 +2534,8 @@ if test "X$srcdir" != "X"; then +@@ -2304,6 +2308,8 @@ if test "X$srcdir" != "X"; then BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" @@ -329,7 +282,7 @@ index 6cce3bb..d80ae31 100644 else BIND9_ISC_BUILDINCLUDE="" BIND9_ISCCC_BUILDINCLUDE="" -@@ -2538,6 +2544,8 @@ else +@@ -2312,6 +2318,8 @@ else BIND9_NS_BUILDINCLUDE="" BIND9_BIND9_BUILDINCLUDE="" BIND9_IRS_BUILDINCLUDE="" @@ -338,7 +291,7 @@ index 6cce3bb..d80ae31 100644 fi AC_SUBST_FILE(BIND9_MAKE_INCLUDES) -@@ -3001,8 +3009,11 @@ AC_CONFIG_FILES([ +@@ -2771,8 +2779,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile @@ -350,7 +303,7 @@ index 6cce3bb..d80ae31 100644 bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile -@@ -3075,6 +3086,10 @@ AC_CONFIG_FILES([ +@@ -2843,6 +2854,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -361,7 +314,7 @@ index 6cce3bb..d80ae31 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -3107,6 +3122,10 @@ AC_CONFIG_FILES([ +@@ -2875,6 +2890,10 @@ AC_CONFIG_FILES([ lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile @@ -371,7 +324,7 @@ index 6cce3bb..d80ae31 100644 + lib/ns-pkcs11/tests/Makefile lib/samples/Makefile lib/samples/Makefile-postinstall - unit/unittest.sh + make/Makefile diff --git a/lib/Makefile.in b/lib/Makefile.in index ffa2d5a..6fbc192 100644 --- a/lib/Makefile.in @@ -386,24 +339,27 @@ index ffa2d5a..6fbc192 100644 @BIND9_MAKE_RULES@ diff --git a/lib/dns-pkcs11/Makefile.in b/lib/dns-pkcs11/Makefile.in -index 9125b10..593270d 100644 +index 0ef3b5f..80683c2 100644 --- a/lib/dns-pkcs11/Makefile.in +++ b/lib/dns-pkcs11/Makefile.in -@@ -26,11 +26,11 @@ VERSION=@BIND9_VERSION@ +@@ -26,14 +26,14 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ -CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ +CINCLUDES = -I. -I${top_srcdir}/lib/dns-pkcs11 -Iinclude ${DNS_PKCS11_INCLUDES} \ - ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + ${ISC_INCLUDES} \ + ${OPENSSL_CFLAGS} @DST_GSSAPI_INC@ \ + ${JSON_C_CFLAGS} \ + ${LIBXML2_CFLAGS} \ + ${MAXMINDDB_CFLAGS} --CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ -+CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_PKCS11@ -DUSE_OPENSSL=0 +-CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} ++CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_PKCS11@ CWARNINGS = -@@ -138,15 +138,15 @@ version.@O@: version.c +@@ -139,15 +139,15 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -423,7 +379,7 @@ index 9125b10..593270d 100644 include: gen ${MAKE} include/dns/enumtype.h -@@ -177,22 +177,22 @@ gen: gen.c +@@ -178,22 +178,22 @@ gen: gen.c ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \ ${BUILD_LIBS} ${LFS_LIBS} @@ -452,7 +408,7 @@ index 9125b10..593270d 100644 rm -f include/dns/rdatastruct.h rm -f dnstap.pb-c.c dnstap.pb-c.h diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index 0e91523..9351c3f 100644 +index fd8ebb9..9384a4f 100644 --- a/lib/dns-pkcs11/tests/Makefile.in +++ b/lib/dns-pkcs11/tests/Makefile.in @@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ @@ -461,11 +417,11 @@ index 0e91523..9351c3f 100644 -CINCLUDES = -I. -Iinclude ${DNS_INCLUDES} ${ISC_INCLUDES} \ +CINCLUDES = -I. -Iinclude ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ - @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ + ${OPENSSL_CFLAGS} ${MAXMINDDB_CFLAGS} @CMOCKA_CFLAGS@ -CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\"" +CDEFINES = @USE_PKCS11@ -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" - ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ + ISCLIBS = ../../isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} ISCDEPLIBS = ../../isc/libisc.@A@ -DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -DNSDEPLIBS = ../libdns.@A@ @@ -474,24 +430,11 @@ index 0e91523..9351c3f 100644 LIBS = @LIBS@ @CMOCKA_LIBS@ -diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in -index 9125b10..70644d8 100644 ---- a/lib/dns/Makefile.in -+++ b/lib/dns/Makefile.in -@@ -30,7 +30,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ - ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ - --CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ -+CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ - - CWARNINGS = - diff --git a/lib/ns-pkcs11/Makefile.in b/lib/ns-pkcs11/Makefile.in -index 58d731a..47b4b98 100644 +index 97aaaf6..c7ffc7b 100644 --- a/lib/ns-pkcs11/Makefile.in +++ b/lib/ns-pkcs11/Makefile.in -@@ -20,8 +20,8 @@ VERSION=@BIND9_VERSION@ +@@ -20,11 +20,11 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ @@ -499,10 +442,14 @@ index 58d731a..47b4b98 100644 - ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ +CINCLUDES = -I. -I${top_srcdir}/lib/ns-pkcs11 -Iinclude \ + ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ + ${OPENSSL_CFLAGS} @DST_GSSAPI_INC@ - CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" -@@ -32,9 +32,9 @@ ISCLIBS = ../../lib/isc/libisc.@A@ @OPENSSL_LIBS@ +-CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" ++CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" + + CWARNINGS = + +@@ -32,9 +32,9 @@ ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS ISCDEPLIBS = ../../lib/isc/libisc.@A@ @@ -552,20 +499,21 @@ index 58d731a..47b4b98 100644 - rm -f libns.@A@ timestamp + rm -f libns-pkcs11.@A@ timestamp diff --git a/lib/ns-pkcs11/tests/Makefile.in b/lib/ns-pkcs11/tests/Makefile.in -index ffd8f41..4a6cb1b 100644 +index 70c77a4..87955a7 100644 --- a/lib/ns-pkcs11/tests/Makefile.in +++ b/lib/ns-pkcs11/tests/Makefile.in -@@ -15,16 +15,16 @@ VERSION=@BIND9_VERSION@ - - @BIND9_MAKE_INCLUDES@ +@@ -21,17 +21,17 @@ WRAP_NAME = -Wl,-install_name,${top_builddir}/lib/ns/tests/$@ + WRAP_RPATH = -Wl,-rpath,${top_builddir}/lib/ns/tests + WRAP_LIB = -L${top_builddir}/lib/ns/tests -lwrap -CINCLUDES = -I. -Iinclude ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ +CINCLUDES = -I. -Iinclude ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ - @OPENSSL_INCLUDES@ @CMOCKA_CFLAGS@ + ${OPENSSL_CFLAGS} \ + @CMOCKA_CFLAGS@ -CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" -+CDEFINES = @USE_PKCS11@ -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" ++CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" @USE_PKCS11@ - ISCLIBS = ../../isc/libisc.@A@ @OPENSSL_LIBS@ + ISCLIBS = ../../isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} ISCDEPLIBS = ../../isc/libisc.@A@ -DNSLIBS = ../../dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -DNSDEPLIBS = ../../dns/libdns.@A@ @@ -578,19 +526,6 @@ index ffd8f41..4a6cb1b 100644 LIBS = @LIBS@ @CMOCKA_LIBS@ -diff --git a/lib/ns/Makefile.in b/lib/ns/Makefile.in -index 58d731a..a14728d 100644 ---- a/lib/ns/Makefile.in -+++ b/lib/ns/Makefile.in -@@ -24,7 +24,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/ns -Iinclude \ - ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ - --CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" -+CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" - - CWARNINGS = - diff --git a/make/includes.in b/make/includes.in index 48cdaf7..7b17738 100644 --- a/make/includes.in diff --git a/bind-9.11-engine-pkcs11.patch b/bind-9.11-engine-pkcs11.patch deleted file mode 100644 index 4a6290d..0000000 --- a/bind-9.11-engine-pkcs11.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 37f89ccfc439f8d86c401d9ae10e94e53b924961 Mon Sep 17 00:00:00 2001 -From: Petr Mensik -Date: Tue, 27 Aug 2019 20:39:59 +0200 -Subject: [PATCH] Do not set engine for native PKCS11 - -It resets already set lib_path to pkcs11, which is invalid in native -pkcs11 crypto. Engine has to be path to PKCS#11 module. ---- - bin/named/include/named/globals.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h -index eda2214..2a611d5 100644 ---- a/bin/named/include/named/globals.h -+++ b/bin/named/include/named/globals.h -@@ -160,7 +160,7 @@ EXTERN const char * ns_g_defaultdnstap INIT(NULL); - - EXTERN const char * ns_g_username INIT(NULL); - --#if defined(USE_PKCS11) -+#if defined(USE_PKCS11) && !defined(PKCS11CRYPTO) - EXTERN const char * ns_g_engine INIT(PKCS11_ENGINE); - #else - EXTERN const char * ns_g_engine INIT(NULL); --- -2.20.1 - diff --git a/bind-9.14-config-pkcs11.patch b/bind-9.14-config-pkcs11.patch index cf73a1c..a71d772 100644 --- a/bind-9.14-config-pkcs11.patch +++ b/bind-9.14-config-pkcs11.patch @@ -1,4 +1,4 @@ -From 233d3784d04bee37b772f391da8726f0cd7b223e Mon Sep 17 00:00:00 2001 +From 2d8abd838870b58629ce55df411b6ba1b2c7288f Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 18 Oct 2019 21:30:52 +0200 Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h @@ -8,17 +8,12 @@ USE_PKCS11 on part of build. That is not possible with config.h value. Move it as normal define to CDEFINES. --- bin/confgen/Makefile.in | 2 +- - bin/dig/Makefile.in | 2 +- - bin/dnssec/Makefile.in | 2 +- - bin/named/Makefile.in | 2 +- configure.ac | 8 ++++++-- - lib/dns/Makefile.in | 2 +- lib/dns/dst_internal.h | 12 +++++++++--- - lib/ns/Makefile.in | 2 +- - 8 files changed, 21 insertions(+), 11 deletions(-) + 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index dc3a7f6..1e0fe0e 100644 +index 1f5165a..ef3e70c 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ @@ -30,50 +25,11 @@ index dc3a7f6..1e0fe0e 100644 CWARNINGS = ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ -diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in -index 0601939..2317ec0 100644 ---- a/bin/dig/Makefile.in -+++ b/bin/dig/Makefile.in -@@ -21,7 +21,7 @@ CINCLUDES = -I${srcdir}/include ${DNS_INCLUDES} \ - ${BIND9_INCLUDES} ${ISC_INCLUDES} \ - ${IRS_INCLUDES} ${ISCCFG_INCLUDES} @LIBIDN2_CFLAGS@ @OPENSSL_INCLUDES@ - --CDEFINES = -DVERSION=\"${VERSION}\" -+CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ - CWARNINGS = - - ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ -diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in -index 321058b..1dad340 100644 ---- a/bin/dnssec/Makefile.in -+++ b/bin/dnssec/Makefile.in -@@ -17,7 +17,7 @@ VERSION=@BIND9_VERSION@ - - CINCLUDES = ${DNS_INCLUDES} ${ISC_INCLUDES} @OPENSSL_INCLUDES@ - --CDEFINES = -DVERSION=\"${VERSION}\" -+CDEFINES = -DVERSION=\"${VERSION}\" @USE_PKCS11@ - CWARNINGS = - - DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index eecfa76..e5b0d4b 100644 ---- a/bin/named/Makefile.in -+++ b/bin/named/Makefile.in -@@ -49,7 +49,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${DBDRIVER_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ - --CDEFINES = @CONTRIB_DLZ@ -+CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ - - CWARNINGS = - diff --git a/configure.ac b/configure.ac -index 80039b7..6cce3bb 100644 +index c69bc37..de6a248 100644 --- a/configure.ac +++ b/configure.ac -@@ -963,9 +963,13 @@ AS_CASE([$enable_native_pkcs11], +@@ -883,9 +883,13 @@ AS_CASE([$enable_native_pkcs11], AC_SUBST([PKCS11_TEST]) AC_SUBST([PKCS11_TOOLS]) @@ -89,64 +45,38 @@ index 80039b7..6cce3bb 100644 # preparation for automake # AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"]) -diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in -index 60c87a8..9125b10 100644 ---- a/lib/dns/Makefile.in -+++ b/lib/dns/Makefile.in -@@ -30,7 +30,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ - ${ISC_INCLUDES} ${MAXMINDDB_CFLAGS} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ - --CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} -+CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @USE_OPENSSL@ @USE_PKCS11@ - - CWARNINGS = - diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h -index bfa28f0..d3ff613 100644 +index bce2a9f..ef9d045 100644 --- a/lib/dns/dst_internal.h +++ b/lib/dns/dst_internal.h -@@ -40,6 +40,13 @@ +@@ -38,6 +38,13 @@ #include - #include + #include -+#ifndef USE_OPENSSL -+#define USE_OPENSSL 1 -+#endif +#ifndef USE_PKCS11 +#define USE_PKCS11 0 +#endif ++#ifndef USE_OPENSSL ++#define USE_OPENSSL (! USE_PKCS11) ++#endif + #if USE_PKCS11 #include #include -@@ -99,11 +106,10 @@ struct dst_key { +@@ -98,11 +105,10 @@ struct dst_key { void *generic; gss_ctx_id_t gssctx; DH *dh; -#if USE_OPENSSL - EVP_PKEY *pkey; --#endif +-#endif /* if USE_OPENSSL */ #if USE_PKCS11 pk11_object_t *pkey; +#else + EVP_PKEY *pkey; - #endif + #endif /* if USE_PKCS11 */ dst_hmac_key_t *hmac_key; - } keydata; /*%< pointer to key in crypto pkg fmt */ -diff --git a/lib/ns/Makefile.in b/lib/ns/Makefile.in -index a14728d..58d731a 100644 ---- a/lib/ns/Makefile.in -+++ b/lib/ns/Makefile.in -@@ -24,7 +24,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/ns -Iinclude \ - ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ - @OPENSSL_INCLUDES@ @DST_GSSAPI_INC@ - --CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" -+CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" - - CWARNINGS = - + } keydata; /*%< pointer to key in crypto pkg fmt */ -- -2.20.1 +2.21.1 diff --git a/bind.spec b/bind.spec index c45b2f1..bf11fcf 100644 --- a/bind.spec +++ b/bind.spec @@ -57,6 +57,7 @@ %global sover_isc 1602 %global sover_irs 1600 %global sover_isccfg 1600 +%global sover_ns 1602 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server @@ -115,7 +116,6 @@ Patch149:bind-9.11-kyua-pkcs11.patch Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch # Avoid conflicts with OpenSSL PKCS11 engine -Patch150:bind-9.11-engine-pkcs11.patch Patch154:bind-9.11-oot-manual.patch Patch157:bind-9.11-fips-tests.patch Patch164:bind-9.11-rh1666814.patch @@ -445,7 +445,6 @@ cp -r lib/dns{,-pkcs11} cp -r lib/ns{,-pkcs11} %patch136 -p1 -b .dist_pkcs11 %patch149 -p1 -b .kyua-pkcs11 -%patch150 -p1 -b .engine-pkcs11 %endif %patch133 -p1 -b .rh640538 @@ -978,7 +977,7 @@ fi; %files libs %{_libdir}/libbind9.so.1600* %{_libdir}/libisccc.so.1600* -%{_libdir}/libns.so.1602* +%{_libdir}/libns.so.%{sover_ns}* %files libs-lite %{_libdir}/libdns.so.%{sover_dns}* @@ -1113,14 +1112,14 @@ fi; %files pkcs11-libs %{_libdir}/libdns-pkcs11.so.%{sover_dns}* -%{_libdir}/libisc-pkcs11.so.%{sover_isc}* +%{_libdir}/libns-pkcs11.so.%{sover_ns}* %files pkcs11-devel %{_includedir}/bind9/pk11/*.h %exclude %{_includedir}/bind9/pk11/site.h %{_includedir}/bind9/pkcs11 %{_libdir}/libdns-pkcs11.so -%{_libdir}/libisc-pkcs11.so +%{_libdir}/libns-pkcs11.so %endif %if %{with DLZ} && %{with BDB} From 40861268f35becf171fb4c636c3285cb34fe5e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 27 Apr 2020 22:22:47 +0200 Subject: [PATCH 34/79] Enable native PKCS11 build again It was disabled because patches were not fixed. It compiles now, try it. --- bind.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index bf11fcf..2f216cf 100644 --- a/bind.spec +++ b/bind.spec @@ -13,7 +13,7 @@ %bcond_without GSSTSIG # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles -%bcond_with PKCS11 +%bcond_without PKCS11 %bcond_without DEVEL %bcond_without JSON %bcond_with BDB @@ -64,7 +64,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.2 -Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 4%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1159,6 +1159,9 @@ fi; %changelog +* Mon Apr 27 2020 Petr Menšík - 32:9.16.2-4 +- Enable PKCS#11 builds again + * Mon Apr 27 2020 Petr Menšík - 32:9.16.2-3 - Correct trust anchors From 775befed48991de698562ea14370924e367f0c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 28 Apr 2020 10:18:03 +0200 Subject: [PATCH 35/79] Try successful build on epel8 softhsm is not provided on RHEL 8 as normal package. It is distributed only in idm:DL1 module. If unittest or systemtest is not enabled, skip configuring softhsm. It would not be used anyway. --- bind.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index 2f216cf..0161355 100644 --- a/bind.spec +++ b/bind.spec @@ -166,7 +166,7 @@ BuildRequires: libdb-devel # make unit dependencies BuildRequires: libcmocka-devel kyua %endif -%if %{with PKCS11} +%if %{with PKCS11} && (%{with UNITTEST} || %{with SYSTEMTEST}) BuildRequires: softhsm %endif %if %{with SYSTEMTEST} @@ -597,7 +597,7 @@ popd # build %systemtest_prepare_build build %check -%if %{with PKCS11} +%if %{with PKCS11} && (%{with UNITTEST} || %{with SYSTEMTEST}) # Tests require initialization of pkcs11 token eval "$(bash %{SOURCE48} -A "`pwd`/softhsm-tokens")" %endif From 8ad137901985d39db0b44edf367ad07826139b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 11 May 2020 18:09:54 +0200 Subject: [PATCH 36/79] Do not request use of urandom and report failure Original script did not report failure as exit status. Report error if rndc key generation failed also by exit status, not only by failed message. -r parameter is unsupported now, do not require it anymore. --- generate-rndc-key.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate-rndc-key.sh b/generate-rndc-key.sh index dde7f70..1ba0004 100755 --- a/generate-rndc-key.sh +++ b/generate-rndc-key.sh @@ -6,7 +6,7 @@ if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then echo -n $"Generating /etc/rndc.key:" - if /usr/sbin/rndc-confgen -a -A hmac-sha256 -r /dev/urandom > /dev/null 2>&1 + if /usr/sbin/rndc-confgen -a -A hmac-sha256 > /dev/null 2>&1 then chmod 640 /etc/rndc.key chown root:named /etc/rndc.key @@ -16,5 +16,6 @@ if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then else failure $"/etc/rndc.key generation" echo + exit 1 fi fi From 7fe31e189255cf58dcbdad511d1573419013b93f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 20 May 2020 13:25:26 +0200 Subject: [PATCH 37/79] Update to 9.16.3 Changes some solib versions and fixes two important CVEs: CVE-2020-8616 CVE-2020-8617 --- bind-9.11-tests-pkcs11.patch | 39 ----------------------------------- bind-9.14-config-pkcs11.patch | 9 ++++---- bind.spec | 17 ++++++++------- 3 files changed, 14 insertions(+), 51 deletions(-) delete mode 100644 bind-9.11-tests-pkcs11.patch diff --git a/bind-9.11-tests-pkcs11.patch b/bind-9.11-tests-pkcs11.patch deleted file mode 100644 index cdba1b0..0000000 --- a/bind-9.11-tests-pkcs11.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 84fc64b556d5b5145eb7831393b856a26a818dc1 Mon Sep 17 00:00:00 2001 -From: Petr Mensik -Date: Fri, 1 Mar 2019 15:55:46 +0100 -Subject: [PATCH] Detect correctly pkcs11 support - -It fails now always, because oot builds are not supported by -cleanpkcs11.sh. ---- - bin/tests/system/cleanpkcs11.sh | 2 +- - bin/tests/system/conf.sh.in | 1 + - 2 files changed, 2 insertions(+), 1 deletion(-) - -diff --git a/bin/tests/system/cleanpkcs11.sh b/bin/tests/system/cleanpkcs11.sh -index b974708..3bbef4c 100644 ---- a/bin/tests/system/cleanpkcs11.sh -+++ b/bin/tests/system/cleanpkcs11.sh -@@ -12,6 +12,6 @@ - SYSTEMTESTTOP=. - . $SYSTEMTESTTOP/conf.sh - --if [ ! -x ../../pkcs11/pkcs11-destroy ]; then exit 1; fi -+if [ ! -x "$PK11DESTROY" ]; then exit 1; fi - - $PK11DEL -w0 > /dev/null 2>&1 -diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index e7831d8..aa2d841 100644 ---- a/bin/tests/system/conf.sh.in -+++ b/bin/tests/system/conf.sh.in -@@ -52,6 +52,7 @@ NSLOOKUP=$TOP/bin/dig/nslookup - NSUPDATE=$TOP/bin/nsupdate/nsupdate - NZD2NZF=$TOP/bin/tools/named-nzd2nzf - PK11DEL="$TOP/bin/pkcs11/pkcs11-destroy -s ${SLOT:-0} -p ${HSMPIN:-1234} -w 0" -+PK11DESTROY=$TOP/bin/pkcs11/pkcs11-destroy - PK11GEN="$TOP/bin/pkcs11/pkcs11-keygen -q -s ${SLOT:-0} -p ${HSMPIN:-1234}" - PK11LIST="$TOP/bin/pkcs11/pkcs11-list -s ${SLOT:-0} -p ${HSMPIN:-1234}" - RESOLVE=$TOP/lib/samples/resolve --- -2.20.1 - diff --git a/bind-9.14-config-pkcs11.patch b/bind-9.14-config-pkcs11.patch index a71d772..bfc6e45 100644 --- a/bind-9.14-config-pkcs11.patch +++ b/bind-9.14-config-pkcs11.patch @@ -1,4 +1,4 @@ -From 2d8abd838870b58629ce55df411b6ba1b2c7288f Mon Sep 17 00:00:00 2001 +From 124c9e4c0500e7589ee63376e8f860f4abc675f2 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 18 Oct 2019 21:30:52 +0200 Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h @@ -26,15 +26,16 @@ index 1f5165a..ef3e70c 100644 ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ diff --git a/configure.ac b/configure.ac -index c69bc37..de6a248 100644 +index fde41dc..e5cc3cd 100644 --- a/configure.ac +++ b/configure.ac -@@ -883,9 +883,13 @@ AS_CASE([$enable_native_pkcs11], +@@ -889,10 +889,14 @@ AS_CASE([$enable_native_pkcs11], AC_SUBST([PKCS11_TEST]) AC_SUBST([PKCS11_TOOLS]) +USE_PKCS11='-DUSE_PKCS11=0' +USE_OPENSSL='-DUSE_OPENSSL=0' + AC_SUBST([CRYPTO]) AS_CASE([$CRYPTO], - [pkcs11],[AC_DEFINE([USE_PKCS11], [1], [define if PKCS11 is used for Public-Key Cryptography])], - [AC_DEFINE([USE_OPENSSL], [1], [define if OpenSSL is used for Public-Key Cryptography])]) @@ -46,7 +47,7 @@ index c69bc37..de6a248 100644 # preparation for automake # AM_CONDITIONAL([PKCS11_TOOLS], [test "$with_native_pkcs11" = "yes"]) diff --git a/lib/dns/dst_internal.h b/lib/dns/dst_internal.h -index bce2a9f..ef9d045 100644 +index 116e2d2..99bdf5b 100644 --- a/lib/dns/dst_internal.h +++ b/lib/dns/dst_internal.h @@ -38,6 +38,13 @@ diff --git a/bind.spec b/bind.spec index 0161355..48f91e8 100644 --- a/bind.spec +++ b/bind.spec @@ -53,18 +53,18 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1602 -%global sover_isc 1602 -%global sover_irs 1600 +%global sover_dns 1603 +%global sover_isc 1603 +%global sover_irs 1601 %global sover_isccfg 1600 -%global sover_ns 1602 +%global sover_ns 1603 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.2 -Release: 4%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Version: 9.16.3 +Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -121,7 +121,6 @@ Patch157:bind-9.11-fips-tests.patch Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch Patch171:bind-9.11-tests-variants.patch -Patch172:bind-9.11-tests-pkcs11.patch Requires(post): systemd Requires(preun): systemd @@ -435,7 +434,6 @@ This package provides a module which allows commands to be sent to rndc directly %patch164 -p1 -b .rh1666814 %patch170 -p1 -b .featuretest-named %patch171 -p1 -b .test-variant -%patch172 -p1 -b .test-pkcs11 %if %{with PKCS11} %patch135 -p1 -b .config-pkcs11 @@ -1159,6 +1157,9 @@ fi; %changelog +* Wed May 20 2020 Petr Menšík - 32:9.16.3-1 +- Update to 9.16.3 + * Mon Apr 27 2020 Petr Menšík - 32:9.16.2-4 - Enable PKCS#11 builds again From 23458b3db173e1a9fd47aae3b3cfeab245ee6f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 22 May 2020 11:25:14 +0200 Subject: [PATCH 38/79] Make usage of initscripts optional Do not depend hard on initscript just to provide fancy colored status. When started from systemd, it does not really matter. Return exactly the same return code as returned by the original tool. --- bind.spec | 1 + generate-rndc-key.sh | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index 48f91e8..e533822 100644 --- a/bind.spec +++ b/bind.spec @@ -1159,6 +1159,7 @@ fi; %changelog * Wed May 20 2020 Petr Menšík - 32:9.16.3-1 - Update to 9.16.3 +- Make initscripts just optional dependency * Mon Apr 27 2020 Petr Menšík - 32:9.16.2-4 - Enable PKCS#11 builds again diff --git a/generate-rndc-key.sh b/generate-rndc-key.sh index 1ba0004..956bb8e 100755 --- a/generate-rndc-key.sh +++ b/generate-rndc-key.sh @@ -1,6 +1,17 @@ #!/bin/bash -. /etc/rc.d/init.d/functions +if [ -r /etc/rc.d/init.d/functions ]; then + . /etc/rc.d/init.d/functions +else +success() { + echo $" OK " +} + +failure() { + echo -n " " + echo $"FAILED" +} +fi # This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf @@ -14,8 +25,9 @@ if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then success $"/etc/rndc.key generation" echo else + rc=$? failure $"/etc/rndc.key generation" echo - exit 1 + exit $rc fi fi From b8ccda0801d6c7e0029763d7770da4e5d76406db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 18 Jun 2020 04:08:57 +0200 Subject: [PATCH 39/79] Update to 9.16.4 Documentation changed and requires another commit. --- bind-9.10-dist-native-pkcs11.patch | 138 ++++++++---------- bind-9.11-feature-test-named.patch | 21 +-- bind-9.14-config-pkcs11.patch | 12 +- ...at_doc.patch => bind-9.16-redhat_doc.patch | 96 ++++++------ bind-9.5-PIE.patch | 21 +-- bind.spec | 11 +- bind97-rh645544.patch | 14 +- bind99-rh640538.patch | 60 +++----- 8 files changed, 174 insertions(+), 199 deletions(-) rename bind-9.3.2-redhat_doc.patch => bind-9.16-redhat_doc.patch (56%) diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index b623f58..0dfc74c 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -12,7 +12,7 @@ index 9ad7f62..094775a 100644 TARGETS = diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index ef3e70c..1f5165a 100644 +index c126bf3..1b7512d 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ @@ -25,7 +25,7 @@ index ef3e70c..1f5165a 100644 ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in -index 7486bf0..7d791d1 100644 +index ace0e5a..e0f6a00 100644 --- a/bin/dnssec-pkcs11/Makefile.in +++ b/bin/dnssec-pkcs11/Makefile.in @@ -15,18 +15,18 @@ VERSION=@BIND9_VERSION@ @@ -40,11 +40,11 @@ index 7486bf0..7d791d1 100644 +CDEFINES = -DVERSION=\"${VERSION}\" -DNAMED_CONFFILE=\"${sysconfdir}/named.conf\" -DUSE_PKCS11=1 CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @NO_LIBTOOL_DNSLIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ - ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} - ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCLIBS = ../../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@ + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @NO_LIBTOOL_ISCLIBS@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @@ -72,7 +72,7 @@ index 7486bf0..7d791d1 100644 OBJS = dnssectool.@O@ -@@ -64,19 +67,19 @@ MANOBJS = ${MANPAGES} ${HTMLPAGES} +@@ -52,19 +55,19 @@ SRCS = dnssec-cds.c dnssec-dsfromkey.c dnssec-importkey.c \ @BIND9_MAKE_RULES@ @@ -96,7 +96,7 @@ index 7486bf0..7d791d1 100644 export BASEOBJS="dnssec-keygen.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -84,7 +87,7 @@ dnssec-signzone.@O@: dnssec-signzone.c +@@ -72,7 +75,7 @@ dnssec-signzone.@O@: dnssec-signzone.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-signzone.c @@ -105,7 +105,7 @@ index 7486bf0..7d791d1 100644 export BASEOBJS="dnssec-signzone.@O@ ${OBJS}"; \ ${FINALBUILDCMD} -@@ -92,19 +95,19 @@ dnssec-verify.@O@: dnssec-verify.c +@@ -80,19 +83,19 @@ dnssec-verify.@O@: dnssec-verify.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \ -c ${srcdir}/dnssec-verify.c @@ -129,26 +129,8 @@ index 7486bf0..7d791d1 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ \ dnssec-importkey.@O@ ${OBJS} ${LIBS} -@@ -115,16 +118,14 @@ docclean manclean maintainer-clean:: - - installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} -- $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - - install-man8: ${MANPAGES} - ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 - --install:: ${TARGETS} installdirs install-man8 -+install:: ${TARGETS} installdirs - for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir} || exit 1; done - - uninstall:: -- for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done - for t in ${TARGETS}; do ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/$$t || exit 1; done - - clean distclean:: diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index cb187e5..1bcb249 100644 +index ed9add2..90bcec7 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in @@ -37,13 +37,14 @@ DBDRIVER_LIBS = @@ -171,21 +153,21 @@ index cb187e5..1bcb249 100644 ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ ${DBDRIVER_INCLUDES} \ -@@ -53,24 +54,24 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ - ${MAXMINDDB_CFLAGS} \ - ${ZLIB_CFLAGS} +@@ -54,24 +55,24 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ + ${LIBXML2_CFLAGS} \ + ${MAXMINDDB_CFLAGS} -CDEFINES = @CONTRIB_DLZ@ +CDEFINES = CWARNINGS = --DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @NO_LIBTOOL_DNSLIBS@ ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ ISCCCLIBS = ../../lib/isccc/libisccc.@A@ - ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} - ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCLIBS = ../../lib/isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@ + ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@ @NO_LIBTOOL_ISCLIBS@ BIND9LIBS = ../../lib/bind9/libbind9.@A@ -NSLIBS = ../../lib/ns/libns.@A@ +NSLIBS = ../../lib/ns-pkcs11/libns-pkcs11.@A@ @@ -201,7 +183,7 @@ index cb187e5..1bcb249 100644 DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS} -@@ -87,7 +88,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -91,7 +92,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix @@ -210,7 +192,7 @@ index cb187e5..1bcb249 100644 GEOIP2LINKOBJS = geoip.@O@ -@@ -151,7 +152,7 @@ server.@O@: server.c +@@ -149,7 +150,7 @@ server.@O@: server.c -DPRODUCT=\"${PRODUCT}\" \ -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c @@ -219,7 +201,7 @@ index cb187e5..1bcb249 100644 export MAKE_SYMTABLE="yes"; \ export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} -@@ -161,7 +162,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c +@@ -159,7 +160,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -c ${top_srcdir}/bin/tests/system/feature-test.c @@ -228,28 +210,26 @@ index cb187e5..1bcb249 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} -@@ -194,13 +195,13 @@ install-man8: named.8 +@@ -178,11 +179,11 @@ statschannel.@O@: bind9.xsl.h + installdirs: + $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - install-man: install-man5 install-man8 - --install:: named@EXEEXT@ installdirs install-man +-install:: named@EXEEXT@ installdirs - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} -+install:: named-pkcs11@EXEEXT@ installdirs install-man ++install:: named-pkcs11@EXEEXT@ installdirs + ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-pkcs11@EXEEXT@ ${DESTDIR}${sbindir} uninstall:: - rm -f ${DESTDIR}${mandir}/man5/named.conf.5 - rm -f ${DESTDIR}${mandir}/man8/named.8 - ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named@EXEEXT@ + ${LIBTOOL_MODE_UNINSTALL} rm -f ${DESTDIR}${sbindir}/named-pkcs11@EXEEXT@ @DLZ_DRIVER_RULES@ diff --git a/configure.ac b/configure.ac -index de6a248..e95ef36 100644 +index 2ff68a5..2638ef2 100644 --- a/configure.ac +++ b/configure.ac -@@ -1196,12 +1196,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1214,12 +1214,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" @@ -264,7 +244,7 @@ index de6a248..e95ef36 100644 # # was --with-lmdb specified? -@@ -2296,6 +2298,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) +@@ -2281,6 +2283,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) AC_SUBST(BIND9_NS_BUILDINCLUDE) AC_SUBST(BIND9_BIND9_BUILDINCLUDE) AC_SUBST(BIND9_IRS_BUILDINCLUDE) @@ -273,7 +253,7 @@ index de6a248..e95ef36 100644 if test "X$srcdir" != "X"; then BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" -@@ -2304,6 +2308,8 @@ if test "X$srcdir" != "X"; then +@@ -2289,6 +2293,8 @@ if test "X$srcdir" != "X"; then BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" @@ -282,7 +262,7 @@ index de6a248..e95ef36 100644 else BIND9_ISC_BUILDINCLUDE="" BIND9_ISCCC_BUILDINCLUDE="" -@@ -2312,6 +2318,8 @@ else +@@ -2297,6 +2303,8 @@ else BIND9_NS_BUILDINCLUDE="" BIND9_BIND9_BUILDINCLUDE="" BIND9_IRS_BUILDINCLUDE="" @@ -291,7 +271,7 @@ index de6a248..e95ef36 100644 fi AC_SUBST_FILE(BIND9_MAKE_INCLUDES) -@@ -2771,8 +2779,11 @@ AC_CONFIG_FILES([ +@@ -2757,8 +2765,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile @@ -303,7 +283,7 @@ index de6a248..e95ef36 100644 bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile -@@ -2843,6 +2854,10 @@ AC_CONFIG_FILES([ +@@ -2820,6 +2831,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -314,7 +294,7 @@ index de6a248..e95ef36 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -2875,6 +2890,10 @@ AC_CONFIG_FILES([ +@@ -2852,6 +2867,10 @@ AC_CONFIG_FILES([ lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile @@ -339,19 +319,20 @@ index ffa2d5a..6fbc192 100644 @BIND9_MAKE_RULES@ diff --git a/lib/dns-pkcs11/Makefile.in b/lib/dns-pkcs11/Makefile.in -index 0ef3b5f..80683c2 100644 +index 8de85bf..d5c3c2b 100644 --- a/lib/dns-pkcs11/Makefile.in +++ b/lib/dns-pkcs11/Makefile.in -@@ -26,14 +26,14 @@ VERSION=@BIND9_VERSION@ +@@ -26,7 +26,7 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ -CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ +CINCLUDES = -I. -I${top_srcdir}/lib/dns-pkcs11 -Iinclude ${DNS_PKCS11_INCLUDES} \ ${ISC_INCLUDES} \ + ${FSTRM_CFLAGS} \ ${OPENSSL_CFLAGS} @DST_GSSAPI_INC@ \ - ${JSON_C_CFLAGS} \ - ${LIBXML2_CFLAGS} \ +@@ -36,7 +36,7 @@ CINCLUDES = -I. -I${top_srcdir}/lib/dns -Iinclude ${DNS_INCLUDES} \ + ${LMDB_CFLAGS} \ ${MAXMINDDB_CFLAGS} -CDEFINES = @USE_GSSAPI@ ${USE_ISC_SPNEGO} @@ -359,7 +340,7 @@ index 0ef3b5f..80683c2 100644 CWARNINGS = -@@ -139,15 +139,15 @@ version.@O@: version.c +@@ -142,15 +142,15 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -379,7 +360,7 @@ index 0ef3b5f..80683c2 100644 include: gen ${MAKE} include/dns/enumtype.h -@@ -178,22 +178,22 @@ gen: gen.c +@@ -181,22 +181,22 @@ gen: gen.c ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c \ ${BUILD_LIBS} ${LFS_LIBS} @@ -408,7 +389,7 @@ index 0ef3b5f..80683c2 100644 rm -f include/dns/rdatastruct.h rm -f dnstap.pb-c.c dnstap.pb-c.h diff --git a/lib/dns-pkcs11/tests/Makefile.in b/lib/dns-pkcs11/tests/Makefile.in -index fd8ebb9..9384a4f 100644 +index 8aec0a8..3c2cc04 100644 --- a/lib/dns-pkcs11/tests/Makefile.in +++ b/lib/dns-pkcs11/tests/Makefile.in @@ -15,14 +15,14 @@ VERSION=@BIND9_VERSION@ @@ -421,20 +402,20 @@ index fd8ebb9..9384a4f 100644 -CDEFINES = -DTESTS="\"${top_builddir}/lib/dns/tests/\"" +CDEFINES = @USE_PKCS11@ -DTESTS="\"${top_builddir}/lib/dns-pkcs11/tests/\"" - ISCLIBS = ../../isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCLIBS = ../../isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@ ISCDEPLIBS = ../../isc/libisc.@A@ --DNSLIBS = ../libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../libdns.@A@ @NO_LIBTOOL_DNSLIBS@ -DNSDEPLIBS = ../libdns.@A@ -+DNSLIBS = ../libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ++DNSLIBS = ../libdns-pkcs11.@A@ @NO_LIBTOOL_DNSLIBS@ +DNSDEPLIBS = ../libdns-pkcs11.@A@ LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/lib/ns-pkcs11/Makefile.in b/lib/ns-pkcs11/Makefile.in -index 97aaaf6..c7ffc7b 100644 +index d00ddaf..b867afe 100644 --- a/lib/ns-pkcs11/Makefile.in +++ b/lib/ns-pkcs11/Makefile.in -@@ -20,11 +20,11 @@ VERSION=@BIND9_VERSION@ +@@ -20,12 +20,12 @@ VERSION=@BIND9_VERSION@ USE_ISC_SPNEGO = @USE_ISC_SPNEGO@ @@ -442,26 +423,27 @@ index 97aaaf6..c7ffc7b 100644 - ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ +CINCLUDES = -I. -I${top_srcdir}/lib/ns-pkcs11 -Iinclude \ + ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ - ${OPENSSL_CFLAGS} @DST_GSSAPI_INC@ + ${OPENSSL_CFLAGS} @DST_GSSAPI_INC@ \ + ${FSTRM_CFLAGS} -CDEFINES = -DNAMED_PLUGINDIR=\"${plugindir}\" +CDEFINES = @USE_PKCS11@ -DNAMED_PLUGINDIR=\"${plugindir}\" CWARNINGS = -@@ -32,9 +32,9 @@ ISCLIBS = ../../lib/isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS +@@ -33,9 +33,9 @@ ISCLIBS = ../../lib/isc/libisc.@A@ ISCDEPLIBS = ../../lib/isc/libisc.@A@ --DNSLIBS = ../../lib/dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ -+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ +-DNSLIBS = ../../lib/dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@ ++DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ @NO_LIBTOOL_DNSLIBS@ -DNSDEPLIBS = ../../lib/dns/libdns.@A@ +DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@A@ LIBS = @LIBS@ -@@ -66,28 +66,28 @@ version.@O@: version.c +@@ -67,28 +67,28 @@ version.@O@: version.c -DLIBAGE=${LIBAGE} \ -c ${srcdir}/version.c @@ -476,8 +458,8 @@ index 97aaaf6..c7ffc7b 100644 - ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libns.la -rpath ${libdir} \ + ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libns-pkcs11.la -rpath ${libdir} \ -version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \ -- ${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS} -+ ${OBJS} ${ISCLIBS} @DNS_CRYPTO_PK11_LIBS@ ${LIBS} +- ${OBJS} ${ISCLIBS} ${DNSLIBS} @DNS_CRYPTO_LIBS@ ${LIBS} ++ ${OBJS} ${ISCLIBS} ${DNSLIBS} @DNS_CRYPTO_PK11_LIBS@ ${LIBS} -timestamp: libns.@A@ +timestamp: libns-pkcs11.@A@ @@ -499,7 +481,7 @@ index 97aaaf6..c7ffc7b 100644 - rm -f libns.@A@ timestamp + rm -f libns-pkcs11.@A@ timestamp diff --git a/lib/ns-pkcs11/tests/Makefile.in b/lib/ns-pkcs11/tests/Makefile.in -index 70c77a4..87955a7 100644 +index 7869c8e..789d6cb 100644 --- a/lib/ns-pkcs11/tests/Makefile.in +++ b/lib/ns-pkcs11/tests/Makefile.in @@ -21,17 +21,17 @@ WRAP_NAME = -Wl,-install_name,${top_builddir}/lib/ns/tests/$@ @@ -513,13 +495,13 @@ index 70c77a4..87955a7 100644 -CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" +CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" @USE_PKCS11@ - ISCLIBS = ../../isc/libisc.@A@ ${OPENSSL_LIBS} ${JSON_C_LIBS} ${LIBXML2_LIBS} ${ZLIB_LIBS} + ISCLIBS = ../../isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@ ISCDEPLIBS = ../../isc/libisc.@A@ --DNSLIBS = ../../dns/libdns.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_LIBS@ +-DNSLIBS = ../../dns/libdns.@A@ @NO_LIBTOOL_DNSLIBS@ -DNSDEPLIBS = ../../dns/libdns.@A@ -NSLIBS = ../libns.@A@ -NSDEPLIBS = ../libns.@A@ -+DNSLIBS = ../../dns-pkcs11/libdns-pkcs11.@A@ ${MAXMINDDB_LIBS} @DNS_CRYPTO_PK11_LIBS@ ++DNSLIBS = ../../dns-pkcs11/libdns-pkcs11.@A@ @NO_LIBTOOL_DNSLIBS@ +DNSDEPLIBS = ../../dns-pkcs11/libdns-pkcs11.@A@ +NSLIBS = ../libns-pkcs11.@A@ +NSDEPLIBS = ../libns-pkcs11.@A@ @@ -527,10 +509,10 @@ index 70c77a4..87955a7 100644 LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/make/includes.in b/make/includes.in -index 48cdaf7..7b17738 100644 +index 9ff1bd8..ebab049 100644 --- a/make/includes.in +++ b/make/includes.in -@@ -39,3 +39,10 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ +@@ -41,3 +41,10 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ TEST_INCLUDES = \ -I${top_srcdir}/lib/tests/include diff --git a/bind-9.11-feature-test-named.patch b/bind-9.11-feature-test-named.patch index c4bbe16..9af8d73 100644 --- a/bind-9.11-feature-test-named.patch +++ b/bind-9.11-feature-test-named.patch @@ -1,4 +1,4 @@ -From 64f29512679fd00c89473d93d8b22017b018dd8f Mon Sep 17 00:00:00 2001 +From e645046202006750f87531e21e3ff7c26fba3466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 30 Jan 2019 14:37:17 +0100 Subject: [PATCH] Create feature-test in source directory @@ -7,15 +7,15 @@ Feature-test tool is used in system tests to test compiled in changes. Because we build more variants of named with different configuration, compile feature-test for each of them this way. --- - bin/named/Makefile.in | 11 ++++++++++- + bin/named/Makefile.in | 12 +++++++++++- bin/tests/system/conf.sh.in | 2 +- - 2 files changed, 11 insertions(+), 2 deletions(-) + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index dd25774..cb187e5 100644 +index 37053a7..ed9add2 100644 --- a/bin/named/Makefile.in +++ b/bin/named/Makefile.in -@@ -87,7 +87,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -91,7 +91,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix @@ -24,7 +24,7 @@ index dd25774..cb187e5 100644 GEOIP2LINKOBJS = geoip.@O@ -@@ -156,6 +156,15 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} +@@ -154,6 +154,16 @@ named@EXEEXT@: ${OBJS} ${DEPLIBS} export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} @@ -37,11 +37,12 @@ index dd25774..cb187e5 100644 + ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ + -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} + - doc man:: ${MANOBJS} ++ + clean distclean maintainer-clean:: + rm -f ${TARGETS} ${OBJS} - docclean manclean maintainer-clean:: diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in -index 2317bd8..5015d5c 100644 +index 7934930..e84fde2 100644 --- a/bin/tests/system/conf.sh.in +++ b/bin/tests/system/conf.sh.in @@ -37,7 +37,7 @@ DELV=$TOP/bin/delv/delv @@ -54,5 +55,5 @@ index 2317bd8..5015d5c 100644 HOST=$TOP/bin/dig/host IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey -- -2.21.1 +2.26.2 diff --git a/bind-9.14-config-pkcs11.patch b/bind-9.14-config-pkcs11.patch index bfc6e45..58b492b 100644 --- a/bind-9.14-config-pkcs11.patch +++ b/bind-9.14-config-pkcs11.patch @@ -1,4 +1,4 @@ -From 124c9e4c0500e7589ee63376e8f860f4abc675f2 Mon Sep 17 00:00:00 2001 +From c42c0ff6f6e0e920356d99b9ed26ed52544621c2 Mon Sep 17 00:00:00 2001 From: Petr Mensik Date: Fri, 18 Oct 2019 21:30:52 +0200 Subject: [PATCH] Move USE_PKCS11 and USE_OPENSSL out of config.h @@ -13,7 +13,7 @@ Move it as normal define to CDEFINES. 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index 1f5165a..ef3e70c 100644 +index 1b7512d..c126bf3 100644 --- a/bin/confgen/Makefile.in +++ b/bin/confgen/Makefile.in @@ -22,7 +22,7 @@ VERSION=@BIND9_VERSION@ @@ -26,12 +26,12 @@ index 1f5165a..ef3e70c 100644 ISCCFGLIBS = ../../lib/isccfg/libisccfg.@A@ diff --git a/configure.ac b/configure.ac -index fde41dc..e5cc3cd 100644 +index eaa6b12..2ff68a5 100644 --- a/configure.ac +++ b/configure.ac -@@ -889,10 +889,14 @@ AS_CASE([$enable_native_pkcs11], - AC_SUBST([PKCS11_TEST]) +@@ -900,10 +900,14 @@ AC_SUBST([PKCS11_TEST]) AC_SUBST([PKCS11_TOOLS]) + AC_SUBST([PKCS11_MANS]) +USE_PKCS11='-DUSE_PKCS11=0' +USE_OPENSSL='-DUSE_OPENSSL=0' @@ -79,5 +79,5 @@ index 116e2d2..99bdf5b 100644 dst_hmac_key_t *hmac_key; } keydata; /*%< pointer to key in crypto pkg fmt */ -- -2.21.1 +2.26.2 diff --git a/bind-9.3.2-redhat_doc.patch b/bind-9.16-redhat_doc.patch similarity index 56% rename from bind-9.3.2-redhat_doc.patch rename to bind-9.16-redhat_doc.patch index d4531f4..15c8a41 100644 --- a/bind-9.3.2-redhat_doc.patch +++ b/bind-9.16-redhat_doc.patch @@ -1,68 +1,74 @@ -diff --git a/bin/named/named.8 b/bin/named/named.8 -index ef10ef4..3150b22 100644 ---- a/bin/named/named.8 -+++ b/bin/named/named.8 -@@ -349,6 +349,63 @@ The default configuration file\&. - /var/run/named/named\&.pid - .RS 4 - The default process\-id file\&. -+.PP -+.SH "NOTES" -+.PP -+.TP -+\fBRed Hat SELinux BIND Security Profile:\fR -+.PP +From 86fd25f3f0c5189fa93e10c6afa1a1cffe639ade Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Wed, 17 Jun 2020 23:17:13 +0200 +Subject: [PATCH] Update man named with Red Hat specifics + +This is almost unmodified text and requires revalidation. Some of those +statements are no longer correct. +--- + bin/named/named.rst | 49 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 49 insertions(+) + +diff --git a/bin/named/named.rst b/bin/named/named.rst +index 3c54a67..c44b6d7 100644 +--- a/bin/named/named.rst ++++ b/bin/named/named.rst +@@ -228,6 +228,55 @@ Files + ``/var/run/named/named.pid`` + The default process-id file. + ++Notes ++~~~~~ ++ ++**Red Hat SELinux BIND Security Profile:** ++ +By default, Red Hat ships BIND with the most secure SELinux policy +that will not prevent normal BIND operation and will prevent exploitation +of all known BIND security vulnerabilities . See the selinux(8) man page +for information about SElinux. -+.PP ++ +It is not necessary to run named in a chroot environment if the Red Hat +SELinux policy for named is enabled. When enabled, this policy is far +more secure than a chroot environment. Users are recommended to enable +SELinux and remove the bind-chroot package. -+.PP -+With this extra security comes some restrictions: -+.PP ++ ++*With this extra security comes some restrictions:* ++ +By default, the SELinux policy does not allow named to write any master +zone database files. Only the root user may create files in the $ROOTDIR/var/named +zone database file directory (the options { "directory" } option), where +$ROOTDIR is set in /etc/sysconfig/named. -+.PP ++ +The "named" group must be granted read privelege to +these files in order for named to be enabled to read them. -+.PP ++ +Any file created in the zone database file directory is automatically assigned -+the SELinux file context named_zone_t . -+.PP -+By default, SELinux prevents any role from modifying named_zone_t files; this ++the SELinux file context *named_zone_t* . ++ ++By default, SELinux prevents any role from modifying *named_zone_t* files; this +means that files in the zone database directory cannot be modified by dynamic +DNS (DDNS) updates or zone transfers. -+.PP ++ +The Red Hat BIND distribution and SELinux policy creates three directories where -+named is allowed to create and modify files: /var/named/slaves, /var/named/dynamic -+/var/named/data. By placing files you want named to modify, such as ++named is allowed to create and modify files: */var/named/slaves*, */var/named/dynamic* ++*/var/named/data*. By placing files you want named to modify, such as +slave or DDNS updateable zone files and database / statistics dump files in +these directories, named will work normally and no further operator action is -+required. Files in these directories are automatically assigned the 'named_cache_t' ++required. Files in these directories are automatically assigned the '*named_cache_t*' +file context, which SELinux allows named to write. -+.PP -+\fBRed Hat BIND SDB support:\fR -+.PP ++ ++**Red Hat BIND SDB support:** ++ +Red Hat ships named with compiled in Simplified Database Backend modules that ISC -+provides in the "contrib/sdb" directory. Install bind-sdb package if you want use them -+.PP -+The SDB modules for LDAP, PostGreSQL, DirDB and SQLite are compiled into named-sdb. -+.PP ++provides in the "contrib/sdb" directory. Install **bind-sdb** package if you want use them ++ ++The SDB modules for LDAP, PostGreSQL, DirDB and SQLite are compiled into *named-sdb*. ++ +See the documentation for the various SDB modules in /usr/share/doc/bind-sdb-*/ . -+.br -+.PP -+\fBRed Hat system-config-bind:\fR -+.PP -+Red Hat provides the system-config-bind GUI to configure named.conf and zone -+database files. Run the "system-config-bind" command and access the manual -+by selecting the Help menu. -+.PP - .RE - .SH "SEE ALSO" - .PP ++ + See Also + ~~~~~~~~ + +-- +2.26.2 + diff --git a/bind-9.5-PIE.patch b/bind-9.5-PIE.patch index a525b9b..d3c73ee 100644 --- a/bind-9.5-PIE.patch +++ b/bind-9.5-PIE.patch @@ -1,8 +1,10 @@ ---- bind-9.5.0b2/bin/named/Makefile.in.pie 2008-02-11 17:21:47.000000000 +0100 -+++ bind-9.5.0b2/bin/named/Makefile.in 2008-02-11 17:22:10.000000000 +0100 -@@ -100,8 +100,12 @@ HTMLPAGES = named.html lwresd.html named - - MANOBJS = ${MANPAGES} ${HTMLPAGES} +diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in +index eb622d1..37053a7 100644 +--- a/bin/named/Makefile.in ++++ b/bin/named/Makefile.in +@@ -117,8 +117,12 @@ SRCS = builtin.c config.c control.c \ + tkeyconf.c tsigconf.c zoneconf.c \ + ${DLZDRIVER_SRCS} ${DBDRIVER_SRCS} +EXT_CFLAGS = -fpie + @@ -13,10 +15,11 @@ main.@O@: main.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -DVERSION=\"${VERSION}\" \ -diff -up bind-9.5.0b2/bin/named/unix/Makefile.in.pie bind-9.5.0b2/bin/named/unix/Makefile.in ---- bind-9.5.0b2/bin/named/unix/Makefile.in.pie 2008-02-11 17:22:21.000000000 +0100 -+++ bind-9.5.0b2/bin/named/unix/Makefile.in 2008-02-11 17:23:00.000000000 +0100 -@@ -19,6 +19,8 @@ srcdir = @srcdir@ +diff --git a/bin/named/unix/Makefile.in b/bin/named/unix/Makefile.in +index fd9ca8d..f1c102c 100644 +--- a/bin/named/unix/Makefile.in ++++ b/bin/named/unix/Makefile.in +@@ -11,6 +11,8 @@ srcdir = @srcdir@ VPATH = @srcdir@ top_srcdir = @top_srcdir@ diff --git a/bind.spec b/bind.spec index e533822..01b5197 100644 --- a/bind.spec +++ b/bind.spec @@ -63,7 +63,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.3 +Version: 9.16.4 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -98,7 +98,7 @@ Source49: named-chroot.files # Common patches Patch10: bind-9.5-PIE.patch -Patch16: bind-9.3.2-redhat_doc.patch +Patch16: bind-9.16-redhat_doc.patch Patch72: bind-9.5-dlz-64bit.patch Patch106:bind93-rh490837.patch Patch112:bind97-rh645544.patch @@ -150,6 +150,8 @@ BuildRequires: selinux-policy # needed for %%{__python3} macro BuildRequires: python3-devel BuildRequires: python3-ply +BuildRequires: python3-sphinx +BuildRequires: doxygen BuildRequires: findutils sed %if 0%{?fedora} BuildRequires: gnupg2 @@ -429,7 +431,7 @@ This package provides a module which allows commands to be sent to rndc directly %patch112 -p1 -b .rh645544 %patch130 -p1 -b .libdb %patch140 -p1 -b .rh1410433 -%patch154 -p1 -b .oot-man +#%patch154 -p1 -b .oot-man # FIXME: sphinx replace? %patch157 -p1 -b .fips-tests %patch164 -p1 -b .rh1666814 %patch170 -p1 -b .featuretest-named @@ -1157,6 +1159,9 @@ fi; %changelog +* Thu Jun 18 2020 Petr Menšík - 32:9.16.4-1 +- Update to 9.16.4 + * Wed May 20 2020 Petr Menšík - 32:9.16.3-1 - Update to 9.16.3 - Make initscripts just optional dependency diff --git a/bind97-rh645544.patch b/bind97-rh645544.patch index e7f67d8..e2ae978 100644 --- a/bind97-rh645544.patch +++ b/bind97-rh645544.patch @@ -1,8 +1,8 @@ diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c -index 51bc368..20a17b9 100644 +index 31549c6..65a14b6 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c -@@ -1754,7 +1754,7 @@ log_edns(fetchctx_t *fctx) { +@@ -1762,7 +1762,7 @@ log_edns(fetchctx_t *fctx) { */ dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_EDNS_DISABLED, @@ -11,7 +11,7 @@ index 51bc368..20a17b9 100644 "success resolving '%s' (in '%s'?) after %s", fctx->info, domainbuf, fctx->reason); } -@@ -5275,7 +5275,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) { +@@ -5298,7 +5298,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) { dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf)); isc_sockaddr_format(&addrinfo->sockaddr, addrbuf, sizeof(addrbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_LAME_SERVERS, @@ -20,12 +20,12 @@ index 51bc368..20a17b9 100644 "lame server resolving '%s' (in '%s'?): %s", namebuf, domainbuf, addrbuf); } -@@ -5302,7 +5302,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) { - } +@@ -5316,7 +5316,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) { + isc_sockaddr_format(&fctx->addrinfo->sockaddr, nsbuf, sizeof(nsbuf)); isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER, - DNS_LOGMODULE_RESOLVER, ISC_LOG_NOTICE, + DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(1), - "DNS format error from %s resolving %s%s%s: %s", nsbuf, - fctx->info, clmsg, clbuf, msgbuf); + "DNS format error from %s resolving %s for %s: %s", nsbuf, + fctx->info, fctx->clientstr, msgbuf); } diff --git a/bind99-rh640538.patch b/bind99-rh640538.patch index 5066a14..54d7e1b 100644 --- a/bind99-rh640538.patch +++ b/bind99-rh640538.patch @@ -1,44 +1,22 @@ -diff --git a/bin/dig/dig.docbook b/bin/dig/dig.docbook -index 1079421..f11abd1 100644 ---- a/bin/dig/dig.docbook -+++ b/bin/dig/dig.docbook -@@ -1177,6 +1177,39 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr - -
+diff --git a/bin/dig/dig.rst b/bin/dig/dig.rst +index 3c899ce..3e9957b 100644 +--- a/bin/dig/dig.rst ++++ b/bin/dig/dig.rst +@@ -616,6 +616,17 @@ like to turn off the IDN support for some reason, use parameters + ``+noidnin`` and ``+noidnout`` or define the IDN_DISABLE environment + variable. -+ RETURN CODES -+ -+ Dig return codes are: -+ -+ -+ -+ 0: Everything went well, including things like NXDOMAIN -+ -+ -+ -+ -+ 1: Usage error -+ -+ -+ -+ -+ 8: Couldn't open batch file -+ -+ -+ -+ -+ 9: No reply from server -+ -+ -+ -+ -+ 10: Internal error -+ -+ -+ -+ -+ ++Return codes ++~~~~~~~~~~~~ + - FILES ++``dig`` return codes are: ++ ++ 0: Everything went well, including things like NXDOMAIN ++ 1: Usage error ++ 8: Couldn't open batch file ++ 9: No reply from server ++ 10: Internal error ++ + Files + ~~~~~ - /etc/resolv.conf From 0963df6403987d8689f752dd52aa35f951baa19c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 18 Jun 2020 04:26:31 +0200 Subject: [PATCH 40/79] Create doc subpackage and regenerate documentation Regenerates full documentation on each build. Make documentation optional in case some dependencies would be missing. --- bind-9.11-oot-manual.patch | 252 ------------------------------------- bind.spec | 48 +++++-- 2 files changed, 41 insertions(+), 259 deletions(-) delete mode 100644 bind-9.11-oot-manual.patch diff --git a/bind-9.11-oot-manual.patch b/bind-9.11-oot-manual.patch deleted file mode 100644 index fe1788f..0000000 --- a/bind-9.11-oot-manual.patch +++ /dev/null @@ -1,252 +0,0 @@ -From c5b39725cd4f3f30eac7eeafd7802005a1fad533 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= -Date: Wed, 25 Jul 2018 12:24:16 +0200 -Subject: [PATCH] Use make automatic variables to install updated manuals - -Make will choose modified manual from build directory or original from source -directory automagically. Take advantage of install tool feature. -Install all files in single command instead of iterating on each of them. ---- - bin/check/Makefile.in | 8 +++++--- - bin/confgen/Makefile.in | 9 +++++---- - bin/delv/Makefile.in | 6 ++++-- - bin/dig/Makefile.in | 8 ++++---- - bin/dnssec/Makefile.in | 6 ++++-- - bin/named/Makefile.in | 12 +++++++++--- - bin/pkcs11/Makefile.in | 9 ++++----- - bin/python/Makefile.in | 8 ++++---- - bin/tools/Makefile.in | 25 +++++++++++++++---------- - 9 files changed, 54 insertions(+), 37 deletions(-) - -diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in -index 8f009a4..de3c066 100644 ---- a/bin/check/Makefile.in -+++ b/bin/check/Makefile.in -@@ -84,12 +84,14 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs -+install-man8: ${MANPAGES} -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ (cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8) -+ -+install:: named-checkconf@EXEEXT@ named-checkzone@EXEEXT@ installdirs install-man8 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkconf@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-checkzone@EXEEXT@ ${DESTDIR}${sbindir} - (cd ${DESTDIR}${sbindir}; rm -f named-compilezone@EXEEXT@; ${LINK_PROGRAM} named-checkzone@EXEEXT@ named-compilezone@EXEEXT@) -- for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done -- (cd ${DESTDIR}${mandir}/man8; rm -f named-compilezone.8; ${LINK_PROGRAM} named-checkzone.8 named-compilezone.8) - - uninstall:: - rm -f ${DESTDIR}${mandir}/man8/named-compilezone.8 -diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in -index 0588f8b..44d87fd 100644 ---- a/bin/confgen/Makefile.in -+++ b/bin/confgen/Makefile.in -@@ -93,13 +93,14 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs -+install-man8: rndc-confgen.8 ddns-confgen.8 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ (cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8) -+ -+install:: rndc-confgen@EXEEXT@ ddns-confgen@EXEEXT@ installdirs install-man8 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} rndc-confgen@EXEEXT@ ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ddns-confgen@EXEEXT@ ${DESTDIR}${sbindir} -- ${INSTALL_DATA} ${srcdir}/rndc-confgen.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/ddns-confgen.8 ${DESTDIR}${mandir}/man8 - (cd ${DESTDIR}${sbindir}; rm -f tsig-keygen@EXEEXT@; ${LINK_PROGRAM} ddns-confgen@EXEEXT@ tsig-keygen@EXEEXT@) -- (cd ${DESTDIR}${mandir}/man8; rm -f tsig-keygen.8; ${LINK_PROGRAM} ddns-confgen.8 tsig-keygen.8) - - uninstall:: - rm -f ${DESTDIR}${mandir}/man8/tsig-keygen.8 -diff --git a/bin/delv/Makefile.in b/bin/delv/Makefile.in -index ea106f8..77adc91 100644 ---- a/bin/delv/Makefile.in -+++ b/bin/delv/Makefile.in -@@ -63,10 +63,12 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 - --install:: delv@EXEEXT@ installdirs -+install-man1: delv.1 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1 -+ -+install:: delv@EXEEXT@ installdirs install-man1 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \ - delv@EXEEXT@ ${DESTDIR}${bindir} -- ${INSTALL_DATA} ${srcdir}/delv.1 ${DESTDIR}${mandir}/man1 - - uninstall:: - rm -f ${DESTDIR}${mandir}/man1/delv.1 -diff --git a/bin/dig/Makefile.in b/bin/dig/Makefile.in -index 8ea146f..3a97024 100644 ---- a/bin/dig/Makefile.in -+++ b/bin/dig/Makefile.in -@@ -93,16 +93,16 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 - --install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs -+install-man1: ${MANPAGES} -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1 -+ -+install:: dig@EXEEXT@ host@EXEEXT@ nslookup@EXEEXT@ installdirs install-man1 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \ - dig@EXEEXT@ ${DESTDIR}${bindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \ - host@EXEEXT@ ${DESTDIR}${bindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} \ - nslookup@EXEEXT@ ${DESTDIR}${bindir} -- for m in ${MANPAGES}; do \ -- ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man1 || exit 1; \ -- done - - uninstall:: - for m in ${MANPAGES}; do \ -diff --git a/bin/dnssec/Makefile.in b/bin/dnssec/Makefile.in -index dfaad27..be1ac3b 100644 ---- a/bin/dnssec/Makefile.in -+++ b/bin/dnssec/Makefile.in -@@ -114,9 +114,11 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: ${TARGETS} installdirs -+install-man8: ${MANPAGES} -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+install:: ${TARGETS} installdirs install-man8 - for t in ${TARGETS}; do ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} $$t ${DESTDIR}${sbindir} || exit 1; done -- for m in ${MANPAGES}; do ${INSTALL_DATA} ${srcdir}/$$m ${DESTDIR}${mandir}/man8 || exit 1; done - - uninstall:: - for m in ${MANPAGES}; do rm -f ${DESTDIR}${mandir}/man8/$$m || exit 1; done -diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in -index 0485002..10d568f 100644 ---- a/bin/named/Makefile.in -+++ b/bin/named/Makefile.in -@@ -169,10 +169,16 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5 - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: named@EXEEXT@ installdirs -+install-man5: named.conf.5 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5 -+ -+install-man8: named.8 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+install-man: install-man5 install-man8 -+ -+install:: named@EXEEXT@ installdirs install-man - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named@EXEEXT@ ${DESTDIR}${sbindir} -- ${INSTALL_DATA} ${srcdir}/named.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/named.conf.5 ${DESTDIR}${mandir}/man5 - - uninstall:: - rm -f ${DESTDIR}${mandir}/man5/named.conf.5 -diff --git a/bin/pkcs11/Makefile.in b/bin/pkcs11/Makefile.in -index 2fd9861..96aec05 100644 ---- a/bin/pkcs11/Makefile.in -+++ b/bin/pkcs11/Makefile.in -@@ -69,7 +69,10 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: ${TARGETS} installdirs -+install-man8: ${MANPAGES} -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+install:: ${TARGETS} installdirs install-man8 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-list@EXEEXT@ \ - ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-destroy@EXEEXT@ \ -@@ -78,10 +81,6 @@ install:: ${TARGETS} installdirs - ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} pkcs11-tokens@EXEEXT@ \ - ${DESTDIR}${sbindir} -- ${INSTALL_DATA} ${srcdir}/pkcs11-list.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/pkcs11-destroy.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/pkcs11-keygen.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/pkcs11-tokens.8 ${DESTDIR}${mandir}/man8 - - uninstall:: - rm -f ${DESTDIR}${mandir}/man8/pkcs11-tokens.8 -diff --git a/bin/python/Makefile.in b/bin/python/Makefile.in -index aa678d4..064c404 100644 ---- a/bin/python/Makefile.in -+++ b/bin/python/Makefile.in -@@ -47,13 +47,13 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --install:: ${TARGETS} installdirs -+install-man8: ${MANPAGES} -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+install:: ${TARGETS} installdirs install-man8 - ${INSTALL_SCRIPT} dnssec-checkds ${DESTDIR}${sbindir} - ${INSTALL_SCRIPT} dnssec-coverage ${DESTDIR}${sbindir} - ${INSTALL_SCRIPT} dnssec-keymgr ${DESTDIR}${sbindir} -- ${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 - if test -n "${PYTHON}" ; then \ - if test -n "${DESTDIR}" ; then \ - ${PYTHON} ${srcdir}/setup.py install --root=${DESTDIR} --prefix=${prefix} @PYTHON_INSTALL_LIB@ ; \ -diff --git a/bin/tools/Makefile.in b/bin/tools/Makefile.in -index 0fd2847..3c4f028 100644 ---- a/bin/tools/Makefile.in -+++ b/bin/tools/Makefile.in -@@ -107,17 +107,27 @@ installdirs: - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1 - $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8 - --nzd: -+nzd-man: named-nzd2nzf.8 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+nzd: nzd-man - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-nzd2nzf@EXEEXT@ \ - ${DESTDIR}${sbindir} -- ${INSTALL_DATA} ${srcdir}/named-nzd2nzf.8 ${DESTDIR}${mandir}/man8 - --dnstap: -+dnstap-man: dnstap-read.1 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1 -+ -+dnstap: dnstap-man - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} dnstap-read@EXEEXT@ \ - ${DESTDIR}${bindir} -- ${INSTALL_DATA} ${srcdir}/dnstap-read.1 ${DESTDIR}${mandir}/man1 - --install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ -+install-man1: arpaname.1 named-rrchecker.1 mdig.1 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man1 -+ -+install-man8: named-journalprint.8 nsec3hash.8 -+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8 -+ -+install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ install-man1 install-man8 - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} arpaname@EXEEXT@ \ - ${DESTDIR}${bindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-journalprint@EXEEXT@ \ -@@ -128,11 +138,6 @@ install:: ${TARGETS} installdirs @DNSTAP@ @NZD_TOOLS@ - ${DESTDIR}${sbindir} - ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} mdig@EXEEXT@ \ - ${DESTDIR}${bindir} -- ${INSTALL_DATA} ${srcdir}/arpaname.1 ${DESTDIR}${mandir}/man1 -- ${INSTALL_DATA} ${srcdir}/named-journalprint.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/named-rrchecker.1 ${DESTDIR}${mandir}/man1 -- ${INSTALL_DATA} ${srcdir}/nsec3hash.8 ${DESTDIR}${mandir}/man8 -- ${INSTALL_DATA} ${srcdir}/mdig.1 ${DESTDIR}${mandir}/man1 - - uninstall:: - rm -f ${DESTDIR}${mandir}/man1/mdig.1 --- -2.20.1 - diff --git a/bind.spec b/bind.spec index 01b5197..9b3a8d1 100644 --- a/bind.spec +++ b/bind.spec @@ -25,10 +25,12 @@ %bcond_without UNITTEST %bcond_without DNSTAP %bcond_without LMDB +%bcond_without DOC %else %bcond_with UNITTEST %bcond_with DNSTAP %bcond_with LMDB +%bcond_with DOC %endif %bcond_with TSAN @@ -115,8 +117,6 @@ Patch149:bind-9.11-kyua-pkcs11.patch # introduced by https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=fc9f0ac5778f78003a7acc957a23711811fec122 Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch -# Avoid conflicts with OpenSSL PKCS11 engine -Patch154:bind-9.11-oot-manual.patch Patch157:bind-9.11-fips-tests.patch Patch164:bind-9.11-rh1666814.patch Patch170:bind-9.11-feature-test-named.patch @@ -150,8 +150,6 @@ BuildRequires: selinux-policy # needed for %%{__python3} macro BuildRequires: python3-devel BuildRequires: python3-ply -BuildRequires: python3-sphinx -BuildRequires: doxygen BuildRequires: findutils sed %if 0%{?fedora} BuildRequires: gnupg2 @@ -192,7 +190,11 @@ BuildRequires: libmaxminddb-devel BuildRequires: fstrm-devel protobuf-c-devel %endif # Needed to regenerate dig.1 manpage -BuildRequires: docbook-style-xsl, libxslt +%if %{with DOC} +BuildRequires: python3-sphinx python3-sphinx_rtd_theme +BuildRequires: python3-sphinx-latex latexmk texlive-xetex texlive-xindy +BuildRequires: doxygen +%endif %if %{with TSAN} BuildRequires: libtsan %endif @@ -416,6 +418,25 @@ BuildArch: noarch %description -n python3-bind This package provides a module which allows commands to be sent to rndc directly from Python programs. +%if %{with DOC} +%package doc +Summary: Documentation for BIND +Requires: bind-license = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description doc +BIND (Berkeley Internet Name Domain) is an implementation of the DNS +(Domain Name System) protocols. BIND includes a DNS server (named), +which resolves host names to IP addresses; a resolver library +(routines for applications to use when interfacing with DNS); and +tools for verifying that the DNS server is operating properly. + +This package contains BIND 9 Administrator Reference Manual +in HTML and PDF format. +%end + +%endif + %prep %if 0%{?gpgverify:1} # RHEL does not yet support this verification @@ -431,7 +452,6 @@ This package provides a module which allows commands to be sent to rndc directly %patch112 -p1 -b .rh645544 %patch130 -p1 -b .libdb %patch140 -p1 -b .rh1410433 -#%patch154 -p1 -b .oot-man # FIXME: sphinx replace? %patch157 -p1 -b .fips-tests %patch164 -p1 -b .rh1666814 %patch170 -p1 -b .featuretest-named @@ -574,6 +594,10 @@ pushd bin/python make man popd +%if %{with DOC} + make doc +%endif + %if %{with DLZ} pushd contrib/dlz pushd modules @@ -763,6 +787,11 @@ ln -s dnssec-verify.8.gz dnssec-verify-pkcs11.8.gz popd %endif +pushd ${RPM_BUILD_ROOT}%{_mandir}/man8 +ln -s ddns-confgen.8.gz tsig-keygen.8.gz +ln -s named-checkzone.8.gz named-compilezone.8.gz +popd + # Ghost config files: touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/named.log @@ -945,7 +974,6 @@ fi; %{_mandir}/man8/named-journalprint.8* %{_mandir}/man8/filter-aaaa.8.gz %doc CHANGES README named.conf.default -%doc doc/arm/*html doc/arm/*pdf %doc sample/ # Hide configuration @@ -1157,10 +1185,16 @@ fi; %{python3_sitelib}/*.egg-info %{python3_sitelib}/isc/ +%if %{with DOC} +%files doc +%doc build/doc/arm/_build/html +%doc build/doc/arm/Bv9ARM.pdf +%endif %changelog * Thu Jun 18 2020 Petr Menšík - 32:9.16.4-1 - Update to 9.16.4 +- Create separate bind-doc package with ARM * Wed May 20 2020 Petr Menšík - 32:9.16.3-1 - Update to 9.16.3 From e8b35851c351851d5299caa657e55344d91a2d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 18 Jun 2020 12:33:42 +0200 Subject: [PATCH 41/79] Delete installed manuals for disabled features Some manuals are installed, even when those features are disabled. Remove such manuals after installation. --- bind.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bind.spec b/bind.spec index 9b3a8d1..afa4d71 100644 --- a/bind.spec +++ b/bind.spec @@ -787,6 +787,14 @@ ln -s dnssec-verify.8.gz dnssec-verify-pkcs11.8.gz popd %endif +# 9.16.4 installs even manual pages for tools not generated +%if %{without DNSTAP} +rm -f ${RPM_BUILD_ROOT}%{_mandir}/man1/dnstap-read.1* || true +%endif +%if %{without LMDB} +rm -f ${RPM_BUILD_ROOT}%{_mandir}/man8/named-nzd2nzf.8* || true +%endif + pushd ${RPM_BUILD_ROOT}%{_mandir}/man8 ln -s ddns-confgen.8.gz tsig-keygen.8.gz ln -s named-checkzone.8.gz named-compilezone.8.gz From 2a2d2faeae0ee889b1fdc8d5f9fccd43a63b8592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 18 Jun 2020 14:07:00 +0200 Subject: [PATCH 42/79] fixup! Update to 9.16.4 --- .gitignore | 2 ++ sources | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 36cb37f..b7f9074 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.1.tar.xz.asc /bind-9.16.2.tar.xz /bind-9.16.2.tar.xz.asc +/bind-9.16.4.tar.xz +/bind-9.16.4.tar.xz.asc diff --git a/sources b/sources index 863a695..2c9c198 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.2.tar.xz) = fec47a0df6f91318504d57730148816ee19d7d14769d9c6f84ecd2ced9f575ea86bac2eac65886835aae99f7120495150a40923ee06a7755c6118ffb1f7f166f -SHA512 (bind-9.16.2.tar.xz.asc) = 854a5f2e82e491e74cfafb874f5cd614c9cb289e1c1bfae66ba37a881d7f8ee0acca99ff9aaddc118e8d52474121a81b627c475e432536cd99411c084479b69b +SHA512 (bind-9.16.4.tar.xz) = b1cf0607b0d7569ea594e02848eed601b8faf31c527fc17d379cfff3cd45c0c8b849364af0312e9b65bc14875aad87de379281603c150a07bf021ec740e92860 +SHA512 (bind-9.16.4.tar.xz.asc) = 3eb7d79a1127ecb404020349ae0c077f27616a27bd3f7983eee6d0d70eb9823d293eea405d8f79e5b87830eb92817dce2de52d96ddad51ff0c1130c4a20ad9eb From 9a4be750942b2dc71227cf147f2dbbdf216e2926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 19 Jun 2020 20:10:55 +0200 Subject: [PATCH 43/79] Move documentation from bind-doc subdir to bind Subpackage is there just as shared documentation for main package. I want to stay in original directory, even most of paths have changed since move to sphinx generated documentation. --- bind.spec | 18 +++++++++++++++--- bind99-rh640538.patch | 37 +++++++++++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/bind.spec b/bind.spec index afa4d71..23934dc 100644 --- a/bind.spec +++ b/bind.spec @@ -36,6 +36,7 @@ %{?!bind_uid: %global bind_uid 25} %{?!bind_gid: %global bind_gid 25} +%{!?_pkgdocdir:%global _pkgdocdir %{_docdir}/%{name}-%{version}} %global bind_dir /var/named %global chroot_prefix %{bind_dir}/chroot %global chroot_create_directories /dev /run/named %{_localstatedir}/{log,named,tmp} \\\ @@ -66,7 +67,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.4 -Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -800,6 +801,13 @@ ln -s ddns-confgen.8.gz tsig-keygen.8.gz ln -s named-checkzone.8.gz named-compilezone.8.gz popd +%if %{with DOC} +mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} +cp -a build/doc/arm/{Bv9ARM.pdf,_build/html} build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} +cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man +rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/{html,html/man}/.{buildinfo,doctrees} +%endif + # Ghost config files: touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/named.log @@ -1195,11 +1203,15 @@ fi; %if %{with DOC} %files doc -%doc build/doc/arm/_build/html -%doc build/doc/arm/Bv9ARM.pdf +%dir %{_pkgdocdir} +%doc %{_pkgdocdir}/html +%doc %{_pkgdocdir}/Bv9ARM.pdf %endif %changelog +* Fri Jun 19 2020 Petr Menšík - 32:9.16.4-2 +- Move html into doc/bind + * Thu Jun 18 2020 Petr Menšík - 32:9.16.4-1 - Update to 9.16.4 - Create separate bind-doc package with ARM diff --git a/bind99-rh640538.patch b/bind99-rh640538.patch index 54d7e1b..30e0a03 100644 --- a/bind99-rh640538.patch +++ b/bind99-rh640538.patch @@ -1,22 +1,43 @@ +From 8b0a284d551d24ec2323713a5641b783b6e1baaa Mon Sep 17 00:00:00 2001 +From: Petr Mensik +Date: Fri, 19 Jun 2020 18:48:23 +0200 +Subject: [PATCH] .rh640538 + +--- + bin/dig/dig.rst | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + diff --git a/bin/dig/dig.rst b/bin/dig/dig.rst -index 3c899ce..3e9957b 100644 +index 3c899ce..46c9885 100644 --- a/bin/dig/dig.rst +++ b/bin/dig/dig.rst -@@ -616,6 +616,17 @@ like to turn off the IDN support for some reason, use parameters +@@ -616,6 +616,26 @@ like to turn off the IDN support for some reason, use parameters ``+noidnin`` and ``+noidnout`` or define the IDN_DISABLE environment variable. -+Return codes ++Return Codes +~~~~~~~~~~~~ + +``dig`` return codes are: + -+ 0: Everything went well, including things like NXDOMAIN -+ 1: Usage error -+ 8: Couldn't open batch file -+ 9: No reply from server -+ 10: Internal error ++``0`` ++ Response received, including NXDOMAIN status ++ ++``1`` ++ Usage error ++ ++``8`` ++ Couldn't open batch file ++ ++``9`` ++ No reply from server ++ ++``10`` ++ Internal error + Files ~~~~~ +-- +2.26.2 + From 23ca2929094b4d75b9ccf9d09cc90377d8ef0179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 15 Jul 2020 22:39:37 +0200 Subject: [PATCH 44/79] Update to 9.16.5 Modifies API of libraries, needs rebuild of dependent packages. --- .gitignore | 2 ++ bind.spec | 13 ++++++++----- sources | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index b7f9074..75cbcdf 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.2.tar.xz.asc /bind-9.16.4.tar.xz /bind-9.16.4.tar.xz.asc +/bind-9.16.5.tar.xz +/bind-9.16.5.tar.xz.asc diff --git a/bind.spec b/bind.spec index 23934dc..91b8c70 100644 --- a/bind.spec +++ b/bind.spec @@ -56,18 +56,18 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1603 -%global sover_isc 1603 +%global sover_dns 1605 +%global sover_isc 1605 %global sover_irs 1601 %global sover_isccfg 1600 -%global sover_ns 1603 +%global sover_ns 1604 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.4 -Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Version: 9.16.5 +Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1209,6 +1209,9 @@ fi; %endif %changelog +* Wed Jul 15 2020 Petr Menšík - 32:9.16.5-1 +- Update to 9.16.5 + * Fri Jun 19 2020 Petr Menšík - 32:9.16.4-2 - Move html into doc/bind diff --git a/sources b/sources index 2c9c198..fd7066c 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.4.tar.xz) = b1cf0607b0d7569ea594e02848eed601b8faf31c527fc17d379cfff3cd45c0c8b849364af0312e9b65bc14875aad87de379281603c150a07bf021ec740e92860 -SHA512 (bind-9.16.4.tar.xz.asc) = 3eb7d79a1127ecb404020349ae0c077f27616a27bd3f7983eee6d0d70eb9823d293eea405d8f79e5b87830eb92817dce2de52d96ddad51ff0c1130c4a20ad9eb +SHA512 (bind-9.16.5.tar.xz) = 789fc19f60e81f67ef13ebacd030ea5d8f8cc42cf5f06a01ee2eefe9b7c6d3b10603a3a6a3df85b0e5d770fcf462ce8dddc3a7e5f7f2dab27aa5879ee5380eb7 +SHA512 (bind-9.16.5.tar.xz.asc) = 264d0e7de24e2d549f4eb6f368c55afd04aea2136416dbf131a47adcf99bae5e440245124469976f311bf752d5e9d3b7652d41d1d4b6d5fb67ed7cd86f3aaf27 From 2053b89207f35a28e8d7b26c0be106e0b2d7cb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 16 Jul 2020 00:02:49 +0200 Subject: [PATCH 45/79] Remove duplicate copy of HTML manual pages --- bind.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bind.spec b/bind.spec index 91b8c70..247116b 100644 --- a/bind.spec +++ b/bind.spec @@ -802,10 +802,10 @@ ln -s named-checkzone.8.gz named-compilezone.8.gz popd %if %{with DOC} -mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} -cp -a build/doc/arm/{Bv9ARM.pdf,_build/html} build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} -cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man -rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/{html,html/man}/.{buildinfo,doctrees} +mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man +cp -a build/doc/arm/{Bv9ARM.pdf,_build/html} ${RPM_BUILD_ROOT}%{_pkgdocdir} +cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html +rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees} %endif # Ghost config files: From cb3f3691e4e57763929c2b9f5ffdd04280e5a29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Sat, 22 Aug 2020 11:44:09 +0200 Subject: [PATCH 46/79] Update to 9.16.6 Release notes: https://downloads.isc.org/isc/bind9/9.16.6/doc/arm/html/notes.html#notes-for-bind-9-16-6 --- .gitignore | 2 ++ bind.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 75cbcdf..c4326f3 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.4.tar.xz.asc /bind-9.16.5.tar.xz /bind-9.16.5.tar.xz.asc +/bind-9.16.6.tar.xz +/bind-9.16.6.tar.xz.asc diff --git a/bind.spec b/bind.spec index 247116b..0f31225 100644 --- a/bind.spec +++ b/bind.spec @@ -57,7 +57,7 @@ # lib*.so.X versions of selected libraries %global sover_dns 1605 -%global sover_isc 1605 +%global sover_isc 1606 %global sover_irs 1601 %global sover_isccfg 1600 %global sover_ns 1604 @@ -66,7 +66,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.5 +Version: 9.16.6 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -1209,6 +1209,9 @@ fi; %endif %changelog +* Sat Aug 22 2020 Petr Menšík - 32:9.16.6-1 +- Update to 9.16.6 + * Wed Jul 15 2020 Petr Menšík - 32:9.16.5-1 - Update to 9.16.5 diff --git a/sources b/sources index fd7066c..7cbeac0 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.5.tar.xz) = 789fc19f60e81f67ef13ebacd030ea5d8f8cc42cf5f06a01ee2eefe9b7c6d3b10603a3a6a3df85b0e5d770fcf462ce8dddc3a7e5f7f2dab27aa5879ee5380eb7 -SHA512 (bind-9.16.5.tar.xz.asc) = 264d0e7de24e2d549f4eb6f368c55afd04aea2136416dbf131a47adcf99bae5e440245124469976f311bf752d5e9d3b7652d41d1d4b6d5fb67ed7cd86f3aaf27 +SHA512 (bind-9.16.6.tar.xz) = 37f57db6d1633cc85a4d954a69bbb3372c65ac43fef965df5aee8dcdd32153bb5b0c6d0d5f00f353dd4464c71d74dc8e801937b930e2b8f6799fa77af5f243e0 +SHA512 (bind-9.16.6.tar.xz.asc) = 519f264f9f2f9f78c3a972aca72d4843328294cb0785d19199a61d6d922ba1dfe30fd80187fcb4e42db177692826158f53ddf8b9333fcb1239b6c78b88491229 From 04a7c5632c73190bfcc6e52564c94aef349ad943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 26 Aug 2020 12:10:38 +0200 Subject: [PATCH 47/79] Do not use home for pdf build files texlive stores some files in $HOME directory. Redirect those files to build directory, where it belongs. Do not touch anything user has. --- bind.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/bind.spec b/bind.spec index 0f31225..57b8c4a 100644 --- a/bind.spec +++ b/bind.spec @@ -521,6 +521,7 @@ cp -frp contrib/dlz/modules build/contrib/dlz/modules pushd build LIBDIR_SUFFIX= export LIBDIR_SUFFIX +export TEXMFVAR="`pwd`" # avoid using home for pdf latex files %configure \ --with-python=%{__python3} \ --with-libtool \ From 7d8ad626e701528f401802181a56c05a5ace64f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 26 Aug 2020 12:44:44 +0200 Subject: [PATCH 48/79] Use fmtutil to generate local settings COPR is missing fmtutil configuration. Try generating it. --- bind.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index 57b8c4a..a159174 100644 --- a/bind.spec +++ b/bind.spec @@ -521,7 +521,6 @@ cp -frp contrib/dlz/modules build/contrib/dlz/modules pushd build LIBDIR_SUFFIX= export LIBDIR_SUFFIX -export TEXMFVAR="`pwd`" # avoid using home for pdf latex files %configure \ --with-python=%{__python3} \ --with-libtool \ @@ -579,7 +578,15 @@ export TEXMFVAR="`pwd`" # avoid using home for pdf latex files %endif popd %endif -make %{?_smp_mflags} + +%if %{with DOC} +# avoid using home for pdf latex files +export TEXMFVAR="`pwd`" +export TEXMFCONFIG="`pwd`" +fmtutil --missing -user +%endif + +%make_build ### FIXME hack!!! ### xsltproc doesn't find properly configured files @@ -699,7 +706,7 @@ touch ${RPM_BUILD_ROOT}/%{chroot_prefix}%{_sysconfdir}/named.conf #end chroot pushd build -make DESTDIR=${RPM_BUILD_ROOT} install +%make_install popd # Remove unwanted files From 823e9d22cf58fec4e5c541d4643be00000b193f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 26 Aug 2020 16:48:02 +0200 Subject: [PATCH 49/79] List latex configuration before make --- bind.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bind.spec b/bind.spec index a159174..69f065b 100644 --- a/bind.spec +++ b/bind.spec @@ -583,7 +583,8 @@ export LIBDIR_SUFFIX # avoid using home for pdf latex files export TEXMFVAR="`pwd`" export TEXMFCONFIG="`pwd`" -fmtutil --missing -user +fmtutil-user --listcfg +fmtutil-user --missing %endif %make_build From bd765f0cce22e9b8fc188b5d7b02ab2661125027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 28 Aug 2020 11:15:29 +0200 Subject: [PATCH 50/79] Ignore fmtutil command status It is not important for the build, just inform about latex tools. --- bind.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index 69f065b..ff412e9 100644 --- a/bind.spec +++ b/bind.spec @@ -583,8 +583,8 @@ export LIBDIR_SUFFIX # avoid using home for pdf latex files export TEXMFVAR="`pwd`" export TEXMFCONFIG="`pwd`" -fmtutil-user --listcfg -fmtutil-user --missing +fmtutil-user --listcfg || : +fmtutil-user --missing || : %endif %make_build From 7be72b675e82972952e67ed1896aaba995d1bb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 31 Aug 2020 13:32:11 +0200 Subject: [PATCH 51/79] Disable PDF regeneration Because pending issues with PDF regeneration, disable PDF for now. Allow turning it on with --with DOCPDF. It prevents building successfully on Rawhide/f33 for some reason. --- bind.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index ff412e9..cd58c9c 100644 --- a/bind.spec +++ b/bind.spec @@ -32,6 +32,8 @@ %bcond_with LMDB %bcond_with DOC %endif +# Because of issues with PDF rebuild, include only HTML pages +%bcond_with DOCPDF %bcond_with TSAN %{?!bind_uid: %global bind_uid 25} @@ -193,9 +195,12 @@ BuildRequires: fstrm-devel protobuf-c-devel # Needed to regenerate dig.1 manpage %if %{with DOC} BuildRequires: python3-sphinx python3-sphinx_rtd_theme -BuildRequires: python3-sphinx-latex latexmk texlive-xetex texlive-xindy BuildRequires: doxygen %endif +%if %{with DOCPDF} +# Because remaining issues with COPR, allow turning off PDF (re)generation +BuildRequires: python3-sphinx-latex latexmk texlive-xetex texlive-xindy +%endif %if %{with TSAN} BuildRequires: libtsan %endif @@ -579,7 +584,7 @@ export LIBDIR_SUFFIX popd %endif -%if %{with DOC} +%if %{with DOCPDF} # avoid using home for pdf latex files export TEXMFVAR="`pwd`" export TEXMFCONFIG="`pwd`" @@ -812,10 +817,13 @@ popd %if %{with DOC} mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man -cp -a build/doc/arm/{Bv9ARM.pdf,_build/html} ${RPM_BUILD_ROOT}%{_pkgdocdir} +cp -a build/doc/arm/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees} %endif +%if %{with DOCPDF} +cp -a build/doc/arm/Bv9ARM.pdf ${RPM_BUILD_ROOT}%{_pkgdocdir} +%endif # Ghost config files: touch ${RPM_BUILD_ROOT}%{_localstatedir}/log/named.log @@ -1214,6 +1222,8 @@ fi; %files doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/html +%endif +%if %{with DOCPDF} %doc %{_pkgdocdir}/Bv9ARM.pdf %endif From 1667a58d2a43d56c091c8c8ee99f2be06b5bc4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 31 Aug 2020 14:55:06 +0200 Subject: [PATCH 52/79] Generate html man pages into man subdirectory --- bind.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index cd58c9c..81552cf 100644 --- a/bind.spec +++ b/bind.spec @@ -816,10 +816,10 @@ ln -s named-checkzone.8.gz named-compilezone.8.gz popd %if %{with DOC} -mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man +mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} cp -a build/doc/arm/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} -cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html -rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees} +cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man +rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html{,/man}/.{buildinfo,doctrees} %endif %if %{with DOCPDF} cp -a build/doc/arm/Bv9ARM.pdf ${RPM_BUILD_ROOT}%{_pkgdocdir} From 89421c0410ecbd485cfbe05cd1945a56bf529904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 31 Aug 2020 14:57:43 +0200 Subject: [PATCH 53/79] Remove lwres remains --- bind.spec | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index 81552cf..4a92ce9 100644 --- a/bind.spec +++ b/bind.spec @@ -780,10 +780,9 @@ popd find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; # Remove -devel files out of buildroot if not needed -%if !%{with DEVEL} -rm -f ${RPM_BUILD_ROOT}/%{_libdir}/bind9/*so +%if %{without DEVEL} +rm -f ${RPM_BUILD_ROOT}/%{_libdir}/bind9/*.so rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/bind9 -rm -f ${RPM_BUILD_ROOT}/%{_mandir}/man3/lwres* %endif # PKCS11 versions manpages From ef5c71f941ef1d4e0388112c3debb34db2ee0e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 14 Sep 2020 17:08:06 +0200 Subject: [PATCH 54/79] Share static data in doc package Fonts add unnecessary size to doc package. Instead of local copy, link to theme package static directory and reuse data already installed. --- bind.spec | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index 4a92ce9..205b723 100644 --- a/bind.spec +++ b/bind.spec @@ -69,7 +69,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.6 -Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -428,6 +428,7 @@ This package provides a module which allows commands to be sent to rndc directly %package doc Summary: Documentation for BIND Requires: bind-license = %{epoch}:%{version}-%{release} +Requires: python3-sphinx_rtd_theme BuildArch: noarch %description doc @@ -817,8 +818,18 @@ popd %if %{with DOC} mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} cp -a build/doc/arm/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} -cp -a build/doc/man/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/man -rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html{,/man}/.{buildinfo,doctrees} +rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees} +# Share static data from original sphinx package +THEMEDIR=$(rpm -ql python3-sphinx_rtd_theme | grep 'sphinx_rtd_theme/static$') +for DIR in "$THEMEDIR"/* +do + BASE=$(basename -- "$DIR") + BINDTHEMEDIR="${RPM_BUILD_ROOT}%{_pkgdocdir}/html/_static/$BASE" + if [ -d "$BINDTHEMEDIR" ]; then + rm -rf "$BINDTHEMEDIR" + ln -s "$DIR" "$BINDTHEMEDIR" + fi +done %endif %if %{with DOCPDF} cp -a build/doc/arm/Bv9ARM.pdf ${RPM_BUILD_ROOT}%{_pkgdocdir} @@ -1227,6 +1238,9 @@ fi; %endif %changelog +* Mon Sep 14 2020 Petr Menšík - 32:9.16.6-2 +- Share static data in doc package + * Sat Aug 22 2020 Petr Menšík - 32:9.16.6-1 - Update to 9.16.6 From e1be70d96ec420bf83a3221009e9d980e1e14c79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Mon, 14 Sep 2020 21:17:32 +0200 Subject: [PATCH 55/79] Disable SDB remains and build only DLZ modules DLZ modules turned built-in support into named, just like former named-sdb package had. That was non-intentional and is disabled now. Instead, build only dynamically loaded modules with support for various database access. --- bind.spec | 55 +++++-------------------------------------------------- 1 file changed, 5 insertions(+), 50 deletions(-) diff --git a/bind.spec b/bind.spec index 205b723..768ef33 100644 --- a/bind.spec +++ b/bind.spec @@ -16,8 +16,6 @@ %bcond_without PKCS11 %bcond_without DEVEL %bcond_without JSON -%bcond_with BDB -# skip DLZ for now %bcond_without DLZ # New MaxMind GeoLite support %bcond_without GEOIP2 @@ -161,9 +159,6 @@ BuildRequires: libuv-devel %if %{with DLZ} BuildRequires: openldap-devel, libpq-devel, sqlite-devel, mariadb-connector-c-devel %endif -%if %{with BDB} -BuildRequires: libdb-devel -%endif %if %{with UNITTEST} # make unit dependencies BuildRequires: libcmocka-devel kyua @@ -364,18 +359,6 @@ Based on the code from Jan "Yenya" Kasprzak %if %{with DLZ} -%if %{with BDB} -%package dlz-bdb -Summary: BIND server bdb DLZ module -Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} - -%description dlz-bdb -Dynamic Loadable Zones Berkeley DB module for BIND server. - -%end - -%endif - %package dlz-filesystem Summary: BIND server filesystem DLZ module Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} @@ -544,15 +527,6 @@ export LIBDIR_SUFFIX --with-pkcs11=%{_libdir}/pkcs11/libsofthsm2.so \ %endif --with-dlopen=yes \ -%if %{with DLZ} - --with-dlz-ldap=yes \ - --with-dlz-postgres=yes \ - --with-dlz-mysql=yes \ - --with-dlz-filesystem=yes \ -%endif -%if %{with BDB} - --with-dlz-bdb=yes \ -%endif %if %{with GSSTSIG} --with-gssapi=yes \ --disable-isc-spnego \ @@ -617,18 +591,15 @@ popd %if %{with DLZ} pushd contrib/dlz pushd modules + for DIR in mysql mysqldyn; do + sed -e 's/@DLZ_DRIVER_MYSQL_INCLUDES@/$(shell mysql_config --cflags)/' \ + -e 's/@DLZ_DRIVER_MYSQL_LIBS@/$(shell mysql_config --libs)/' \ + $DIR/Makefile.in > $DIR/Makefile + done for DIR in filesystem ldap mysql mysqldyn sqlite3; do make -C $DIR CFLAGS="-fPIC -I../include $CFLAGS $LDFLAGS" done popd - %if %{with BDB} - pushd bin/dlzbdb - make - popd - pushd modules - make -C bdbhpt CFLAGS="-fPIC -I../include $CFLAGS $LDFLAGS" - popd - %endif popd %endif popd # build @@ -756,15 +727,7 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files make -C $DIR DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/bind install done mv mysqldyn/testing/README mysqldyn/testing/README.testing - %if %{with BDB} - make -C bdbhpt DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/bind install - %endif popd - %if %{with BDB} - pushd bin/dlzbdb - make DESTDIR=${RPM_BUILD_ROOT} install - popd - %endif popd popd %endif @@ -1193,14 +1156,6 @@ fi; %{_libdir}/libns-pkcs11.so %endif -%if %{with DLZ} && %{with BDB} -%files dlz-bdb -%{_libdir}/bind/dlz_bdbhpt_dynamic.so -%doc contrib/dlz/modules/bdbhpt/testing/* -%doc contrib/dlz/modules/bdbhpt/README* - -%endif - %if %{with DLZ} %files dlz-filesystem %{_libdir}/bind/dlz_filesystem_dynamic.so From 1799c36d2300037d91634c11e85d0934ffaa3868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 17:51:50 +0200 Subject: [PATCH 56/79] Merge bind-lite-devel into bind-devel Those packages were very similar in BIND 9.11. Since there is no isc-config.sh, no significant or required reason to have them separated exist. Keep separated libraries, but only one devel package. --- bind.spec | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/bind.spec b/bind.spec index 768ef33..4a55578 100644 --- a/bind.spec +++ b/bind.spec @@ -67,7 +67,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.6 -Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -244,7 +244,7 @@ functionality. %package pkcs11-devel Summary: Development files for Bind libraries compiled with native PKCS#11 Requires: bind-pkcs11-libs%{?_isa} = %{epoch}:%{version}-%{release} -Requires: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} +Requires: bind-devel%{?_isa} = %{epoch}:%{version}-%{release} %description pkcs11-devel This a set of development files for BIND libraries (dns, isc) compiled @@ -314,15 +314,7 @@ Summary: Header files and libraries needed for BIND DNS development Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7 Provides: bind-libbind-devel = 31:9.3.3-4.fc7 Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} -Requires: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} - -%description devel -The bind-devel package contains full version of the header files and libraries -required for development with ISC BIND 9 -%endif - -%package lite-devel -Summary: Lite version of header files and libraries needed for BIND DNS development +Provides: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} Requires: openssl-devel%{?_isa} libxml2-devel%{?_isa} %if %{with GSSTSIG} @@ -341,9 +333,10 @@ Requires: fstrm-devel%{?_isa} protobuf-c-devel%{?_isa} Requires: libmaxminddb-devel%{?_isa} %endif -%description lite-devel -The bind-lite-devel package contains lite version of the header -files and libraries required for development with ISC BIND 9 +%description devel +The bind-devel package contains full version of the header files and libraries +required for development with ISC BIND 9 +%endif %package chroot Summary: A chroot runtime environment for the ISC BIND DNS server, named(8) @@ -1069,18 +1062,15 @@ fi; %{_libdir}/libbind9.so %{_libdir}/libisccc.so %{_libdir}/libns.so -%{_includedir}/bind9/config.h -%{_includedir}/bind9/bind9 -%{_includedir}/bind9/isccc -%{_includedir}/bind9/ns -%endif - -%files lite-devel %{_libdir}/libdns.so %{_libdir}/libirs.so %{_libdir}/libisc.so %{_libdir}/libisccfg.so %dir %{_includedir}/bind9 +%{_includedir}/bind9/config.h +%{_includedir}/bind9/bind9 +%{_includedir}/bind9/isccc +%{_includedir}/bind9/ns %{_includedir}/bind9/dns %{_includedir}/bind9/dst %{_includedir}/bind9/irs @@ -1088,6 +1078,7 @@ fi; %dir %{_includedir}/bind9/pk11 %{_includedir}/bind9/pk11/site.h %{_includedir}/bind9/isccfg +%endif %files chroot %config(noreplace) %{_sysconfdir}/named-chroot.files @@ -1193,6 +1184,9 @@ fi; %endif %changelog +* Tue Sep 15 2020 Petr Menšík - 32:9.16.6-3 +- Merge bind-lite-devel into devel package + * Mon Sep 14 2020 Petr Menšík - 32:9.16.6-2 - Share static data in doc package From 8a73c57ad49fb896be5ddab9e340a882620e0161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 17:55:01 +0200 Subject: [PATCH 57/79] Remove DEVEL conditional define I find no reason to turn off devel package creation. It can be ignored if required, but is mandatory due to Fedora packaging guidelines. Simplify it a bit. --- bind.spec | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bind.spec b/bind.spec index 4a55578..0dab73c 100644 --- a/bind.spec +++ b/bind.spec @@ -14,7 +14,6 @@ # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles %bcond_without PKCS11 -%bcond_without DEVEL %bcond_without JSON %bcond_without DLZ # New MaxMind GeoLite support @@ -308,7 +307,6 @@ revocation and verification of keys and DNSSEC signatures in zone files. You should install bind-dnssec-utils if you need to sign a DNS zone or maintain keys for it. -%if %{with DEVEL} %package devel Summary: Header files and libraries needed for BIND DNS development Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7 @@ -331,7 +329,6 @@ Requires: fstrm-devel%{?_isa} protobuf-c-devel%{?_isa} %endif %if %{with GEOIP2} Requires: libmaxminddb-devel%{?_isa} -%endif %description devel The bind-devel package contains full version of the header files and libraries @@ -736,12 +733,6 @@ popd # Remove libtool .la files: find ${RPM_BUILD_ROOT}/%{_libdir} -name '*.la' -exec '/bin/rm' '-f' '{}' ';'; -# Remove -devel files out of buildroot if not needed -%if %{without DEVEL} -rm -f ${RPM_BUILD_ROOT}/%{_libdir}/bind9/*.so -rm -rf ${RPM_BUILD_ROOT}/%{_includedir}/bind9 -%endif - # PKCS11 versions manpages %if %{with PKCS11} pushd ${RPM_BUILD_ROOT}%{_mandir}/man8 @@ -1057,7 +1048,6 @@ fi; %exclude %{_mandir}/man8/dnssec*-pkcs11.8* %endif -%if %{with DEVEL} %files devel %{_libdir}/libbind9.so %{_libdir}/libisccc.so @@ -1078,7 +1068,6 @@ fi; %dir %{_includedir}/bind9/pk11 %{_includedir}/bind9/pk11/site.h %{_includedir}/bind9/isccfg -%endif %files chroot %config(noreplace) %{_sysconfdir}/named-chroot.files From f290ef8ed65b3a772ae1a7eb293c135c784f204b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 18:06:30 +0200 Subject: [PATCH 58/79] Move DLZ modules out of bind base package All DLZ modules were installed by mistake in main bind package. Remove them from there, they should be offered only by each dlz subpackage. Move modules to upstream used directory %{_libdir}/named. --- bind.spec | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bind.spec b/bind.spec index 0dab73c..1ddeb0a 100644 --- a/bind.spec +++ b/bind.spec @@ -579,8 +579,7 @@ popd %endif %if %{with DLZ} - pushd contrib/dlz - pushd modules + pushd contrib/dlz/modules for DIR in mysql mysqldyn; do sed -e 's/@DLZ_DRIVER_MYSQL_INCLUDES@/$(shell mysql_config --cflags)/' \ -e 's/@DLZ_DRIVER_MYSQL_LIBS@/$(shell mysql_config --libs)/' \ @@ -590,7 +589,6 @@ popd make -C $DIR CFLAGS="-fPIC -I../include $CFLAGS $LDFLAGS" done popd - popd %endif popd # build @@ -711,15 +709,13 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files %if %{with DLZ} pushd build - pushd contrib/dlz - pushd modules + pushd contrib/dlz/modules for DIR in filesystem ldap mysql mysqldyn sqlite3; do - make -C $DIR DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/bind install + make -C $DIR DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/named install done mv mysqldyn/testing/README mysqldyn/testing/README.testing popd popd - popd %endif # Install isc/errno2result.h header @@ -938,8 +934,10 @@ fi; %files # TODO: Move from lib/bind to lib/named, as used by upstream -%{_libdir}/bind -%{_libdir}/named +%dir %{_libdir}/bind +%dir %{_libdir}/named +%{_libdir}/named/*.so +%exclude %{_libdir}/named/dlz_*.so %config(noreplace) %verify(not md5 size mtime) %{_sysconfdir}/sysconfig/named %config(noreplace) %attr(0644,root,named) %{_sysconfdir}/named.root.key %{_tmpfilesdir}/named.conf From bd20caa99a248d8f44be17c5828cc36347ab6416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 18:22:27 +0200 Subject: [PATCH 59/79] Move plugins to upstream default directory Keep backward-compatible links from old directory. Any original configuration should keep running like before. --- bind.spec | 17 ++++++++++------- named-chroot.files | 2 ++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/bind.spec b/bind.spec index 1ddeb0a..96c852d 100644 --- a/bind.spec +++ b/bind.spec @@ -40,7 +40,7 @@ %global chroot_prefix %{bind_dir}/chroot %global chroot_create_directories /dev /run/named %{_localstatedir}/{log,named,tmp} \\\ %{_sysconfdir}/{crypto-policies/back-ends,pki/dnssec-keys,named} \\\ - %{_libdir}/bind %{_datadir}/GeoIP + %{_libdir}/bind %{_libdir}/named %{_datadir}/GeoIP %global selinuxbooleans named_write_master_zones=1 ## The order of libs is important. See lib/Makefile.in for details @@ -650,7 +650,7 @@ fi %install # Build directory hierarchy mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d -mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/bind +mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/{bind,named} mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/named/{slaves,data,dynamic} mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/{man1,man5,man8} mkdir -p ${RPM_BUILD_ROOT}/run/named @@ -713,6 +713,9 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files for DIR in filesystem ldap mysql mysqldyn sqlite3; do make -C $DIR DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/named install done + pushd ${RPM_BUILD_ROOT}/%{_libdir}/bind + cp -s ../named/dlz_*.so . + popd mv mysqldyn/testing/README mysqldyn/testing/README.testing popd popd @@ -1136,23 +1139,23 @@ fi; %if %{with DLZ} %files dlz-filesystem -%{_libdir}/bind/dlz_filesystem_dynamic.so +%{_libdir}/{named,bind}/dlz_filesystem_dynamic.so %files dlz-mysql -%{_libdir}/bind/dlz_mysql_dynamic.so +%{_libdir}/{named,bind}/dlz_mysql_dynamic.so %doc contrib/dlz/modules/mysql/testing/* %files dlz-mysqldyn -%{_libdir}/bind/dlz_mysqldyn_mod.so +%{_libdir}/{named,bind}/dlz_mysqldyn_mod.so %doc contrib/dlz/modules/mysqldyn/testing/* %doc contrib/dlz/modules/mysqldyn/README* %files dlz-ldap -%{_libdir}/bind/dlz_ldap_dynamic.so +%{_libdir}/{named,bind}/dlz_ldap_dynamic.so %doc contrib/dlz/modules/ldap/testing/* %files dlz-sqlite3 -%{_libdir}/bind/dlz_sqlite3_dynamic.so +%{_libdir}/{named,bind}/dlz_sqlite3_dynamic.so %doc contrib/dlz/modules/sqlite3/testing/* %endif diff --git a/named-chroot.files b/named-chroot.files index 43c559a..9a768e4 100644 --- a/named-chroot.files +++ b/named-chroot.files @@ -16,6 +16,8 @@ /etc/named /usr/lib64/bind /usr/lib/bind +/usr/lib64/named +/usr/lib/named /usr/share/GeoIP /run/named # Warning: the order is important From aa8fce73814cb6996a86edb72b0f9d0822cd14ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 19:28:35 +0200 Subject: [PATCH 60/79] Remove ancient provides Most of they are related to RHEL 5, which is far too long unsupported. Stop dragging them along for ages. --- bind.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bind.spec b/bind.spec index 96c852d..86f2b3b 100644 --- a/bind.spec +++ b/bind.spec @@ -131,12 +131,6 @@ Requires(post): shadow-utils Requires(post): glibc-common Requires(post): grep Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} -Obsoletes: bind-config < 30:9.3.2-34.fc6 -Provides: bind-config = 30:9.3.2-34.fc6 -Obsoletes: caching-nameserver < 31:9.4.1-7.fc8 -Provides: caching-nameserver = 31:9.4.1-7.fc8 -Obsoletes: dnssec-conf < 1.27-2 -Provides: dnssec-conf = 1.27-2 # This wild require should satisfy %%selinux_set_boolean macro only # in case it needs to be used Requires(post): ((policycoreutils-python-utils and libselinux-utils) if (selinux-policy-targeted or selinux-policy-mls)) @@ -252,8 +246,6 @@ with native PKCS#11 functionality. %package libs-lite Summary: Libraries for working with the DNS protocol -Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7 -Provides: bind-libbind-devel = 31:9.3.3-4.fc7 Requires: bind-license = %{epoch}:%{version}-%{release} %description libs-lite @@ -309,8 +301,6 @@ or maintain keys for it. %package devel Summary: Header files and libraries needed for BIND DNS development -Obsoletes:bind-libbind-devel < 31:9.3.3-4.fc7 -Provides: bind-libbind-devel = 31:9.3.3-4.fc7 Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} Provides: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} From 4158647a7a9e40f095898fed51940b6a51f3a693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 19:34:43 +0200 Subject: [PATCH 61/79] Remove ancient version triggers --- bind.spec | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/bind.spec b/bind.spec index 86f2b3b..4801ee8 100644 --- a/bind.spec +++ b/bind.spec @@ -874,24 +874,6 @@ fi %systemd_postun_with_restart named-pkcs11.service %endif -%triggerpostun -n bind -- bind <= 32:9.5.0-20.b1 -if [ "$1" -gt 0 ]; then - [ -e /etc/rndc.key ] && chown root:named /etc/rndc.key - [ -e /etc/rndc.key ] && chmod 0640 /etc/rndc.key -fi -:; - -%triggerun -- bind < 32:9.9.0-0.6.rc1 -/sbin/chkconfig --del named >/dev/null 2>&1 || : -/bin/systemctl try-restart named.service >/dev/null 2>&1 || : - -%ldconfig_scriptlets libs -%ldconfig_scriptlets libs-lite - -%if %{with PKCS11} -%ldconfig_scriptlets pkcs11-libs -%endif - # Fix permissions on existing device files on upgrade %define chroot_fix_devices() \ if [ $1 -gt 1 ]; then \ @@ -904,6 +886,17 @@ if [ $1 -gt 1 ]; then \ done \ fi +%triggerun -- bind < 32:9.9.0-0.6.rc1 +/sbin/chkconfig --del named >/dev/null 2>&1 || : +/bin/systemctl try-restart named.service >/dev/null 2>&1 || : + +%ldconfig_scriptlets libs +%ldconfig_scriptlets libs-lite + +%if %{with PKCS11} +%ldconfig_scriptlets pkcs11-libs +%endif + %post chroot %systemd_post named-chroot.service %chroot_fix_devices %{chroot_prefix} From aa13488713f9519bb20872006d0832c41ad8da55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 15 Sep 2020 19:48:36 +0200 Subject: [PATCH 62/79] Create bind-dnssec-doc subpackage Move there all manual pages of bind-dnssec-utils. They can be then shared by bind-pkcs11-utils with just one package owning them. --- bind.spec | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/bind.spec b/bind.spec index 4801ee8..5c5ad8b 100644 --- a/bind.spec +++ b/bind.spec @@ -219,6 +219,7 @@ For other supported HSM modules please check the BIND documentation. Summary: Bind tools with native PKCS#11 for using DNSSEC Requires: bind-pkcs11-libs%{?_isa} = %{epoch}:%{version}-%{release} Obsoletes: bind-pkcs11 < 32:9.9.4-16.P2 +Requires: bind-dnssec-doc = %{epoch}:%{version}-%{release} %description pkcs11-utils This is a set of PKCS#11 utilities that when used together create rsa @@ -286,10 +287,11 @@ You should install bind-utils if you need to get information from DNS name servers. %package dnssec-utils -Summary: Utilities for DNSSEC keys and DNS zone files management +Summary: DNSSEC keys and zones management utilities Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} Recommends: bind-utils Requires: python3-bind = %{epoch}:%{version}-%{release} +Requires: bind-dnssec-doc = %{epoch}:%{version}-%{release} %description dnssec-utils Bind-dnssec-utils contains a collection of utilities for editing @@ -299,6 +301,14 @@ revocation and verification of keys and DNSSEC signatures in zone files. You should install bind-dnssec-utils if you need to sign a DNS zone or maintain keys for it. +%package dnssec-doc +Summary: Manual pages of DNSSEC utilities +Requires: bind-license = %{epoch}:%{version}-%{release} +BuildArch:noarch + +%description dnssec-doc +Bind-dnssec-doc contains manual pages for bind-dnssec-utils. + %package devel Summary: Header files and libraries needed for BIND DNS development Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -1026,9 +1036,13 @@ fi; %files dnssec-utils %{_sbindir}/dnssec* -%{_mandir}/man8/dnssec*.8* %if %{with PKCS11} %exclude %{_sbindir}/dnssec*pkcs11 +%endif + +%files dnssec-doc +%{_mandir}/man8/dnssec*.8* +%if %{with PKCS11} %exclude %{_mandir}/man8/dnssec*-pkcs11.8* %endif @@ -1104,9 +1118,6 @@ fi; %{_sbindir}/pkcs11-tokens %{_mandir}/man8/pkcs11*.8* %{_mandir}/man8/dnssec*-pkcs11.8* -%{_mandir}/man8/dnssec*.8* -%exclude %{_mandir}/man8/dnssec-coverage.8* -%exclude %{_mandir}/man8/dnssec-keymgr.8* %files pkcs11-libs %{_libdir}/libdns-pkcs11.so.%{sover_dns}* From 11da1628d865b2980c8de8582d583fbc211e8ce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Sep 2020 12:05:00 +0200 Subject: [PATCH 63/79] Allow easy upgrade of bind-devel bind-lite-devel needs to be obsoleted. It demands license with its own reason and block upgrade. --- bind.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/bind.spec b/bind.spec index 5c5ad8b..a4d1e87 100644 --- a/bind.spec +++ b/bind.spec @@ -313,6 +313,7 @@ Bind-dnssec-doc contains manual pages for bind-dnssec-utils. Summary: Header files and libraries needed for BIND DNS development Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} Provides: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} +Obsoletes: bind-lite-devel < 32:9.16.6-3 Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} Requires: openssl-devel%{?_isa} libxml2-devel%{?_isa} %if %{with GSSTSIG} From c2387c40c77eb1481e9645d8da4061cdb6a50e98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Sep 2020 12:13:51 +0200 Subject: [PATCH 64/79] Add missing architecture to lmdb --- bind.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.spec b/bind.spec index a4d1e87..46c32e3 100644 --- a/bind.spec +++ b/bind.spec @@ -320,7 +320,7 @@ Requires: openssl-devel%{?_isa} libxml2-devel%{?_isa} Requires: krb5-devel%{?_isa} %endif %if %{with LMDB} -Requires: lmdb-devel +Requires: lmdb-devel%{?_isa} %endif %if %{with JSON} Requires: json-c-devel%{?_isa} From fe1a07243532af52a469cdf75afc8a6f2908f3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Sep 2020 16:09:08 +0200 Subject: [PATCH 65/79] Provide should not contain architecture --- bind.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index 46c32e3..6c9bcfa 100644 --- a/bind.spec +++ b/bind.spec @@ -311,10 +311,10 @@ Bind-dnssec-doc contains manual pages for bind-dnssec-utils. %package devel Summary: Header files and libraries needed for BIND DNS development -Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} -Provides: bind-lite-devel%{?_isa} = %{epoch}:%{version}-%{release} +Provides: bind-lite-devel = %{epoch}:%{version}-%{release} Obsoletes: bind-lite-devel < 32:9.16.6-3 Requires: bind-libs-lite%{?_isa} = %{epoch}:%{version}-%{release} +Requires: bind-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: openssl-devel%{?_isa} libxml2-devel%{?_isa} %if %{with GSSTSIG} Requires: krb5-devel%{?_isa} From 7ffde7d75569505fc09ef24c473fdfa21aa8ba97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Sep 2020 16:12:12 +0200 Subject: [PATCH 66/79] Address warning of rpmlint --- bind-9.10-use-of-strlcat.patch | 18 ------------------ bind.spec | 6 +----- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 bind-9.10-use-of-strlcat.patch diff --git a/bind-9.10-use-of-strlcat.patch b/bind-9.10-use-of-strlcat.patch deleted file mode 100644 index 2a39916..0000000 --- a/bind-9.10-use-of-strlcat.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/bin/sdb_tools/zone2ldap.c b/bin/sdb_tools/zone2ldap.c -index d56bc56..99c3314 100644 ---- a/bin/sdb_tools/zone2ldap.c -+++ b/bin/sdb_tools/zone2ldap.c -@@ -817,11 +817,11 @@ build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag, char *zone) - } - - -- strlcat (dn, tmp, sizeof (dn)); -+ strncat (dn, tmp, sizeof (dn) - strlen (dn)); - } - - sprintf (tmp, "dc=%s", dc_list[0]); -- strlcat (dn, tmp, sizeof (dn)); -+ strncat (dn, tmp, sizeof (dn) - strlen (dn)); - - fflush(NULL); - return dn; diff --git a/bind.spec b/bind.spec index 6c9bcfa..3ecc99a 100644 --- a/bind.spec +++ b/bind.spec @@ -113,9 +113,6 @@ Patch136:bind-9.10-dist-native-pkcs11.patch # Do not use isc-pkcs11. Patch149:bind-9.11-kyua-pkcs11.patch -# [ISC-Bugs #42525] non-portable use of strlcat in contrib/sdb/ldap/zone2ldap.c -# introduced by https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=commit;h=fc9f0ac5778f78003a7acc957a23711811fec122 -Patch137:bind-9.10-use-of-strlcat.patch Patch140:bind-9.11-rh1410433.patch Patch157:bind-9.11-fips-tests.patch Patch164:bind-9.11-rh1666814.patch @@ -449,7 +446,6 @@ cp -r lib/ns{,-pkcs11} %endif %patch133 -p1 -b .rh640538 -#%patch134 -p1 -b .rh669163 # Sparc and s390 arches need to use -fPIE %ifarch sparcv9 sparc64 s390 s390x @@ -691,7 +687,7 @@ install -m 644 %{SOURCE47} ${RPM_BUILD_ROOT}%{_unitdir} %else # Not packaged without PKCS11 find ${RPM_BUILD_ROOT}%{_includedir}/bind9/pk11 ${RPM_BUILD_ROOT}%{_includedir}/bind9/pkcs11 \ - -name '*.h' \! -name site.h -delete + -name '*.h' \! -name site.h -delete %endif From 1f070d7ab35f4651e31b506f440239f2823830c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 16 Sep 2020 16:52:39 +0200 Subject: [PATCH 67/79] Move mysql DLZ modules together Remove dlz-mysqldyn subpackage, move documentation and modules to the same package. It is similar and has exactly the same dependencies, different package is not required. --- bind.spec | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/bind.spec b/bind.spec index 3ecc99a..725d270 100644 --- a/bind.spec +++ b/bind.spec @@ -362,18 +362,14 @@ Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} Dynamic Loadable Zones LDAP module for BIND server. %package dlz-mysql -Summary: BIND server mysql DLZ module +Summary: BIND server mysql and mysqldyn DLZ modules Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} +Provides: %{name}-dlz-mysqldyn +Obsoletes: %{name}-dlz-mysqldyn < 32:9.16.6-3 %description dlz-mysql Dynamic Loadable Zones MySQL module for BIND server. - -%package dlz-mysqldyn -Summary: BIND server mysqldyn DLZ module -Requires: bind%{?_isa} = %{epoch}:%{version}-%{release} - -%description dlz-mysqldyn -BIND 9 DLZ MySQL module with support for dynamic DNS (DDNS) +Contains also mysqldyn module with dynamic DNS updates (DDNS) support. %package dlz-sqlite3 Summary: BIND server sqlite3 DLZ module @@ -713,7 +709,10 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files pushd ${RPM_BUILD_ROOT}/%{_libdir}/bind cp -s ../named/dlz_*.so . popd - mv mysqldyn/testing/README mysqldyn/testing/README.testing + mkdir -p doc/{mysql,mysqldyn} + cp -p mysqldyn/testing/README doc/mysqldyn/README.testing + cp -p mysqldyn/testing/* doc/mysqldyn + cp -p mysql/testing/* doc/mysql popd popd %endif @@ -1134,12 +1133,9 @@ fi; %files dlz-mysql %{_libdir}/{named,bind}/dlz_mysql_dynamic.so -%doc contrib/dlz/modules/mysql/testing/* - -%files dlz-mysqldyn +%doc build/contrib/dlz/modules/doc/mysql %{_libdir}/{named,bind}/dlz_mysqldyn_mod.so -%doc contrib/dlz/modules/mysqldyn/testing/* -%doc contrib/dlz/modules/mysqldyn/README* +%doc build/contrib/dlz/modules/doc/mysqldyn %files dlz-ldap %{_libdir}/{named,bind}/dlz_ldap_dynamic.so From 9e7477b3c47d78490a0fdd5c982b1983ea4e7e0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 17 Sep 2020 11:42:55 +0200 Subject: [PATCH 68/79] Update to 9.16.7 Bugfix release. https://downloads.isc.org/isc/bind9/9.16.7/doc/arm/html/notes.html#notes-for-bind-9-16-7 --- .gitignore | 2 ++ bind.spec | 11 +++++++---- sources | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c4326f3..7ff5f5f 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.5.tar.xz.asc /bind-9.16.6.tar.xz /bind-9.16.6.tar.xz.asc +/bind-9.16.7.tar.xz +/bind-9.16.7.tar.xz.asc diff --git a/bind.spec b/bind.spec index 725d270..4f649a0 100644 --- a/bind.spec +++ b/bind.spec @@ -55,18 +55,18 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1605 +%global sover_dns 1607 %global sover_isc 1606 %global sover_irs 1601 -%global sover_isccfg 1600 +%global sover_isccfg 1601 %global sover_ns 1604 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.6 -Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Version: 9.16.7 +Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -1161,6 +1161,9 @@ fi; %endif %changelog +* Thu Sep 17 2020 Petr Menšík - 32:9.16.7-1 +- Update to 9.16.7 + * Tue Sep 15 2020 Petr Menšík - 32:9.16.6-3 - Merge bind-lite-devel into devel package diff --git a/sources b/sources index 7cbeac0..0dab457 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.6.tar.xz) = 37f57db6d1633cc85a4d954a69bbb3372c65ac43fef965df5aee8dcdd32153bb5b0c6d0d5f00f353dd4464c71d74dc8e801937b930e2b8f6799fa77af5f243e0 -SHA512 (bind-9.16.6.tar.xz.asc) = 519f264f9f2f9f78c3a972aca72d4843328294cb0785d19199a61d6d922ba1dfe30fd80187fcb4e42db177692826158f53ddf8b9333fcb1239b6c78b88491229 +SHA512 (bind-9.16.7.tar.xz) = 176c84657e8a7b10a7ca93c939ca6a7fcdefb22f9200c3f01be59bcd8990dee27b8dc0970299225bcbe0f1aa8f49a67c80c4a9853895ffbcd685adb9674e7768 +SHA512 (bind-9.16.7.tar.xz.asc) = a94721692a3c400aa9df9499874ac833e605a647ec8e4e42065bf4822581eb6e3cfb8b5f61e127fb069e821364de9aef2030fa7bb456616993321897e06c7ec4 From b4711541c268311522488306310125b61706545c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 23 Oct 2020 20:30:49 +0200 Subject: [PATCH 69/79] Update to 9.16.8 DNS Flag Day 2020 - reduced default EDNS buffer to 1232. New rndc dnssec -rollover command. https://downloads.isc.org/isc/bind9/9.16.8/doc/arm/html/notes.html#notes-for-bind-9-16-8 --- .gitignore | 2 + bind-9.10-dist-native-pkcs11.patch | 40 ++++++++--------- bind-9.11-fips-tests.patch | 69 +++++++++++++++--------------- bind.spec | 15 ++++--- sources | 4 +- 5 files changed, 67 insertions(+), 63 deletions(-) diff --git a/.gitignore b/.gitignore index 7ff5f5f..20396a6 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.6.tar.xz.asc /bind-9.16.7.tar.xz /bind-9.16.7.tar.xz.asc +/bind-9.16.8.tar.xz +/bind-9.16.8.tar.xz.asc diff --git a/bind-9.10-dist-native-pkcs11.patch b/bind-9.10-dist-native-pkcs11.patch index 0dfc74c..48ff40b 100644 --- a/bind-9.10-dist-native-pkcs11.patch +++ b/bind-9.10-dist-native-pkcs11.patch @@ -130,7 +130,7 @@ index ace0e5a..e0f6a00 100644 dnssec-importkey.@O@ ${OBJS} ${LIBS} diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in -index ed9add2..90bcec7 100644 +index 525f505..d517ec6 100644 --- a/bin/named-pkcs11/Makefile.in +++ b/bin/named-pkcs11/Makefile.in @@ -37,13 +37,14 @@ DBDRIVER_LIBS = @@ -153,7 +153,7 @@ index ed9add2..90bcec7 100644 ${BIND9_INCLUDES} ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} \ ${ISC_INCLUDES} ${DLZDRIVER_INCLUDES} \ ${DBDRIVER_INCLUDES} \ -@@ -54,24 +55,24 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ +@@ -55,24 +56,24 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \ ${LIBXML2_CFLAGS} \ ${MAXMINDDB_CFLAGS} @@ -183,7 +183,7 @@ index ed9add2..90bcec7 100644 DEPLIBS = ${NSDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \ ${ISCCFGDEPLIBS} ${ISCCCDEPLIBS} ${ISCDEPLIBS} -@@ -91,7 +92,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ +@@ -92,7 +93,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \ SUBDIRS = unix @@ -192,7 +192,7 @@ index ed9add2..90bcec7 100644 GEOIP2LINKOBJS = geoip.@O@ -@@ -149,7 +150,7 @@ server.@O@: server.c +@@ -150,7 +151,7 @@ server.@O@: server.c -DPRODUCT=\"${PRODUCT}\" \ -DVERSION=\"${VERSION}\" -c ${srcdir}/server.c @@ -201,7 +201,7 @@ index ed9add2..90bcec7 100644 export MAKE_SYMTABLE="yes"; \ export BASEOBJS="${OBJS} ${UOBJS}"; \ ${FINALBUILDCMD} -@@ -159,7 +160,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c +@@ -160,7 +161,7 @@ feature-test.@O@: ${top_srcdir}/bin/tests/system/feature-test.c ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \ -c ${top_srcdir}/bin/tests/system/feature-test.c @@ -210,7 +210,7 @@ index ed9add2..90bcec7 100644 ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS} -@@ -178,11 +179,11 @@ statschannel.@O@: bind9.xsl.h +@@ -179,11 +180,11 @@ statschannel.@O@: bind9.xsl.h installdirs: $(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir} @@ -226,10 +226,10 @@ index ed9add2..90bcec7 100644 @DLZ_DRIVER_RULES@ diff --git a/configure.ac b/configure.ac -index 2ff68a5..2638ef2 100644 +index 1932000..cf15786 100644 --- a/configure.ac +++ b/configure.ac -@@ -1214,12 +1214,14 @@ AC_SUBST(USE_GSSAPI) +@@ -1244,12 +1244,14 @@ AC_SUBST(USE_GSSAPI) AC_SUBST(DST_GSSAPI_INC) AC_SUBST(DNS_GSSAPI_LIBS) DNS_CRYPTO_LIBS="$DNS_GSSAPI_LIBS" @@ -244,7 +244,7 @@ index 2ff68a5..2638ef2 100644 # # was --with-lmdb specified? -@@ -2281,6 +2283,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) +@@ -2336,6 +2338,8 @@ AC_SUBST(BIND9_DNS_BUILDINCLUDE) AC_SUBST(BIND9_NS_BUILDINCLUDE) AC_SUBST(BIND9_BIND9_BUILDINCLUDE) AC_SUBST(BIND9_IRS_BUILDINCLUDE) @@ -253,7 +253,7 @@ index 2ff68a5..2638ef2 100644 if test "X$srcdir" != "X"; then BIND9_ISC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isc/include" BIND9_ISCCC_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/isccc/include" -@@ -2289,6 +2293,8 @@ if test "X$srcdir" != "X"; then +@@ -2344,6 +2348,8 @@ if test "X$srcdir" != "X"; then BIND9_NS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/ns/include" BIND9_BIND9_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/bind9/include" BIND9_IRS_BUILDINCLUDE="-I${BIND9_TOP_BUILDDIR}/lib/irs/include" @@ -262,7 +262,7 @@ index 2ff68a5..2638ef2 100644 else BIND9_ISC_BUILDINCLUDE="" BIND9_ISCCC_BUILDINCLUDE="" -@@ -2297,6 +2303,8 @@ else +@@ -2352,6 +2358,8 @@ else BIND9_NS_BUILDINCLUDE="" BIND9_BIND9_BUILDINCLUDE="" BIND9_IRS_BUILDINCLUDE="" @@ -271,7 +271,7 @@ index 2ff68a5..2638ef2 100644 fi AC_SUBST_FILE(BIND9_MAKE_INCLUDES) -@@ -2757,8 +2765,11 @@ AC_CONFIG_FILES([ +@@ -2824,8 +2832,11 @@ AC_CONFIG_FILES([ bin/delv/Makefile bin/dig/Makefile bin/dnssec/Makefile @@ -283,7 +283,7 @@ index 2ff68a5..2638ef2 100644 bin/nsupdate/Makefile bin/pkcs11/Makefile bin/plugins/Makefile -@@ -2820,6 +2831,10 @@ AC_CONFIG_FILES([ +@@ -2887,6 +2898,10 @@ AC_CONFIG_FILES([ lib/dns/include/dns/Makefile lib/dns/include/dst/Makefile lib/dns/tests/Makefile @@ -294,7 +294,7 @@ index 2ff68a5..2638ef2 100644 lib/irs/Makefile lib/irs/include/Makefile lib/irs/include/irs/Makefile -@@ -2852,6 +2867,10 @@ AC_CONFIG_FILES([ +@@ -2919,6 +2934,10 @@ AC_CONFIG_FILES([ lib/ns/include/Makefile lib/ns/include/ns/Makefile lib/ns/tests/Makefile @@ -481,19 +481,19 @@ index d00ddaf..b867afe 100644 - rm -f libns.@A@ timestamp + rm -f libns-pkcs11.@A@ timestamp diff --git a/lib/ns-pkcs11/tests/Makefile.in b/lib/ns-pkcs11/tests/Makefile.in -index 7869c8e..789d6cb 100644 +index ef1c1a6..5bbf10d 100644 --- a/lib/ns-pkcs11/tests/Makefile.in +++ b/lib/ns-pkcs11/tests/Makefile.in -@@ -21,17 +21,17 @@ WRAP_NAME = -Wl,-install_name,${top_builddir}/lib/ns/tests/$@ - WRAP_RPATH = -Wl,-rpath,${top_builddir}/lib/ns/tests - WRAP_LIB = -L${top_builddir}/lib/ns/tests -lwrap +@@ -17,17 +17,17 @@ VERSION=@BIND9_VERSION@ + + WRAP_OPTIONS = -Wl,--wrap=isc_nmhandle_detach -Wl,--wrap=isc_nmhandle_attach -CINCLUDES = -I. -Iinclude ${NS_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \ +CINCLUDES = -I. -Iinclude ${NS_PKCS11_INCLUDES} ${DNS_PKCS11_INCLUDES} ${ISC_INCLUDES} \ ${OPENSSL_CFLAGS} \ @CMOCKA_CFLAGS@ -CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" -+CDEFINES = -DTESTS="\"${top_builddir}/lib/ns/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" @USE_PKCS11@ ++CDEFINES = -DTESTS="\"${top_builddir}/lib/ns-pkcs11/tests/\"" -DNAMED_PLUGINDIR=\"${plugindir}\" @USE_PKCS11@ ISCLIBS = ../../isc/libisc.@A@ @NO_LIBTOOL_ISCLIBS@ ISCDEPLIBS = ../../isc/libisc.@A@ @@ -509,7 +509,7 @@ index 7869c8e..789d6cb 100644 LIBS = @LIBS@ @CMOCKA_LIBS@ diff --git a/make/includes.in b/make/includes.in -index 9ff1bd8..ebab049 100644 +index 5373a7e..f1901ee 100644 --- a/make/includes.in +++ b/make/includes.in @@ -41,3 +41,10 @@ BIND9_INCLUDES = @BIND9_BIND9_BUILDINCLUDE@ \ diff --git a/bind-9.11-fips-tests.patch b/bind-9.11-fips-tests.patch index 7ee915b..03d7ad1 100644 --- a/bind-9.11-fips-tests.patch +++ b/bind-9.11-fips-tests.patch @@ -1,4 +1,4 @@ -From 303aae42064a4f6245f9c519953a5e6dd67510c0 Mon Sep 17 00:00:00 2001 +From cb648b203af5bf9085ad78d021f47c3baeb9b6e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 2 Aug 2018 23:46:45 +0200 Subject: [PATCH] FIPS tests changes @@ -82,16 +82,16 @@ Date: Wed Mar 7 10:44:23 2018 +0100 bin/tests/system/nsupdate/ns1/named.conf.in | 2 +- bin/tests/system/nsupdate/ns2/named.conf.in | 2 +- bin/tests/system/nsupdate/setup.sh | 6 +- - bin/tests/system/nsupdate/tests.sh | 11 ++- + bin/tests/system/nsupdate/tests.sh | 11 +++- bin/tests/system/rndc/setup.sh | 2 +- bin/tests/system/rndc/tests.sh | 23 ++++--- bin/tests/system/tsig/ns1/named.conf.in | 10 +-- bin/tests/system/tsig/ns1/rndc5.conf.in | 10 +++ bin/tests/system/tsig/setup.sh | 5 ++ - bin/tests/system/tsig/tests.sh | 67 ++++++++++++------- + bin/tests/system/tsig/tests.sh | 65 ++++++++++++------- bin/tests/system/upforwd/ns1/named.conf.in | 2 +- bin/tests/system/upforwd/tests.sh | 2 +- - 33 files changed, 161 insertions(+), 107 deletions(-) + 33 files changed, 160 insertions(+), 106 deletions(-) create mode 100644 bin/tests/system/tsig/ns1/rndc5.conf.in diff --git a/bin/tests/system/acl/ns2/named1.conf.in b/bin/tests/system/acl/ns2/named1.conf.in @@ -177,10 +177,10 @@ index 7cdcb6e..606a345 100644 }; diff --git a/bin/tests/system/acl/ns2/named5.conf.in b/bin/tests/system/acl/ns2/named5.conf.in -index 4b4e050..0e679a8 100644 +index 7e20bac..9753a9d 100644 --- a/bin/tests/system/acl/ns2/named5.conf.in +++ b/bin/tests/system/acl/ns2/named5.conf.in -@@ -34,12 +34,12 @@ options { +@@ -35,12 +35,12 @@ options { }; key one { @@ -196,7 +196,7 @@ index 4b4e050..0e679a8 100644 }; diff --git a/bin/tests/system/acl/tests.sh b/bin/tests/system/acl/tests.sh -index fe49a86..d7819f1 100644 +index b4d3045..ebbc798 100644 --- a/bin/tests/system/acl/tests.sh +++ b/bin/tests/system/acl/tests.sh @@ -22,14 +22,14 @@ echo_i "testing basic ACL processing" @@ -431,7 +431,7 @@ index f4bc399..e01f312 100644 }; diff --git a/bin/tests/system/allow-query/tests.sh b/bin/tests/system/allow-query/tests.sh -index 479910c..53b9e5c 100644 +index 4cb2709..c0884cf 100644 --- a/bin/tests/system/allow-query/tests.sh +++ b/bin/tests/system/allow-query/tests.sh @@ -182,7 +182,7 @@ rndc_reload ns2 10.53.0.2 @@ -551,10 +551,10 @@ index 21be03e..e57c308 100644 }; diff --git a/bin/tests/system/checkconf/good.conf b/bin/tests/system/checkconf/good.conf -index 2eb2850..9e6913d 100644 +index 0dabe54..d55c51b 100644 --- a/bin/tests/system/checkconf/good.conf +++ b/bin/tests/system/checkconf/good.conf -@@ -197,6 +197,6 @@ dyndb "name" "library.so" { +@@ -204,6 +204,6 @@ dyndb "name" "library.so" { system; }; key "mykey" { @@ -563,7 +563,7 @@ index 2eb2850..9e6913d 100644 secret "qwertyuiopasdfgh"; }; diff --git a/bin/tests/system/feature-test.c b/bin/tests/system/feature-test.c -index 204d612..684fab6 100644 +index 4a90332..2f85b44 100644 --- a/bin/tests/system/feature-test.c +++ b/bin/tests/system/feature-test.c @@ -14,6 +14,7 @@ @@ -574,7 +574,7 @@ index 204d612..684fab6 100644 #include #include #include -@@ -158,6 +159,19 @@ main(int argc, char **argv) { +@@ -177,6 +178,19 @@ main(int argc, char **argv) { #endif /* ifdef DLZ_FILESYSTEM */ } @@ -591,8 +591,8 @@ index 204d612..684fab6 100644 + } + } + - if (strcmp(argv[1], "--ipv6only=no") == 0) { - #ifdef WIN32 + if (strcmp(argv[1], "--with-idn") == 0) { + #ifdef HAVE_LIBIDN2 return (0); diff --git a/bin/tests/system/notify/ns5/named.conf.in b/bin/tests/system/notify/ns5/named.conf.in index 2976bfc..256d846 100644 @@ -620,7 +620,7 @@ index 2976bfc..256d846 100644 }; diff --git a/bin/tests/system/notify/tests.sh b/bin/tests/system/notify/tests.sh -index d54ab0d..ba38177 100644 +index 3d7e0b7..ec4d9a7 100644 --- a/bin/tests/system/notify/tests.sh +++ b/bin/tests/system/notify/tests.sh @@ -212,16 +212,16 @@ ret=0 @@ -644,7 +644,7 @@ index d54ab0d..ba38177 100644 grep "test string" dig.out.b.ns5.test$n > /dev/null && grep "test string" dig.out.c.ns5.test$n > /dev/null && diff --git a/bin/tests/system/nsupdate/ns1/named.conf.in b/bin/tests/system/nsupdate/ns1/named.conf.in -index e7b6adb..4ad5cc1 100644 +index 346b647..c018fb4 100644 --- a/bin/tests/system/nsupdate/ns1/named.conf.in +++ b/bin/tests/system/nsupdate/ns1/named.conf.in @@ -33,7 +33,7 @@ controls { @@ -670,7 +670,7 @@ index b703843..8bfe2b0 100644 }; diff --git a/bin/tests/system/nsupdate/setup.sh b/bin/tests/system/nsupdate/setup.sh -index 5d70114..6c4b55a 100644 +index c055da3..4e1242b 100644 --- a/bin/tests/system/nsupdate/setup.sh +++ b/bin/tests/system/nsupdate/setup.sh @@ -56,7 +56,11 @@ EOF @@ -687,10 +687,10 @@ index 5d70114..6c4b55a 100644 $DDNSCONFGEN -q -a hmac-sha224 -k sha224-key -z keytests.nil > ns1/sha224.key $DDNSCONFGEN -q -a hmac-sha256 -k sha256-key -z keytests.nil > ns1/sha256.key diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh -index 72a282a..5d42e04 100755 +index b15fa2d..cb7979b 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh -@@ -715,7 +715,14 @@ fi +@@ -797,7 +797,14 @@ fi n=`expr $n + 1` ret=0 echo_i "check TSIG key algorithms ($n)" @@ -706,7 +706,7 @@ index 72a282a..5d42e04 100755 $NSUPDATE -k ns1/${alg}.key < /dev/null || ret=1 server 10.53.0.1 ${PORT} update add ${alg}.keytests.nil. 600 A 10.10.10.3 -@@ -723,7 +730,7 @@ send +@@ -805,7 +812,7 @@ send END done sleep 2 @@ -716,7 +716,7 @@ index 72a282a..5d42e04 100755 done if [ $ret -ne 0 ]; then diff --git a/bin/tests/system/rndc/setup.sh b/bin/tests/system/rndc/setup.sh -index 6b539d1..4d7eaa2 100644 +index b59e7a7..04d5f5a 100644 --- a/bin/tests/system/rndc/setup.sh +++ b/bin/tests/system/rndc/setup.sh @@ -33,7 +33,7 @@ make_key () { @@ -729,7 +729,7 @@ index 6b539d1..4d7eaa2 100644 make_key 3 ${EXTRAPORT3} hmac-sha224 make_key 4 ${EXTRAPORT4} hmac-sha256 diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh -index 2af855a..36cd1aa 100644 +index 78508f3..a2a201e 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh @@ -348,15 +348,20 @@ if [ $ret != 0 ]; then echo_i "failed"; fi @@ -763,7 +763,7 @@ index 2af855a..36cd1aa 100644 n=`expr $n + 1` echo_i "testing rndc with hmac-sha1 ($n)" diff --git a/bin/tests/system/tsig/ns1/named.conf.in b/bin/tests/system/tsig/ns1/named.conf.in -index fbf30c6..f61657d 100644 +index 4ee703f..635434e 100644 --- a/bin/tests/system/tsig/ns1/named.conf.in +++ b/bin/tests/system/tsig/ns1/named.conf.in @@ -21,10 +21,7 @@ options { @@ -807,7 +807,7 @@ index 0000000..0682194 + algorithm hmac-md5-80; +}; diff --git a/bin/tests/system/tsig/setup.sh b/bin/tests/system/tsig/setup.sh -index b3e0450..90a6ce4 100644 +index e3b4a45..ae21d04 100644 --- a/bin/tests/system/tsig/setup.sh +++ b/bin/tests/system/tsig/setup.sh @@ -15,3 +15,8 @@ SYSTEMTESTTOP=.. @@ -820,7 +820,7 @@ index b3e0450..90a6ce4 100644 + cat ns1/rndc5.conf.in >> ns1/named.conf +fi diff --git a/bin/tests/system/tsig/tests.sh b/bin/tests/system/tsig/tests.sh -index 3a720de..e20e7f9 100644 +index 38d842a..668aa6f 100644 --- a/bin/tests/system/tsig/tests.sh +++ b/bin/tests/system/tsig/tests.sh @@ -26,20 +26,25 @@ sha512="jI/Pa4qRu96t76Pns5Z/Ndxbn3QCkwcxLOgt9vgvnJw5wqTRvNyk3FtD6yIMd1dWVlqZ+Y4f @@ -834,13 +834,6 @@ index 3a720de..e20e7f9 100644 -if [ $ret -eq 1 ] ; then - echo_i "failed"; status=1 -fi -- --echo_i "fetching using hmac-md5 (new form)" --ret=0 --$DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1 --grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1 --if [ $ret -eq 1 ] ; then -- echo_i "failed"; status=1 +if $FEATURETEST --md5 +then + echo_i "fetching using hmac-md5 (old form)" @@ -850,7 +843,13 @@ index 3a720de..e20e7f9 100644 + if [ $ret -eq 1 ] ; then + echo_i "failed"; status=1 + fi -+ + +-echo_i "fetching using hmac-md5 (new form)" +-ret=0 +-$DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1 +-grep -i "md5.*TSIG.*NOERROR" dig.out.md5.new > /dev/null || ret=1 +-if [ $ret -eq 1 ] ; then +- echo_i "failed"; status=1 + echo_i "fetching using hmac-md5 (new form)" + ret=0 + $DIG $DIGOPTS example.nil. -y "hmac-md5:md5:$md5" @10.53.0.1 soa > dig.out.md5.new || ret=1 @@ -925,7 +924,7 @@ index ea42b4d..08676da 100644 }; diff --git a/bin/tests/system/upforwd/tests.sh b/bin/tests/system/upforwd/tests.sh -index 3b0d7b3..cc1ae3e 100644 +index ecd91a6..be9993a 100644 --- a/bin/tests/system/upforwd/tests.sh +++ b/bin/tests/system/upforwd/tests.sh @@ -66,7 +66,7 @@ if [ $ret != 0 ] ; then echo_i "failed"; status=`expr $status + $ret`; fi @@ -938,5 +937,5 @@ index 3b0d7b3..cc1ae3e 100644 update add updated.example. 600 A 10.10.10.1 update add updated.example. 600 TXT Foo -- -2.21.1 +2.26.2 diff --git a/bind.spec b/bind.spec index 4f649a0..7eb101a 100644 --- a/bind.spec +++ b/bind.spec @@ -55,24 +55,24 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1607 -%global sover_isc 1606 +%global sover_dns 1608 +%global sover_isc 1607 %global sover_irs 1601 %global sover_isccfg 1601 -%global sover_ns 1604 +%global sover_ns 1605 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.7 +Version: 9.16.8 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # -Source: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz +Source0: https://downloads.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz Source1: named.sysconfig -Source2: https://ftp.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz.asc +Source2: https://downloads.isc.org/isc/bind9/%{BINDVERSION}/bind-%{BINDVERSION}.tar.xz.asc Source3: named.logrotate Source4: https://downloads.isc.org/isc/pgpkeys/codesign2019.txt Source16: named.conf @@ -1161,6 +1161,9 @@ fi; %endif %changelog +* Fri Oct 23 2020 Petr Menšík - 32:9.16.8-1 +- Update to 9.16.8 + * Thu Sep 17 2020 Petr Menšík - 32:9.16.7-1 - Update to 9.16.7 diff --git a/sources b/sources index 0dab457..0b7efe9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.7.tar.xz) = 176c84657e8a7b10a7ca93c939ca6a7fcdefb22f9200c3f01be59bcd8990dee27b8dc0970299225bcbe0f1aa8f49a67c80c4a9853895ffbcd685adb9674e7768 -SHA512 (bind-9.16.7.tar.xz.asc) = a94721692a3c400aa9df9499874ac833e605a647ec8e4e42065bf4822581eb6e3cfb8b5f61e127fb069e821364de9aef2030fa7bb456616993321897e06c7ec4 +SHA512 (bind-9.16.8.tar.xz) = 803af842b4f83c16556036f3a2a52b4aeab4781bafb35385b786a3331cf17ef6148c23928f6903fd371337ba92870d7a8548f5d178b805d160d0af34af45fee7 +SHA512 (bind-9.16.8.tar.xz.asc) = e33fdd6dc8b1fffc7ffaf4b23a5b1c2b7e75296cff745b3e6bc35f362e42097b52202600f9b1762e7c6193e295254335cf992ffa3d34ee85cda8fad7b74bcb07 From 1f381a94698eba91ea0b5518fbcba73e9ef0c591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 26 Nov 2020 15:17:59 +0100 Subject: [PATCH 70/79] Update to 9.16.9 Changes solib version, requires rebuild of dependent packages. Upstream release notes: https://downloads.isc.org/isc/bind9/9.16.9/doc/arm/html/notes.html#notes-for-bind-9-16-9 --- .gitignore | 2 ++ bind.spec | 11 +++++++---- sources | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 20396a6..2737bdf 100644 --- a/.gitignore +++ b/.gitignore @@ -117,3 +117,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.7.tar.xz.asc /bind-9.16.8.tar.xz /bind-9.16.8.tar.xz.asc +/bind-9.16.9.tar.xz +/bind-9.16.9.tar.xz.asc diff --git a/bind.spec b/bind.spec index 7eb101a..09c1aec 100644 --- a/bind.spec +++ b/bind.spec @@ -55,17 +55,17 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1608 -%global sover_isc 1607 +%global sover_dns 1609 +%global sover_isc 1608 %global sover_irs 1601 %global sover_isccfg 1601 -%global sover_ns 1605 +%global sover_ns 1606 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.8 +Version: 9.16.9 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -1161,6 +1161,9 @@ fi; %endif %changelog +* Thu Nov 26 2020 Petr Menšík - 32:9.16.9-1 +- Update to 9.16.9 + * Fri Oct 23 2020 Petr Menšík - 32:9.16.8-1 - Update to 9.16.8 diff --git a/sources b/sources index 0b7efe9..36feb7d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.8.tar.xz) = 803af842b4f83c16556036f3a2a52b4aeab4781bafb35385b786a3331cf17ef6148c23928f6903fd371337ba92870d7a8548f5d178b805d160d0af34af45fee7 -SHA512 (bind-9.16.8.tar.xz.asc) = e33fdd6dc8b1fffc7ffaf4b23a5b1c2b7e75296cff745b3e6bc35f362e42097b52202600f9b1762e7c6193e295254335cf992ffa3d34ee85cda8fad7b74bcb07 +SHA512 (bind-9.16.9.tar.xz) = d5b7694c51d3756aa273efd19d08889d28dd0e80d4ee29660cd06de0fdbc16a77f4f0d2dd9faef527eea1e496ec3292d158a556a84d5aa3f42dbddbb9c890aac +SHA512 (bind-9.16.9.tar.xz.asc) = 0e2092e91dc092c39b05acda817a350fc937a941890e537dc6ef40b473c40c42bb6058b4822eb8e8e7e9bb7ad560b7eff1a5b3942993daa6059187d412831b9c From d553bc086fadb7e230c4ff9611d18f4ea376feed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 26 Nov 2020 15:52:06 +0100 Subject: [PATCH 71/79] Support ifconfig.sh for out-of-tree builds --- bind.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bind.spec b/bind.spec index 09c1aec..4198807 100644 --- a/bind.spec +++ b/bind.spec @@ -449,6 +449,8 @@ for i in bin/named/{,unix}/Makefile.in; do sed -i 's|fpie|fPIE|g' $i done %endif + +sed -e 's|"$TOP/config.guess"|"$TOP_SRCDIR/config.guess"|' -i bin/tests/system/ifconfig.sh :; From 91193796e74a616d7a89023ad1080a798a3fc03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 26 Nov 2020 16:19:35 +0100 Subject: [PATCH 72/79] Use python macro instead of rpm query Rpm might prevent access to rpm database during the build. It is not required anyway. Use %python3_sitelib macro to get path for shared data. --- bind.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bind.spec b/bind.spec index 4198807..763ee53 100644 --- a/bind.spec +++ b/bind.spec @@ -764,8 +764,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_pkgdocdir} cp -a build/doc/arm/_build/html ${RPM_BUILD_ROOT}%{_pkgdocdir} rm -rf ${RPM_BUILD_ROOT}%{_pkgdocdir}/html/.{buildinfo,doctrees} # Share static data from original sphinx package -THEMEDIR=$(rpm -ql python3-sphinx_rtd_theme | grep 'sphinx_rtd_theme/static$') -for DIR in "$THEMEDIR"/* +for DIR in %{python3_sitelib}/sphinx_rtd_theme/static/* do BASE=$(basename -- "$DIR") BINDTHEMEDIR="${RPM_BUILD_ROOT}%{_pkgdocdir}/html/_static/$BASE" From ddf24a90e3ac5a7fee5f21ca01db0261a7a14037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 5 Jan 2021 15:16:21 +0100 Subject: [PATCH 73/79] Update to 9.16.10 Enhancement and bugfix update. Changes documented at upstream release note: https://downloads.isc.org/isc/bind9/9.16.10/doc/arm/html/notes.html#notes-for-bind-9-16-10 --- .gitignore | 2 ++ bind.spec | 9 ++++++--- sources | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2737bdf..eae28e5 100644 --- a/.gitignore +++ b/.gitignore @@ -119,3 +119,5 @@ bind-9.7.2b1.tar.gz /bind-9.16.8.tar.xz.asc /bind-9.16.9.tar.xz /bind-9.16.9.tar.xz.asc +/bind-9.16.10.tar.xz +/bind-9.16.10.tar.xz.asc diff --git a/bind.spec b/bind.spec index 763ee53..421a6d8 100644 --- a/bind.spec +++ b/bind.spec @@ -55,17 +55,17 @@ # no more isc-config.sh and bind9-config # lib*.so.X versions of selected libraries -%global sover_dns 1609 +%global sover_dns 1610 %global sover_isc 1608 %global sover_irs 1601 -%global sover_isccfg 1601 +%global sover_isccfg 1602 %global sover_ns 1606 Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server Name: bind License: MPLv2.0 -Version: 9.16.9 +Version: 9.16.10 Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ @@ -1162,6 +1162,9 @@ fi; %endif %changelog +* Tue Jan 05 2021 Petr Menšík - 32:9.16.10-1 +- Update to 9.16.10 + * Thu Nov 26 2020 Petr Menšík - 32:9.16.9-1 - Update to 9.16.9 diff --git a/sources b/sources index 36feb7d..08489e3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (bind-9.16.9.tar.xz) = d5b7694c51d3756aa273efd19d08889d28dd0e80d4ee29660cd06de0fdbc16a77f4f0d2dd9faef527eea1e496ec3292d158a556a84d5aa3f42dbddbb9c890aac -SHA512 (bind-9.16.9.tar.xz.asc) = 0e2092e91dc092c39b05acda817a350fc937a941890e537dc6ef40b473c40c42bb6058b4822eb8e8e7e9bb7ad560b7eff1a5b3942993daa6059187d412831b9c +SHA512 (bind-9.16.10.tar.xz) = cb140fd577042ddeb7a47bc5e132d405d885bed22c9aeecb3d91a9115481ce4380ef191f78ba7acc9580ad0d4c8ed2658643007adf5b5527060879f34efdf8f7 +SHA512 (bind-9.16.10.tar.xz.asc) = 9ab68e1628ea953996190e754476c37e27a3c0f2b2d391c86e1da96930fddbcd5792df13cc5012d8b9f28c5565950a7d1d8ad36b8bef5abec90e407872724bf8 From bea44d51ee3d251d8eb618049895edcbdf318c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Wed, 6 Jan 2021 14:41:24 +0100 Subject: [PATCH 74/79] Use make macros Reduce number of variables, use prepared %make_build and %make_install where possible. Manual merge of MR #7. --- bind.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bind.spec b/bind.spec index 421a6d8..a2720ba 100644 --- a/bind.spec +++ b/bind.spec @@ -66,7 +66,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: MPLv2.0 Version: 9.16.10 -Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} +Release: 2%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist} Epoch: 32 Url: https://www.isc.org/downloads/bind/ # @@ -628,7 +628,7 @@ then set -e pushd build/bin/tests chown -R ${USER} . # Can be unknown user - make test %{?_smp_mflags} 2>&1 | tee test.log + %make_build test 2>&1 | tee test.log e=$? popd [ "$CONFIGURED" = build ] && sh bin/tests/system/ifconfig.sh down @@ -706,7 +706,7 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files pushd build pushd contrib/dlz/modules for DIR in filesystem ldap mysql mysqldyn sqlite3; do - make -C $DIR DESTDIR=${RPM_BUILD_ROOT} libdir=%{_libdir}/named install + %make_install -C $DIR libdir=%{_libdir}/bind done pushd ${RPM_BUILD_ROOT}/%{_libdir}/bind cp -s ../named/dlz_*.so . @@ -1162,6 +1162,10 @@ fi; %endif %changelog +* Wed Jan 06 2021 Petr Menšík - 32:9.16.10-2 +- Use make macros +- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro + * Tue Jan 05 2021 Petr Menšík - 32:9.16.10-1 - Update to 9.16.10 From dbc722407ebe4986fb23f2c4b96289aa7996fe69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Thu, 7 Jan 2021 11:38:47 +0100 Subject: [PATCH 75/79] Link tests to fedora test namespace Add ci.fmf too. --- ci.fmf | 13 +++++++++++++ tests/tests.yml | 21 +++------------------ 2 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 ci.fmf diff --git a/ci.fmf b/ci.fmf new file mode 100644 index 0000000..9a9fbea --- /dev/null +++ b/ci.fmf @@ -0,0 +1,13 @@ +/test: + summary: + CI plan, picks Tier1 tests, runs in beakerlib. + description: + This special plan has to be named ci.fmf to run in CI. + It selects test which have 'tier 1' in their main.fmf file + discover: + - name: tier1 + how: fmf + filter: 'tier: 1' + repository: "https://src.fedoraproject.org/tests/bind.git" + execute: + how: tmt diff --git a/tests/tests.yml b/tests/tests.yml index 15360ed..f30faff 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -6,21 +6,6 @@ tags: - classic tests: - - Master-server-chrooted - - Master-server-not-chrooted - - Run-internal-BIND-test-suite - required_packages: - - bind - - bind-chroot - - bind-sdb-chroot - - redhat-lsb - - bind-utils - - dnf-utils - - kyua - - bind-devel - - perl-Net-DNS - - perl-Net-DNS-Nameserver - - perl-Time-HiRes - - softhsm - - bind-pkcs11 - - bind-pkcs11-utils + - repo: "https://src.fedoraproject.org/tests/bind.git" + dest: "bind-tests" + fmf_filter: "tier: 1" From 893376130b8c2433bb79fccf6c29215c3c51c47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 12 Jan 2021 11:03:40 +0100 Subject: [PATCH 76/79] Remove docbook generation remains New BIND no longer uses any part of docbook. It can handle out of tree builds, therefore no hacks with copy back are required. Documents should be installed just fine. --- bind.spec | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bind.spec b/bind.spec index a2720ba..7938b62 100644 --- a/bind.spec +++ b/bind.spec @@ -498,7 +498,7 @@ export LIBDIR_SUFFIX %configure \ --with-python=%{__python3} \ --with-libtool \ - --localstatedir=/var \ + --localstatedir=%{_var} \ --with-pic \ --disable-static \ --includedir=%{_includedir}/bind9 \ @@ -531,7 +531,6 @@ export LIBDIR_SUFFIX --with-cmocka \ %endif --enable-fixed-rrset \ - --with-docbook-xsl=%{_datadir}/sgml/docbook/xsl-stylesheets \ --enable-full-report \ ; %if %{with DNSTAP} @@ -554,13 +553,6 @@ fmtutil-user --missing || : %make_build -### FIXME hack!!! -### xsltproc doesn't find properly configured files -### and use ones from source tree -### copy generated files to the original location -cp -rv doc/* ../doc/ - - # Regenerate dig.1 manpage pushd bin/dig make man From 6648a9230f1b911a8437f4893162d140ab5cf158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 12 Jan 2021 11:04:39 +0100 Subject: [PATCH 77/79] Install DLZ modules to named location Make compatibility symlinks to original bind location. --- bind.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bind.spec b/bind.spec index 7938b62..ccdded9 100644 --- a/bind.spec +++ b/bind.spec @@ -698,7 +698,7 @@ install -m 644 %{SOURCE49} ${RPM_BUILD_ROOT}%{_sysconfdir}/named-chroot.files pushd build pushd contrib/dlz/modules for DIR in filesystem ldap mysql mysqldyn sqlite3; do - %make_install -C $DIR libdir=%{_libdir}/bind + %make_install -C $DIR libdir=%{_libdir}/named done pushd ${RPM_BUILD_ROOT}/%{_libdir}/bind cp -s ../named/dlz_*.so . From cc152b028f6dddc9e0e77827d295510ebe1270ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 12 Jan 2021 11:39:58 +0100 Subject: [PATCH 78/79] Use autosetup/autopatch, reorder few patches Use autopatch, do not require mentioning each patch twice. Patches below 300 are generic patches applied after unpacking. Patches betwee 300 and 310 are PKCS11 specific, applied only when pkcs11 is enabled. Substracted 100 from current patches. --- bind.spec | 61 +++++++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 36 deletions(-) diff --git a/bind.spec b/bind.spec index ccdded9..5bf8c9f 100644 --- a/bind.spec +++ b/bind.spec @@ -99,25 +99,26 @@ Source48: setup-named-softhsm.sh Source49: named-chroot.files # Common patches -Patch10: bind-9.5-PIE.patch -Patch16: bind-9.16-redhat_doc.patch -Patch72: bind-9.5-dlz-64bit.patch -Patch106:bind93-rh490837.patch -Patch112:bind97-rh645544.patch -Patch130:bind-9.9.1-P2-dlz-libdb.patch -Patch133:bind99-rh640538.patch -# Make PKCS11 used only for pkcs11 parts -Patch135:bind-9.14-config-pkcs11.patch -# Fedora specific patch to distribute native-pkcs#11 functionality -Patch136:bind-9.10-dist-native-pkcs11.patch -# Do not use isc-pkcs11. -Patch149:bind-9.11-kyua-pkcs11.patch +Patch01: bind-9.5-PIE.patch +Patch02: bind-9.16-redhat_doc.patch +Patch03: bind-9.5-dlz-64bit.patch +Patch06: bind93-rh490837.patch +Patch12: bind97-rh645544.patch +Patch30: bind-9.9.1-P2-dlz-libdb.patch +# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/2688 +Patch33: bind99-rh640538.patch +Patch40: bind-9.11-rh1410433.patch +Patch57: bind-9.11-fips-tests.patch +Patch64: bind-9.11-rh1666814.patch +Patch70: bind-9.11-feature-test-named.patch +Patch71: bind-9.11-tests-variants.patch -Patch140:bind-9.11-rh1410433.patch -Patch157:bind-9.11-fips-tests.patch -Patch164:bind-9.11-rh1666814.patch -Patch170:bind-9.11-feature-test-named.patch -Patch171:bind-9.11-tests-variants.patch +# Make PKCS11 used only for pkcs11 parts +Patch300: bind-9.14-config-pkcs11.patch +# Fedora specific patch to distribute native-pkcs#11 functionality +Patch301: bind-9.10-dist-native-pkcs11.patch +# Do not use isc-pkcs11. +Patch302: bind-9.11-kyua-pkcs11.patch Requires(post): systemd Requires(preun): systemd @@ -412,36 +413,23 @@ in HTML and PDF format. %endif %prep -%if 0%{?gpgverify:1} -# RHEL does not yet support this verification +%if 0%{?fedora} %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE0}' %endif -%setup -q -n %{name}-%{BINDVERSION} +%autosetup -n %{name}-%{BINDVERSION} -N # Common patches -%patch10 -p1 -b .PIE -%patch16 -p1 -b .redhat_doc -%patch72 -p1 -b .64bit -%patch106 -p1 -b .rh490837 -%patch112 -p1 -b .rh645544 -%patch130 -p1 -b .libdb -%patch140 -p1 -b .rh1410433 -%patch157 -p1 -b .fips-tests -%patch164 -p1 -b .rh1666814 -%patch170 -p1 -b .featuretest-named -%patch171 -p1 -b .test-variant +%autopatch -M 299 -p1 %if %{with PKCS11} -%patch135 -p1 -b .config-pkcs11 +%patch300 -p1 -b .config-pkcs11 cp -r bin/named{,-pkcs11} cp -r bin/dnssec{,-pkcs11} cp -r lib/dns{,-pkcs11} cp -r lib/ns{,-pkcs11} -%patch136 -p1 -b .dist_pkcs11 -%patch149 -p1 -b .kyua-pkcs11 +%autopatch -m 301 -M 309 -p1 %endif -%patch133 -p1 -b .rh640538 # Sparc and s390 arches need to use -fPIE %ifarch sparcv9 sparc64 s390 s390x @@ -1157,6 +1145,7 @@ fi; * Wed Jan 06 2021 Petr Menšík - 32:9.16.10-2 - Use make macros - https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro +- Use autosetup/autopatch macros * Tue Jan 05 2021 Petr Menšík - 32:9.16.10-1 - Update to 9.16.10 From 684e4b0d0a94d487f24108cb59a952eda5a67f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 12 Jan 2021 20:54:56 +0100 Subject: [PATCH 79/79] Revert "Use autosetup/autopatch, reorder few patches" This reverts commit cc152b028f6dddc9e0e77827d295510ebe1270ce. EPEL and RHEL 8 do not yet support %autopatch -M X. I want check the compatibility with them, keep it legacy way until they are supported in RHEL 8. --- bind.spec | 57 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/bind.spec b/bind.spec index 5bf8c9f..ccdded9 100644 --- a/bind.spec +++ b/bind.spec @@ -99,26 +99,25 @@ Source48: setup-named-softhsm.sh Source49: named-chroot.files # Common patches -Patch01: bind-9.5-PIE.patch -Patch02: bind-9.16-redhat_doc.patch -Patch03: bind-9.5-dlz-64bit.patch -Patch06: bind93-rh490837.patch -Patch12: bind97-rh645544.patch -Patch30: bind-9.9.1-P2-dlz-libdb.patch -# https://gitlab.isc.org/isc-projects/bind9/-/merge_requests/2688 -Patch33: bind99-rh640538.patch -Patch40: bind-9.11-rh1410433.patch -Patch57: bind-9.11-fips-tests.patch -Patch64: bind-9.11-rh1666814.patch -Patch70: bind-9.11-feature-test-named.patch -Patch71: bind-9.11-tests-variants.patch - +Patch10: bind-9.5-PIE.patch +Patch16: bind-9.16-redhat_doc.patch +Patch72: bind-9.5-dlz-64bit.patch +Patch106:bind93-rh490837.patch +Patch112:bind97-rh645544.patch +Patch130:bind-9.9.1-P2-dlz-libdb.patch +Patch133:bind99-rh640538.patch # Make PKCS11 used only for pkcs11 parts -Patch300: bind-9.14-config-pkcs11.patch +Patch135:bind-9.14-config-pkcs11.patch # Fedora specific patch to distribute native-pkcs#11 functionality -Patch301: bind-9.10-dist-native-pkcs11.patch +Patch136:bind-9.10-dist-native-pkcs11.patch # Do not use isc-pkcs11. -Patch302: bind-9.11-kyua-pkcs11.patch +Patch149:bind-9.11-kyua-pkcs11.patch + +Patch140:bind-9.11-rh1410433.patch +Patch157:bind-9.11-fips-tests.patch +Patch164:bind-9.11-rh1666814.patch +Patch170:bind-9.11-feature-test-named.patch +Patch171:bind-9.11-tests-variants.patch Requires(post): systemd Requires(preun): systemd @@ -413,23 +412,36 @@ in HTML and PDF format. %endif %prep -%if 0%{?fedora} +%if 0%{?gpgverify:1} +# RHEL does not yet support this verification %{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE0}' %endif -%autosetup -n %{name}-%{BINDVERSION} -N +%setup -q -n %{name}-%{BINDVERSION} # Common patches -%autopatch -M 299 -p1 +%patch10 -p1 -b .PIE +%patch16 -p1 -b .redhat_doc +%patch72 -p1 -b .64bit +%patch106 -p1 -b .rh490837 +%patch112 -p1 -b .rh645544 +%patch130 -p1 -b .libdb +%patch140 -p1 -b .rh1410433 +%patch157 -p1 -b .fips-tests +%patch164 -p1 -b .rh1666814 +%patch170 -p1 -b .featuretest-named +%patch171 -p1 -b .test-variant %if %{with PKCS11} -%patch300 -p1 -b .config-pkcs11 +%patch135 -p1 -b .config-pkcs11 cp -r bin/named{,-pkcs11} cp -r bin/dnssec{,-pkcs11} cp -r lib/dns{,-pkcs11} cp -r lib/ns{,-pkcs11} -%autopatch -m 301 -M 309 -p1 +%patch136 -p1 -b .dist_pkcs11 +%patch149 -p1 -b .kyua-pkcs11 %endif +%patch133 -p1 -b .rh640538 # Sparc and s390 arches need to use -fPIE %ifarch sparcv9 sparc64 s390 s390x @@ -1145,7 +1157,6 @@ fi; * Wed Jan 06 2021 Petr Menšík - 32:9.16.10-2 - Use make macros - https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro -- Use autosetup/autopatch macros * Tue Jan 05 2021 Petr Menšík - 32:9.16.10-1 - Update to 9.16.10