Update to 9.11.0-P1

This commit is contained in:
Michal Ruprich 2016-11-16 08:46:09 +01:00
parent 20cebfb8c5
commit d886cd072d
11 changed files with 2663 additions and 2022 deletions

1
.gitignore vendored
View File

@ -67,3 +67,4 @@ bind-9.7.2b1.tar.gz
/bind-9.10.4-P2.tar.gz
/bind-9.10.4-P3.tar.gz
/bind-9.10.4-P4.tar.gz
/bind-9.11.0-P1.tar.gz

View File

@ -2,13 +2,13 @@ diff --git a/bin/Makefile.in b/bin/Makefile.in
index e3aeffb..7654169 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -19,7 +19,7 @@ srcdir = @srcdir@
@@ -10,7 +10,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \
+SUBDIRS = named named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools tests nsupdate \
check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@
TARGETS =
diff --git a/bin/dnssec-pkcs11/Makefile.in b/bin/dnssec-pkcs11/Makefile.in
@ -137,14 +137,14 @@ diff --git a/bin/named-pkcs11/Makefile.in b/bin/named-pkcs11/Makefile.in
index 95e36c1..fb658e9 100644
--- a/bin/named-pkcs11/Makefile.in
+++ b/bin/named-pkcs11/Makefile.in
@@ -47,26 +47,26 @@ DLZDRIVER_INCLUDES = @DLZ_DRIVER_INCLUDES@
@@ -36,26 +36,26 @@ 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} \
+ ${LWRES_INCLUDES} ${DNS_PKCS11_INCLUDES} ${BIND9_INCLUDES} \
+ ${ISCCFG_INCLUDES} ${ISCCC_INCLUDES} ${ISC_PKCS11_INCLUDES} \
${DLZDRIVER_INCLUDES} ${DBDRIVER_INCLUDES} @DST_OPENSSL_INC@
-CDEFINES = @CONTRIB_DLZ@ @USE_PKCS11@ @PKCS11_ENGINE@ @CRYPTO@
@ -153,25 +153,25 @@ index 95e36c1..fb658e9 100644
CWARNINGS =
-DNSLIBS = ../../lib/dns/libdns.@A@ @DNS_CRYPTO_LIBS@
+DNSLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@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@
+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@
+ISCLIBS = ../../lib/isc-pkcs11/libisc-pkcs11.@A@
ISCNOSYMLIBS = ../../lib/isc/libisc-nosymtbl.@A@
LWRESLIBS = ../../lib/lwres/liblwres.@A@
BIND9LIBS = ../../lib/bind9/libbind9.@A@
-DNSDEPLIBS = ../../lib/dns/libdns.@A@
+DNSDEPLIBS = ../../lib/dns-pkcs11/libdns-pkcs11.@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-pkcs11/libisc-pkcs11.@A@
LWRESDEPLIBS = ../../lib/lwres/liblwres.@A@
BIND9DEPLIBS = ../../lib/bind9/libbind9.@A@
@@ -75,15 +75,15 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
@@ -64,15 +64,15 @@ DEPLIBS = ${LWRESDEPLIBS} ${DNSDEPLIBS} ${BIND9DEPLIBS} \
LIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCLIBS} \
@ -181,58 +181,57 @@ index 95e36c1..fb658e9 100644
NOSYMLIBS = ${LWRESLIBS} ${DNSLIBS} ${BIND9LIBS} \
${ISCCFGLIBS} ${ISCCCLIBS} ${ISCNOSYMLIBS} \
- ${DLZDRIVER_LIBS} ${DBDRIVER_LIBS} @LIBS@
+ @LIBS@
+ @LIBS@
SUBDIRS = unix
-TARGETS = named@EXEEXT@ lwresd@EXEEXT@
+TARGETS = named-pkcs11@EXEEXT@
+TARGETS = named-pkcs11@EXEEXT@
GEOIPLINKOBJS = geoip.@O@
@@ -94,8 +94,7 @@ OBJS = builtin.@O@ client.@O@ config.@O@ control.@O@ \
@@ -83,8 +83,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@
+ lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@
UOBJS = unix/os.@O@ unix/dlz_dlopen_driver.@O@
@@ -110,8 +109,7 @@ SRCS = builtin.c client.c config.c control.c \
@@ -99,8 +98,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
+ lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c
MANPAGES = named.8 lwresd.8 named.conf.5
@@ -144,7 +142,7 @@ config.@O@: config.c
-DNS_SYSCONFDIR=\"${sysconfdir}\" \
-c ${srcdir}/config.c
@@ -139,7 +137,7 @@ server.@O@: server.c
-DPRODUCT=\"${PRODUCT}\" \
-DVERSION=\"${VERSION}\" -c ${srcdir}/server.c
-named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
+named-pkcs11@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
export MAKE_SYMTABLE="yes"; \
export BASEOBJS="${OBJS} ${UOBJS}"; \
${FINALBUILDCMD}
@@ -171,15 +169,9 @@ statschannel.@O@: bind9.xsl.h
@@ -166,15 +164,9 @@ 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:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
- ${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
+
+install:: named-pkcs11@EXEEXT@ installdirs
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} named-pkcs11@EXEEXT@ ${DESTDIR}${sbindir}
@ -291,27 +290,26 @@ index a28f773..8f3b8f4 100644
#
# was --with-randomdev specified?
@@ -1383,10 +1385,10 @@ OPENSSL_WARNING=
@@ -1383,11 +1385,11 @@
AC_MSG_CHECKING(for OpenSSL library)
OPENSSL_WARNING=
openssldirs="/usr /usr/local /usr/local/ssl /usr/pkg /usr/sfw"
-if test "$want_native_pkcs11" = "yes"
-then
- use_openssl="native_pkcs11"
- AC_MSG_RESULT(use of native PKCS11 instead)
-fi
+# if test "$want_native_pkcs11" = "yes"
+# then
+# use_openssl="native_pkcs11"
+# AC_MSG_RESULT(use of native PKCS11 instead)
+# fi
if test "$use_openssl" = "auto"
then
- if test "$want_native_pkcs11" = "yes"
- then
- use_openssl="native_pkcs11"
- else
+# if test "$want_native_pkcs11" = "yes"
+# then
+# use_openssl="native_pkcs11"
+# else
for d in $openssldirs
do
if test -f $d/include/openssl/opensslv.h
@@ -1395,8 +1397,9 @@ then
break
fi
done
- fi
+# fi
@@ -1395,6 +1397,7 @@ then
fi
done
fi
+CRYPTO_PK11=""
OPENSSL_ECDSA=""
@ -470,9 +468,9 @@ index 5f1ce56..830c0d5 100644
${RANLIB} $@
@@ -144,23 +144,23 @@ dynamic_db.@O@: dynamic_db.c
-c ${srcdir}/dynamic_db.c
${AR} ${ARFLAGS} $@ ${OBJS}
${RANLIB} $@
-libdns.la: ${OBJS}
+libdns-pkcs11.la: ${OBJS}
${LIBTOOL_MODE_LINK} \
@ -481,24 +479,24 @@ index 5f1ce56..830c0d5 100644
-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
- ${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS}
+ ${OBJS} ${ISCLIBS} @DNS_CRYPTO_PK11_LIBS@ ${LIBS}
-timestamp: libdns.@A@
+timestamp: libdns-pkcs11.@A@
touch timestamp
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
install:: timestamp installdirs
- ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libdns.@A@ ${DESTDIR}${libdir}
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_LIBRARY} libdns-pkcs11.@A@ ${DESTDIR}${libdir}
clean distclean::
- rm -f libdns.@A@ timestamp
+ 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
@@ -190,7 +190,7 @@ code.h: gen
./gen -s ${srcdir} > code.h

View File

@ -1,731 +0,0 @@
diff --git a/bin/named/main.c b/bin/named/main.c
index 556db54..0051f9a 100644
--- a/bin/named/main.c
+++ b/bin/named/main.c
@@ -43,6 +43,7 @@
#include <isccc/result.h>
#include <dns/dispatch.h>
+#include <dns/dynamic_db.h>
#include <dns/name.h>
#include <dns/result.h>
#include <dns/view.h>
diff --git a/bin/named/server.c b/bin/named/server.c
index 33483f8..3d2f1c6 100644
--- a/bin/named/server.c
+++ b/bin/named/server.c
@@ -68,6 +68,7 @@
#include <dns/db.h>
#include <dns/dispatch.h>
#include <dns/dlz.h>
+#include <dns/dynamic_db.h>
#include <dns/dns64.h>
#include <dns/forward.h>
#include <dns/journal.h>
@@ -1309,6 +1310,70 @@ configure_peer(const cfg_obj_t *cpeer, isc_mem_t *mctx, dns_peer_t **peerp) {
return (result);
}
+configure_dynamic_db(const cfg_obj_t *dynamic_db, isc_mem_t *mctx,
+ const dns_dyndb_arguments_t *dyndb_args)
+{
+ isc_result_t result;
+ const cfg_obj_t *obj;
+ const cfg_obj_t *options;
+ const cfg_listelt_t *element;
+ const char *name;
+ const char *libname;
+ const char **argv = NULL;
+ unsigned int i;
+ unsigned int len;
+
+ /* Get the name of the database. */
+ obj = cfg_tuple_get(dynamic_db, "name");
+ name = cfg_obj_asstring(obj);
+
+ /* Get options. */
+ options = cfg_tuple_get(dynamic_db, "options");
+
+ /* Get library name. */
+ obj = NULL;
+ CHECK(cfg_map_get(options, "library", &obj));
+ libname = cfg_obj_asstring(obj);
+
+ /* Create a list of arguments. */
+ obj = NULL;
+ result = cfg_map_get(options, "arg", &obj);
+ if (result == ISC_R_NOTFOUND)
+ len = 0;
+ else if (result == ISC_R_SUCCESS)
+ len = cfg_list_length(obj, isc_boolean_false);
+ else
+ goto cleanup;
+
+ /* Account for the last terminating NULL. */
+ len++;
+
+ argv = isc_mem_allocate(mctx, len * sizeof(const char *));
+ if (argv == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup;
+ }
+ for (element = cfg_list_first(obj), i = 0;
+ element != NULL;
+ element = cfg_list_next(element), i++)
+ {
+ REQUIRE(i < len);
+
+ obj = cfg_listelt_value(element);
+ argv[i] = cfg_obj_asstring(obj);
+ }
+ REQUIRE(i < len);
+ argv[i] = NULL;
+
+ CHECK(dns_dynamic_db_load(libname, name, mctx, argv, dyndb_args));
+
+cleanup:
+ if (argv != NULL)
+ isc_mem_free(mctx, argv);
+
+ return result;
+}
+
static isc_result_t
disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) {
isc_result_t result;
@@ -2349,6 +2414,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
const cfg_obj_t *dlz;
unsigned int dlzargc;
char **dlzargv;
+ const cfg_obj_t *dynamic_db_list;
const cfg_obj_t *disabled;
const cfg_obj_t *obj;
#ifdef ENABLE_FETCHLIMIT
@@ -3704,6 +3770,37 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
dns_view_setrootdelonly(view, ISC_FALSE);
/*
+ * Configure dynamic databases.
+ */
+ dynamic_db_list = NULL;
+ if (voptions != NULL)
+ (void)cfg_map_get(voptions, "dynamic-db", &dynamic_db_list);
+ else
+ (void)cfg_map_get(config, "dynamic-db", &dynamic_db_list);
+ element = cfg_list_first(dynamic_db_list);
+ if (element != NULL) {
+ dns_dyndb_arguments_t *args;
+
+ args = dns_dyndb_arguments_create(mctx);
+ if (args == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup;
+ }
+ dns_dyndb_set_view(args, view);
+ dns_dyndb_set_zonemgr(args, ns_g_server->zonemgr);
+ dns_dyndb_set_task(args, ns_g_server->task);
+ dns_dyndb_set_timermgr(args, ns_g_timermgr);
+ while (element != NULL) {
+ obj = cfg_listelt_value(element);
+ CHECK(configure_dynamic_db(obj, mctx, args));
+
+ element = cfg_list_next(element);
+ }
+
+ dns_dyndb_arguments_destroy(mctx, args);
+ }
+
+ /*
* Setup automatic empty zones. If recursion is off then
* they are disabled by default.
*/
@@ -5457,6 +5554,7 @@ load_configuration(const char *filename, ns_server_t *server,
cfg_aclconfctx_detach(&ns_g_aclconfctx);
CHECK(cfg_aclconfctx_create(ns_g_mctx, &ns_g_aclconfctx));
+ dns_dynamic_db_cleanup(ISC_FALSE);
/*
* Parse the global default pseudo-config file.
*/
@@ -6685,6 +6783,8 @@ shutdown_server(isc_task_t *task, isc_event_t *event) {
dns_view_detach(&view);
}
+ dns_dynamic_db_cleanup(ISC_TRUE);
+
while ((nsc = ISC_LIST_HEAD(server->cachelist)) != NULL) {
ISC_LIST_UNLINK(server->cachelist, nsc, link);
dns_cache_detach(&nsc->cache);
diff --git a/lib/dns/Makefile.in b/lib/dns/Makefile.in
index 4f3ef52..34973af 100644
--- a/lib/dns/Makefile.in
+++ b/lib/dns/Makefile.in
@@ -65,7 +65,7 @@ GEOIPLINKOBJS = geoip.@O@
DNSOBJS = acache.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
cache.@O@ callbacks.@O@ clientinfo.@O@ compress.@O@ \
db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
- dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ forward.@O@ \
+ dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ dynamic_db.@O@ forward.@O@ \
iptable.@O@ journal.@O@ keydata.@O@ keytable.@O@ \
lib.@O@ log.@O@ lookup.@O@ \
master.@O@ masterdump.@O@ message.@O@ \
@@ -103,7 +103,7 @@ GEOIOLINKSRCS = geoip.c
DNSSRCS = acache.c acl.c adb.c byaddr.c \
cache.c callbacks.c clientinfo.c compress.c \
db.c dbiterator.c dbtable.c diff.c dispatch.c \
- dlz.c dns64.c dnssec.c ds.c forward.c \
+ dlz.c dns64.c dnssec.c ds.c dynamic_db.c forward.c \
iptable.c journal.c keydata.c keytable.c lib.c log.c \
lookup.c master.c masterdump.c message.c \
name.c ncache.c nsec.c nsec3.c order.c peer.c portlist.c \
@@ -142,6 +142,12 @@ libdns.@SA@: ${OBJS}
${AR} ${ARFLAGS} $@ ${OBJS}
${RANLIB} $@
+dynamic_db.@O@: dynamic_db.c
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
+ -DDYNDB_LIBDIR=\"@libdir@/bind/\" \
+ -c ${srcdir}/dynamic_db.c
+
+
libdns.la: ${OBJS}
${LIBTOOL_MODE_LINK} \
${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libdns.la -rpath ${libdir} \
diff --git a/lib/dns/dynamic_db.c b/lib/dns/dynamic_db.c
index e69de29..e32a3c8 100644
--- a/lib/dns/dynamic_db.c
+++ b/lib/dns/dynamic_db.c
@@ -0,0 +1,367 @@
+/*
+ * Copyright (C) 2008-2011 Red Hat, Inc.
+ *
+ * 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 Red Hat DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL Red Hat 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.
+ */
+
+
+#include <config.h>
+
+#include <isc/buffer.h>
+#include <isc/mem.h>
+#include <isc/mutex.h>
+#include <isc/once.h>
+#include <isc/result.h>
+#include <isc/region.h>
+#include <isc/task.h>
+#include <isc/types.h>
+#include <isc/util.h>
+
+#include <dns/dynamic_db.h>
+#include <dns/log.h>
+#include <dns/types.h>
+#include <dns/view.h>
+#include <dns/zone.h>
+
+#include <string.h>
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#ifndef DYNDB_LIBDIR
+#define DYNDB_LIBDIR ""
+#endif
+
+#define CHECK(op) \
+ do { result = (op); \
+ if (result != ISC_R_SUCCESS) goto cleanup; \
+ } while (0)
+
+
+typedef isc_result_t (*register_func_t)(isc_mem_t *mctx, const char *name,
+ const char * const *argv,
+ const dns_dyndb_arguments_t *dyndb_args);
+typedef void (*destroy_func_t)(void);
+
+typedef struct dyndb_implementation dyndb_implementation_t;
+
+struct dyndb_implementation {
+ isc_mem_t *mctx;
+ void *handle;
+ register_func_t register_function;
+ destroy_func_t destroy_function;
+ LINK(dyndb_implementation_t) link;
+};
+
+struct dns_dyndb_arguments {
+ dns_view_t *view;
+ dns_zonemgr_t *zmgr;
+ isc_task_t *task;
+ isc_timermgr_t *timermgr;
+};
+
+/* List of implementations. Locked by dyndb_lock. */
+static LIST(dyndb_implementation_t) dyndb_implementations;
+/* Locks dyndb_implementations. */
+static isc_mutex_t dyndb_lock;
+static isc_once_t once = ISC_ONCE_INIT;
+
+static void
+dyndb_initialize(void) {
+ RUNTIME_CHECK(isc_mutex_init(&dyndb_lock) == ISC_R_SUCCESS);
+ INIT_LIST(dyndb_implementations);
+}
+
+
+#if HAVE_DLFCN_H
+static isc_result_t
+load_symbol(void *handle, const char *symbol_name, void **symbolp)
+{
+ const char *errmsg;
+ void *symbol;
+
+ REQUIRE(handle != NULL);
+ REQUIRE(symbolp != NULL && *symbolp == NULL);
+
+ symbol = dlsym(handle, symbol_name);
+ if (symbol == NULL) {
+ errmsg = dlerror();
+ if (errmsg == NULL)
+ errmsg = "returned function pointer is NULL";
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
+ DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR,
+ "failed to lookup symbol %s: %s",
+ symbol_name, errmsg);
+ return ISC_R_FAILURE;
+ }
+ dlerror();
+
+ *symbolp = symbol;
+
+ return ISC_R_SUCCESS;
+}
+
+static isc_result_t
+load_library(isc_mem_t *mctx, const char *filename, dyndb_implementation_t **impp)
+{
+ isc_result_t result;
+ size_t module_size;
+ isc_buffer_t *module_buf = NULL;
+ isc_region_t module_region;
+ void *handle = NULL;
+ dyndb_implementation_t *imp;
+ register_func_t register_function = NULL;
+ destroy_func_t destroy_function = NULL;
+
+ REQUIRE(impp != NULL && *impp == NULL);
+
+ /* Build up the full path. */
+ module_size = strlen(DYNDB_LIBDIR) + strlen(filename) + 1;
+ CHECK(isc_buffer_allocate(mctx, &module_buf, module_size));
+ isc_buffer_putstr(module_buf, DYNDB_LIBDIR);
+ isc_buffer_putstr(module_buf, filename);
+ isc_buffer_putuint8(module_buf, 0);
+ isc_buffer_region(module_buf, &module_region);
+
+ handle = dlopen((char *)module_region.base, RTLD_LAZY);
+ if (handle == NULL) {
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE,
+ DNS_LOGMODULE_DYNDB, ISC_LOG_ERROR,
+ "failed to dynamically load driver '%s': %s",
+ filename, dlerror());
+ result = ISC_R_FAILURE;
+ goto cleanup;
+ }
+ dlerror();
+
+ CHECK(load_symbol(handle, "dynamic_driver_init",
+ (void **)&register_function));
+ CHECK(load_symbol(handle, "dynamic_driver_destroy",
+ (void **)&destroy_function));
+
+ imp = isc_mem_get(mctx, sizeof(dyndb_implementation_t));
+ if (imp == NULL) {
+ result = ISC_R_NOMEMORY;
+ goto cleanup;
+ }
+
+ imp->mctx = NULL;
+ isc_mem_attach(mctx, &imp->mctx);
+ imp->handle = handle;
+ imp->register_function = register_function;
+ imp->destroy_function = destroy_function;
+ INIT_LINK(imp, link);
+
+ *impp = imp;
+
+cleanup:
+ if (result != ISC_R_SUCCESS && handle != NULL)
+ dlclose(handle);
+ if (module_buf != NULL)
+ isc_buffer_free(&module_buf);
+
+ return result;
+}
+
+static void
+unload_library(dyndb_implementation_t **impp)
+{
+ dyndb_implementation_t *imp;
+
+ REQUIRE(impp != NULL && *impp != NULL);
+
+ imp = *impp;
+
+ isc_mem_putanddetach(&imp->mctx, imp, sizeof(dyndb_implementation_t));
+
+ *impp = NULL;
+}
+
+#else /* HAVE_DLFCN_H */
+static isc_result_t
+load_library(isc_mem_t *mctx, const char *filename, dyndb_implementation_t **impp)
+{
+ UNUSED(mctx);
+ UNUSED(filename);
+ UNUSED(impp);
+
+ isc_log_write(dns_lctx, DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_DYNDB,
+ ISC_LOG_ERROR,
+ "dynamic database support is not implemented")
+
+ return ISC_R_NOTIMPLEMENTED;
+}
+
+static void
+unload_library(dyndb_implementation_t **impp)
+{
+ dyndb_implementation_t *imp;
+
+ REQUIRE(impp != NULL && *impp != NULL);
+
+ imp = *impp;
+
+ isc_mem_putanddetach(&imp->mctx, imp, sizeof(dyndb_implementation_t));
+
+ *impp = NULL;
+}
+#endif /* HAVE_DLFCN_H */
+
+isc_result_t
+dns_dynamic_db_load(const char *libname, const char *name, isc_mem_t *mctx,
+ const char * const *argv,
+ const dns_dyndb_arguments_t *dyndb_args)
+{
+ isc_result_t result;
+ dyndb_implementation_t *implementation = NULL;
+
+ RUNTIME_CHECK(isc_once_do(&once, dyndb_initialize) == ISC_R_SUCCESS);
+
+ CHECK(load_library(mctx, libname, &implementation));
+ CHECK(implementation->register_function(mctx, name, argv, dyndb_args));
+
+ LOCK(&dyndb_lock);
+ APPEND(dyndb_implementations, implementation, link);
+ UNLOCK(&dyndb_lock);
+
+ return ISC_R_SUCCESS;
+
+cleanup:
+ if (implementation != NULL)
+ unload_library(&implementation);
+
+ return result;
+}
+
+void
+dns_dynamic_db_cleanup(isc_boolean_t exiting)
+{
+ dyndb_implementation_t *elem;
+ dyndb_implementation_t *prev;
+
+ RUNTIME_CHECK(isc_once_do(&once, dyndb_initialize) == ISC_R_SUCCESS);
+
+ LOCK(&dyndb_lock);
+ elem = TAIL(dyndb_implementations);
+ while (elem != NULL) {
+ prev = PREV(elem, link);
+ UNLINK(dyndb_implementations, elem, link);
+ elem->destroy_function();
+ unload_library(&elem);
+ elem = prev;
+ }
+ UNLOCK(&dyndb_lock);
+
+ if (exiting == ISC_TRUE)
+ isc_mutex_destroy(&dyndb_lock);
+}
+
+dns_dyndb_arguments_t *
+dns_dyndb_arguments_create(isc_mem_t *mctx)
+{
+ dns_dyndb_arguments_t *args;
+
+ args = isc_mem_get(mctx, sizeof(*args));
+ if (args != NULL)
+ memset(args, 0, sizeof(*args));
+
+ return args;
+}
+
+void
+dns_dyndb_arguments_destroy(isc_mem_t *mctx, dns_dyndb_arguments_t *args)
+{
+ REQUIRE(args != NULL);
+
+ dns_dyndb_set_view(args, NULL);
+ dns_dyndb_set_zonemgr(args, NULL);
+ dns_dyndb_set_task(args, NULL);
+ dns_dyndb_set_timermgr(args, NULL);
+
+ isc_mem_put(mctx, args, sizeof(*args));
+}
+
+void
+dns_dyndb_set_view(dns_dyndb_arguments_t *args, dns_view_t *view)
+{
+ REQUIRE(args != NULL);
+
+ if (args->view != NULL)
+ dns_view_detach(&args->view);
+ if (view != NULL)
+ dns_view_attach(view, &args->view);
+}
+
+dns_view_t *
+dns_dyndb_get_view(dns_dyndb_arguments_t *args)
+{
+ REQUIRE(args != NULL);
+
+ return args->view;
+}
+
+void
+dns_dyndb_set_zonemgr(dns_dyndb_arguments_t *args, dns_zonemgr_t *zmgr)
+{
+ REQUIRE(args != NULL);
+
+ if (args->zmgr != NULL)
+ dns_zonemgr_detach(&args->zmgr);
+ if (zmgr != NULL)
+ dns_zonemgr_attach(zmgr, &args->zmgr);
+}
+
+dns_zonemgr_t *
+dns_dyndb_get_zonemgr(dns_dyndb_arguments_t *args)
+{
+ REQUIRE(args != NULL);
+
+ return args->zmgr;
+}
+
+void
+dns_dyndb_set_task(dns_dyndb_arguments_t *args, isc_task_t *task)
+{
+ REQUIRE(args != NULL);
+
+ if (args->task != NULL)
+ isc_task_detach(&args->task);
+ if (task != NULL)
+ isc_task_attach(task, &args->task);
+}
+
+isc_task_t *
+dns_dyndb_get_task(dns_dyndb_arguments_t *args)
+{
+ REQUIRE(args != NULL);
+
+ return args->task;
+}
+
+void
+dns_dyndb_set_timermgr(dns_dyndb_arguments_t *args, isc_timermgr_t *timermgr)
+{
+ REQUIRE(args != NULL);
+
+ args->timermgr = timermgr;
+}
+
+isc_timermgr_t *
+dns_dyndb_get_timermgr(dns_dyndb_arguments_t *args)
+{
+ REQUIRE(args != NULL);
+
+ return args->timermgr;
+}
+
diff --git a/lib/dns/include/dns/Makefile.in b/lib/dns/include/dns/Makefile.in
index aecf6f0..8e24b54 100644
--- a/lib/dns/include/dns/Makefile.in
+++ b/lib/dns/include/dns/Makefile.in
@@ -23,7 +23,7 @@ VERSION=@BIND9_VERSION@
HEADERS = acache.h acl.h adb.h bit.h byaddr.h cache.h callbacks.h cert.h \
client.h clientinfo.h compress.h \
- db.h dbiterator.h dbtable.h diff.h dispatch.h \
+ db.h dbiterator.h dbtable.h diff.h dispatch.h dynamic_db.h \
dlz.h dlz_dlopen.h dns64.h dnssec.h ds.h dsdigest.h \
ecdb.h events.h fixedname.h forward.h geoip.h iptable.h \
journal.h keydata.h keyflags.h keytable.h keyvalues.h \
diff --git a/lib/dns/include/dns/dynamic_db.h b/lib/dns/include/dns/dynamic_db.h
index e69de29..719fa0f 100644
--- a/lib/dns/include/dns/dynamic_db.h
+++ b/lib/dns/include/dns/dynamic_db.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2008-2011 Red Hat, Inc.
+ *
+ * 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 Red Hat DISCLAIMS ALL WARRANTIES WITH
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS. IN NO EVENT SHALL Red Hat 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.
+ */
+
+
+#ifndef DYNAMIC_DB_H
+#define DYNAMIC_DB_H
+
+#include <isc/types.h>
+
+#include <dns/types.h>
+
+/*
+ * TODO:
+ * Reformat the prototypes.
+ * Add annotated comments.
+ */
+
+isc_result_t dns_dynamic_db_load(const char *libname, const char *name,
+ isc_mem_t *mctx, const char * const *argv,
+ const dns_dyndb_arguments_t *dyndb_args);
+
+void dns_dynamic_db_cleanup(isc_boolean_t exiting);
+
+dns_dyndb_arguments_t *dns_dyndb_arguments_create(isc_mem_t *mctx);
+void dns_dyndb_arguments_destroy(isc_mem_t *mctx, dns_dyndb_arguments_t *args);
+
+void dns_dyndb_set_view(dns_dyndb_arguments_t *args, dns_view_t *view);
+dns_view_t *dns_dyndb_get_view(dns_dyndb_arguments_t *args);
+void dns_dyndb_set_zonemgr(dns_dyndb_arguments_t *args, dns_zonemgr_t *zmgr);
+dns_zonemgr_t *dns_dyndb_get_zonemgr(dns_dyndb_arguments_t *args);
+void dns_dyndb_set_task(dns_dyndb_arguments_t *args, isc_task_t *task);
+isc_task_t *dns_dyndb_get_task(dns_dyndb_arguments_t *args);
+void dns_dyndb_set_timermgr(dns_dyndb_arguments_t *args,
+ isc_timermgr_t *timermgr);
+isc_timermgr_t *dns_dyndb_get_timermgr(dns_dyndb_arguments_t *args);
+
+#endif
+
diff --git a/lib/dns/include/dns/log.h b/lib/dns/include/dns/log.h
index 845be49..7b94ec6 100644
--- a/lib/dns/include/dns/log.h
+++ b/lib/dns/include/dns/log.h
@@ -78,6 +78,7 @@ LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[];
#define DNS_LOGMODULE_DNSSEC (&dns_modules[27])
#define DNS_LOGMODULE_CRYPTO (&dns_modules[28])
#define DNS_LOGMODULE_PACKETS (&dns_modules[29])
+#define DNS_LOGMODULE_DYNDB (&dns_modules[30])
ISC_LANG_BEGINDECLS
diff --git a/lib/dns/include/dns/types.h b/lib/dns/include/dns/types.h
index 00ba58e..b7fdead 100644
--- a/lib/dns/include/dns/types.h
+++ b/lib/dns/include/dns/types.h
@@ -64,6 +64,7 @@ typedef struct dns_dlzimplementation dns_dlzimplementation_t;
typedef struct dns_dlzdb dns_dlzdb_t;
typedef ISC_LIST(dns_dlzdb_t) dns_dlzdblist_t;
typedef struct dns_sdlzimplementation dns_sdlzimplementation_t;
+typedef struct dns_dyndb_arguments dns_dyndb_arguments_t;
typedef struct dns_decompress dns_decompress_t;
typedef struct dns_dispatch dns_dispatch_t;
typedef struct dns_dispatchevent dns_dispatchevent_t;
diff --git a/lib/dns/log.c b/lib/dns/log.c
index 377b03c..acef9e6 100644
--- a/lib/dns/log.c
+++ b/lib/dns/log.c
@@ -84,6 +84,7 @@ LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
{ "dns/dnssec", 0 },
{ "dns/crypto", 0 },
{ "dns/packets", 0 },
+ { "dns/dynamic_db", 0 },
{ NULL, 0 }
};
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
index 67d65f0..bd348be 100644
--- a/lib/isccfg/namedconf.c
+++ b/lib/isccfg/namedconf.c
@@ -106,6 +106,7 @@ static cfg_type_t cfg_type_controls;
static cfg_type_t cfg_type_controls_sockaddr;
static cfg_type_t cfg_type_destinationlist;
static cfg_type_t cfg_type_dialuptype;
+static cfg_type_t cfg_type_dynamic_db;
static cfg_type_t cfg_type_ixfrdifftype;
static cfg_type_t cfg_type_key;
static cfg_type_t cfg_type_logfile;
@@ -969,6 +970,7 @@ namedconf_or_view_clauses[] = {
{ "key", &cfg_type_key, CFG_CLAUSEFLAG_MULTI },
{ "zone", &cfg_type_zone, CFG_CLAUSEFLAG_MULTI },
{ "dlz", &cfg_type_dlz, CFG_CLAUSEFLAG_MULTI },
+ { "dynamic-db", &cfg_type_dynamic_db, CFG_CLAUSEFLAG_MULTI },
{ "server", &cfg_type_server, CFG_CLAUSEFLAG_MULTI },
{ "trusted-keys", &cfg_type_dnsseckeys, CFG_CLAUSEFLAG_MULTI },
{ "managed-keys", &cfg_type_managedkeys, CFG_CLAUSEFLAG_MULTI },
@@ -2230,6 +2232,40 @@ static cfg_type_t cfg_type_dialuptype = {
&cfg_rep_string, dialup_enums
};
+/*
+ * Dynamic database clauses.
+ */
+
+static cfg_clausedef_t
+dynamic_db_clauses[] = {
+ { "library", &cfg_type_qstring, 0 },
+ { "arg", &cfg_type_qstring, CFG_CLAUSEFLAG_MULTI },
+ { NULL, NULL, 0 }
+};
+
+static cfg_clausedef_t *
+dynamic_db_clausesets[] = {
+ dynamic_db_clauses,
+ NULL
+};
+
+static cfg_type_t cfg_type_dynamic_db_opts = {
+ "dynamically_loadable_zones_opts", cfg_parse_map,
+ cfg_print_map, cfg_doc_map, &cfg_rep_map,
+ dynamic_db_clausesets
+};
+
+static cfg_tuplefielddef_t dynamic_db_fields[] = {
+ { "name", &cfg_type_astring, 0 },
+ { "options", &cfg_type_dynamic_db_opts, 0 },
+ { NULL, NULL, 0 }
+};
+
+static cfg_type_t cfg_type_dynamic_db = {
+ "dynamic_db", cfg_parse_tuple, cfg_print_tuple, cfg_doc_tuple,
+ &cfg_rep_tuple, dynamic_db_fields
+};
+
static const char *notify_enums[] = { "explicit", "master-only", NULL };
static isc_result_t
parse_notify_type(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret) {

File diff suppressed because it is too large Load Diff

View File

@ -7,9 +7,9 @@ index 7654169..b4c9c03 100644
top_srcdir = @top_srcdir@
-SUBDIRS = named named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools tests nsupdate \
- check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
- check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@
+SUBDIRS = named named-sdb named-pkcs11 rndc dig delv dnssec dnssec-pkcs11 tools tests nsupdate \
+ check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@ sdb_tools
+ check confgen @NZD_TOOLS@ @PYTHON_TOOLS@ @PKCS11_TOOLS@ sdb_tools
TARGETS =
@BIND9_MAKE_RULES@
@ -40,10 +40,10 @@ index ba5ec3c..d7ac259 100644
GEOIPLINKOBJS = geoip.@O@
@@ -144,7 +144,7 @@ config.@O@: config.c
-DNS_SYSCONFDIR=\"${sysconfdir}\" \
-c ${srcdir}/config.c
@@ -144,7 +144,7 @@ server.@O@: server.c
-DPRODUCT=\"${PRODUCT}\" \
-DVERSION=\"${VERSION}\" -c ${srcdir}/server.c
-named@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
+named-sdb@EXEEXT@: ${OBJS} ${UOBJS} ${DEPLIBS}
export MAKE_SYMTABLE="yes"; \
@ -93,7 +93,7 @@ index 306295f..a7f3327 100644
+ sqlitedb_clear();
+
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN,
ISC_LOG_NOTICE, "starting %s %s%s%s <id:%s>%s",
ISC_LOG_NOTICE, "starting %s %s%s%s <id:%s>",
ns_g_product, ns_g_version,
@@ -1099,6 +1108,75 @@ setup(void) {
isc_result_totext(result));
@ -280,7 +280,7 @@ diff --git a/configure.in b/configure.in
index 6dab9dc..f84d161 100644
--- a/configure.in
+++ b/configure.in
@@ -4686,12 +4686,15 @@ AC_CONFIG_FILES([
@@ -4686,30 +4686,33 @@ AC_CONFIG_FILES([
bin/named/unix/Makefile
bin/named-pkcs11/Makefile
bin/named-pkcs11/unix/Makefile
@ -289,8 +289,26 @@ index 6dab9dc..f84d161 100644
bin/nsupdate/Makefile
bin/pkcs11/Makefile
bin/python/Makefile
bin/python/isc/Makefile
bin/python/isc/utils.py
bin/python/isc/tests/Makefile
bin/python/dnssec-checkds.py
bin/python/dnssec-coverage.py
bin/python/dnssec-keymgr.py
bin/python/isc/__init__.py
bin/python/isc/checkds.py
bin/python/isc/coverage.py
bin/python/isc/dnskey.py
bin/python/isc/eventlist.py
bin/python/isc/keydict.py
bin/python/isc/keyevent.py
bin/python/isc/keymgr.py
bin/python/isc/keyseries.py
bin/python/isc/keyzone.py
bin/python/isc/policy.py
bin/python/isc/rndc.py
bin/python/isc/tests/dnskey_test.py
bin/python/isc/tests/policy_test.py
bin/rndc/Makefile
+ bin/sdb_tools/Makefile
bin/tests/Makefile

View File

@ -39,14 +39,6 @@ diff --git a/bin/sdb_tools/zone2ldap.c b/bin/sdb_tools/zone2ldap.c
index 23dd873..d56bc56 100644
--- a/bin/sdb_tools/zone2ldap.c
+++ b/bin/sdb_tools/zone2ldap.c
@@ -26,6 +26,7 @@
#include <isc/hash.h>
#include <isc/mem.h>
#include <isc/print.h>
+#include <isc/hash.h>
#include <isc/result.h>
#include <dns/db.h>
@@ -65,6 +66,9 @@ ldap_info;
/* usage Info */
void usage (void);

View File

@ -167,7 +167,7 @@ index 3ca7cb9..f11884e 100644
#else
if (lookup->origin != NULL) {
debug("trying origin %s", lookup->origin->origin);
@@ -2348,6 +2387,13 @@ setup_lookup(dig_lookup_t *lookup) {
@@ -2372,6 +2411,13 @@ setup_lookup(dig_lookup_t *lookup) {
result = dns_name_fromtext(lookup->name, &b,
dns_rootname, 0,
&lookup->namebuf);
@ -179,7 +179,7 @@ index 3ca7cb9..f11884e 100644
+ dns_rootname, 0,
+ &lookup->namebuf);
#else
len = strlen(lookup->textname);
len = (unsigned int) strlen(lookup->textname);
isc_buffer_init(&b, lookup->textname, len);
@@ -4227,7 +4273,7 @@ destroy_libs(void) {
void * ptr;

View File

@ -2,7 +2,7 @@
# Red Hat BIND package .spec file
#
%global PATCHVER P4
%global PATCHVER P1
#%%global PREVER rc1
%global VERSION %{version}%{?PREVER}%{?PATCHVER:-%{PATCHVER}}
@ -23,9 +23,9 @@
#
Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) server
Name: bind
License: ISC
Version: 9.10.4
Release: 3%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
License: MPLv2.0
Version: 9.11.0
Release: 1%{?PATCHVER:.%{PATCHVER}}%{?PREVER:.%{PREVER}}%{?dist}
Epoch: 32
Url: http://www.isc.org/products/BIND/
Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -66,11 +66,9 @@ Patch101:bind-96-old-api.patch
Patch102:bind-95-rh452060.patch
Patch106:bind93-rh490837.patch
Patch109:bind97-rh478718.patch
Patch110:bind97-rh570851.patch
Patch112:bind97-rh645544.patch
Patch119:bind97-rh693982.patch
Patch123:bind98-rh735103.patch
Patch125:bind99-buildfix.patch
Patch130:bind-9.9.1-P2-dlz-libdb.patch
Patch131:bind-9.9.1-P2-multlib-conflict.patch
Patch133:bind99-rh640538.patch
@ -90,7 +88,6 @@ Patch12: bind-9.10-sdb.patch
# needs inpection
Patch17: bind-9.3.2b1-fix_sdb_ldap.patch
Patch104: bind-9.10-dyndb.patch
# [ISC-Bugs #36101] IDN support in host/dig/nslookup using GNU libidn(2)
Patch73: bind-99-libidn.patch
@ -101,6 +98,8 @@ Requires(preun): systemd
Requires(postun): systemd
Requires: coreutils
Requires(pre): shadow-utils
Requires: python3-ply
BuildRequires: python3-ply
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
@ -291,6 +290,15 @@ chroot(2) jail for the named-sdb(8) program from the BIND package.
Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
%endif
%package -n python3-bind
Summary: A module allowing rndc commands to be sent from Python programs
Group: Applications/System
Requires: bind-license = %{epoch}:%{version}-%{release}
Requires: python3
%{?python_provide:%python_provide python3-bind}
%description -n python3-bind
This package provides a module which allows commands to be sent to rndc directly from Python programs.
%prep
%setup -q -n %{name}-%{VERSION}
@ -298,7 +306,6 @@ Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
# Common patches
%patch10 -p1 -b .PIE
%patch16 -p1 -b .redhat_doc
%patch104 -p1 -b .dyndb
%ifnarch alpha ia64
%patch72 -p1 -b .64bit
%endif
@ -306,12 +313,11 @@ Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
%patch102 -p1 -b .rh452060
%patch106 -p0 -b .rh490837
%patch109 -p1 -b .rh478718
%patch110 -p1 -b .rh570851
%patch112 -p1 -b .rh645544
%patch119 -p1 -b .rh693982
%patch125 -p1 -b .buildfix
%patch130 -p1 -b .libdb
%patch131 -p1 -b .multlib-conflict
%patch138 -p1 -b .rh1390238
%if %{PKCS11}
cp -r bin/named{,-pkcs11}
@ -351,7 +357,6 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools
%patch133 -p1 -b .rh640538
%patch134 -p1 -b .rh669163
%patch138 -p1 -b .rh1390238
# Sparc and s390 arches need to use -fPIE
%ifarch sparcv9 sparc64 s390 s390x
@ -765,12 +770,14 @@ rm -rf ${RPM_BUILD_ROOT}
%{_unitdir}/named-setup-rndc.service
%{_sbindir}/named-journalprint
%{_sbindir}/named-checkconf
%{_sbindir}/named-rrchecker
%{_bindir}/named-rrchecker
%{_bindir}/mdig
%{_sbindir}/lwresd
%{_sbindir}/named
%{_sbindir}/rndc*
%{_sbindir}/tsig-keygen
%{_libexecdir}/generate-rndc-key.sh
%{_mandir}/man1/mdig.1*
%{_mandir}/man1/named-rrchecker.1*
%{_mandir}/man5/named.conf.5*
%{_mandir}/man5/rndc.conf.5*
@ -831,16 +838,16 @@ rm -rf ${RPM_BUILD_ROOT}
%files libs
%defattr(-,root,root,-)
%{_libdir}/libbind9.so.140*
%{_libdir}/libisccc.so.140*
%{_libdir}/liblwres.so.141*
%{_libdir}/libbind9.so.160*
%{_libdir}/libisccc.so.160*
%{_libdir}/liblwres.so.160*
%files libs-lite
%defattr(-,root,root,-)
%{_libdir}/libdns.so.165*
%{_libdir}/libirs.so.141*
%{_libdir}/libdns.so.166*
%{_libdir}/libirs.so.160*
%{_libdir}/libisc.so.160*
%{_libdir}/libisccfg.so.140*
%{_libdir}/libisccfg.so.160*
%files license
%defattr(-,root,root,-)
@ -854,7 +861,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_bindir}/host
%{_bindir}/nslookup
%{_bindir}/nsupdate
%{_sbindir}/arpaname
%{_bindir}/arpaname
%{_sbindir}/ddns-confgen
%{_sbindir}/genrandom
%{_sbindir}/nsec3hash
@ -893,6 +900,7 @@ rm -rf ${RPM_BUILD_ROOT}
%{_includedir}/bind9/bind9
%{_includedir}/bind9/isccc
%{_includedir}/bind9/lwres
%{_includedir}/bind9/pk11
%{_mandir}/man1/isc-config.sh.1*
%{_mandir}/man1/bind9-config.1*
%{_mandir}/man3/lwres*
@ -992,7 +1000,7 @@ rm -rf ${RPM_BUILD_ROOT}
%files pkcs11-libs
%defattr(-,root,root,-)
%{_libdir}/libdns-pkcs11.so.165*
%{_libdir}/libdns-pkcs11.so.166*
%{_libdir}/libisc-pkcs11.so.160*
%files pkcs11-devel
@ -1003,8 +1011,16 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/libisc-pkcs11.so
%endif
%files -n python3-bind
%defattr(-,root,root,-)
%{python3_sitelib}/*py*
%{python3_sitelib}/isc/*py
%{python3_sitelib}/isc/__pycache__/*py*
%changelog
* Wed Nov 16 2016 Michal Ruprich <mruprich@redhat.com> - 32:9.11.0-1.P1
- Update to 9.11.0-P1
* Tue Nov 08 2016 Petr Menšík <pemensik@redhat.com> - 32:9.10.4-3.P4
- Build with OpenSSL 1.1

View File

@ -1,151 +0,0 @@
diff -up bind-9.9.5b1/bin/dig/dighost.c.rh570851 bind-9.9.5b1/bin/dig/dighost.c
--- bind-9.9.5b1/bin/dig/dighost.c.rh570851 2014-01-06 13:49:25.230380554 +0100
+++ bind-9.9.5b1/bin/dig/dighost.c 2014-01-06 13:54:25.804839409 +0100
@@ -131,6 +131,7 @@ isc_boolean_t
showsearch = ISC_FALSE,
qr = ISC_FALSE,
is_dst_up = ISC_FALSE,
+ verbose = ISC_FALSE,
keep_open = ISC_FALSE;
in_port_t port = 53;
unsigned int timeout = 0;
@@ -1257,10 +1258,24 @@ setup_system(void) {
}
}
+ if (lwconf->resdebug) {
+ verbose = ISC_TRUE;
+ debug("verbose is on");
+ }
if (ndots == -1) {
ndots = lwconf->ndots;
debug("ndots is %d.", ndots);
}
+ if (lwconf->attempts) {
+ tries = lwconf->attempts + 1;
+ if (tries < 2)
+ tries = 2;
+ debug("tries is %d.", tries);
+ }
+ if (lwconf->timeout) {
+ timeout = lwconf->timeout;
+ debug("timeout is %d.", timeout);
+ }
/* If user doesn't specify server use nameservers from resolv.conf. */
if (ISC_LIST_EMPTY(server_list))
diff -up bind-9.9.5b1/bin/dig/host.c.rh570851 bind-9.9.5b1/bin/dig/host.c
--- bind-9.9.5b1/bin/dig/host.c.rh570851 2013-12-12 06:59:59.000000000 +0100
+++ bind-9.9.5b1/bin/dig/host.c 2014-01-06 13:49:25.241380571 +0100
@@ -672,6 +672,7 @@ parse_args(isc_boolean_t is_batchfile, i
lookup->servfail_stops = ISC_FALSE;
lookup->comments = ISC_FALSE;
+ short_form = !verbose;
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
@@ -882,8 +883,8 @@ main(int argc, char **argv) {
result = isc_app_start();
check_result(result, "isc_app_start");
setup_libs();
- parse_args(ISC_FALSE, argc, argv);
setup_system();
+ parse_args(ISC_FALSE, argc, argv);
result = isc_app_onrun(mctx, global_task, onrun_callback, NULL);
check_result(result, "isc_app_onrun");
isc_app_run();
diff -up bind-9.9.5b1/bin/dig/include/dig/dig.h.rh570851 bind-9.9.5b1/bin/dig/include/dig/dig.h
--- bind-9.9.5b1/bin/dig/include/dig/dig.h.rh570851 2013-12-12 06:59:59.000000000 +0100
+++ bind-9.9.5b1/bin/dig/include/dig/dig.h 2014-01-06 13:49:25.241380571 +0100
@@ -281,6 +281,7 @@ extern isc_boolean_t keep_open;
extern char *progname;
extern int tries;
extern int fatalexit;
+extern isc_boolean_t verbose;
#ifdef WITH_IDN
extern int idnoptions;
#endif
diff -up bind-9.9.5b1/lib/lwres/include/lwres/lwres.h.rh570851 bind-9.9.5b1/lib/lwres/include/lwres/lwres.h
--- bind-9.9.5b1/lib/lwres/include/lwres/lwres.h.rh570851 2013-12-12 06:59:59.000000000 +0100
+++ bind-9.9.5b1/lib/lwres/include/lwres/lwres.h 2014-01-06 13:49:25.241380571 +0100
@@ -243,6 +243,8 @@ typedef struct {
lwres_uint8_t resdebug; /*%< non-zero if 'options debug' set */
lwres_uint8_t ndots; /*%< set to n in 'options ndots:n' */
lwres_uint8_t no_tld_query; /*%< non-zero if 'options no_tld_query' */
+ lwres_int32_t attempts; /*%< set to n in 'options attempts:n' */
+ lwres_int32_t timeout; /*%< set to n in 'options timeout:n' */
} lwres_conf_t;
#define LWRES_ADDRTYPE_V4 0x00000001U /*%< ipv4 */
diff -up bind-9.9.5b1/lib/lwres/lwconfig.c.rh570851 bind-9.9.5b1/lib/lwres/lwconfig.c
--- bind-9.9.5b1/lib/lwres/lwconfig.c.rh570851 2013-12-12 06:59:59.000000000 +0100
+++ bind-9.9.5b1/lib/lwres/lwconfig.c 2014-01-06 13:49:25.241380571 +0100
@@ -237,6 +237,8 @@ lwres_conf_init(lwres_context_t *ctx) {
confdata->resdebug = 0;
confdata->ndots = 1;
confdata->no_tld_query = 0;
+ confdata->attempts = 0;
+ confdata->timeout = 0;
for (i = 0; i < LWRES_CONFMAXNAMESERVERS; i++)
lwres_resetaddr(&confdata->nameservers[i]);
@@ -289,6 +291,8 @@ lwres_conf_clear(lwres_context_t *ctx) {
confdata->resdebug = 0;
confdata->ndots = 1;
confdata->no_tld_query = 0;
+ confdata->attempts = 0;
+ confdata->timeout = 0;
}
static lwres_result_t
@@ -530,6 +534,8 @@ static lwres_result_t
lwres_conf_parseoption(lwres_context_t *ctx, FILE *fp) {
int delim;
long ndots;
+ long attempts;
+ long timeout;
char *p;
char word[LWRES_CONFMAXLINELEN];
lwres_conf_t *confdata;
@@ -546,6 +552,8 @@ lwres_conf_parseoption(lwres_context_t *
confdata->resdebug = 1;
} else if (strcmp("no_tld_query", word) == 0) {
confdata->no_tld_query = 1;
+ } else if (strcmp("debug", word) == 0) {
+ confdata->resdebug = 1;
} else if (strncmp("ndots:", word, 6) == 0) {
ndots = strtol(word + 6, &p, 10);
if (*p != '\0') /* Bad string. */
@@ -553,6 +561,18 @@ lwres_conf_parseoption(lwres_context_t *
if (ndots < 0 || ndots > 0xff) /* Out of range. */
return (LWRES_R_FAILURE);
confdata->ndots = (lwres_uint8_t)ndots;
+ } else if (strncmp("timeout:", word, 8) == 0) {
+ timeout = strtol(word + 8, &p, 10);
+ if (*p != '\0') /* Bad string. */
+ return (LWRES_R_FAILURE);
+ confdata->timeout = (lwres_int32_t)timeout;
+ } else if (strncmp("attempts:", word, 9) == 0) {
+ attempts = strtol(word + 9, &p, 10);
+ if (*p != '\0') /* Bad string. */
+ return (LWRES_R_FAILURE);
+ if (attempts < 0) /* Out of range. */
+ return (LWRES_R_FAILURE);
+ confdata->attempts = (lwres_int32_t)attempts;
}
if (delim == EOF || delim == '\n')
@@ -717,6 +737,12 @@ lwres_conf_print(lwres_context_t *ctx, F
if (confdata->no_tld_query)
fprintf(fp, "options no_tld_query\n");
+ if (confdata->attempts)
+ fprintf(fp, "options attempts:%d\n", confdata->attempts);
+
+ if (confdata->timeout)
+ fprintf(fp, "options timeout:%d\n", confdata->timeout);
+
return (LWRES_R_SUCCESS);
}

View File

@ -1,13 +0,0 @@
diff --git a/bin/tests/system/Makefile.in b/bin/tests/system/Makefile.in
index bdfd72a..706290c 100644
--- a/bin/tests/system/Makefile.in
+++ b/bin/tests/system/Makefile.in
@@ -19,7 +19,7 @@ top_srcdir = @top_srcdir@
@BIND9_MAKE_INCLUDES@
-SUBDIRS = builtin dlzexternal fetchlimit filter-aaaa geoip lwresd rpz rsabigexponent statistics tkey tsiggss
+SUBDIRS = builtin fetchlimit filter-aaaa geoip lwresd rpz rsabigexponent statistics tkey tsiggss
TARGETS =
@BIND9_MAKE_RULES@

View File

@ -1,2 +1,2 @@
4ec15dcf90ad77e923a05d7386348080 bind-9.11.0-P1.tar.gz
c47ee477f29baac49dc59ef4fb732b97 config-15.tar.bz2
e110904a1d54f83f01d4be8bcd842927 bind-9.10.4-P4.tar.gz