Compare commits
No commits in common. 'c9' and 'i8c' have entirely different histories.
@ -1 +1,2 @@
|
||||
30cbd1f3e9d2d47d653498143334128aac1f8fc0 SOURCES/bind-9.16.23.tar.xz
|
||||
4b45d15edc1e3b7902129ce27baec58a50d76b5c SOURCES/bind-9.11.36.tar.gz
|
||||
a164fcad1d64d6b5fab5034928cb7260f1fa8fdd SOURCES/random.data
|
||||
|
@ -1 +1,2 @@
|
||||
SOURCES/bind-9.16.23.tar.xz
|
||||
SOURCES/bind-9.11.36.tar.gz
|
||||
SOURCES/random.data
|
||||
|
@ -0,0 +1,79 @@
|
||||
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!
|
@ -0,0 +1,310 @@
|
||||
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 03a72d5..4c1cb6d 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@
|
||||
+TARGETS = named-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}
|
||||
@@ -181,8 +181,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
|
||||
@@ -192,16 +190,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 c9fc3cc..148ebb3 100644
|
||||
--- a/bin/named-sdb/main.c
|
||||
+++ b/bin/named-sdb/main.c
|
||||
@@ -97,6 +97,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
|
||||
/*
|
||||
@@ -1134,6 +1138,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 <id:%s>",
|
||||
ns_g_product, ns_g_version,
|
||||
@@ -1334,6 +1343,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
|
||||
@@ -1376,6 +1454,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 03a72d5..47cc046 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
|
||||
|
||||
@@ -203,7 +201,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 f85f45f..7d28c52 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -5400,6 +5400,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
|
||||
@@ -5424,6 +5426,7 @@ AC_CONFIG_FILES([
|
||||
bin/python/isc/tests/policy_test.py
|
||||
bin/python/isc/utils.py
|
||||
bin/rndc/Makefile
|
||||
+ bin/sdb_tools/Makefile
|
||||
bin/tests/Makefile
|
||||
bin/tests/headerdep_test.sh
|
||||
bin/tests/optional/Makefile
|
@ -0,0 +1,18 @@
|
||||
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;
|
@ -0,0 +1,46 @@
|
||||
From 6c26ede8edcb700caca12c501c6c129801989526 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Fri, 23 Feb 2024 10:12:47 +1100
|
||||
Subject: [PATCH] Do not use header_prev in expire_lru_headers
|
||||
|
||||
dns__cacherbt_expireheader can unlink / free header_prev underneath
|
||||
it. Use ISC_LIST_TAIL after calling dns__cacherbt_expireheader
|
||||
instead to get the next pointer to be processed.
|
||||
|
||||
(cherry picked from commit 7ce2e86024f022decb2678963538515ca39ab4ab)
|
||||
(cherry picked from commit f88f21b7d890eb80097f4bd434fedb29c2f9ff63)
|
||||
---
|
||||
lib/dns/rbtdb.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
|
||||
index cc40eaec60..ee59c1b18b 100644
|
||||
--- a/lib/dns/rbtdb.c
|
||||
+++ b/lib/dns/rbtdb.c
|
||||
@@ -10667,19 +10667,19 @@ update_header(dns_rbtdb_t *rbtdb, rdatasetheader_t *header,
|
||||
static size_t
|
||||
expire_lru_headers(dns_rbtdb_t *rbtdb, unsigned int locknum, size_t purgesize,
|
||||
bool tree_locked) {
|
||||
- rdatasetheader_t *header, *header_prev;
|
||||
+ rdatasetheader_t *header;
|
||||
size_t purged = 0;
|
||||
|
||||
for (header = ISC_LIST_TAIL(rbtdb->rdatasets[locknum]);
|
||||
- header != NULL && purged <= purgesize; header = header_prev)
|
||||
+ header != NULL && purged <= purgesize;
|
||||
+ header = ISC_LIST_TAIL(rbtdb->rdatasets[locknum]))
|
||||
{
|
||||
- header_prev = ISC_LIST_PREV(header, link);
|
||||
/*
|
||||
* Unlink the entry at this point to avoid checking it
|
||||
* again even if it's currently used someone else and
|
||||
* cannot be purged at this moment. This entry won't be
|
||||
* referenced any more (so unlinking is safe) since the
|
||||
- * TTL was reset to 0.
|
||||
+ * TTL will be reset to 0.
|
||||
*/
|
||||
ISC_LIST_UNLINK(rbtdb->rdatasets[locknum], header, link);
|
||||
size_t header_size = rdataset_size(header);
|
||||
--
|
||||
2.43.2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,64 @@
|
||||
From f0fc9d7999a94da3d471c4e0a35b1f447f25eea6 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Mon, 26 Feb 2024 21:08:42 +0100
|
||||
Subject: [PATCH] Add normal task queue also to non-thread version
|
||||
|
||||
Non-thread builds are used by us for dhcp package. Make it working
|
||||
again.
|
||||
|
||||
Related to [GL #4424] and [GL #4459].
|
||||
---
|
||||
lib/isc/task.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/isc/task.c b/lib/isc/task.c
|
||||
index cc83269..5315b51 100644
|
||||
--- a/lib/isc/task.c
|
||||
+++ b/lib/isc/task.c
|
||||
@@ -1115,7 +1115,7 @@ dispatch(isc__taskmgr_t *manager, isc_taskqueue_t qid) {
|
||||
}
|
||||
#else /* USE_WORKER_THREADS */
|
||||
if (total_dispatch_count >= DEFAULT_TASKMGR_QUANTUM ||
|
||||
- empty_readyq(manager))
|
||||
+ empty_readyq(manager, qid))
|
||||
break;
|
||||
#endif /* USE_WORKER_THREADS */
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK,
|
||||
@@ -1318,11 +1318,11 @@ dispatch(isc__taskmgr_t *manager, isc_taskqueue_t qid) {
|
||||
}
|
||||
|
||||
#ifndef USE_WORKER_THREADS
|
||||
- ISC_LIST_APPENDLIST(manager->ready_tasks, new_ready_tasks, ready_link);
|
||||
- ISC_LIST_APPENDLIST(manager->ready_priority_tasks, new_priority_tasks,
|
||||
+ ISC_LIST_APPENDLIST(manager->ready_tasks[qid], new_ready_tasks, ready_link);
|
||||
+ ISC_LIST_APPENDLIST(manager->ready_priority_tasks[qid], new_priority_tasks,
|
||||
ready_priority_link);
|
||||
manager->tasks_ready += tasks_ready;
|
||||
- if (empty_readyq(manager))
|
||||
+ if (empty_readyq(manager, qid))
|
||||
manager->mode = isc_taskmgrmode_normal;
|
||||
#endif
|
||||
|
||||
@@ -1713,7 +1713,8 @@ isc__taskmgr_ready(isc_taskmgr_t *manager0) {
|
||||
return (false);
|
||||
|
||||
LOCK(&manager->lock);
|
||||
- is_ready = !empty_readyq(manager);
|
||||
+ is_ready = !empty_readyq(manager, isc_taskqueue_normal) ||
|
||||
+ !empty_readyq(manager, isc_taskqueue_slow);
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
return (is_ready);
|
||||
@@ -1730,7 +1731,8 @@ isc__taskmgr_dispatch(isc_taskmgr_t *manager0) {
|
||||
if (manager == NULL)
|
||||
return (ISC_R_NOTFOUND);
|
||||
|
||||
- dispatch(manager);
|
||||
+ dispatch(manager, isc_taskqueue_normal);
|
||||
+ dispatch(manager, isc_taskqueue_slow);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
--
|
||||
2.43.2
|
||||
|
@ -0,0 +1,737 @@
|
||||
From 4c20ab54ec503f65d8ee0b863cbf41103d95130a Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Wed, 22 Nov 2023 16:59:03 +1100
|
||||
Subject: [PATCH] Fail the DNSSEC validation on the first failure
|
||||
|
||||
Be more strict when encountering DNSSEC validation failures - fail on
|
||||
the first failure. This will break domains that have DNSSEC signing
|
||||
keys with duplicate key ids, but this is something that's much easier
|
||||
to fix on the authoritative side, so we are just going to be strict
|
||||
on the resolver side where it is causing performance problems.
|
||||
|
||||
(cherry picked from commit 8b7ecba9885e163c07c2dd3e1ceab79b2ba89e34)
|
||||
|
||||
Add normal and slow task queues
|
||||
|
||||
Split the task manager queues into normal and slow task queues, so we
|
||||
can move the tasks that blocks processing for a long time (like DNSSEC
|
||||
validation) into the slow queue which doesn't block fast
|
||||
operations (like responding from the cache). This mitigates the whole
|
||||
class of KeyTrap-like issues.
|
||||
|
||||
(cherry picked from commit db083a21726300916fa0b9fd8a433a796fedf636)
|
||||
|
||||
Don't iterate from start every time we select new signing key
|
||||
|
||||
Improve the selecting of the new signing key by remembering where
|
||||
we stopped the iteration and just continue from that place instead
|
||||
of iterating from the start over and over again each time.
|
||||
|
||||
(cherry picked from commit 75faeefcab47e4f1e12b358525190b4be90f97de)
|
||||
|
||||
Optimize selecting the signing key
|
||||
|
||||
Don't parse the crypto data before parsing and matching the id and the
|
||||
algorithm.
|
||||
|
||||
(cherry picked from commit b38552cca7200a72658e482f8407f57516efc5db)
|
||||
|
||||
6322. [security] Specific DNS answers could cause a denial-of-service
|
||||
condition due to DNS validation taking a long time.
|
||||
(CVE-2023-50387) [GL #4424]
|
||||
|
||||
The same code change also addresses another problem:
|
||||
preparing NSEC3 closest encloser proofs could exhaust
|
||||
available CPU resources. (CVE-2023-50868) [GL #4459]
|
||||
---
|
||||
lib/dns/dst_api.c | 25 ++++--
|
||||
lib/dns/include/dns/validator.h | 1 +
|
||||
lib/dns/include/dst/dst.h | 4 +
|
||||
lib/dns/resolver.c | 2 +-
|
||||
lib/dns/validator.c | 97 +++++++++-----------
|
||||
lib/dns/win32/libdns.def.in | 1 +
|
||||
lib/isc/include/isc/task.h | 11 ++-
|
||||
lib/isc/task.c | 153 ++++++++++++++++++++++----------
|
||||
8 files changed, 186 insertions(+), 108 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c
|
||||
index 2156384ec1..6bcd99796c 100644
|
||||
--- a/lib/dns/dst_api.c
|
||||
+++ b/lib/dns/dst_api.c
|
||||
@@ -105,6 +105,7 @@ static isc_result_t frombuffer(dns_name_t *name,
|
||||
dns_rdataclass_t rdclass,
|
||||
isc_buffer_t *source,
|
||||
isc_mem_t *mctx,
|
||||
+ bool no_rdata,
|
||||
dst_key_t **keyp);
|
||||
|
||||
static isc_result_t algorithm_status(unsigned int alg);
|
||||
@@ -764,6 +765,13 @@ isc_result_t
|
||||
dst_key_fromdns(dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
+ return (dst_key_fromdns_ex(name, rdclass, source, mctx, false, keyp));
|
||||
+}
|
||||
+
|
||||
+isc_result_t
|
||||
+dst_key_fromdns_ex(dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp) {
|
||||
uint8_t alg, proto;
|
||||
uint32_t flags, extflags;
|
||||
dst_key_t *key = NULL;
|
||||
@@ -792,7 +800,7 @@ dst_key_fromdns(dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
}
|
||||
|
||||
result = frombuffer(name, alg, flags, proto, rdclass, source,
|
||||
- mctx, &key);
|
||||
+ mctx, no_rdata, &key);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
key->key_id = id;
|
||||
@@ -814,7 +822,7 @@ dst_key_frombuffer(dns_name_t *name, unsigned int alg,
|
||||
REQUIRE(dst_initialized);
|
||||
|
||||
result = frombuffer(name, alg, flags, protocol, rdclass, source,
|
||||
- mctx, &key);
|
||||
+ mctx, false, &key);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
|
||||
@@ -1915,7 +1923,8 @@ computeid(dst_key_t *key) {
|
||||
static isc_result_t
|
||||
frombuffer(dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
unsigned int protocol, dns_rdataclass_t rdclass,
|
||||
- isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp)
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp)
|
||||
{
|
||||
dst_key_t *key;
|
||||
isc_result_t ret;
|
||||
@@ -1940,10 +1949,12 @@ frombuffer(dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
return (DST_R_UNSUPPORTEDALG);
|
||||
}
|
||||
|
||||
- ret = key->func->fromdns(key, source);
|
||||
- if (ret != ISC_R_SUCCESS) {
|
||||
- dst_key_free(&key);
|
||||
- return (ret);
|
||||
+ if (!no_rdata) {
|
||||
+ ret = key->func->fromdns(key, source);
|
||||
+ if (ret != ISC_R_SUCCESS) {
|
||||
+ dst_key_free(&key);
|
||||
+ return (ret);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/lib/dns/include/dns/validator.h b/lib/dns/include/dns/validator.h
|
||||
index cc4478d6d4..b4bf8f29db 100644
|
||||
--- a/lib/dns/include/dns/validator.h
|
||||
+++ b/lib/dns/include/dns/validator.h
|
||||
@@ -160,6 +160,7 @@ struct dns_validator {
|
||||
unsigned int depth;
|
||||
unsigned int authcount;
|
||||
unsigned int authfail;
|
||||
+ bool failed;
|
||||
isc_stdtime_t start;
|
||||
};
|
||||
|
||||
diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h
|
||||
index 180c841307..a8be2daf67 100644
|
||||
--- a/lib/dns/include/dst/dst.h
|
||||
+++ b/lib/dns/include/dst/dst.h
|
||||
@@ -435,6 +435,10 @@ dst_key_tofile(const dst_key_t *key, int type, const char *directory);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
+dst_key_fromdns_ex(dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp);
|
||||
+isc_result_t
|
||||
dst_key_fromdns(dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp);
|
||||
/*%<
|
||||
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||
index 4f71f48039..487107614c 100644
|
||||
--- a/lib/dns/resolver.c
|
||||
+++ b/lib/dns/resolver.c
|
||||
@@ -9267,7 +9267,7 @@ dns_resolver_create(dns_view_t *view,
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup_buckets;
|
||||
res->buckets[i].task = NULL;
|
||||
- result = isc_task_create(taskmgr, 0, &res->buckets[i].task);
|
||||
+ result = isc_task_create(taskmgr, ISC_TASK_QUANTUM_SLOW, &res->buckets[i].task);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
DESTROYLOCK(&res->buckets[i].lock);
|
||||
goto cleanup_buckets;
|
||||
diff --git a/lib/dns/validator.c b/lib/dns/validator.c
|
||||
index 2a5c3caa6a..0b257fe874 100644
|
||||
--- a/lib/dns/validator.c
|
||||
+++ b/lib/dns/validator.c
|
||||
@@ -1207,6 +1207,12 @@ create_validator(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
|
||||
* val->key at it.
|
||||
*
|
||||
* If val->key is non-NULL, this returns the next matching key.
|
||||
+ * If val->key is already non-NULL, start searching from the next position in
|
||||
+ * 'rdataset' to find the *next* key that could have signed 'siginfo', then
|
||||
+ * set val->key to that.
|
||||
+ *
|
||||
+ * Returns ISC_R_SUCCESS if a possible matching key has been found,
|
||||
+ * ISC_R_NOTFOUND if not. Any other value indicates error.
|
||||
*/
|
||||
static isc_result_t
|
||||
get_dst_key(dns_validator_t *val, dns_rdata_rrsig_t *siginfo,
|
||||
@@ -1216,54 +1222,59 @@ get_dst_key(dns_validator_t *val, dns_rdata_rrsig_t *siginfo,
|
||||
isc_buffer_t b;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dst_key_t *oldkey = val->key;
|
||||
- bool foundold;
|
||||
+ bool no_rdata = false;
|
||||
|
||||
- if (oldkey == NULL)
|
||||
- foundold = true;
|
||||
- else {
|
||||
- foundold = false;
|
||||
+ if (oldkey == NULL) {
|
||||
+ result = dns_rdataset_first(rdataset);
|
||||
+ } else {
|
||||
+ dst_key_free(&oldkey);
|
||||
val->key = NULL;
|
||||
+ result = dns_rdataset_next(rdataset);
|
||||
+ }
|
||||
+
|
||||
+ if (result != ISC_R_SUCCESS) {
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
- result = dns_rdataset_first(rdataset);
|
||||
- if (result != ISC_R_SUCCESS)
|
||||
- goto failure;
|
||||
do {
|
||||
dns_rdataset_current(rdataset, &rdata);
|
||||
|
||||
isc_buffer_init(&b, rdata.data, rdata.length);
|
||||
isc_buffer_add(&b, rdata.length);
|
||||
INSIST(val->key == NULL);
|
||||
- result = dst_key_fromdns(&siginfo->signer, rdata.rdclass, &b,
|
||||
- val->view->mctx, &val->key);
|
||||
+ result = dst_key_fromdns_ex(&siginfo->signer, rdata.rdclass, &b,
|
||||
+ val->view->mctx, no_rdata,
|
||||
+ &val->key);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (siginfo->algorithm ==
|
||||
(dns_secalg_t)dst_key_alg(val->key) &&
|
||||
siginfo->keyid ==
|
||||
(dns_keytag_t)dst_key_id(val->key) &&
|
||||
+ (dst_key_flags(val->key) & DNS_KEYFLAG_REVOKE) ==
|
||||
+ 0 &&
|
||||
dst_key_iszonekey(val->key))
|
||||
{
|
||||
- if (foundold) {
|
||||
- /*
|
||||
- * This is the key we're looking for.
|
||||
- */
|
||||
- return (ISC_R_SUCCESS);
|
||||
- } else if (dst_key_compare(oldkey, val->key)) {
|
||||
- foundold = true;
|
||||
- dst_key_free(&oldkey);
|
||||
+ if (no_rdata) {
|
||||
+ /* Retry with full key */
|
||||
+ dns_rdata_reset(&rdata);
|
||||
+ dst_key_free(&val->key);
|
||||
+ no_rdata = false;
|
||||
+ continue;
|
||||
}
|
||||
+ /* This is the key we're looking for. */
|
||||
+ goto done;
|
||||
}
|
||||
dst_key_free(&val->key);
|
||||
}
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(rdataset);
|
||||
+ no_rdata = true;
|
||||
} while (result == ISC_R_SUCCESS);
|
||||
- if (result == ISC_R_NOMORE)
|
||||
- result = ISC_R_NOTFOUND;
|
||||
|
||||
- failure:
|
||||
- if (oldkey != NULL)
|
||||
- dst_key_free(&oldkey);
|
||||
+done:
|
||||
+ if (result == ISC_R_NOMORE) {
|
||||
+ result = ISC_R_NOTFOUND;
|
||||
+ }
|
||||
|
||||
return (result);
|
||||
}
|
||||
@@ -1633,37 +1644,13 @@ validate(dns_validator_t *val, bool resume) {
|
||||
continue;
|
||||
}
|
||||
|
||||
- do {
|
||||
- vresult = verify(val, val->key, &rdata,
|
||||
- val->siginfo->keyid);
|
||||
- if (vresult == ISC_R_SUCCESS)
|
||||
- break;
|
||||
- if (val->keynode != NULL) {
|
||||
- dns_keynode_t *nextnode = NULL;
|
||||
- result = dns_keytable_findnextkeynode(
|
||||
- val->keytable,
|
||||
- val->keynode,
|
||||
- &nextnode);
|
||||
- dns_keytable_detachkeynode(val->keytable,
|
||||
- &val->keynode);
|
||||
- val->keynode = nextnode;
|
||||
- if (result != ISC_R_SUCCESS) {
|
||||
- val->key = NULL;
|
||||
- break;
|
||||
- }
|
||||
- val->key = dns_keynode_key(val->keynode);
|
||||
- if (val->key == NULL)
|
||||
- break;
|
||||
- } else {
|
||||
- if (get_dst_key(val, val->siginfo, val->keyset)
|
||||
- != ISC_R_SUCCESS)
|
||||
- break;
|
||||
- }
|
||||
- } while (1);
|
||||
- if (vresult != ISC_R_SUCCESS)
|
||||
+ vresult = verify(val, val->key, &rdata,
|
||||
+ val->siginfo->keyid);
|
||||
+ if (vresult != ISC_R_SUCCESS) {
|
||||
+ val->failed = true;
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"failed to verify rdataset");
|
||||
- else {
|
||||
+ } else {
|
||||
dns_rdataset_trimttl(event->rdataset,
|
||||
event->sigrdataset,
|
||||
val->siginfo, val->start,
|
||||
@@ -1700,9 +1687,13 @@ validate(dns_validator_t *val, bool resume) {
|
||||
} else {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"verify failure: %s",
|
||||
- isc_result_totext(result));
|
||||
+ isc_result_totext(vresult));
|
||||
resume = false;
|
||||
}
|
||||
+ if (val->failed) {
|
||||
+ result = ISC_R_NOMORE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
if (result != ISC_R_NOMORE) {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
diff --git a/lib/dns/win32/libdns.def.in b/lib/dns/win32/libdns.def.in
|
||||
index f597049493..7320653439 100644
|
||||
--- a/lib/dns/win32/libdns.def.in
|
||||
+++ b/lib/dns/win32/libdns.def.in
|
||||
@@ -1439,6 +1439,7 @@ dst_key_format
|
||||
dst_key_free
|
||||
dst_key_frombuffer
|
||||
dst_key_fromdns
|
||||
+dst_key_fromdns_ex
|
||||
dst_key_fromfile
|
||||
dst_key_fromgssapi
|
||||
dst_key_fromlabel
|
||||
diff --git a/lib/isc/include/isc/task.h b/lib/isc/include/isc/task.h
|
||||
index 28e5e25fc6..42f7763869 100644
|
||||
--- a/lib/isc/include/isc/task.h
|
||||
+++ b/lib/isc/include/isc/task.h
|
||||
@@ -98,8 +98,15 @@ ISC_LANG_BEGINDECLS
|
||||
***/
|
||||
|
||||
typedef enum {
|
||||
- isc_taskmgrmode_normal = 0,
|
||||
- isc_taskmgrmode_privileged
|
||||
+ isc_taskqueue_normal = 0,
|
||||
+ isc_taskqueue_slow = 1,
|
||||
+} isc_taskqueue_t;
|
||||
+
|
||||
+#define ISC_TASK_QUANTUM_SLOW 1024
|
||||
+
|
||||
+typedef enum {
|
||||
+ isc_taskmgrmode_normal = 0,
|
||||
+ isc_taskmgrmode_privileged
|
||||
} isc_taskmgrmode_t;
|
||||
|
||||
/*% Task and task manager methods */
|
||||
diff --git a/lib/isc/task.c b/lib/isc/task.c
|
||||
index 048639350b..cc83269df2 100644
|
||||
--- a/lib/isc/task.c
|
||||
+++ b/lib/isc/task.c
|
||||
@@ -107,6 +107,7 @@ struct isc__task {
|
||||
isc_eventlist_t on_shutdown;
|
||||
unsigned int nevents;
|
||||
unsigned int quantum;
|
||||
+ unsigned int qid;
|
||||
unsigned int flags;
|
||||
isc_stdtime_t now;
|
||||
isc_time_t tnow;
|
||||
@@ -141,11 +142,11 @@ struct isc__taskmgr {
|
||||
/* Locked by task manager lock. */
|
||||
unsigned int default_quantum;
|
||||
LIST(isc__task_t) tasks;
|
||||
- isc__tasklist_t ready_tasks;
|
||||
- isc__tasklist_t ready_priority_tasks;
|
||||
+ isc__tasklist_t ready_tasks[2];
|
||||
+ isc__tasklist_t ready_priority_tasks[2];
|
||||
isc_taskmgrmode_t mode;
|
||||
#ifdef ISC_PLATFORM_USETHREADS
|
||||
- isc_condition_t work_available;
|
||||
+ isc_condition_t work_available[2];
|
||||
isc_condition_t exclusive_granted;
|
||||
isc_condition_t paused;
|
||||
#endif /* ISC_PLATFORM_USETHREADS */
|
||||
@@ -247,13 +248,13 @@ isc_taskmgrmode_t
|
||||
isc__taskmgr_mode(isc_taskmgr_t *manager0);
|
||||
|
||||
static inline bool
|
||||
-empty_readyq(isc__taskmgr_t *manager);
|
||||
+empty_readyq(isc__taskmgr_t *manager, isc_taskqueue_t qid);
|
||||
|
||||
static inline isc__task_t *
|
||||
-pop_readyq(isc__taskmgr_t *manager);
|
||||
+pop_readyq(isc__taskmgr_t *manager, isc_taskqueue_t qid);
|
||||
|
||||
static inline void
|
||||
-push_readyq(isc__taskmgr_t *manager, isc__task_t *task);
|
||||
+push_readyq(isc__taskmgr_t *manager, isc__task_t *task, isc_taskqueue_t qid);
|
||||
|
||||
static struct isc__taskmethods {
|
||||
isc_taskmethods_t methods;
|
||||
@@ -324,7 +325,8 @@ task_finished(isc__task_t *task) {
|
||||
* any idle worker threads so they
|
||||
* can exit.
|
||||
*/
|
||||
- BROADCAST(&manager->work_available);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_slow]);
|
||||
}
|
||||
#endif /* USE_WORKER_THREADS */
|
||||
UNLOCK(&manager->lock);
|
||||
@@ -364,7 +366,13 @@ isc__task_create(isc_taskmgr_t *manager0, unsigned int quantum,
|
||||
INIT_LIST(task->events);
|
||||
INIT_LIST(task->on_shutdown);
|
||||
task->nevents = 0;
|
||||
- task->quantum = quantum;
|
||||
+ if (quantum >= ISC_TASK_QUANTUM_SLOW) {
|
||||
+ task->qid = isc_taskqueue_slow;
|
||||
+ task->quantum = quantum - ISC_TASK_QUANTUM_SLOW;
|
||||
+ } else {
|
||||
+ task->qid = isc_taskqueue_normal;
|
||||
+ task->quantum = quantum;
|
||||
+ }
|
||||
task->flags = 0;
|
||||
task->now = 0;
|
||||
isc_time_settoepoch(&task->tnow);
|
||||
@@ -476,11 +484,11 @@ task_ready(isc__task_t *task) {
|
||||
|
||||
LOCK(&manager->lock);
|
||||
LOCK(&task->lock);
|
||||
- push_readyq(manager, task);
|
||||
+ push_readyq(manager, task, task->qid);
|
||||
UNLOCK(&task->lock);
|
||||
#ifdef USE_WORKER_THREADS
|
||||
if (manager->mode == isc_taskmgrmode_normal || has_privilege)
|
||||
- SIGNAL(&manager->work_available);
|
||||
+ SIGNAL(&manager->work_available[task->qid]);
|
||||
#endif /* USE_WORKER_THREADS */
|
||||
UNLOCK(&manager->lock);
|
||||
}
|
||||
@@ -961,13 +969,13 @@ isc__task_getcurrenttimex(isc_task_t *task0, isc_time_t *t) {
|
||||
* Caller must hold the task manager lock.
|
||||
*/
|
||||
static inline bool
|
||||
-empty_readyq(isc__taskmgr_t *manager) {
|
||||
+empty_readyq(isc__taskmgr_t *manager, isc_taskqueue_t qid) {
|
||||
isc__tasklist_t queue;
|
||||
|
||||
if (manager->mode == isc_taskmgrmode_normal)
|
||||
- queue = manager->ready_tasks;
|
||||
+ queue = manager->ready_tasks[qid];
|
||||
else
|
||||
- queue = manager->ready_priority_tasks;
|
||||
+ queue = manager->ready_priority_tasks[qid];
|
||||
|
||||
return (EMPTY(queue));
|
||||
}
|
||||
@@ -981,18 +989,18 @@ empty_readyq(isc__taskmgr_t *manager) {
|
||||
* Caller must hold the task manager lock.
|
||||
*/
|
||||
static inline isc__task_t *
|
||||
-pop_readyq(isc__taskmgr_t *manager) {
|
||||
+pop_readyq(isc__taskmgr_t *manager, isc_taskqueue_t qid) {
|
||||
isc__task_t *task;
|
||||
|
||||
if (manager->mode == isc_taskmgrmode_normal)
|
||||
- task = HEAD(manager->ready_tasks);
|
||||
+ task = HEAD(manager->ready_tasks[qid]);
|
||||
else
|
||||
- task = HEAD(manager->ready_priority_tasks);
|
||||
+ task = HEAD(manager->ready_priority_tasks[qid]);
|
||||
|
||||
if (task != NULL) {
|
||||
- DEQUEUE(manager->ready_tasks, task, ready_link);
|
||||
+ DEQUEUE(manager->ready_tasks[qid], task, ready_link);
|
||||
if (ISC_LINK_LINKED(task, ready_priority_link))
|
||||
- DEQUEUE(manager->ready_priority_tasks, task,
|
||||
+ DEQUEUE(manager->ready_priority_tasks[qid], task,
|
||||
ready_priority_link);
|
||||
}
|
||||
|
||||
@@ -1006,16 +1014,16 @@ pop_readyq(isc__taskmgr_t *manager) {
|
||||
* Caller must hold the task manager lock.
|
||||
*/
|
||||
static inline void
|
||||
-push_readyq(isc__taskmgr_t *manager, isc__task_t *task) {
|
||||
- ENQUEUE(manager->ready_tasks, task, ready_link);
|
||||
+push_readyq(isc__taskmgr_t *manager, isc__task_t *task, isc_taskqueue_t qid) {
|
||||
+ ENQUEUE(manager->ready_tasks[qid], task, ready_link);
|
||||
if ((task->flags & TASK_F_PRIVILEGED) != 0)
|
||||
- ENQUEUE(manager->ready_priority_tasks, task,
|
||||
+ ENQUEUE(manager->ready_priority_tasks[qid], task,
|
||||
ready_priority_link);
|
||||
manager->tasks_ready++;
|
||||
}
|
||||
|
||||
static void
|
||||
-dispatch(isc__taskmgr_t *manager) {
|
||||
+dispatch(isc__taskmgr_t *manager, isc_taskqueue_t qid) {
|
||||
isc__task_t *task;
|
||||
#ifndef USE_WORKER_THREADS
|
||||
unsigned int total_dispatch_count = 0;
|
||||
@@ -1094,13 +1102,13 @@ dispatch(isc__taskmgr_t *manager) {
|
||||
* If a pause has been requested, don't do any work
|
||||
* until it's been released.
|
||||
*/
|
||||
- while ((empty_readyq(manager) || manager->pause_requested ||
|
||||
+ while ((empty_readyq(manager, qid) || manager->pause_requested ||
|
||||
manager->exclusive_requested) && !FINISHED(manager))
|
||||
{
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat,
|
||||
ISC_MSGSET_GENERAL,
|
||||
ISC_MSG_WAIT, "wait"));
|
||||
- WAIT(&manager->work_available, &manager->lock);
|
||||
+ WAIT(&manager->work_available[qid], &manager->lock);
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat,
|
||||
ISC_MSGSET_TASK,
|
||||
ISC_MSG_AWAKE, "awake"));
|
||||
@@ -1113,7 +1121,7 @@ dispatch(isc__taskmgr_t *manager) {
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_TASK,
|
||||
ISC_MSG_WORKING, "working"));
|
||||
|
||||
- task = pop_readyq(manager);
|
||||
+ task = pop_readyq(manager, qid);
|
||||
if (task != NULL) {
|
||||
unsigned int dispatch_count = 0;
|
||||
bool done = false;
|
||||
@@ -1278,7 +1286,7 @@ dispatch(isc__taskmgr_t *manager) {
|
||||
*/
|
||||
#ifdef USE_WORKER_THREADS
|
||||
LOCK(&task->lock);
|
||||
- push_readyq(manager, task);
|
||||
+ push_readyq(manager, task, qid);
|
||||
UNLOCK(&task->lock);
|
||||
#else
|
||||
ENQUEUE(new_ready_tasks, task, ready_link);
|
||||
@@ -1297,10 +1305,14 @@ dispatch(isc__taskmgr_t *manager) {
|
||||
* we're stuck. Automatically drop privileges at that
|
||||
* point and continue with the regular ready queue.
|
||||
*/
|
||||
- if (manager->tasks_running == 0 && empty_readyq(manager)) {
|
||||
+ if (manager->tasks_running == 0 && empty_readyq(manager, isc_taskqueue_normal) && empty_readyq(manager, isc_taskqueue_slow)) {
|
||||
manager->mode = isc_taskmgrmode_normal;
|
||||
- if (!empty_readyq(manager))
|
||||
- BROADCAST(&manager->work_available);
|
||||
+ if (!empty_readyq(manager, isc_taskqueue_normal)) {
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ }
|
||||
+ if (!empty_readyq(manager, isc_taskqueue_slow)) {
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_slow]);
|
||||
+ }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1322,13 +1334,37 @@ static isc_threadresult_t
|
||||
#ifdef _WIN32
|
||||
WINAPI
|
||||
#endif
|
||||
-run(void *uap) {
|
||||
+run_normal(void *uap) {
|
||||
isc__taskmgr_t *manager = uap;
|
||||
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
ISC_MSG_STARTING, "starting"));
|
||||
|
||||
- dispatch(manager);
|
||||
+ dispatch(manager, isc_taskqueue_normal);
|
||||
+
|
||||
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
+ ISC_MSG_EXITING, "exiting"));
|
||||
+
|
||||
+#ifdef OPENSSL_LEAKS
|
||||
+ ERR_remove_state(0);
|
||||
+#endif
|
||||
+
|
||||
+ return ((isc_threadresult_t)0);
|
||||
+}
|
||||
+#endif /* USE_WORKER_THREADS */
|
||||
+
|
||||
+#ifdef USE_WORKER_THREADS
|
||||
+static isc_threadresult_t
|
||||
+#ifdef _WIN32
|
||||
+WINAPI
|
||||
+#endif
|
||||
+run_slow(void *uap) {
|
||||
+ isc__taskmgr_t *manager = uap;
|
||||
+
|
||||
+ XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
+ ISC_MSG_STARTING, "starting"));
|
||||
+
|
||||
+ dispatch(manager, isc_taskqueue_slow);
|
||||
|
||||
XTHREADTRACE(isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
ISC_MSG_EXITING, "exiting"));
|
||||
@@ -1347,7 +1383,8 @@ manager_free(isc__taskmgr_t *manager) {
|
||||
|
||||
#ifdef USE_WORKER_THREADS
|
||||
(void)isc_condition_destroy(&manager->exclusive_granted);
|
||||
- (void)isc_condition_destroy(&manager->work_available);
|
||||
+ (void)isc_condition_destroy(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ (void)isc_condition_destroy(&manager->work_available[isc_taskqueue_slow]);
|
||||
(void)isc_condition_destroy(&manager->paused);
|
||||
isc_mem_free(manager->mctx, manager->threads);
|
||||
#endif /* USE_WORKER_THREADS */
|
||||
@@ -1414,12 +1451,20 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
|
||||
#ifdef USE_WORKER_THREADS
|
||||
manager->workers = 0;
|
||||
manager->threads = isc_mem_allocate(mctx,
|
||||
- workers * sizeof(isc_thread_t));
|
||||
+ 2 * workers * sizeof(isc_thread_t));
|
||||
if (manager->threads == NULL) {
|
||||
result = ISC_R_NOMEMORY;
|
||||
goto cleanup_lock;
|
||||
}
|
||||
- if (isc_condition_init(&manager->work_available) != ISC_R_SUCCESS) {
|
||||
+ if (isc_condition_init(&manager->work_available[isc_taskqueue_normal]) != ISC_R_SUCCESS) {
|
||||
+ UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
+ "isc_condition_init() %s",
|
||||
+ isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
+ ISC_MSG_FAILED, "failed"));
|
||||
+ result = ISC_R_UNEXPECTED;
|
||||
+ goto cleanup_threads;
|
||||
+ }
|
||||
+ if (isc_condition_init(&manager->work_available[isc_taskqueue_slow]) != ISC_R_SUCCESS) {
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"isc_condition_init() %s",
|
||||
isc_msgcat_get(isc_msgcat, ISC_MSGSET_GENERAL,
|
||||
@@ -1448,8 +1493,10 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
|
||||
default_quantum = DEFAULT_DEFAULT_QUANTUM;
|
||||
manager->default_quantum = default_quantum;
|
||||
INIT_LIST(manager->tasks);
|
||||
- INIT_LIST(manager->ready_tasks);
|
||||
- INIT_LIST(manager->ready_priority_tasks);
|
||||
+ INIT_LIST(manager->ready_tasks[isc_taskqueue_normal]);
|
||||
+ INIT_LIST(manager->ready_tasks[isc_taskqueue_slow]);
|
||||
+ INIT_LIST(manager->ready_priority_tasks[isc_taskqueue_normal]);
|
||||
+ INIT_LIST(manager->ready_priority_tasks[isc_taskqueue_slow]);
|
||||
manager->tasks_running = 0;
|
||||
manager->tasks_ready = 0;
|
||||
manager->exclusive_requested = false;
|
||||
@@ -1465,7 +1512,19 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
|
||||
* Start workers.
|
||||
*/
|
||||
for (i = 0; i < workers; i++) {
|
||||
- if (isc_thread_create(run, manager,
|
||||
+ if (isc_thread_create(run_normal, manager,
|
||||
+ &manager->threads[manager->workers]) ==
|
||||
+ ISC_R_SUCCESS) {
|
||||
+ char name[21]; /* thread name limit on Linux */
|
||||
+ snprintf(name, sizeof(name), "isc-worker%04u", i);
|
||||
+ isc_thread_setname(manager->threads[manager->workers],
|
||||
+ name);
|
||||
+ manager->workers++;
|
||||
+ started++;
|
||||
+ }
|
||||
+ }
|
||||
+ for (; i < workers * 2; i++) {
|
||||
+ if (isc_thread_create(run_slow, manager,
|
||||
&manager->threads[manager->workers]) ==
|
||||
ISC_R_SUCCESS) {
|
||||
char name[21]; /* thread name limit on Linux */
|
||||
@@ -1482,7 +1541,7 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
|
||||
manager_free(manager);
|
||||
return (ISC_R_NOTHREADS);
|
||||
}
|
||||
- isc_thread_setconcurrency(workers);
|
||||
+ isc_thread_setconcurrency(workers * 2);
|
||||
#endif /* USE_WORKER_THREADS */
|
||||
#ifdef USE_SHARED_MANAGER
|
||||
manager->refs = 1;
|
||||
@@ -1497,7 +1556,8 @@ isc__taskmgr_create(isc_mem_t *mctx, unsigned int workers,
|
||||
cleanup_exclusivegranted:
|
||||
(void)isc_condition_destroy(&manager->exclusive_granted);
|
||||
cleanup_workavailable:
|
||||
- (void)isc_condition_destroy(&manager->work_available);
|
||||
+ (void)isc_condition_destroy(&manager->work_available[isc_taskqueue_slow]);
|
||||
+ (void)isc_condition_destroy(&manager->work_available[isc_taskqueue_normal]);
|
||||
cleanup_threads:
|
||||
isc_mem_free(mctx, manager->threads);
|
||||
cleanup_lock:
|
||||
@@ -1582,7 +1642,7 @@ isc__taskmgr_destroy(isc_taskmgr_t **managerp) {
|
||||
task = NEXT(task, link)) {
|
||||
LOCK(&task->lock);
|
||||
if (task_shutdown(task))
|
||||
- push_readyq(manager, task);
|
||||
+ push_readyq(manager, task, task->qid);
|
||||
UNLOCK(&task->lock);
|
||||
}
|
||||
#ifdef USE_WORKER_THREADS
|
||||
@@ -1591,7 +1651,8 @@ isc__taskmgr_destroy(isc_taskmgr_t **managerp) {
|
||||
* there's work left to do, and if there are already no tasks left
|
||||
* it will cause the workers to see manager->exiting.
|
||||
*/
|
||||
- BROADCAST(&manager->work_available);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_slow]);
|
||||
UNLOCK(&manager->lock);
|
||||
|
||||
/*
|
||||
@@ -1693,7 +1754,8 @@ isc__taskmgr_resume(isc_taskmgr_t *manager0) {
|
||||
LOCK(&manager->lock);
|
||||
if (manager->pause_requested) {
|
||||
manager->pause_requested = false;
|
||||
- BROADCAST(&manager->work_available);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_slow]);
|
||||
}
|
||||
UNLOCK(&manager->lock);
|
||||
}
|
||||
@@ -1778,7 +1840,8 @@ isc__task_endexclusive(isc_task_t *task0) {
|
||||
LOCK(&manager->lock);
|
||||
REQUIRE(manager->exclusive_requested);
|
||||
manager->exclusive_requested = false;
|
||||
- BROADCAST(&manager->work_available);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_normal]);
|
||||
+ BROADCAST(&manager->work_available[isc_taskqueue_slow]);
|
||||
UNLOCK(&manager->lock);
|
||||
#else
|
||||
UNUSED(task0);
|
||||
@@ -1804,10 +1867,10 @@ isc__task_setprivilege(isc_task_t *task0, bool priv) {
|
||||
|
||||
LOCK(&manager->lock);
|
||||
if (priv && ISC_LINK_LINKED(task, ready_link))
|
||||
- ENQUEUE(manager->ready_priority_tasks, task,
|
||||
+ ENQUEUE(manager->ready_priority_tasks[task->qid], task,
|
||||
ready_priority_link);
|
||||
else if (!priv && ISC_LINK_LINKED(task, ready_priority_link))
|
||||
- DEQUEUE(manager->ready_priority_tasks, task,
|
||||
+ DEQUEUE(manager->ready_priority_tasks[task->qid], task,
|
||||
ready_priority_link);
|
||||
UNLOCK(&manager->lock);
|
||||
}
|
||||
--
|
||||
2.43.2
|
||||
|
@ -0,0 +1,133 @@
|
||||
From 0a7909045f9e1bf74c1f0fd561a8ef5f55481e8f Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 29 Jul 2024 16:20:50 +0200
|
||||
Subject: [PATCH] Allow global runtime definition by DNS_RBTDB_MAX_RTYPES
|
||||
|
||||
Modify rbtdb to not set it only at runtime, but allow setting that also
|
||||
in runtime via environment variable. It is still possible to modify
|
||||
default during the build define. In addition to it allows runtime change
|
||||
also. Can be positive number to set limit, 0 disabled the check.
|
||||
|
||||
Similarly add also DNS_RDATASET_MAX_RECORDS to set maximum number of
|
||||
records for a single name. This must be positive number, 0 is no accepted.
|
||||
|
||||
These replaces max-records-per-type and max-types-per-name in later
|
||||
versions. But can be configured only by environment and can be
|
||||
configured only globally, not in each view or zone.
|
||||
---
|
||||
lib/dns/rbtdb.c | 21 +++++++++++++++++++--
|
||||
lib/dns/rdataslab.c | 24 ++++++++++++++++++++++--
|
||||
2 files changed, 41 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
|
||||
index a3cb8dc871..0104c3ee36 100644
|
||||
--- a/lib/dns/rbtdb.c
|
||||
+++ b/lib/dns/rbtdb.c
|
||||
@@ -6320,15 +6320,29 @@ update_recordsandbytes(bool add, rbtdb_version_t *rbtversion,
|
||||
#define DNS_RBTDB_MAX_RTYPES 100
|
||||
#endif /* DNS_RBTDB_MAX_RTYPES */
|
||||
|
||||
+static uint32_t dns_g_rbtdb_max_rtypes = DNS_RBTDB_MAX_RTYPES;
|
||||
+
|
||||
+static void
|
||||
+init_max_rtypes(void) {
|
||||
+ /* Red Hat change, allow setting different max value by environment. */
|
||||
+ const char *max = getenv("DNS_RBTDB_MAX_RTYPES");
|
||||
+ if (max) {
|
||||
+ char *endp = NULL;
|
||||
+ long l = strtol(max, &endp, 10);
|
||||
+ if (max != endp && endp && !*endp && l >= 0)
|
||||
+ dns_g_rbtdb_max_rtypes = l;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
overmaxtype(dns_rbtdb_t *rbtdb, uint32_t ntypes) {
|
||||
UNUSED(rbtdb);
|
||||
|
||||
- if (DNS_RBTDB_MAX_RTYPES == 0) {
|
||||
+ if (dns_g_rbtdb_max_rtypes == 0) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
- return (ntypes >= DNS_RBTDB_MAX_RTYPES);
|
||||
+ return (ntypes >= dns_g_rbtdb_max_rtypes);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -8831,6 +8845,8 @@ static dns_dbmethods_t cache_methods = {
|
||||
getservestalettl
|
||||
};
|
||||
|
||||
+static isc_once_t once_db = ISC_ONCE_INIT;
|
||||
+
|
||||
isc_result_t
|
||||
#ifdef DNS_RBTDB_VERSION64
|
||||
dns_rbtdb64_create
|
||||
@@ -8850,6 +8866,7 @@ dns_rbtdb_create
|
||||
|
||||
/* Keep the compiler happy. */
|
||||
UNUSED(driverarg);
|
||||
+ RUNTIME_CHECK(isc_once_do(&once_db, init_max_rtypes) == ISC_R_SUCCESS);
|
||||
|
||||
rbtdb = isc_mem_get(mctx, sizeof(*rbtdb));
|
||||
if (rbtdb == NULL)
|
||||
diff --git a/lib/dns/rdataslab.c b/lib/dns/rdataslab.c
|
||||
index 347b7d2ce8..9566f79671 100644
|
||||
--- a/lib/dns/rdataslab.c
|
||||
+++ b/lib/dns/rdataslab.c
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
+#include <isc/once.h>
|
||||
#include <isc/region.h>
|
||||
#include <isc/string.h> /* Required for HP/UX (and others?) */
|
||||
#include <isc/util.h>
|
||||
@@ -119,6 +120,23 @@ fillin_offsets(unsigned char *offsetbase, unsigned int *offsettable,
|
||||
#define DNS_RDATASET_MAX_RECORDS 100
|
||||
#endif /* DNS_RDATASET_MAX_RECORDS */
|
||||
|
||||
+static unsigned int dns_g_rdataset_max_records = DNS_RDATASET_MAX_RECORDS;
|
||||
+static isc_once_t once = ISC_ONCE_INIT;
|
||||
+
|
||||
+static void
|
||||
+init_max_records(void) {
|
||||
+ /* Red Hat change, allow setting different max value by environment. */
|
||||
+ const char *max = getenv("DNS_RDATASET_MAX_RECORDS");
|
||||
+ if (max) {
|
||||
+ char *endp = NULL;
|
||||
+ long l = strtol(max, &endp, 10);
|
||||
+ if (max != endp && endp && !*endp && l > 0)
|
||||
+ dns_g_rdataset_max_records = l;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
isc_result_t
|
||||
dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
|
||||
isc_region_t *region, unsigned int reservelen)
|
||||
@@ -165,7 +183,9 @@ dns_rdataslab_fromrdataset(dns_rdataset_t *rdataset, isc_mem_t *mctx,
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
- if (nitems > DNS_RDATASET_MAX_RECORDS) {
|
||||
+ RUNTIME_CHECK(isc_once_do(&once, init_max_records) == ISC_R_SUCCESS);
|
||||
+
|
||||
+ if (nitems > dns_g_rdataset_max_records) {
|
||||
return (DNS_R_TOOMANYRECORDS);
|
||||
}
|
||||
|
||||
@@ -662,7 +682,7 @@ dns_rdataslab_merge(unsigned char *oslab, unsigned char *nslab,
|
||||
#endif
|
||||
INSIST(ocount > 0 && ncount > 0);
|
||||
|
||||
- if (ocount + ncount > DNS_RDATASET_MAX_RECORDS) {
|
||||
+ if (ocount + ncount > dns_g_rdataset_max_records) {
|
||||
return (DNS_R_TOOMANYRECORDS);
|
||||
}
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,171 @@
|
||||
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..cceeb5e 100644
|
||||
--- a/lib/isc/include/isc/util.h
|
||||
+++ b/lib/isc/include/isc/util.h
|
||||
@@ -289,6 +289,10 @@ 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..f33fc6b 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..286fe95 100644
|
||||
--- a/lib/isc/unix/app.c
|
||||
+++ b/lib/isc/unix/app.c
|
||||
@@ -442,15 +442,47 @@ 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;
|
||||
+ isc_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,7 +507,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);
|
||||
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
|
@ -0,0 +1,27 @@
|
||||
From 37f89ccfc439f8d86c401d9ae10e94e53b924961 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
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
|
||||
|
@ -0,0 +1,39 @@
|
||||
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
|
||||
|
@ -1,70 +0,0 @@
|
||||
From e9e7069ede766fa5c881517bdae74e2fc6682398 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Wed, 30 Jan 2019 14:37:17 +0100
|
||||
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.
|
||||
|
||||
Make gsstsig test supported
|
||||
---
|
||||
bin/named/Makefile.in | 14 ++++++++++++--
|
||||
bin/tests/system/conf.sh.in | 2 +-
|
||||
2 files changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/bin/named/Makefile.in b/bin/named/Makefile.in
|
||||
index debb906adc..dd894fe934 100644
|
||||
--- a/bin/named/Makefile.in
|
||||
+++ b/bin/named/Makefile.in
|
||||
@@ -56,7 +56,7 @@ CINCLUDES = -I${srcdir}/include -I${srcdir}/unix/include -I. \
|
||||
${LIBXML2_CFLAGS} \
|
||||
${MAXMINDDB_CFLAGS}
|
||||
|
||||
-CDEFINES = @CONTRIB_DLZ@
|
||||
+CDEFINES = @USE_GSSAPI@ @CONTRIB_DLZ@
|
||||
|
||||
CWARNINGS =
|
||||
|
||||
@@ -93,7 +93,7 @@ NOSYMLIBS = ${NSLIBS} ${DNSLIBS} ${BIND9LIBS} \
|
||||
|
||||
SUBDIRS = unix
|
||||
|
||||
-TARGETS = named@EXEEXT@
|
||||
+TARGETS = named@EXEEXT@ feature-test@EXEEXT@
|
||||
|
||||
GEOIP2LINKOBJS = geoip.@O@
|
||||
|
||||
@@ -156,6 +156,16 @@ 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
|
||||
+ ${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
|
||||
+ -c ${top_srcdir}/bin/tests/system/feature-test.c
|
||||
+
|
||||
+feature-test@EXEEXT@: feature-test.@O@
|
||||
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} \
|
||||
+ -o $@ feature-test.@O@ ${ISCLIBS} ${LIBS}
|
||||
+
|
||||
+
|
||||
clean distclean maintainer-clean::
|
||||
rm -f ${TARGETS} ${OBJS}
|
||||
|
||||
diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in
|
||||
index 9a61622143..f69c5be334 100644
|
||||
--- a/bin/tests/system/conf.sh.in
|
||||
+++ b/bin/tests/system/conf.sh.in
|
||||
@@ -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
|
||||
FSTRM_CAPTURE=@FSTRM_CAPTURE@
|
||||
HOST=$TOP/bin/dig/host
|
||||
IMPORTKEY=$TOP/bin/dnssec/dnssec-importkey
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,39 @@
|
||||
From c928591eb2a3b17c5be0cad56c8e061ebba11a95 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Thu, 20 Dec 2018 11:52:12 +0100
|
||||
Subject: [PATCH] Fix implicit declaration warning
|
||||
|
||||
isc_md5_available() function is not declared before its use. Include
|
||||
header providing it in files that use it.
|
||||
---
|
||||
bin/tests/system/tkey/keydelete.c | 1 +
|
||||
lib/dns/tsig.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
diff --git a/bin/tests/system/tkey/keydelete.c b/bin/tests/system/tkey/keydelete.c
|
||||
index 4b5b901..a3dd450 100644
|
||||
--- a/bin/tests/system/tkey/keydelete.c
|
||||
+++ b/bin/tests/system/tkey/keydelete.c
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <isc/hash.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/mem.h>
|
||||
+#include <isc/md5.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/sockaddr.h>
|
||||
#include <isc/socket.h>
|
||||
diff --git a/lib/dns/tsig.c b/lib/dns/tsig.c
|
||||
index c37b235..7786801 100644
|
||||
--- a/lib/dns/tsig.c
|
||||
+++ b/lib/dns/tsig.c
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/mem.h>
|
||||
+#include <isc/md5.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/print.h>
|
||||
#include <isc/refcount.h>
|
||||
--
|
||||
2.26.2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,121 @@
|
||||
From 83b889c238282b210f874a3ad81bb56299767495 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 5 Aug 2019 11:54:03 +0200
|
||||
Subject: [PATCH] Allow explicit disabling of autodisabled MD5
|
||||
|
||||
Default security policy might include explicitly disabled RSAMD5
|
||||
algorithm. Current FIPS code automatically disables in FIPS mode. But if
|
||||
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(-)
|
||||
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 5b57371..51702ab 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) {
|
||||
r.length = strlen(r.base);
|
||||
|
||||
result = dns_secalg_fromtext(&alg, &r);
|
||||
- if (result != ISC_R_SUCCESS) {
|
||||
+ if (result != ISC_R_SUCCESS && result != ISC_R_DISABLED) {
|
||||
uint8_t ui;
|
||||
result = isc_parse_uint8(&ui, r.base, 10);
|
||||
alg = ui;
|
||||
}
|
||||
- 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");
|
||||
diff --git a/lib/bind9/check.c b/lib/bind9/check.c
|
||||
index e0803d4..8023784 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) {
|
||||
r.length = strlen(r.base);
|
||||
|
||||
tresult = dns_secalg_fromtext(&alg, &r);
|
||||
+ if (tresult == ISC_R_DISABLED) {
|
||||
+ // Recognize disabled algorithms, disable it explicitly
|
||||
+ tresult = ISC_R_SUCCESS;
|
||||
+ }
|
||||
if (tresult != ISC_R_SUCCESS) {
|
||||
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
|
||||
--- 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 };
|
||||
static struct tbl tsigrcodes[] = { RCODENAMES TSIGRCODENAMES };
|
||||
static struct tbl certs[] = { CERTNAMES };
|
||||
static struct tbl secalgs[] = { SECALGNAMES };
|
||||
+static struct tbl md5_secalgs[] = { MD5_SECALGNAMES };
|
||||
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
|
||||
|
@ -0,0 +1,92 @@
|
||||
From ec50eff97c259b5bfbfa4e050d69fe7b39b0f15a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
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 <parameter>+noidnin</parameter> and
|
||||
- <parameter>+noidnout</parameter>.
|
||||
+ <parameter>+noidnout</parameter> or define
|
||||
+ the <envar>IDN_DISABLE</envar> environment variable.
|
||||
+
|
||||
</para>
|
||||
</refsection>
|
||||
|
||||
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 @@
|
||||
<command>host</command> 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 <envar>IDN_DISABLE</envar> environment variable.
|
||||
The IDN support is disabled if the variable is set when
|
||||
<command>host</command> 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
|
||||
</para>
|
||||
</refsection>
|
||||
|
||||
+ <refsection><info><title>IDN SUPPORT</title></info>
|
||||
+
|
||||
+ <para>
|
||||
+ If <command>nslookup</command> has been built with IDN (internationalized
|
||||
+ domain name) support, it can accept and display non-ASCII domain names.
|
||||
+ <command>nslookup</command> 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 <envar>IDN_DISABLE</envar> environment variable.
|
||||
+ The IDN support is disabled if the variable is set when
|
||||
+ <command>nslookup</command> runs.
|
||||
+ </para>
|
||||
+ </refsection>
|
||||
+
|
||||
<refsection><info><title>FILES</title></info>
|
||||
|
||||
<para><filename>/etc/resolv.conf</filename>
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,50 @@
|
||||
From cb6d2019766a6c8c5516fd8859cedf0052f03293 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
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
|
||||
|
@ -0,0 +1,256 @@
|
||||
From 8ca95f47231822df2b9c171a4da1e93ca5b748eb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
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 | 13 +++++++++----
|
||||
bin/pkcs11/Makefile.in | 9 ++++-----
|
||||
bin/python/Makefile.in | 8 ++++----
|
||||
bin/tools/Makefile.in | 25 +++++++++++++++----------
|
||||
9 files changed, 54 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/bin/check/Makefile.in b/bin/check/Makefile.in
|
||||
index c124e80..1174f8d 100644
|
||||
--- a/bin/check/Makefile.in
|
||||
+++ b/bin/check/Makefile.in
|
||||
@@ -83,12 +83,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 87f13dd..7865c0c 100644
|
||||
--- a/bin/confgen/Makefile.in
|
||||
+++ b/bin/confgen/Makefile.in
|
||||
@@ -95,13 +95,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 e2d2802..19361a8 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 a9830a9..d7ac0b6 100644
|
||||
--- a/bin/dig/Makefile.in
|
||||
+++ b/bin/dig/Makefile.in
|
||||
@@ -91,16 +91,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 2239ad1..ce0a177 100644
|
||||
--- a/bin/dnssec/Makefile.in
|
||||
+++ b/bin/dnssec/Makefile.in
|
||||
@@ -110,9 +110,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 e1f85a9..d92bc9a 100644
|
||||
--- a/bin/named/Makefile.in
|
||||
+++ b/bin/named/Makefile.in
|
||||
@@ -176,12 +176,17 @@ installdirs:
|
||||
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
|
||||
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man8
|
||||
|
||||
-install:: named@EXEEXT@ lwresd@EXEEXT@ installdirs
|
||||
+install-man5: named.conf.5
|
||||
+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man5
|
||||
+
|
||||
+install-man8: named.8 lwresd.8
|
||||
+ ${INSTALL_DATA} $^ ${DESTDIR}${mandir}/man8
|
||||
+
|
||||
+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_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
|
||||
--- a/bin/pkcs11/Makefile.in
|
||||
+++ b/bin/pkcs11/Makefile.in
|
||||
@@ -71,7 +71,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@ \
|
||||
@@ -80,10 +83,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 7bf2af4..c395bc7 100644
|
||||
--- a/bin/tools/Makefile.in
|
||||
+++ b/bin/tools/Makefile.in
|
||||
@@ -119,17 +119,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@ \
|
||||
@@ -144,13 +154,8 @@ 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
|
||||
|
@ -0,0 +1,27 @@
|
||||
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 <openssl/objects.h>
|
||||
#include <openssl/rsa.h>
|
||||
#endif
|
||||
+#if PKCS11CRYPTO
|
||||
+#include <pk11/pk11.h>
|
||||
+#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
|
||||
+++ b/lib/isc/include/pk11/internal.h
|
||||
@@ -13,6 +13,8 @@
|
||||
#ifndef PK11_INTERNAL_H
|
||||
#define PK11_INTERNAL_H 1
|
||||
|
||||
+#include <pk11/pk11.h>
|
||||
+
|
||||
/*! \file pk11/internal.h */
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
@ -0,0 +1,120 @@
|
||||
From 90416594843a56550e40b11561807786219ce1c4 Mon Sep 17 00:00:00 2001
|
||||
From: Evan Hunt <each@isc.org>
|
||||
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
|
||||
|
@ -0,0 +1,16 @@
|
||||
diff --git a/lib/dns/dyndb.c b/lib/dns/dyndb.c
|
||||
index 15561ce..e4449b0 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,
|
||||
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_DEEPBIND;
|
||||
+#endif
|
||||
#endif
|
||||
|
||||
handle = dlopen(filename, flags);
|
@ -1,29 +0,0 @@
|
||||
From 0f03071080e7fa68433b322359d46abaca2cc5ad Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Wed, 16 Jan 2019 16:27:33 +0100
|
||||
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 | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
|
||||
index 5aee5f6..7f2c2d2 100644
|
||||
--- a/lib/dns/rbt.c
|
||||
+++ b/lib/dns/rbt.c
|
||||
@@ -945,7 +945,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.31.1
|
||||
|
@ -0,0 +1,37 @@
|
||||
From 16c1bd61384e993fef13d7be88fdd34551a2b3ce Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Wed, 23 Jan 2019 20:12:51 +0100
|
||||
Subject: [PATCH] Use custom random generator only for bind build
|
||||
|
||||
Do not test random entropy on startup when used by DHCP. On most cases
|
||||
random entropy is not even used by DHCP. In cases it is (LDAP SSL), fail
|
||||
whenever it is not available.
|
||||
|
||||
Resolves: rhbz#1668682
|
||||
---
|
||||
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 91e87d0..2551b0a 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) */
|
||||
|
||||
+#ifdef 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 /* ISC_PLATFORM_USETHREADS */
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,32 @@
|
||||
From a503519533eb375a5ce1f7566bfc153aac980d87 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Fri, 9 Jul 2021 20:52:21 +0200
|
||||
Subject: [PATCH] Use proper entropy to initialize tsig keyname
|
||||
|
||||
Random names used on GSS backed nsupdate can conflict in specific
|
||||
situations. That might include starting a lot of machines from
|
||||
containers, where they took all similar time to start. PID and timestamp
|
||||
would be similar and therefore randomness is quite low. Use entropy to
|
||||
generate more random identifier and reduce chance of conflict.
|
||||
---
|
||||
bin/nsupdate/nsupdate.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c
|
||||
index 458aa76..d9e5a2b 100644
|
||||
--- a/bin/nsupdate/nsupdate.c
|
||||
+++ b/bin/nsupdate/nsupdate.c
|
||||
@@ -2941,7 +2941,9 @@ start_gssrequest(dns_name_t *master) {
|
||||
|
||||
keyname = dns_fixedname_initname(&fkname);
|
||||
|
||||
- isc_random_get(&val);
|
||||
+ result = isc_entropy_getdata(entropy, &val, sizeof(val), NULL, 0);
|
||||
+ if (result != ISC_R_SUCCESS)
|
||||
+ isc_random_get(&val);
|
||||
result = isc_string_printf(mykeystr, sizeof(mykeystr), "%u.sig-%s",
|
||||
val, namestr);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
--
|
||||
2.31.1
|
||||
|
@ -0,0 +1,232 @@
|
||||
From fff2960981a3294ac641968a17558c8d7eecf74d Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Wed, 24 Aug 2022 12:21:50 +1000
|
||||
Subject: [PATCH] Have dns_zt_apply lock the zone table
|
||||
|
||||
There where a number of places where the zone table should have
|
||||
been locked, but wasn't, when dns_zt_apply was called.
|
||||
|
||||
Added a isc_rwlocktype_t type parameter to dns_zt_apply and adjusted
|
||||
all calls to using it. Removed locks in callers.
|
||||
|
||||
Modified upstream commit for v9_11
|
||||
---
|
||||
bin/named/server.c | 11 ++++++-----
|
||||
bin/named/statschannel.c | 8 ++++----
|
||||
lib/dns/include/dns/zt.h | 4 ++--
|
||||
lib/dns/tests/zt_test.c | 3 ++-
|
||||
lib/dns/view.c | 3 ++-
|
||||
lib/dns/zt.c | 34 +++++++++++++++++++---------------
|
||||
6 files changed, 35 insertions(+), 28 deletions(-)
|
||||
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 9826588e6d..0b4b309461 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -8723,8 +8723,8 @@ load_configuration(const char *filename, ns_server_t *server,
|
||||
strcmp(view->name, "_bind") != 0)
|
||||
{
|
||||
dns_view_setviewrevert(view);
|
||||
- (void)dns_zt_apply(view->zonetable, false,
|
||||
- removed, view);
|
||||
+ (void)dns_zt_apply(view->zonetable, isc_rwlocktype_read,
|
||||
+ false, removed, view);
|
||||
}
|
||||
dns_view_detach(&view);
|
||||
}
|
||||
@@ -10090,8 +10090,8 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
|
||||
ISC_LIST_INIT(vle->zonelist);
|
||||
ISC_LIST_APPEND(dctx->viewlist, vle, link);
|
||||
if (dctx->dumpzones)
|
||||
- result = dns_zt_apply(view->zonetable, true,
|
||||
- add_zone_tolist, dctx);
|
||||
+ result = dns_zt_apply(view->zonetable, isc_rwlocktype_read,
|
||||
+ true, add_zone_tolist, dctx);
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -11367,7 +11367,8 @@ ns_server_sync(ns_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
|
||||
for (view = ISC_LIST_HEAD(server->viewlist);
|
||||
view != NULL;
|
||||
view = ISC_LIST_NEXT(view, link)) {
|
||||
- result = dns_zt_apply(view->zonetable, false,
|
||||
+ result = dns_zt_apply(view->zonetable,
|
||||
+ isc_rwlocktype_none, false,
|
||||
synczone, &cleanup);
|
||||
if (result != ISC_R_SUCCESS &&
|
||||
tresult == ISC_R_SUCCESS)
|
||||
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
|
||||
index 12ab048469..9828df0f4e 100644
|
||||
--- a/bin/named/statschannel.c
|
||||
+++ b/bin/named/statschannel.c
|
||||
@@ -1833,8 +1833,8 @@ generatexml(ns_server_t *server, uint32_t flags,
|
||||
if ((flags & STATS_XML_ZONES) != 0) {
|
||||
TRY0(xmlTextWriterStartElement(writer,
|
||||
ISC_XMLCHAR "zones"));
|
||||
- result = dns_zt_apply(view->zonetable, true,
|
||||
- zone_xmlrender, writer);
|
||||
+ result = dns_zt_apply(view->zonetable, isc_rwlocktype_read,
|
||||
+ true, zone_xmlrender, writer);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto error;
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* /zones */
|
||||
@@ -2489,8 +2489,8 @@ generatejson(ns_server_t *server, size_t *msglen,
|
||||
CHECKMEM(za);
|
||||
|
||||
if ((flags & STATS_JSON_ZONES) != 0) {
|
||||
- result = dns_zt_apply(view->zonetable, true,
|
||||
- zone_jsonrender, za);
|
||||
+ result = dns_zt_apply(view->zonetable, isc_rwlocktype_read,
|
||||
+ true, zone_jsonrender, za);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto error;
|
||||
}
|
||||
diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h
|
||||
index e658e5bb67..94212250da 100644
|
||||
--- a/lib/dns/include/dns/zt.h
|
||||
+++ b/lib/dns/include/dns/zt.h
|
||||
@@ -177,11 +177,11 @@ dns_zt_freezezones(dns_zt_t *zt, bool freeze);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply(dns_zt_t *zt, bool stop,
|
||||
+dns_zt_apply(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap);
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply2(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
+dns_zt_apply2(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop, isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap);
|
||||
/*%<
|
||||
* Apply a given 'action' to all zone zones in the table.
|
||||
diff --git a/lib/dns/tests/zt_test.c b/lib/dns/tests/zt_test.c
|
||||
index 3f1e812d60..ee75303a50 100644
|
||||
--- a/lib/dns/tests/zt_test.c
|
||||
+++ b/lib/dns/tests/zt_test.c
|
||||
@@ -145,7 +145,8 @@ apply(void **state) {
|
||||
assert_non_null(view->zonetable);
|
||||
|
||||
assert_int_equal(nzones, 0);
|
||||
- result = dns_zt_apply(view->zonetable, false, count_zone, &nzones);
|
||||
+ result = dns_zt_apply2(view->zonetable, isc_rwlocktype_read, false, NULL,
|
||||
+ count_zone, &nzones);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(nzones, 1);
|
||||
|
||||
diff --git a/lib/dns/view.c b/lib/dns/view.c
|
||||
index f01b4dea0f..bd1ced2863 100644
|
||||
--- a/lib/dns/view.c
|
||||
+++ b/lib/dns/view.c
|
||||
@@ -676,7 +676,8 @@ dns_view_dialup(dns_view_t *view) {
|
||||
REQUIRE(DNS_VIEW_VALID(view));
|
||||
REQUIRE(view->zonetable != NULL);
|
||||
|
||||
- (void)dns_zt_apply(view->zonetable, false, dialup, NULL);
|
||||
+ (void)dns_zt_apply2(view->zonetable, isc_rwlocktype_read, false, NULL,
|
||||
+ dialup, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
diff --git a/lib/dns/zt.c b/lib/dns/zt.c
|
||||
index 3f12e247e0..af65740325 100644
|
||||
--- a/lib/dns/zt.c
|
||||
+++ b/lib/dns/zt.c
|
||||
@@ -202,7 +202,8 @@ flush(dns_zone_t *zone, void *uap) {
|
||||
static void
|
||||
zt_destroy(dns_zt_t *zt) {
|
||||
if (zt->flush) {
|
||||
- (void)dns_zt_apply(zt, false, flush, NULL);
|
||||
+ (void)dns_zt_apply(zt, isc_rwlocktype_none,
|
||||
+ false, flush, NULL);
|
||||
}
|
||||
isc_refcount_destroy(&zt->references);
|
||||
dns_rbt_destroy(&zt->table);
|
||||
@@ -249,9 +250,7 @@ dns_zt_load(dns_zt_t *zt, bool stop) {
|
||||
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply(zt, stop, load, NULL);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply2(zt, isc_rwlocktype_read, stop, NULL, load, NULL);
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -293,7 +292,7 @@ dns_zt_asyncload2(dns_zt_t *zt, dns_zt_allloaded_t alldone, void *arg,
|
||||
* Prevent loads_pending going to zero while kicking off the loads.
|
||||
*/
|
||||
zt->loads_pending++;
|
||||
- result = dns_zt_apply2(zt, false, NULL, asyncload, ¶ms);
|
||||
+ result = dns_zt_apply2(zt, isc_rwlocktype_none, false, NULL, asyncload, ¶ms);
|
||||
pending = --zt->loads_pending;
|
||||
if (pending != 0) {
|
||||
zt->loaddone = alldone;
|
||||
@@ -342,9 +341,7 @@ dns_zt_loadnew(dns_zt_t *zt, bool stop) {
|
||||
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply(zt, stop, loadnew, NULL);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply(zt, isc_rwlocktype_read, stop, loadnew, NULL);
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -366,9 +363,7 @@ dns_zt_freezezones(dns_zt_t *zt, bool freeze) {
|
||||
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply2(zt, false, &tresult, freezezones, &freeze);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply2(zt, isc_rwlocktype_read, false, &tresult, freezezones, &freeze);
|
||||
if (tresult == ISC_R_NOTFOUND)
|
||||
tresult = ISC_R_SUCCESS;
|
||||
return ((result == ISC_R_SUCCESS) ? tresult : result);
|
||||
@@ -490,14 +485,14 @@ dns_zt_setviewrevert(dns_zt_t *zt) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply(dns_zt_t *zt, bool stop,
|
||||
+dns_zt_apply(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap)
|
||||
{
|
||||
- return (dns_zt_apply2(zt, stop, NULL, action, uap));
|
||||
+ return (dns_zt_apply2(zt, lock, stop, NULL, action, uap));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply2(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
+dns_zt_apply2(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop, isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap)
|
||||
{
|
||||
dns_rbtnode_t *node;
|
||||
@@ -508,6 +503,10 @@ dns_zt_apply2(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
REQUIRE(action != NULL);
|
||||
|
||||
+ if (lock != isc_rwlocktype_none) {
|
||||
+ RWLOCK(&zt->rwlock, lock);
|
||||
+ }
|
||||
+
|
||||
dns_rbtnodechain_init(&chain, zt->mctx);
|
||||
result = dns_rbtnodechain_first(&chain, zt->table, NULL, NULL);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
@@ -538,8 +537,13 @@ dns_zt_apply2(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
|
||||
cleanup:
|
||||
dns_rbtnodechain_invalidate(&chain);
|
||||
- if (sub != NULL)
|
||||
+ if (sub != NULL) {
|
||||
*sub = tresult;
|
||||
+ }
|
||||
+
|
||||
+ if (lock != isc_rwlocktype_none) {
|
||||
+ RWUNLOCK(&zt->rwlock, lock);
|
||||
+ }
|
||||
|
||||
return (result);
|
||||
}
|
||||
--
|
||||
2.37.2
|
||||
|
@ -0,0 +1,26 @@
|
||||
From c8f5b31f0637315c1c45d0287f05fcad2250f40f Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Thu, 13 Oct 2022 15:35:46 +0200
|
||||
Subject: [PATCH] Add include to rwlocktype_t to dns/zt.h
|
||||
|
||||
It got broken as part of bug #2101712 fix. Introduced new definition,
|
||||
which passes during bind build, but breaks bind-dyndb-ldap build.
|
||||
---
|
||||
lib/dns/include/dns/zt.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h
|
||||
index 9421225..64c24d6 100644
|
||||
--- a/lib/dns/include/dns/zt.h
|
||||
+++ b/lib/dns/include/dns/zt.h
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
+#include <isc/rwlock.h>
|
||||
|
||||
#include <dns/types.h>
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,780 @@
|
||||
From af3b530773231f8cff6548e36962ad1f25e38c5d Mon Sep 17 00:00:00 2001
|
||||
From: Evan Hunt <each@isc.org>
|
||||
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 | 42 ++++++++++++++++++
|
||||
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 | 48 +++++++++++++++------
|
||||
lib/isc/include/isc/random.h | 26 +++++++----
|
||||
lib/isccfg/namedconf.c | 2 +-
|
||||
23 files changed, 240 insertions(+), 102 deletions(-)
|
||||
create mode 100644 doc/arm/notes-rh-changes.xml
|
||||
|
||||
diff --git a/bin/confgen/keygen.c b/bin/confgen/keygen.c
|
||||
index bd269e7..1ac775f 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 bd19e1d..2c09b30 100644
|
||||
--- a/bin/dnssec/dnssec-keygen.docbook
|
||||
+++ b/bin/dnssec/dnssec-keygen.docbook
|
||||
@@ -349,15 +349,23 @@
|
||||
<term>-r <replaceable class="parameter">randomdev</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
- Specifies the source of randomness. If the operating
|
||||
- system does not provide a <filename>/dev/random</filename>
|
||||
- or equivalent device, the default source of randomness
|
||||
- is keyboard input. <filename>randomdev</filename>
|
||||
- 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.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ If that behavior is disabled at compile time, however,
|
||||
+ the specified file will be used as entropy source
|
||||
+ for key generation. <filename>randomdev</filename> is
|
||||
the name of a character device or file containing random
|
||||
- data to be used instead of the default. The special value
|
||||
- <filename>keyboard</filename> indicates that keyboard
|
||||
- input should be used.
|
||||
+ data to be used. The special value <filename>keyboard</filename>
|
||||
+ indicates that keyboard input should be used.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ The default is <filename>/dev/random</filename> if the
|
||||
+ operating system provides it or an equivalent device;
|
||||
+ if not, the default source of randomness is keyboard input.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c
|
||||
index 2a0f9c6..6fcd411 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 4a50ad9..4d140e8 100644
|
||||
--- a/bin/named/client.c
|
||||
+++ b/bin/named/client.c
|
||||
@@ -1768,7 +1768,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 9b343fa..5e663c6 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 9fdf49b..42128dc 100644
|
||||
--- a/bin/named/controlconf.c
|
||||
+++ b/bin/named/controlconf.c
|
||||
@@ -327,9 +327,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;
|
||||
@@ -340,16 +341,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;
|
||||
@@ -462,8 +464,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 4fd0194..0ba2627 100644
|
||||
--- a/bin/named/include/named/server.h
|
||||
+++ b/bin/named/include/named/server.h
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <isc/log.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/quota.h>
|
||||
+#include <isc/random.h>
|
||||
#include <isc/sockaddr.h>
|
||||
#include <isc/types.h>
|
||||
#include <isc/xml.h>
|
||||
@@ -135,6 +136,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 93aac31..e12fad9 100644
|
||||
--- a/bin/named/interfacemgr.c
|
||||
+++ b/bin/named/interfacemgr.c
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include <isc/interfaceiter.h>
|
||||
#include <isc/os.h>
|
||||
+#include <isc/random.h>
|
||||
#include <isc/string.h>
|
||||
#include <isc/task.h>
|
||||
#include <isc/util.h>
|
||||
diff --git a/bin/named/query.c b/bin/named/query.c
|
||||
index 58b5914..edf42d2 100644
|
||||
--- a/bin/named/query.c
|
||||
+++ b/bin/named/query.c
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <isc/mem.h>
|
||||
#include <isc/platform.h>
|
||||
#include <isc/print.h>
|
||||
+#include <isc/random.h>
|
||||
#include <isc/rwlock.h>
|
||||
#include <isc/serial.h>
|
||||
#include <isc/stats.h>
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index b2ae57c..cca7fe8 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -8279,21 +8279,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;
|
||||
@@ -8304,8 +8315,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));
|
||||
}
|
||||
@@ -8325,7 +8336,6 @@ load_configuration(const char *filename, ns_server_t *server,
|
||||
}
|
||||
isc_entropy_detach(&ns_g_fallbackentropy);
|
||||
}
|
||||
-#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -9097,6 +9107,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,
|
||||
@@ -9123,6 +9134,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
|
||||
@@ -9329,7 +9343,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);
|
||||
|
||||
@@ -13366,10 +13381,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;
|
||||
@@ -13379,9 +13394,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 7f15cbc..458aa76 100644
|
||||
--- a/bin/nsupdate/nsupdate.c
|
||||
+++ b/bin/nsupdate/nsupdate.c
|
||||
@@ -289,9 +289,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 95b65bf..7a81d4e 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 3236968..4fa77b6 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 43fb6b0..105e151 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 ca98726..1f9df2c 100644
|
||||
--- a/doc/arm/Bv9ARM-book.xml
|
||||
+++ b/doc/arm/Bv9ARM-book.xml
|
||||
@@ -5034,22 +5034,45 @@ badresp:1,adberr:0,findfail:0,valfail:0]
|
||||
<term><command>random-device</command></term>
|
||||
<listitem>
|
||||
<para>
|
||||
- This specifies a 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 option specifies the device (or file) from which
|
||||
- to read
|
||||
- entropy. If it is a file, operations requiring entropy will
|
||||
- fail when the
|
||||
- file has been exhausted. If <command>random-device</command> is not specified, the default value
|
||||
- is
|
||||
- <filename>/dev/random</filename>
|
||||
- (or equivalent) when present, and none otherwise. The
|
||||
- <command>random-device</command> 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.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ 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.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ If <command>random-device</command> is not specified, or
|
||||
+ if it is set to <literal>none</literal>, 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).
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ The <command>random-device</command> option takes
|
||||
+ effect during the initial configuration load at server
|
||||
+ startup time and is ignored on subsequent reloads.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ If BIND is built with
|
||||
+ <command>configure --disable-crypto-rand</command>, then
|
||||
+ entropy is <emphasis>not</emphasis> sourced from the
|
||||
+ cryptographic library. In this case, if
|
||||
+ <command>random-device</command> is not specified, the
|
||||
+ default value is the system random device,
|
||||
+ <filename>/dev/random</filename> or the equivalent.
|
||||
+ This default can be overridden with
|
||||
+ <command>configure --with-randomdev</command>.
|
||||
+ If no system random device exists, then no entropy source
|
||||
+ will be configured, and <command>named</command> will only
|
||||
+ be able to use pseudo-random numbers.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
diff --git a/doc/arm/notes-rh-changes.xml b/doc/arm/notes-rh-changes.xml
|
||||
new file mode 100644
|
||||
index 0000000..89a4961
|
||||
--- /dev/null
|
||||
+++ b/doc/arm/notes-rh-changes.xml
|
||||
@@ -0,0 +1,42 @@
|
||||
+<!--
|
||||
+ - 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.
|
||||
+-->
|
||||
+
|
||||
+<section xml:id="relnotes_rh_changes"><info><title>Red Hat Specific Changes</title></info>
|
||||
+ <itemizedlist>
|
||||
+ <listitem>
|
||||
+ <para>
|
||||
+ 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
|
||||
+ <filename>/dev/random</filename>. This is suitable for virtual
|
||||
+ machine environments, which may have limited entropy pools and
|
||||
+ lack hardware random number generators.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ This can be overridden by specifying another entropy source via
|
||||
+ the <command>random-device</command> option in
|
||||
+ <filename>named.conf</filename>, or via the <command>-r</command>
|
||||
+ command line option. However, for functions requiring full
|
||||
+ cryptographic strength, such as DNSSEC key generation, this
|
||||
+ <emphasis>cannot</emphasis> be overridden. In particular, the
|
||||
+ <command>-r</command> command line option no longer has any
|
||||
+ effect on <command>dnssec-keygen</command>.
|
||||
+ </para>
|
||||
+ <para>
|
||||
+ This can be disabled by building with
|
||||
+ <command>configure --disable-crypto-rand</command>, in which
|
||||
+ case <filename>/dev/random</filename> will be the default
|
||||
+ entropy source. [RT #31459] [RT #46047]
|
||||
+ </para>
|
||||
+ </listitem>
|
||||
+ </itemizedlist>
|
||||
+</section>
|
||||
+
|
||||
diff --git a/doc/arm/notes.xml b/doc/arm/notes.xml
|
||||
index a5e42c0..f8cb1f9 100644
|
||||
--- a/doc/arm/notes.xml
|
||||
+++ b/doc/arm/notes.xml
|
||||
@@ -47,6 +47,7 @@
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="notes-9.11.1.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="notes-9.11.0.xml"/>
|
||||
|
||||
+ <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="notes-rh-changes.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="notes-eol.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="notes-thankyou.xml"/>
|
||||
</section>
|
||||
diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c
|
||||
index aa54afc..2156384 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 3aba028..180c841 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 3f4f822..cfdc757 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 f32c9dc..bed276b 100644
|
||||
--- a/lib/isc/include/isc/entropy.h
|
||||
+++ b/lib/isc/include/isc/entropy.h
|
||||
@@ -189,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
|
||||
@@ -232,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'.
|
||||
*
|
||||
- * Do this 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 returned.
|
||||
+ * 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.
|
||||
*
|
||||
- * Honor the request from the caller to only return good data, any data,
|
||||
- * etc.
|
||||
+ * 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.
|
||||
+ *
|
||||
+ * 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.)
|
||||
+ *
|
||||
+ * 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
|
||||
@@ -305,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 f38e80d..3cb1c56 100644
|
||||
--- a/lib/isc/include/isc/random.h
|
||||
+++ b/lib/isc/include/isc/random.h
|
||||
@@ -19,13 +19,23 @@
|
||||
#include <isc/mutex.h>
|
||||
|
||||
/*! \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.
|
||||
*
|
||||
- * 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.
|
||||
+ * 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).
|
||||
+ *
|
||||
+ * 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
|
||||
@@ -113,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 e74c93b..212194e 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.26.2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,65 @@
|
||||
From 8a7bff93037432fcfe8532752e89f150ea3030a4 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 9 Oct 2023 19:00:12 +0200
|
||||
Subject: [PATCH] Do not keep stale records by default
|
||||
|
||||
By default set max-stale-ttl to 0, unless stale-answer-enable yes. This
|
||||
were enabled by mistake when backporting fix for CVE-2023-2828. It
|
||||
causes increased cache usage on servers not wanting to serve stale
|
||||
records. Fix that by setting smart defaults based on stale answers
|
||||
enabled with possible manual tuning.
|
||||
---
|
||||
bin/named/server.c | 25 +++++++++++++++++++------
|
||||
1 file changed, 19 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 7af90d0..afdc4fa 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -3295,7 +3295,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;
|
||||
+ uint32_t max_stale_ttl = 0;
|
||||
dns_tsig_keyring_t *ring = NULL;
|
||||
dns_view_t *pview = NULL; /* Production view */
|
||||
isc_mem_t *cmctx = NULL, *hmctx = NULL;
|
||||
@@ -3739,16 +3739,29 @@ 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);
|
||||
|
||||
+ // RHEL-11785 -- set the stale-ttl to non-zero value only if enabled
|
||||
+ obj = NULL;
|
||||
+ if (view->staleanswersenable) {
|
||||
+ result = ns_config_get(maps, "max-stale-ttl", &obj);
|
||||
+ INSIST(result == ISC_R_SUCCESS);
|
||||
+ max_stale_ttl = cfg_obj_asuint32(obj);
|
||||
+ /*
|
||||
+ * If 'stale-answer-enable' is false, max_stale_ttl is set
|
||||
+ * to 0, meaning keeping stale RRsets in cache is disabled.
|
||||
+ */
|
||||
+ } else {
|
||||
+ /* Do not use default value if stale is disabled,
|
||||
+ * but allow manual overriding, like 'stale-cache-enable' */
|
||||
+ result = ns_config_get(optionmaps, "max-stale-ttl", &obj);
|
||||
+ if (result == ISC_R_SUCCESS)
|
||||
+ max_stale_ttl = cfg_obj_asuint32(obj);
|
||||
+ }
|
||||
+
|
||||
result = dns_viewlist_find(&ns_g_server->viewlist, view->name,
|
||||
view->rdclass, &pview);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
--
|
||||
2.41.0
|
||||
|
@ -1,65 +0,0 @@
|
||||
From 607cec78382b016aad0fe041f2e1895b6896c647 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Fri, 1 Mar 2019 15:48:20 +0100
|
||||
Subject: [PATCH] Make alternative named builds testable in system tests
|
||||
|
||||
Red Hat has alternative variant builds of named, which are not ever
|
||||
tested by system tests. New variables make it relatively easy to test
|
||||
alternative variants.
|
||||
|
||||
For sdb variant use:
|
||||
export NAMED_VARIANT=-sdb DNSSEC_VARIANT=
|
||||
|
||||
For pkcs variant use:
|
||||
export NAMED_VARIANT=-pkcs11 DNSSEC_VARIANT=-pkcs11
|
||||
---
|
||||
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 d859909..9152f07 100644
|
||||
--- a/bin/tests/system/conf.sh.in
|
||||
+++ b/bin/tests/system/conf.sh.in
|
||||
@@ -37,17 +37,17 @@ 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@
|
||||
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
|
||||
-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}
|
||||
NSEC3HASH=$TOP/bin/tools/nsec3hash
|
||||
NSLOOKUP=$TOP/bin/dig/nslookup
|
||||
NSUPDATE=$TOP/bin/nsupdate/nsupdate
|
||||
@@ -56,12 +56,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/bin/tests/system/resolve
|
||||
-REVOKE=$TOP/bin/dnssec/dnssec-revoke
|
||||
+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}
|
||||
+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.26.3
|
||||
|
@ -0,0 +1,30 @@
|
||||
From 373f07148217a8e70e33446f5108fb42d1079ba6 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
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 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/isc/tests/Kyuafile b/lib/isc/tests/Kyuafile
|
||||
index 4cd2574..9df2340 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'}
|
||||
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='regex_test'}
|
||||
tap_test_program{name='result_test'}
|
||||
tap_test_program{name='safe_test'}
|
||||
--
|
||||
2.20.1
|
||||
|
@ -0,0 +1,195 @@
|
||||
From 9683a4d2524b870c4cee09259cb5eb7b8075a507 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
|
||||
Date: Tue, 18 Dec 2018 16:06:26 +0100
|
||||
Subject: [PATCH] Make absolute hostname by dns API instead of strings
|
||||
|
||||
Duplicate all strings in dc_list. Free allocated memory on each record.
|
||||
---
|
||||
bin/sdb_tools/zone2ldap.c | 70 +++++++++++++++++++++++++--------------
|
||||
1 file changed, 45 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/bin/sdb_tools/zone2ldap.c b/bin/sdb_tools/zone2ldap.c
|
||||
index d59936c..9ba73b8 100644
|
||||
--- a/bin/sdb_tools/zone2ldap.c
|
||||
+++ b/bin/sdb_tools/zone2ldap.c
|
||||
@@ -84,6 +84,10 @@ 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 *zone);
|
||||
|
||||
+/* Free a DN list */
|
||||
+static void
|
||||
+free_dc_list(char **dc_list);
|
||||
+
|
||||
/* Add to RR list */
|
||||
void add_to_rr_list (char *dn, char *name, char *type, char *data,
|
||||
unsigned int ttl, unsigned int flags);
|
||||
@@ -120,6 +124,7 @@ static char dNSTTL []="dNSTTL";
|
||||
static char zoneName []="zoneName";
|
||||
static char dc []="dc";
|
||||
static char sameZone []="@";
|
||||
+static char dot []=".";
|
||||
/* LDAPMod mod_values: */
|
||||
static char *objectClasses []= { &(topClass[0]), &(dNSZoneClass[0]), NULL };
|
||||
static char *topObjectClasses []= { &(topClass[0]), &(dcObjectClass[0]), &(dNSZoneClass[0]), NULL };
|
||||
@@ -391,6 +396,8 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
}
|
||||
+
|
||||
+ free_dc_list(dc_list);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -446,12 +453,18 @@ generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, unsigned int ttl)
|
||||
char data[2048];
|
||||
char **dc_list;
|
||||
char *dn;
|
||||
+ size_t argzone_len;
|
||||
+ bool omit_dot;
|
||||
|
||||
isc_buffer_t buff;
|
||||
isc_result_t result;
|
||||
|
||||
isc_buffer_init (&buff, name, sizeof (name));
|
||||
result = dns_name_totext (dnsname, true, &buff);
|
||||
+ argzone_len = strlen(argzone);
|
||||
+ /* If argzone is absolute, output absolute name too */
|
||||
+ omit_dot = (!(argzone_len > 0 && argzone[argzone_len-1] == '.'));
|
||||
+ result = dns_name_totext (dnsname, omit_dot, &buff);
|
||||
isc_result_check (result, "dns_name_totext");
|
||||
name[isc_buffer_usedlength (&buff)] = 0;
|
||||
|
||||
@@ -473,6 +486,7 @@ generate_ldap (dns_name_t * dnsname, dns_rdata_t * rdata, unsigned int ttl)
|
||||
printf ("Adding %s (%s %s) to run queue list.\n", dn, type, data);
|
||||
|
||||
add_to_rr_list (dn, dc_list[len], (char*)type, (char*)data, ttl, DNS_OBJECT);
|
||||
+ free_dc_list(dc_list);
|
||||
}
|
||||
|
||||
|
||||
@@ -533,12 +547,9 @@ add_to_rr_list (char *dn, char *name, char *type,
|
||||
if (tmp->attrs == (LDAPMod **) NULL)
|
||||
fatal("calloc");
|
||||
|
||||
- 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] = (LDAPMod *) malloc (sizeof (LDAPMod));
|
||||
+ if (tmp->attrs[0] == (LDAPMod *) NULL)
|
||||
+ fatal("malloc");
|
||||
tmp->attrs[0]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[0]->mod_type = objectClass;
|
||||
|
||||
@@ -554,9 +565,18 @@ add_to_rr_list (char *dn, char *name, char *type,
|
||||
return;
|
||||
}
|
||||
|
||||
+ for (i = 1; i < (int)flags-1; i++)
|
||||
+ {
|
||||
+ tmp->attrs[i] = (LDAPMod *) malloc (sizeof (LDAPMod));
|
||||
+ if (tmp->attrs[i] == (LDAPMod *) NULL)
|
||||
+ fatal("malloc");
|
||||
+ }
|
||||
+ tmp->attrs[i] = NULL;
|
||||
+
|
||||
+
|
||||
tmp->attrs[1]->mod_op = LDAP_MOD_ADD;
|
||||
tmp->attrs[1]->mod_type = relativeDomainName;
|
||||
- tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 2);
|
||||
+ tmp->attrs[1]->mod_values = (char **) calloc (sizeof (char *), 3);
|
||||
|
||||
if (tmp->attrs[1]->mod_values == (char **)NULL)
|
||||
fatal("calloc");
|
||||
@@ -701,24 +721,16 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
||||
{
|
||||
char *tmp;
|
||||
int i = 0;
|
||||
+ int j = 0;
|
||||
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);
|
||||
+ hname= strdup(hostname);
|
||||
last = strdup(sameZone);
|
||||
}else
|
||||
{
|
||||
@@ -726,8 +738,6 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
||||
||( 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);
|
||||
@@ -735,8 +745,7 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
||||
sprintf(hname,"%s",zone);
|
||||
}else
|
||||
{
|
||||
- if( hname == 0 )
|
||||
- hname = strdup(hostname);
|
||||
+ hname = strdup(hostname);
|
||||
}
|
||||
last = hname;
|
||||
}
|
||||
@@ -749,18 +758,21 @@ hostname_to_dn_list (char *hostname, char *zone, unsigned int flags)
|
||||
for (tmp = strrchr (hname, '.'); tmp != (char *) 0;
|
||||
tmp = strrchr (hname, '.'))
|
||||
{
|
||||
- if( *( tmp + 1 ) != '\0' )
|
||||
+ tmp[0] = '\0';
|
||||
+ if( tmp[1] != '\0' )
|
||||
{
|
||||
- *tmp = '\0';
|
||||
dn_buffer[i++] = ++tmp;
|
||||
}else
|
||||
{ /* trailing '.' ! */
|
||||
- dn_buffer[i++] = strdup(".");
|
||||
- *tmp = '\0';
|
||||
+ dn_buffer[i++] = dot;
|
||||
if( tmp == hname )
|
||||
break;
|
||||
}
|
||||
}
|
||||
+ for (j=0; j<i; j++)
|
||||
+ {
|
||||
+ dn_buffer[j] = strdup(dn_buffer[j]);
|
||||
+ }
|
||||
if( ( last != hname ) && (tmp != hname) )
|
||||
dn_buffer[i++] = hname;
|
||||
dn_buffer[i++] = last;
|
||||
@@ -820,6 +832,14 @@ build_dn_from_dc_list (char **dc_list, unsigned int ttl, int flag, char *zone)
|
||||
return dn;
|
||||
}
|
||||
|
||||
+static void
|
||||
+free_dc_list(char **dc_list)
|
||||
+{
|
||||
+ for (; *dc_list; dc_list++) {
|
||||
+ free(*dc_list);
|
||||
+ *dc_list=NULL;
|
||||
+ }
|
||||
+}
|
||||
|
||||
/* Initialize LDAP Conn */
|
||||
void
|
||||
--
|
||||
2.21.1
|
||||
|
@ -1,83 +0,0 @@
|
||||
From e6ab9c67f0a14adc23c1067e03a106da1b1651b7 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
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 +-
|
||||
configure.ac | 8 ++++++--
|
||||
lib/dns/dst_internal.h | 12 +++++++++---
|
||||
3 files changed, 16 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
|
||||
index 1b7512d..c126bf3 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/configure.ac b/configure.ac
|
||||
index f5483fe..08a7d8a 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -935,10 +935,14 @@ AC_SUBST([PKCS11_TEST])
|
||||
AC_SUBST([PKCS11_TOOLS])
|
||||
AC_SUBST([PKCS11_MANS])
|
||||
|
||||
+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])])
|
||||
+ [pkcs11],[USE_PKCS11='-DUSE_PKCS11=1'],
|
||||
+ [USE_OPENSSL='-DUSE_OPENSSL=1'])
|
||||
+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/dst_internal.h b/lib/dns/dst_internal.h
|
||||
index 2c3b4a3..55e9dc4 100644
|
||||
--- a/lib/dns/dst_internal.h
|
||||
+++ b/lib/dns/dst_internal.h
|
||||
@@ -38,6 +38,13 @@
|
||||
#include <isc/stdtime.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
+#ifndef USE_PKCS11
|
||||
+#define USE_PKCS11 0
|
||||
+#endif
|
||||
+#ifndef USE_OPENSSL
|
||||
+#define USE_OPENSSL (! USE_PKCS11)
|
||||
+#endif
|
||||
+
|
||||
#if USE_PKCS11
|
||||
#include <pk11/pk11.h>
|
||||
#include <pk11/site.h>
|
||||
@@ -116,11 +123,10 @@ struct dst_key {
|
||||
void *generic;
|
||||
dns_gss_ctx_id_t gssctx;
|
||||
DH *dh;
|
||||
-#if USE_OPENSSL
|
||||
- EVP_PKEY *pkey;
|
||||
-#endif /* if USE_OPENSSL */
|
||||
#if USE_PKCS11
|
||||
pk11_object_t *pkey;
|
||||
+#else
|
||||
+ EVP_PKEY *pkey;
|
||||
#endif /* if USE_PKCS11 */
|
||||
dst_hmac_key_t *hmac_key;
|
||||
} keydata; /*%< pointer to key in crypto pkg fmt */
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,58 @@
|
||||
From 6d6acf236841da5c2511f8afcd3e4a89af4c5658 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Witold=20Kr=C4=99cicki?= <wpk@isc.org>
|
||||
Date: Fri, 14 Feb 2020 09:18:48 +0100
|
||||
Subject: [PATCH] Use RESOLVER_NTASKS_PERCPU - 32 for regular tuning, 8 for
|
||||
small
|
||||
|
||||
Modify original upstream commit 0d80266f7e3, add high limit of used
|
||||
tasks. Minimum would be lower on machines with few cpus, but maximum
|
||||
would stay unchanged. Should prevent negatives of this change.
|
||||
|
||||
Signed-off-by: Petr Mensik <pemensik@redhat.com>
|
||||
---
|
||||
bin/named/server.c | 12 ++++++++----
|
||||
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 39b1124..94b4daa 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -148,11 +148,13 @@
|
||||
#endif
|
||||
|
||||
#ifdef TUNE_LARGE
|
||||
-#define RESOLVER_NTASKS 523
|
||||
+#define RESOLVER_NTASKS_MAX 523
|
||||
+#define RESOLVER_NTASKS_PERCPU 32
|
||||
#define UDPBUFFERS 32768
|
||||
#define EXCLBUFFERS 32768
|
||||
#else
|
||||
-#define RESOLVER_NTASKS 31
|
||||
+#define RESOLVER_NTASKS_MAX 31
|
||||
+#define RESOLVER_NTASKS_PERCPU 8
|
||||
#define UDPBUFFERS 1000
|
||||
#define EXCLBUFFERS 4096
|
||||
#endif /* TUNE_LARGE */
|
||||
@@ -3318,7 +3320,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
ns_cache_t *nsc;
|
||||
bool zero_no_soattl;
|
||||
dns_acl_t *clients = NULL, *mapped = NULL, *excluded = NULL;
|
||||
- unsigned int query_timeout, ndisp;
|
||||
+ unsigned int query_timeout, ndisp, ntasks;
|
||||
bool old_rpz_ok = false;
|
||||
isc_dscp_t dscp4 = -1, dscp6 = -1;
|
||||
dns_dyndbctx_t *dctx = NULL;
|
||||
@@ -3926,7 +3928,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
dns_view_setresquerystats(view, resquerystats);
|
||||
|
||||
ndisp = 4 * ISC_MIN(ns_g_udpdisp, MAX_UDP_DISPATCH);
|
||||
- CHECK(dns_view_createresolver(view, ns_g_taskmgr, RESOLVER_NTASKS,
|
||||
+ ntasks = ISC_MIN(RESOLVER_NTASKS_PERCPU * ns_g_cpus,
|
||||
+ RESOLVER_NTASKS_MAX);
|
||||
+ CHECK(dns_view_createresolver(view, ns_g_taskmgr, ntasks,
|
||||
ndisp, ns_g_socketmgr, ns_g_timermgr,
|
||||
resopts, ns_g_dispatchmgr,
|
||||
dispatch4, dispatch6));
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,81 +0,0 @@
|
||||
From 33064cd077cf6fa386f0a5a840c2161868da7b3a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
|
||||
Date: Tue, 8 Feb 2022 12:42:34 +0100
|
||||
Subject: [PATCH] Run .closehandle_cb asynchrounosly in nmhandle_detach_cb()
|
||||
|
||||
When sock->closehandle_cb is set, we need to run nmhandle_detach_cb()
|
||||
asynchronously to ensure correct order of multiple packets processing in
|
||||
the isc__nm_process_sock_buffer(). When not run asynchronously, it
|
||||
would cause:
|
||||
|
||||
a) out-of-order processing of the return codes from processbuffer();
|
||||
|
||||
b) stack growth because the next TCP DNS message read callback will
|
||||
be called from within the current TCP DNS message read callback.
|
||||
|
||||
The sock->closehandle_cb is set to isc__nm_resume_processing() for TCP
|
||||
sockets which calls isc__nm_process_sock_buffer(). If the read callback
|
||||
(called from isc__nm_process_sock_buffer()->processbuffer()) doesn't
|
||||
attach to the nmhandle (f.e. because it wants to drop the processing or
|
||||
we send the response directly via uv_try_write()), the
|
||||
isc__nm_resume_processing() (via .closehandle_cb) would call
|
||||
isc__nm_process_sock_buffer() recursively.
|
||||
|
||||
The below shortened code path shows how the stack can grow:
|
||||
|
||||
1: ns__client_request(handle, ...);
|
||||
2: isc_nm_tcpdns_sequential(handle);
|
||||
3: ns_query_start(client, handle);
|
||||
4: query_lookup(qctx);
|
||||
5: query_send(qctcx->client);
|
||||
6: isc__nmhandle_detach(&client->reqhandle);
|
||||
7: nmhandle_detach_cb(&handle);
|
||||
8: sock->closehandle_cb(sock); // isc__nm_resume_processing
|
||||
9: isc__nm_process_sock_buffer(sock);
|
||||
10: processbuffer(sock); // isc__nm_tcpdns_processbuffer
|
||||
11: isc_nmhandle_attach(req->handle, &handle);
|
||||
12: isc__nm_readcb(sock, req, ISC_R_SUCCESS);
|
||||
13: isc__nm_async_readcb(NULL, ...);
|
||||
14: uvreq->cb.recv(...); // ns__client_request
|
||||
|
||||
Instead, if 'sock->closehandle_cb' is set, we need to run detach the
|
||||
handle asynchroniously in 'isc__nmhandle_detach', so that on line 8 in
|
||||
the code flow above does not start this recursion. This ensures the
|
||||
correct order when processing multiple packets in the function
|
||||
'isc__nm_process_sock_buffer()' and prevents the stack growth.
|
||||
|
||||
When not run asynchronously, the out-of-order processing leaves the
|
||||
first TCP socket open until all requests on the stream have been
|
||||
processed.
|
||||
|
||||
If the pipelining is disabled on the TCP via `keep-response-order`
|
||||
configuration option, named would keep the first socket in lingering
|
||||
CLOSE_WAIT state when the client sends an incomplete packet and then
|
||||
closes the connection from the client side.
|
||||
|
||||
(cherry picked from commit afee2b5a7bc933a2d987907fc327a9f118fdbd17)
|
||||
---
|
||||
lib/isc/netmgr/netmgr.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c
|
||||
index 3283eb6e4f..0ed3182fb6 100644
|
||||
--- a/lib/isc/netmgr/netmgr.c
|
||||
+++ b/lib/isc/netmgr/netmgr.c
|
||||
@@ -1746,8 +1746,12 @@ isc__nmhandle_detach(isc_nmhandle_t **handlep FLARG) {
|
||||
handle = *handlep;
|
||||
*handlep = NULL;
|
||||
|
||||
+ /*
|
||||
+ * If the closehandle_cb is set, it needs to run asynchronously to
|
||||
+ * ensure correct ordering of the isc__nm_process_sock_buffer().
|
||||
+ */
|
||||
sock = handle->sock;
|
||||
- if (sock->tid == isc_nm_tid()) {
|
||||
+ if (sock->tid == isc_nm_tid() && sock->closehandle_cb == NULL) {
|
||||
nmhandle_detach_cb(&handle FLARG_PASS);
|
||||
} else {
|
||||
isc__netievent_detach_t *event =
|
||||
--
|
||||
2.34.1
|
||||
|
@ -1,116 +0,0 @@
|
||||
From 3bcd32572504ac9b92e3c6ec1e2cee3df3b68309 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Tue, 20 Sep 2022 11:34:42 +0200
|
||||
Subject: [PATCH 2/4] Fix CVE-2022-3080
|
||||
|
||||
5960. [security] Fix serve-stale crash that could happen when
|
||||
stale-answer-client-timeout was set to 0 and there was
|
||||
a stale CNAME in the cache for an incoming query.
|
||||
(CVE-2022-3080) [GL #3517]
|
||||
---
|
||||
lib/ns/include/ns/query.h | 1 +
|
||||
lib/ns/query.c | 42 ++++++++++++++++++++++++---------------
|
||||
2 files changed, 27 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/lib/ns/include/ns/query.h b/lib/ns/include/ns/query.h
|
||||
index 4d48cf6..34b3070 100644
|
||||
--- a/lib/ns/include/ns/query.h
|
||||
+++ b/lib/ns/include/ns/query.h
|
||||
@@ -145,6 +145,7 @@ struct query_ctx {
|
||||
bool authoritative; /* authoritative query? */
|
||||
bool want_restart; /* CNAME chain or other
|
||||
* restart needed */
|
||||
+ bool refresh_rrset; /* stale RRset refresh needed */
|
||||
bool need_wildcardproof; /* wildcard proof needed */
|
||||
bool nxrewrite; /* negative answer from RPZ */
|
||||
bool findcoveringnsec; /* lookup covering NSEC */
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index 249321c..a450cb7 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -5686,7 +5686,6 @@ query_lookup(query_ctx_t *qctx) {
|
||||
bool dbfind_stale = false;
|
||||
bool stale_timeout = false;
|
||||
bool stale_found = false;
|
||||
- bool refresh_rrset = false;
|
||||
bool stale_refresh_window = false;
|
||||
|
||||
CCTRACE(ISC_LOG_DEBUG(3), "query_lookup");
|
||||
@@ -5868,8 +5867,7 @@ query_lookup(query_ctx_t *qctx) {
|
||||
"%s stale answer used, an attempt to "
|
||||
"refresh the RRset will still be made",
|
||||
namebuf);
|
||||
- refresh_rrset = STALE(qctx->rdataset);
|
||||
- qctx->client->nodetach = refresh_rrset;
|
||||
+ qctx->refresh_rrset = STALE(qctx->rdataset);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -5907,17 +5905,6 @@ query_lookup(query_ctx_t *qctx) {
|
||||
|
||||
result = query_gotanswer(qctx, result);
|
||||
|
||||
- if (refresh_rrset) {
|
||||
- /*
|
||||
- * If we reached this point then it means that we have found a
|
||||
- * stale RRset entry in cache and BIND is configured to allow
|
||||
- * queries to be answered with stale data if no active RRset
|
||||
- * is available, i.e. "stale-anwer-client-timeout 0". But, we
|
||||
- * still need to refresh the RRset.
|
||||
- */
|
||||
- query_refresh_rrset(qctx);
|
||||
- }
|
||||
-
|
||||
cleanup:
|
||||
return (result);
|
||||
}
|
||||
@@ -7737,11 +7724,14 @@ query_addanswer(query_ctx_t *qctx) {
|
||||
|
||||
/*
|
||||
* On normal lookups, clear any rdatasets that were added on a
|
||||
- * lookup due to stale-answer-client-timeout.
|
||||
+ * lookup due to stale-answer-client-timeout. Do not clear if we
|
||||
+ * are going to refresh the RRset, because the stale contents are
|
||||
+ * prioritized.
|
||||
*/
|
||||
if (QUERY_STALEOK(&qctx->client->query) &&
|
||||
- !QUERY_STALETIMEOUT(&qctx->client->query))
|
||||
+ !QUERY_STALETIMEOUT(&qctx->client->query) && !qctx->refresh_rrset)
|
||||
{
|
||||
+ CCTRACE(ISC_LOG_DEBUG(3), "query_clear_stale");
|
||||
query_clear_stale(qctx->client);
|
||||
/*
|
||||
* We can clear the attribute to prevent redundant clearing
|
||||
@@ -11457,9 +11447,29 @@ ns_query_done(query_ctx_t *qctx) {
|
||||
/*
|
||||
* Client may have been detached after query_send(), so
|
||||
* we test and store the flag state here, for safety.
|
||||
+ * If we are refreshing the RRSet, we must not detach from the client
|
||||
+ * in the query_send(), so we need to override the flag.
|
||||
*/
|
||||
+ if (qctx->refresh_rrset) {
|
||||
+ qctx->client->nodetach = true;
|
||||
+ }
|
||||
nodetach = qctx->client->nodetach;
|
||||
query_send(qctx->client);
|
||||
+
|
||||
+ if (qctx->refresh_rrset) {
|
||||
+ /*
|
||||
+ * If we reached this point then it means that we have found a
|
||||
+ * stale RRset entry in cache and BIND is configured to allow
|
||||
+ * queries to be answered with stale data if no active RRset
|
||||
+ * is available, i.e. "stale-anwer-client-timeout 0". But, we
|
||||
+ * still need to refresh the RRset. To prevent adding duplicate
|
||||
+ * RRsets, clear the RRsets from the message before doing the
|
||||
+ * refresh.
|
||||
+ */
|
||||
+ message_clearrdataset(qctx->client->message, 0);
|
||||
+ query_refresh_rrset(qctx);
|
||||
+ }
|
||||
+
|
||||
if (!nodetach) {
|
||||
qctx->detach_client = true;
|
||||
}
|
||||
--
|
||||
2.37.3
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 1b6590eafce064cbf70f5afc2fe4d6f1bfdc3804 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Thu, 27 Oct 2022 13:22:11 +1100
|
||||
Subject: [PATCH] Move the mapping of SIG and RRSIG to ANY
|
||||
|
||||
dns_db_findext() asserts if RRSIG is passed to it and
|
||||
query_lookup_stale() failed to map RRSIG to ANY to prevent this. To
|
||||
avoid cases like this in the future, move the mapping of SIG and RRSIG
|
||||
to ANY for qctx->type to qctx_init().
|
||||
|
||||
(cherry picked from commit 56eae064183488bcf7ff08c3edf59f2e1742c1b6)
|
||||
---
|
||||
lib/ns/query.c | 17 +++++++++--------
|
||||
1 file changed, 9 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index a450cb7..f66bab4 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -5103,6 +5103,15 @@ qctx_init(ns_client_t *client, dns_fetchevent_t **eventp, dns_rdatatype_t qtype,
|
||||
qctx->result = ISC_R_SUCCESS;
|
||||
qctx->findcoveringnsec = qctx->view->synthfromdnssec;
|
||||
|
||||
+ /*
|
||||
+ * If it's an RRSIG or SIG query, we'll iterate the node.
|
||||
+ */
|
||||
+ if (qctx->qtype == dns_rdatatype_rrsig ||
|
||||
+ qctx->qtype == dns_rdatatype_sig)
|
||||
+ {
|
||||
+ qctx->type = dns_rdatatype_any;
|
||||
+ }
|
||||
+
|
||||
CALL_HOOK_NORETURN(NS_QUERY_QCTX_INITIALIZED, qctx);
|
||||
}
|
||||
|
||||
@@ -5243,14 +5252,6 @@ query_setup(ns_client_t *client, dns_rdatatype_t qtype) {
|
||||
|
||||
CALL_HOOK(NS_QUERY_SETUP, &qctx);
|
||||
|
||||
- /*
|
||||
- * If it's a SIG query, we'll iterate the node.
|
||||
- */
|
||||
- if (qctx.qtype == dns_rdatatype_rrsig ||
|
||||
- qctx.qtype == dns_rdatatype_sig) {
|
||||
- qctx.type = dns_rdatatype_any;
|
||||
- }
|
||||
-
|
||||
/*
|
||||
* Check SERVFAIL cache
|
||||
*/
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,32 +1,27 @@
|
||||
From 132ef295b8407f91e6922f4dfc4f30f1790b61c5 Mon Sep 17 00:00:00 2001
|
||||
From bb68864bf05d29df644427ec841bc3db6a336519 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Tue, 20 Sep 2022 11:22:47 +0200
|
||||
Subject: [PATCH 4/4] Fix CVE-2022-38178
|
||||
Subject: [PATCH] Fix CVE-2022-38178
|
||||
|
||||
5962. [security] Fix memory leak in EdDSA verify processing.
|
||||
(CVE-2022-38178) [GL #3487]
|
||||
---
|
||||
lib/dns/openssleddsa_link.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
lib/dns/openssleddsa_link.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/dns/openssleddsa_link.c b/lib/dns/openssleddsa_link.c
|
||||
index 6a6a74d..3157011 100644
|
||||
index 8b115ec..4f3c2a8 100644
|
||||
--- a/lib/dns/openssleddsa_link.c
|
||||
+++ b/lib/dns/openssleddsa_link.c
|
||||
@@ -234,11 +234,11 @@ openssleddsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
}
|
||||
#endif /* if HAVE_OPENSSL_ED448 */
|
||||
if (siglen == 0) {
|
||||
- return (ISC_R_NOTIMPLEMENTED);
|
||||
+ DST_RET(ISC_R_NOTIMPLEMENTED);
|
||||
}
|
||||
@@ -325,7 +325,7 @@ openssleddsa_verify(dst_context_t *dctx, const isc_region_t *sig) {
|
||||
siglen = DNS_SIG_ED448SIZE;
|
||||
|
||||
if (sig->length != siglen) {
|
||||
if (sig->length != siglen)
|
||||
- return (DST_R_VERIFYFAILURE);
|
||||
+ DST_RET(DST_R_VERIFYFAILURE);
|
||||
}
|
||||
|
||||
isc_buffer_usedregion(buf, &tbsreg);
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
||||
|
@ -1,128 +0,0 @@
|
||||
From 20424b3bfe8d3fae92c11a30e79aeffd26dc2891 Mon Sep 17 00:00:00 2001
|
||||
From: Aram Sargsyan <aram@isc.org>
|
||||
Date: Mon, 14 Nov 2022 12:18:06 +0000
|
||||
Subject: [PATCH] Cancel all fetch events in dns_resolver_cancelfetch()
|
||||
|
||||
Although 'dns_fetch_t' fetch can have two associated events, one for
|
||||
each of 'DNS_EVENT_FETCHDONE' and 'DNS_EVENT_TRYSTALE' types, the
|
||||
dns_resolver_cancelfetch() function is designed in a way that it
|
||||
expects only one existing event, which it must cancel, and when it
|
||||
happens so that 'stale-answer-client-timeout' is enabled and there
|
||||
are two events, only one of them is canceled, and it results in an
|
||||
assertion in dns_resolver_destroyfetch(), when it finds a dangling
|
||||
event.
|
||||
|
||||
Change the logic of dns_resolver_cancelfetch() function so that it
|
||||
cancels both the events (if they exist), and in the right order.
|
||||
|
||||
(cherry picked from commit ec2098ca35039e4f81fd0aa7c525eb960b8f47bf)
|
||||
---
|
||||
lib/dns/resolver.c | 53 +++++++++++++++++++++++++++++++++++-----------
|
||||
lib/ns/query.c | 4 +++-
|
||||
2 files changed, 44 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||
index 18585b5..7cbfbb2 100644
|
||||
--- a/lib/dns/resolver.c
|
||||
+++ b/lib/dns/resolver.c
|
||||
@@ -11254,8 +11254,9 @@ void
|
||||
dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
||||
fetchctx_t *fctx;
|
||||
dns_resolver_t *res;
|
||||
- dns_fetchevent_t *event, *next_event;
|
||||
- isc_task_t *etask;
|
||||
+ dns_fetchevent_t *event = NULL;
|
||||
+ dns_fetchevent_t *event_trystale = NULL;
|
||||
+ dns_fetchevent_t *event_fetchdone = NULL;
|
||||
|
||||
REQUIRE(DNS_FETCH_VALID(fetch));
|
||||
fctx = fetch->private;
|
||||
@@ -11267,32 +11268,60 @@ dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
||||
LOCK(&res->buckets[fctx->bucketnum].lock);
|
||||
|
||||
/*
|
||||
- * Find the completion event for this fetch (as opposed
|
||||
+ * Find the events for this fetch (as opposed
|
||||
* to those for other fetches that have joined the same
|
||||
- * fctx) and send it with result = ISC_R_CANCELED.
|
||||
+ * fctx) and send them with result = ISC_R_CANCELED.
|
||||
*/
|
||||
- event = NULL;
|
||||
if (fctx->state != fetchstate_done) {
|
||||
+ dns_fetchevent_t *next_event = NULL;
|
||||
for (event = ISC_LIST_HEAD(fctx->events); event != NULL;
|
||||
event = next_event) {
|
||||
next_event = ISC_LIST_NEXT(event, ev_link);
|
||||
if (event->fetch == fetch) {
|
||||
ISC_LIST_UNLINK(fctx->events, event, ev_link);
|
||||
- break;
|
||||
+ switch (event->ev_type) {
|
||||
+ case DNS_EVENT_TRYSTALE:
|
||||
+ INSIST(event_trystale == NULL);
|
||||
+ event_trystale = event;
|
||||
+ break;
|
||||
+ case DNS_EVENT_FETCHDONE:
|
||||
+ INSIST(event_fetchdone == NULL);
|
||||
+ event_fetchdone = event;
|
||||
+ break;
|
||||
+ default:
|
||||
+ ISC_UNREACHABLE();
|
||||
+ }
|
||||
+ if (event_trystale != NULL &&
|
||||
+ event_fetchdone != NULL)
|
||||
+ {
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (event != NULL) {
|
||||
- etask = event->ev_sender;
|
||||
- event->ev_sender = fctx;
|
||||
- event->result = ISC_R_CANCELED;
|
||||
- isc_task_sendanddetach(&etask, ISC_EVENT_PTR(&event));
|
||||
+
|
||||
+ /*
|
||||
+ * The "trystale" event must be sent before the "fetchdone" event,
|
||||
+ * because the latter clears the "recursing" query attribute, which is
|
||||
+ * required by both events (handled by the same callback function).
|
||||
+ */
|
||||
+ if (event_trystale != NULL) {
|
||||
+ isc_task_t *etask = event_trystale->ev_sender;
|
||||
+ event_trystale->ev_sender = fctx;
|
||||
+ event_trystale->result = ISC_R_CANCELED;
|
||||
+ isc_task_sendanddetach(&etask, ISC_EVENT_PTR(&event_trystale));
|
||||
}
|
||||
+ if (event_fetchdone != NULL) {
|
||||
+ isc_task_t *etask = event_fetchdone->ev_sender;
|
||||
+ event_fetchdone->ev_sender = fctx;
|
||||
+ event_fetchdone->result = ISC_R_CANCELED;
|
||||
+ isc_task_sendanddetach(&etask, ISC_EVENT_PTR(&event_fetchdone));
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* The fctx continues running even if no fetches remain;
|
||||
* the answer is still cached.
|
||||
*/
|
||||
-
|
||||
UNLOCK(&res->buckets[fctx->bucketnum].lock);
|
||||
}
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index f66bab4..4f61374 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -6021,7 +6021,9 @@ fetch_callback(isc_task_t *task, isc_event_t *event) {
|
||||
CTRACE(ISC_LOG_DEBUG(3), "fetch_callback");
|
||||
|
||||
if (event->ev_type == DNS_EVENT_TRYSTALE) {
|
||||
- query_lookup_stale(client);
|
||||
+ if (devent->result != ISC_R_CANCELED) {
|
||||
+ query_lookup_stale(client);
|
||||
+ }
|
||||
isc_event_free(ISC_EVENT_PTR(&event));
|
||||
return;
|
||||
}
|
||||
--
|
||||
2.39.1
|
||||
|
@ -1,37 +0,0 @@
|
||||
From e73ecbf039c3b2cd33dd2926691a8a346c9ca574 Mon Sep 17 00:00:00 2001
|
||||
From: Matthijs Mekking <matthijs@isc.org>
|
||||
Date: Tue, 2 Aug 2022 14:21:40 +0200
|
||||
Subject: [PATCH 1/3] Don't enable serve-stale on duplicate queries
|
||||
|
||||
When checking if we should enable serve-stale, add an early out case
|
||||
when the result is an error signalling a duplicate query or a query
|
||||
that would be dropped.
|
||||
|
||||
(cherry picked from commit 059a4c2f4d9d3cff371842f43208d021509314fa)
|
||||
(cherry picked from commit dd7dde5743715dc0dec2defbb92b1a8637977bf9)
|
||||
---
|
||||
lib/ns/query.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index 4f61374e2c..c169e22bf4 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -7205,6 +7205,14 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
+ if (result == DNS_R_DUPLICATE || result == DNS_R_DROP) {
|
||||
+ /*
|
||||
+ * Don't enable serve-stale if the result signals a duplicate
|
||||
+ * query or query that is being dropped.
|
||||
+ */
|
||||
+ return (false);
|
||||
+ }
|
||||
+
|
||||
qctx_clean(qctx);
|
||||
qctx_freedata(qctx);
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,72 +0,0 @@
|
||||
From 589c06568e3036bfe713d42b53c8e88005ce17e4 Mon Sep 17 00:00:00 2001
|
||||
From: Evan Hunt <each@isc.org>
|
||||
Date: Thu, 25 May 2023 23:53:50 -0700
|
||||
Subject: [PATCH 2/3] Stale answer lookups could loop when over recursion quota
|
||||
|
||||
When a query was aborted because of the recursion quota being exceeded,
|
||||
but triggered a stale answer response and a stale data refresh query,
|
||||
it could cause named to loop back where we are iterating and following
|
||||
a delegation. Having no good answer in cache, we would fall back to
|
||||
using serve-stale again, use the stale data, try to refresh the RRset,
|
||||
and loop back again, without ever terminating until crashing due to
|
||||
stack overflow.
|
||||
|
||||
This happens because in the functions 'query_notfound()' and
|
||||
'query_delegation_recurse()', we check whether we can fall back to
|
||||
serving stale data. We shouldn't do so if we are already refreshing
|
||||
an RRset due to having prioritized stale data in cache.
|
||||
|
||||
In other words, we need to add an extra check to 'query_usestale()' to
|
||||
disallow serving stale data if we are currently refreshing a stale
|
||||
RRset.
|
||||
|
||||
As an additional mitigation to prevent looping, we now use the result
|
||||
code ISC_R_ALREADYRUNNING rather than ISC_R_FAILURE when a recursion
|
||||
loop is encountered, and we check for that condition in
|
||||
'query_usestale()' as well.
|
||||
|
||||
(cherry picked from commit 0101e28f91fb36b6a16a0049d3b3e2b7846f23f0)
|
||||
---
|
||||
lib/ns/query.c | 17 ++++++++++++++---
|
||||
1 file changed, 14 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index c169e22bf4..1eb662ea4d 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -6229,7 +6229,7 @@ ns_query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
|
||||
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);
|
||||
+ return (ISC_R_ALREADYRUNNING);
|
||||
}
|
||||
|
||||
recparam_update(&client->query.recparam, qtype, qname, qdomain);
|
||||
@@ -7205,10 +7205,21 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
- if (result == DNS_R_DUPLICATE || result == DNS_R_DROP) {
|
||||
+ if (qctx->refresh_rrset) {
|
||||
+ /*
|
||||
+ * This is a refreshing query, we have already prioritized
|
||||
+ * stale data, so don't enable serve-stale again.
|
||||
+ */
|
||||
+ return (false);
|
||||
+ }
|
||||
+
|
||||
+ if (result == DNS_R_DUPLICATE || result == DNS_R_DROP ||
|
||||
+ result == ISC_R_ALREADYRUNNING)
|
||||
+ {
|
||||
/*
|
||||
* Don't enable serve-stale if the result signals a duplicate
|
||||
- * query or query that is being dropped.
|
||||
+ * query or a query that is being dropped or can't proceed
|
||||
+ * because of a recursion loop.
|
||||
*/
|
||||
return (false);
|
||||
}
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,60 +0,0 @@
|
||||
From c20e9d30bae58d3120aa7c6a0e5dcae0e7e93dbd Mon Sep 17 00:00:00 2001
|
||||
From: Matthijs Mekking <matthijs@isc.org>
|
||||
Date: Thu, 1 Jun 2023 10:03:48 +0200
|
||||
Subject: [PATCH 3/3] Fix serve-stale hang at shutdown
|
||||
|
||||
The 'refresh_rrset' variable is used to determine if we can detach from
|
||||
the client. This can cause a hang on shutdown. To fix this, move setting
|
||||
of the 'nodetach' variable up to where 'refresh_rrset' is set (in
|
||||
query_lookup(), and thus not in ns_query_done()), and set it to false
|
||||
when actually refreshing the RRset, so that when this lookup is
|
||||
completed, the client will be detached.
|
||||
|
||||
(cherry picked from commit c003c5bc3c68f3e513654b6689e1f60280d14844)
|
||||
---
|
||||
lib/ns/query.c | 13 ++++++++-----
|
||||
1 file changed, 8 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index 1eb662ea4d..4fe3e30f45 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -5644,6 +5644,7 @@ query_refresh_rrset(query_ctx_t *orig_qctx) {
|
||||
qctx.client->query.dboptions &= ~(DNS_DBFIND_STALETIMEOUT |
|
||||
DNS_DBFIND_STALEOK |
|
||||
DNS_DBFIND_STALEENABLED);
|
||||
+ qctx.client->nodetach = false;
|
||||
|
||||
/*
|
||||
* We'll need some resources...
|
||||
@@ -5868,7 +5869,14 @@ query_lookup(query_ctx_t *qctx) {
|
||||
"%s stale answer used, an attempt to "
|
||||
"refresh the RRset will still be made",
|
||||
namebuf);
|
||||
+
|
||||
qctx->refresh_rrset = STALE(qctx->rdataset);
|
||||
+
|
||||
+ /*
|
||||
+ * If we are refreshing the RRSet, we must not
|
||||
+ * detach from the client in query_send().
|
||||
+ */
|
||||
+ qctx->client->nodetach = qctx->refresh_rrset;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
@@ -11469,12 +11477,7 @@ ns_query_done(query_ctx_t *qctx) {
|
||||
/*
|
||||
* Client may have been detached after query_send(), so
|
||||
* we test and store the flag state here, for safety.
|
||||
- * If we are refreshing the RRSet, we must not detach from the client
|
||||
- * in the query_send(), so we need to override the flag.
|
||||
*/
|
||||
- if (qctx->refresh_rrset) {
|
||||
- qctx->client->nodetach = true;
|
||||
- }
|
||||
nodetach = qctx->client->nodetach;
|
||||
query_send(qctx->client);
|
||||
|
||||
--
|
||||
2.40.1
|
||||
|
@ -1,88 +0,0 @@
|
||||
From d258422d3e653621ce6340ba9af0153f8d4e8c07 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
|
||||
Date: Sun, 11 Feb 2024 00:49:32 +0100
|
||||
Subject: [PATCH] Test case insensitive matching in isc_ht hash table
|
||||
implementation
|
||||
|
||||
The case insensitive matching in isc_ht was basically completely broken
|
||||
as only the hashvalue computation was case insensitive, but the key
|
||||
comparison was always case sensitive.
|
||||
|
||||
Import only test part from upstream.
|
||||
|
||||
(cherry picked from commit 175655b771fd17b06dfb8cfb29eaadf0f3b6a8b5)
|
||||
(cherry picked from upstream commit f493a8394102b0aeb101d5dc2f963004c8741175)
|
||||
---
|
||||
lib/isc/tests/ht_test.c | 53 +++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 53 insertions(+)
|
||||
|
||||
diff --git a/lib/isc/tests/ht_test.c b/lib/isc/tests/ht_test.c
|
||||
index 74d95c1..65502b5 100644
|
||||
--- a/lib/isc/tests/ht_test.c
|
||||
+++ b/lib/isc/tests/ht_test.c
|
||||
@@ -334,9 +334,62 @@ isc_ht_iterator_test(void **state) {
|
||||
test_ht_iterator();
|
||||
}
|
||||
|
||||
+static void
|
||||
+isc_ht_case(void **state) {
|
||||
+ UNUSED(state);
|
||||
+
|
||||
+ isc_ht_t *ht = NULL;
|
||||
+ void *f = NULL;
|
||||
+ isc_result_t result = ISC_R_UNSET;
|
||||
+
|
||||
+ unsigned char lower[16] = { "test case" };
|
||||
+ unsigned char same[16] = { "test case" };
|
||||
+ unsigned char upper[16] = { "TEST CASE" };
|
||||
+ unsigned char mixed[16] = { "tEsT CaSe" };
|
||||
+
|
||||
+ isc_ht_init(&ht, test_mctx, 8, ISC_HT_CASE_SENSITIVE);
|
||||
+ assert_non_null(ht);
|
||||
+
|
||||
+ result = isc_ht_add(ht, lower, 16, (void *)lower);
|
||||
+ assert_int_equal(result, ISC_R_SUCCESS);
|
||||
+
|
||||
+ result = isc_ht_add(ht, same, 16, (void *)same);
|
||||
+ assert_int_equal(result, ISC_R_EXISTS);
|
||||
+
|
||||
+ result = isc_ht_add(ht, upper, 16, (void *)upper);
|
||||
+ assert_int_equal(result, ISC_R_SUCCESS);
|
||||
+
|
||||
+ result = isc_ht_find(ht, mixed, 16, &f);
|
||||
+ assert_int_equal(result, ISC_R_NOTFOUND);
|
||||
+ assert_null(f);
|
||||
+
|
||||
+ isc_ht_destroy(&ht);
|
||||
+ assert_null(ht);
|
||||
+
|
||||
+ isc_ht_init(&ht, test_mctx, 8, ISC_HT_CASE_INSENSITIVE);
|
||||
+ assert_non_null(ht);
|
||||
+
|
||||
+ result = isc_ht_add(ht, lower, 16, (void *)lower);
|
||||
+ assert_int_equal(result, ISC_R_SUCCESS);
|
||||
+
|
||||
+ result = isc_ht_add(ht, same, 16, (void *)same);
|
||||
+ assert_int_equal(result, ISC_R_EXISTS);
|
||||
+
|
||||
+ result = isc_ht_add(ht, upper, 16, (void *)upper);
|
||||
+ assert_int_equal(result, ISC_R_EXISTS);
|
||||
+
|
||||
+ result = isc_ht_find(ht, mixed, 16, &f);
|
||||
+ assert_int_equal(result, ISC_R_SUCCESS);
|
||||
+ assert_ptr_equal(f, &lower);
|
||||
+
|
||||
+ isc_ht_destroy(&ht);
|
||||
+ assert_null(ht);
|
||||
+}
|
||||
+
|
||||
int
|
||||
main(void) {
|
||||
const struct CMUnitTest tests[] = {
|
||||
+ cmocka_unit_test(isc_ht_case),
|
||||
cmocka_unit_test(isc_ht_20),
|
||||
cmocka_unit_test(isc_ht_8),
|
||||
cmocka_unit_test(isc_ht_1),
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,75 +0,0 @@
|
||||
From aa1b0fc4b24d26233db30c85ae3609e54e9fa6d2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
|
||||
Date: Sun, 11 Feb 2024 09:13:43 +0100
|
||||
Subject: [PATCH] Add a system test for mixed-case data for the same owner
|
||||
|
||||
We were missing a test where a single owner name would have multiple
|
||||
types with a different case. The generated RRSIGs and NSEC records will
|
||||
then have different case than the signed records and message parser have
|
||||
to cope with that and treat everything as the same owner.
|
||||
|
||||
(cherry picked from commit a114042059ecbbc94ae0f604ca681323a75af480)
|
||||
(cherry picked from upstream commit b9c10a194da3358204f5ba7d91e55332db435614)
|
||||
---
|
||||
bin/tests/system/dnssec/ns3/secure.example.db.in | 5 +++++
|
||||
bin/tests/system/dnssec/ns3/sign.sh | 4 +++-
|
||||
bin/tests/system/dnssec/tests.sh | 15 +++++++++++++++
|
||||
3 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/bin/tests/system/dnssec/ns3/secure.example.db.in b/bin/tests/system/dnssec/ns3/secure.example.db.in
|
||||
index 27f2b24..599566e 100644
|
||||
--- a/bin/tests/system/dnssec/ns3/secure.example.db.in
|
||||
+++ b/bin/tests/system/dnssec/ns3/secure.example.db.in
|
||||
@@ -45,3 +45,8 @@ rrsigonly A 10.0.0.29
|
||||
cnameandkey CNAME @
|
||||
cnamenokey CNAME @
|
||||
dnameandkey DNAME @
|
||||
+
|
||||
+mixedcase A 10.0.0.30
|
||||
+mixedCASE TXT "mixed case"
|
||||
+MIXEDcase AAAA 2002::
|
||||
+mIxEdCaSe LOC 37 52 56.788 N 121 54 55.02 W 1120m 10m 100m 10m
|
||||
diff --git a/bin/tests/system/dnssec/ns3/sign.sh b/bin/tests/system/dnssec/ns3/sign.sh
|
||||
index 80d412e..d94f382 100644
|
||||
--- a/bin/tests/system/dnssec/ns3/sign.sh
|
||||
+++ b/bin/tests/system/dnssec/ns3/sign.sh
|
||||
@@ -86,7 +86,9 @@ keyname=$("$KEYGEN" -q -a "$DEFAULT_ALGORITHM" -b "$DEFAULT_BITS" -n zone "$zone
|
||||
|
||||
cat "$infile" "$cnameandkey.key" "$dnameandkey.key" "$keyname.key" > "$zonefile"
|
||||
|
||||
-"$SIGNER" -P -o "$zone" "$zonefile" > /dev/null
|
||||
+"$SIGNER" -P -D -o "$zone" "$zonefile" >/dev/null
|
||||
+cat "$zonefile" "$zonefile".signed >"$zonefile".tmp
|
||||
+mv "$zonefile".tmp "$zonefile".signed
|
||||
|
||||
zone=bogus.example.
|
||||
infile=bogus.example.db.in
|
||||
diff --git a/bin/tests/system/dnssec/tests.sh b/bin/tests/system/dnssec/tests.sh
|
||||
index fe95c8d..0c03970 100644
|
||||
--- a/bin/tests/system/dnssec/tests.sh
|
||||
+++ b/bin/tests/system/dnssec/tests.sh
|
||||
@@ -762,6 +762,21 @@ n=$((n+1))
|
||||
test "$ret" -eq 0 || echo_i "failed"
|
||||
status=$((status+ret))
|
||||
|
||||
+echo_i "checking mixed-case positive validation ($n)"
|
||||
+ret=0
|
||||
+for type in a txt aaaa loc; do
|
||||
+ dig_with_opts +noauth mixedcase.secure.example. \
|
||||
+ @10.53.0.3 $type >dig.out.$type.ns3.test$n || ret=1
|
||||
+ dig_with_opts +noauth mixedcase.secure.example. \
|
||||
+ @10.53.0.4 $type >dig.out.$type.ns4.test$n || ret=1
|
||||
+ digcomp --lc dig.out.$type.ns3.test$n dig.out.$type.ns4.test$n || ret=1
|
||||
+ grep "status: NOERROR" dig.out.$type.ns4.test$n >/dev/null || ret=1
|
||||
+ grep "flags:.*ad.*QUERY" dig.out.$type.ns4.test$n >/dev/null || ret=1
|
||||
+done
|
||||
+n=$((n + 1))
|
||||
+test "$ret" -eq 0 || echo_i "failed"
|
||||
+status=$((status + ret))
|
||||
+
|
||||
echo_i "checking multi-stage positive validation NSEC/NSEC3 ($n)"
|
||||
ret=0
|
||||
dig_with_opts +noauth a.nsec3.example. \
|
||||
--
|
||||
2.43.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,478 +0,0 @@
|
||||
From c6e05ffc5fb784514ab54938867abaab41126c65 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 12 Feb 2024 21:09:51 +0100
|
||||
Subject: [PATCH] Prevent increased CPU consumption in DNSSEC validator
|
||||
|
||||
KeyTrap - Extreme CPU consumption in DNSSEC validator. Preparing an
|
||||
NSEC3 closest encloser proof can exhaust CPU resources.
|
||||
|
||||
6322. [security] Specific DNS answers could cause a denial-of-service
|
||||
condition due to DNS validation taking a long time.
|
||||
(CVE-2023-50387) [GL #4424]
|
||||
|
||||
Resolves: CVE-2023-50387 CVE-2023-50868
|
||||
---
|
||||
lib/dns/dst_api.c | 27 +++++++++----
|
||||
lib/dns/include/dns/validator.h | 1 +
|
||||
lib/dns/include/dst/dst.h | 4 ++
|
||||
lib/dns/resolver.c | 4 +-
|
||||
lib/dns/validator.c | 67 +++++++++++++++------------------
|
||||
lib/isc/include/isc/netmgr.h | 3 ++
|
||||
lib/isc/netmgr/netmgr-int.h | 1 +
|
||||
lib/isc/netmgr/netmgr.c | 36 +++++++++++-------
|
||||
lib/isc/netmgr/tcp.c | 6 +--
|
||||
lib/isc/netmgr/tcpdns.c | 4 +-
|
||||
lib/isc/netmgr/udp.c | 6 +--
|
||||
11 files changed, 91 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c
|
||||
index 62600dd..3aafd7c 100644
|
||||
--- a/lib/dns/dst_api.c
|
||||
+++ b/lib/dns/dst_api.c
|
||||
@@ -160,7 +160,8 @@ computeid(dst_key_t *key);
|
||||
static isc_result_t
|
||||
frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
unsigned int protocol, dns_rdataclass_t rdclass,
|
||||
- isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp);
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp);
|
||||
|
||||
static isc_result_t
|
||||
algorithm_status(unsigned int alg);
|
||||
@@ -745,6 +746,13 @@ dst_key_todns(const dst_key_t *key, isc_buffer_t *target) {
|
||||
isc_result_t
|
||||
dst_key_fromdns(const dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp) {
|
||||
+ return (dst_key_fromdns_ex(name, rdclass, source, mctx, false, keyp));
|
||||
+}
|
||||
+
|
||||
+isc_result_t
|
||||
+dst_key_fromdns_ex(const dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp) {
|
||||
uint8_t alg, proto;
|
||||
uint32_t flags, extflags;
|
||||
dst_key_t *key = NULL;
|
||||
@@ -775,7 +783,7 @@ dst_key_fromdns(const dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
}
|
||||
|
||||
result = frombuffer(name, alg, flags, proto, rdclass, source, mctx,
|
||||
- &key);
|
||||
+ no_rdata, &key);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
@@ -796,7 +804,7 @@ dst_key_frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
REQUIRE(dst_initialized);
|
||||
|
||||
result = frombuffer(name, alg, flags, protocol, rdclass, source, mctx,
|
||||
- &key);
|
||||
+ false, &key);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
@@ -2288,7 +2296,8 @@ computeid(dst_key_t *key) {
|
||||
static isc_result_t
|
||||
frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
unsigned int protocol, dns_rdataclass_t rdclass,
|
||||
- isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp) {
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp) {
|
||||
dst_key_t *key;
|
||||
isc_result_t ret;
|
||||
|
||||
@@ -2313,10 +2322,12 @@ frombuffer(const dns_name_t *name, unsigned int alg, unsigned int flags,
|
||||
return (DST_R_UNSUPPORTEDALG);
|
||||
}
|
||||
|
||||
- ret = key->func->fromdns(key, source);
|
||||
- if (ret != ISC_R_SUCCESS) {
|
||||
- dst_key_free(&key);
|
||||
- return (ret);
|
||||
+ if (!no_rdata) {
|
||||
+ ret = key->func->fromdns(key, source);
|
||||
+ if (ret != ISC_R_SUCCESS) {
|
||||
+ dst_key_free(&key);
|
||||
+ return (ret);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/lib/dns/include/dns/validator.h b/lib/dns/include/dns/validator.h
|
||||
index 4744014..fe97e41 100644
|
||||
--- a/lib/dns/include/dns/validator.h
|
||||
+++ b/lib/dns/include/dns/validator.h
|
||||
@@ -148,6 +148,7 @@ struct dns_validator {
|
||||
unsigned int authcount;
|
||||
unsigned int authfail;
|
||||
isc_stdtime_t start;
|
||||
+ bool failed;
|
||||
};
|
||||
|
||||
/*%
|
||||
diff --git a/lib/dns/include/dst/dst.h b/lib/dns/include/dst/dst.h
|
||||
index f454ebb..36770b5 100644
|
||||
--- a/lib/dns/include/dst/dst.h
|
||||
+++ b/lib/dns/include/dst/dst.h
|
||||
@@ -469,6 +469,10 @@ dst_key_tofile(const dst_key_t *key, int type, const char *directory);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
+dst_key_fromdns_ex(const dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
+ isc_buffer_t *source, isc_mem_t *mctx, bool no_rdata,
|
||||
+ dst_key_t **keyp);
|
||||
+isc_result_t
|
||||
dst_key_fromdns(const dns_name_t *name, dns_rdataclass_t rdclass,
|
||||
isc_buffer_t *source, isc_mem_t *mctx, dst_key_t **keyp);
|
||||
/*%<
|
||||
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||
index 7cbfbb2..be1d735 100644
|
||||
--- a/lib/dns/resolver.c
|
||||
+++ b/lib/dns/resolver.c
|
||||
@@ -10613,8 +10613,8 @@ dns_resolver_create(dns_view_t *view, isc_taskmgr_t *taskmgr,
|
||||
* Since we have a pool of tasks we bind them to task queues
|
||||
* to spread the load evenly
|
||||
*/
|
||||
- result = isc_task_create_bound(taskmgr, 0,
|
||||
- &res->buckets[i].task, i);
|
||||
+ result = isc_task_create_bound(
|
||||
+ taskmgr, 0, &res->buckets[i].task, ISC_NM_TASK_SLOW(i));
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
isc_mutex_destroy(&res->buckets[i].lock);
|
||||
goto cleanup_buckets;
|
||||
diff --git a/lib/dns/validator.c b/lib/dns/validator.c
|
||||
index e54fc70..e416cc9 100644
|
||||
--- a/lib/dns/validator.c
|
||||
+++ b/lib/dns/validator.c
|
||||
@@ -1098,8 +1098,8 @@ create_validator(dns_validator_t *val, dns_name_t *name, dns_rdatatype_t type,
|
||||
* 'rdataset'. If found, build a dst_key_t for it and point val->key at
|
||||
* it.
|
||||
*
|
||||
- * If val->key is already non-NULL, locate it in the rdataset and then
|
||||
- * search past it for the *next* key that could have signed 'siginfo', then
|
||||
+ * If val->key is already non-NULL, start searching from the next position in
|
||||
+ * 'rdataset' to find the *next* key that could have signed 'siginfo', then
|
||||
* set val->key to that.
|
||||
*
|
||||
* Returns ISC_R_SUCCESS if a possible matching key has been found,
|
||||
@@ -1112,59 +1112,59 @@ select_signing_key(dns_validator_t *val, dns_rdataset_t *rdataset) {
|
||||
isc_buffer_t b;
|
||||
dns_rdata_t rdata = DNS_RDATA_INIT;
|
||||
dst_key_t *oldkey = val->key;
|
||||
- bool foundold;
|
||||
+ bool no_rdata = false;
|
||||
|
||||
if (oldkey == NULL) {
|
||||
- foundold = true;
|
||||
+ result = dns_rdataset_first(rdataset);
|
||||
} else {
|
||||
- foundold = false;
|
||||
+ dst_key_free(&oldkey);
|
||||
val->key = NULL;
|
||||
+ result = dns_rdataset_next(rdataset);
|
||||
}
|
||||
-
|
||||
- result = dns_rdataset_first(rdataset);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
- goto failure;
|
||||
+ goto done;
|
||||
}
|
||||
+
|
||||
do {
|
||||
dns_rdataset_current(rdataset, &rdata);
|
||||
|
||||
isc_buffer_init(&b, rdata.data, rdata.length);
|
||||
isc_buffer_add(&b, rdata.length);
|
||||
INSIST(val->key == NULL);
|
||||
- result = dst_key_fromdns(&siginfo->signer, rdata.rdclass, &b,
|
||||
- val->view->mctx, &val->key);
|
||||
+ result = dst_key_fromdns_ex(&siginfo->signer, rdata.rdclass, &b,
|
||||
+ val->view->mctx, no_rdata,
|
||||
+ &val->key);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
if (siginfo->algorithm ==
|
||||
(dns_secalg_t)dst_key_alg(val->key) &&
|
||||
siginfo->keyid ==
|
||||
(dns_keytag_t)dst_key_id(val->key) &&
|
||||
+ (dst_key_flags(val->key) & DNS_KEYFLAG_REVOKE) ==
|
||||
+ 0 &&
|
||||
dst_key_iszonekey(val->key))
|
||||
{
|
||||
- if (foundold) {
|
||||
- /*
|
||||
- * This is the key we're looking for.
|
||||
- */
|
||||
- return (ISC_R_SUCCESS);
|
||||
- } else if (dst_key_compare(oldkey, val->key)) {
|
||||
- foundold = true;
|
||||
- dst_key_free(&oldkey);
|
||||
+ if (no_rdata) {
|
||||
+ /* Retry with full key */
|
||||
+ dns_rdata_reset(&rdata);
|
||||
+ dst_key_free(&val->key);
|
||||
+ no_rdata = false;
|
||||
+ continue;
|
||||
}
|
||||
+ /* This is the key we're looking for. */
|
||||
+ goto done;
|
||||
}
|
||||
dst_key_free(&val->key);
|
||||
}
|
||||
dns_rdata_reset(&rdata);
|
||||
result = dns_rdataset_next(rdataset);
|
||||
+ no_rdata = true;
|
||||
} while (result == ISC_R_SUCCESS);
|
||||
|
||||
+done:
|
||||
if (result == ISC_R_NOMORE) {
|
||||
result = ISC_R_NOTFOUND;
|
||||
}
|
||||
|
||||
-failure:
|
||||
- if (oldkey != NULL) {
|
||||
- dst_key_free(&oldkey);
|
||||
- }
|
||||
-
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -1557,20 +1557,9 @@ validate_answer(dns_validator_t *val, bool resume) {
|
||||
continue;
|
||||
}
|
||||
|
||||
- do {
|
||||
- isc_result_t tresult;
|
||||
- vresult = verify(val, val->key, &rdata,
|
||||
- val->siginfo->keyid);
|
||||
- if (vresult == ISC_R_SUCCESS) {
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- tresult = select_signing_key(val, val->keyset);
|
||||
- if (tresult != ISC_R_SUCCESS) {
|
||||
- break;
|
||||
- }
|
||||
- } while (1);
|
||||
+ vresult = verify(val, val->key, &rdata, val->siginfo->keyid);
|
||||
if (vresult != ISC_R_SUCCESS) {
|
||||
+ val->failed = true;
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"failed to verify rdataset");
|
||||
} else {
|
||||
@@ -1607,9 +1596,13 @@ validate_answer(dns_validator_t *val, bool resume) {
|
||||
} else {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
"verify failure: %s",
|
||||
- isc_result_totext(result));
|
||||
+ isc_result_totext(vresult));
|
||||
resume = false;
|
||||
}
|
||||
+ if (val->failed) {
|
||||
+ result = ISC_R_NOMORE;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
if (result != ISC_R_NOMORE) {
|
||||
validator_log(val, ISC_LOG_DEBUG(3),
|
||||
diff --git a/lib/isc/include/isc/netmgr.h b/lib/isc/include/isc/netmgr.h
|
||||
index be9fd56..dfabdc8 100644
|
||||
--- a/lib/isc/include/isc/netmgr.h
|
||||
+++ b/lib/isc/include/isc/netmgr.h
|
||||
@@ -455,6 +455,9 @@ isc_nm_tcpdnsconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
||||
* 'cb'.
|
||||
*/
|
||||
|
||||
+#define ISC_NM_TASK_SLOW_OFFSET -2
|
||||
+#define ISC_NM_TASK_SLOW(i) (ISC_NM_TASK_SLOW_OFFSET - 1 - i)
|
||||
+
|
||||
void
|
||||
isc_nm_task_enqueue(isc_nm_t *mgr, isc_task_t *task, int threadid);
|
||||
/*%<
|
||||
diff --git a/lib/isc/netmgr/netmgr-int.h b/lib/isc/netmgr/netmgr-int.h
|
||||
index f7b54f9..70bb32d 100644
|
||||
--- a/lib/isc/netmgr/netmgr-int.h
|
||||
+++ b/lib/isc/netmgr/netmgr-int.h
|
||||
@@ -673,6 +673,7 @@ struct isc_nm {
|
||||
#ifdef NETMGR_TRACE
|
||||
ISC_LIST(isc_nmsocket_t) active_sockets;
|
||||
#endif
|
||||
+ int nlisteners;
|
||||
};
|
||||
|
||||
typedef enum isc_nmsocket_type {
|
||||
diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c
|
||||
index 0ed3182..898de41 100644
|
||||
--- a/lib/isc/netmgr/netmgr.c
|
||||
+++ b/lib/isc/netmgr/netmgr.c
|
||||
@@ -269,31 +269,34 @@ isc__nm_winsock_destroy(void) {
|
||||
#endif /* WIN32 */
|
||||
|
||||
static void
|
||||
-isc__nm_threadpool_initialize(uint32_t workers) {
|
||||
+isc__nm_threadpool_initialize(uint32_t nworkers) {
|
||||
char buf[11];
|
||||
int r = uv_os_getenv("UV_THREADPOOL_SIZE", buf,
|
||||
&(size_t){ sizeof(buf) });
|
||||
if (r == UV_ENOENT) {
|
||||
- snprintf(buf, sizeof(buf), "%" PRIu32, workers);
|
||||
+ snprintf(buf, sizeof(buf), "%" PRIu32, nworkers);
|
||||
uv_os_setenv("UV_THREADPOOL_SIZE", buf);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
-isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
||||
+isc__netmgr_create(isc_mem_t *mctx, uint32_t nworkers, isc_nm_t **netmgrp) {
|
||||
isc_nm_t *mgr = NULL;
|
||||
char name[32];
|
||||
|
||||
- REQUIRE(workers > 0);
|
||||
+ REQUIRE(nworkers > 0);
|
||||
|
||||
#ifdef WIN32
|
||||
isc__nm_winsock_initialize();
|
||||
#endif /* WIN32 */
|
||||
|
||||
- isc__nm_threadpool_initialize(workers);
|
||||
+ isc__nm_threadpool_initialize(nworkers);
|
||||
|
||||
mgr = isc_mem_get(mctx, sizeof(*mgr));
|
||||
- *mgr = (isc_nm_t){ .nworkers = workers };
|
||||
+ *mgr = (isc_nm_t){
|
||||
+ .nworkers = nworkers * 2,
|
||||
+ .nlisteners = nworkers,
|
||||
+ };
|
||||
|
||||
isc_mem_attach(mctx, &mgr->mctx);
|
||||
isc_mutex_init(&mgr->lock);
|
||||
@@ -334,11 +337,12 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
||||
isc_mempool_associatelock(mgr->evpool, &mgr->evlock);
|
||||
isc_mempool_setfillcount(mgr->evpool, 32);
|
||||
|
||||
- isc_barrier_init(&mgr->pausing, workers);
|
||||
- isc_barrier_init(&mgr->resuming, workers);
|
||||
+ isc_barrier_init(&mgr->pausing, mgr->nworkers);
|
||||
+ isc_barrier_init(&mgr->resuming, mgr->nworkers);
|
||||
|
||||
- mgr->workers = isc_mem_get(mctx, workers * sizeof(isc__networker_t));
|
||||
- for (size_t i = 0; i < workers; i++) {
|
||||
+ mgr->workers = isc_mem_get(mctx,
|
||||
+ mgr->nworkers * sizeof(isc__networker_t));
|
||||
+ for (int i = 0; i < mgr->nworkers; i++) {
|
||||
int r;
|
||||
isc__networker_t *worker = &mgr->workers[i];
|
||||
*worker = (isc__networker_t){
|
||||
@@ -373,7 +377,7 @@ isc__netmgr_create(isc_mem_t *mctx, uint32_t workers, isc_nm_t **netmgrp) {
|
||||
mgr->workers_running++;
|
||||
isc_thread_create(nm_thread, &mgr->workers[i], &worker->thread);
|
||||
|
||||
- snprintf(name, sizeof(name), "isc-net-%04zu", i);
|
||||
+ snprintf(name, sizeof(name), "isc-net-%04d", i);
|
||||
isc_thread_setname(worker->thread, name);
|
||||
}
|
||||
|
||||
@@ -848,9 +852,15 @@ isc_nm_task_enqueue(isc_nm_t *nm, isc_task_t *task, int threadid) {
|
||||
isc__networker_t *worker = NULL;
|
||||
|
||||
if (threadid == -1) {
|
||||
- tid = (int)isc_random_uniform(nm->nworkers);
|
||||
+ tid = (int)isc_random_uniform(nm->nlisteners);
|
||||
+ } else if (threadid == ISC_NM_TASK_SLOW_OFFSET) {
|
||||
+ tid = nm->nlisteners +
|
||||
+ (int)isc_random_uniform(nm->nworkers - nm->nlisteners);
|
||||
+ } else if (threadid < ISC_NM_TASK_SLOW_OFFSET) {
|
||||
+ tid = nm->nlisteners + (ISC_NM_TASK_SLOW(threadid) %
|
||||
+ (nm->nworkers - nm->nlisteners));
|
||||
} else {
|
||||
- tid = threadid % nm->nworkers;
|
||||
+ tid = threadid % nm->nlisteners;
|
||||
}
|
||||
|
||||
worker = &nm->workers[tid];
|
||||
diff --git a/lib/isc/netmgr/tcp.c b/lib/isc/netmgr/tcp.c
|
||||
index 5cca9f5..83bd2e2 100644
|
||||
--- a/lib/isc/netmgr/tcp.c
|
||||
+++ b/lib/isc/netmgr/tcp.c
|
||||
@@ -321,7 +321,7 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
||||
isc__nm_connectcb(sock, req, result, false);
|
||||
} else {
|
||||
isc__nmsocket_clearcb(sock);
|
||||
- sock->tid = isc_random_uniform(mgr->nworkers);
|
||||
+ sock->tid = isc_random_uniform(mgr->nlisteners);
|
||||
isc__nm_connectcb(sock, req, result, true);
|
||||
}
|
||||
atomic_store(&sock->closed, true);
|
||||
@@ -339,7 +339,7 @@ isc_nm_tcpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
||||
isc__nm_put_netievent_tcpconnect(mgr, ievent);
|
||||
} else {
|
||||
atomic_init(&sock->active, false);
|
||||
- sock->tid = isc_random_uniform(mgr->nworkers);
|
||||
+ sock->tid = isc_random_uniform(mgr->nlisteners);
|
||||
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)ievent);
|
||||
}
|
||||
@@ -435,7 +435,7 @@ isc_nm_listentcp(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
||||
#if defined(WIN32)
|
||||
sock->nchildren = 1;
|
||||
#else
|
||||
- sock->nchildren = mgr->nworkers;
|
||||
+ sock->nchildren = mgr->nlisteners;
|
||||
#endif
|
||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||
diff --git a/lib/isc/netmgr/tcpdns.c b/lib/isc/netmgr/tcpdns.c
|
||||
index 188790c..7f13ab2 100644
|
||||
--- a/lib/isc/netmgr/tcpdns.c
|
||||
+++ b/lib/isc/netmgr/tcpdns.c
|
||||
@@ -305,7 +305,7 @@ isc_nm_tcpdnsconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
||||
isc__nm_put_netievent_tcpdnsconnect(mgr, ievent);
|
||||
} else {
|
||||
atomic_init(&sock->active, false);
|
||||
- sock->tid = isc_random_uniform(mgr->nworkers);
|
||||
+ sock->tid = isc_random_uniform(mgr->nlisteners);
|
||||
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)ievent);
|
||||
}
|
||||
@@ -404,7 +404,7 @@ isc_nm_listentcpdns(isc_nm_t *mgr, isc_sockaddr_t *iface,
|
||||
#if defined(WIN32)
|
||||
sock->nchildren = 1;
|
||||
#else
|
||||
- sock->nchildren = mgr->nworkers;
|
||||
+ sock->nchildren = mgr->nlisteners;
|
||||
#endif
|
||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||
sock->children = isc_mem_get(mgr->mctx, children_size);
|
||||
diff --git a/lib/isc/netmgr/udp.c b/lib/isc/netmgr/udp.c
|
||||
index a91c425..f2e161c 100644
|
||||
--- a/lib/isc/netmgr/udp.c
|
||||
+++ b/lib/isc/netmgr/udp.c
|
||||
@@ -126,7 +126,7 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb,
|
||||
uv_os_sock_t fd = -1;
|
||||
|
||||
/*
|
||||
- * We are creating mgr->nworkers duplicated sockets, one
|
||||
+ * We are creating mgr->nlisteners duplicated sockets, one
|
||||
* socket for each worker thread.
|
||||
*/
|
||||
sock = isc_mem_get(mgr->mctx, sizeof(isc_nmsocket_t));
|
||||
@@ -136,7 +136,7 @@ isc_nm_listenudp(isc_nm_t *mgr, isc_sockaddr_t *iface, isc_nm_recv_cb_t cb,
|
||||
#if defined(WIN32)
|
||||
sock->nchildren = 1;
|
||||
#else
|
||||
- sock->nchildren = mgr->nworkers;
|
||||
+ sock->nchildren = mgr->nlisteners;
|
||||
#endif
|
||||
|
||||
children_size = sock->nchildren * sizeof(sock->children[0]);
|
||||
@@ -795,7 +795,7 @@ isc_nm_udpconnect(isc_nm_t *mgr, isc_sockaddr_t *local, isc_sockaddr_t *peer,
|
||||
isc__nm_put_netievent_udpconnect(mgr, event);
|
||||
} else {
|
||||
atomic_init(&sock->active, false);
|
||||
- sock->tid = isc_random_uniform(mgr->nworkers);
|
||||
+ sock->tid = isc_random_uniform(mgr->nlisteners);
|
||||
isc__nm_enqueue_ievent(&mgr->workers[sock->tid],
|
||||
(isc__netievent_t *)event);
|
||||
}
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,111 +0,0 @@
|
||||
From bef141d5795429cab745f29f7d080d1e2ea8f164 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 12 Feb 2024 20:33:41 +0100
|
||||
Subject: [PATCH] Prevent assertion failure when nxdomain-redirect is used with
|
||||
RFC 1918 reverse zones
|
||||
|
||||
6316. [security] Specific queries could trigger an assertion check with
|
||||
nxdomain-redirect enabled. (CVE-2023-5517) [GL #4281]
|
||||
---
|
||||
lib/ns/query.c | 25 ++++++++++++-------------
|
||||
1 file changed, 12 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index 4fe3e30..cc1d179 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -453,10 +453,10 @@ static void
|
||||
query_addnxrrsetnsec(query_ctx_t *qctx);
|
||||
|
||||
static isc_result_t
|
||||
-query_nxdomain(query_ctx_t *qctx, bool empty_wild);
|
||||
+query_nxdomain(query_ctx_t *qctx, isc_result_t result);
|
||||
|
||||
static isc_result_t
|
||||
-query_redirect(query_ctx_t *qctx);
|
||||
+query_redirect(query_ctx_t *qctx, isc_result_t result);
|
||||
|
||||
static isc_result_t
|
||||
query_ncache(query_ctx_t *qctx, isc_result_t result);
|
||||
@@ -7262,8 +7262,7 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
|
||||
* result from the search.
|
||||
*/
|
||||
static isc_result_t
|
||||
-query_gotanswer(query_ctx_t *qctx, isc_result_t res) {
|
||||
- isc_result_t result = res;
|
||||
+query_gotanswer(query_ctx_t *qctx, isc_result_t result) {
|
||||
char errmsg[256];
|
||||
|
||||
CCTRACE(ISC_LOG_DEBUG(3), "query_gotanswer");
|
||||
@@ -7333,16 +7332,16 @@ root_key_sentinel:
|
||||
return (query_nodata(qctx, DNS_R_NXRRSET));
|
||||
|
||||
case DNS_R_EMPTYWILD:
|
||||
- return (query_nxdomain(qctx, true));
|
||||
+ return (query_nxdomain(qctx, DNS_R_EMPTYWILD));
|
||||
|
||||
case DNS_R_NXDOMAIN:
|
||||
- return (query_nxdomain(qctx, false));
|
||||
+ return (query_nxdomain(qctx, DNS_R_NXDOMAIN));
|
||||
|
||||
case DNS_R_COVERINGNSEC:
|
||||
return (query_coveringnsec(qctx));
|
||||
|
||||
case DNS_R_NCACHENXDOMAIN:
|
||||
- result = query_redirect(qctx);
|
||||
+ result = query_redirect(qctx, result);
|
||||
if (result != ISC_R_COMPLETE) {
|
||||
return (result);
|
||||
}
|
||||
@@ -9155,10 +9154,10 @@ query_addnxrrsetnsec(query_ctx_t *qctx) {
|
||||
* Handle NXDOMAIN and empty wildcard responses.
|
||||
*/
|
||||
static isc_result_t
|
||||
-query_nxdomain(query_ctx_t *qctx, bool empty_wild) {
|
||||
+query_nxdomain(query_ctx_t *qctx, isc_result_t result) {
|
||||
dns_section_t section;
|
||||
uint32_t ttl;
|
||||
- isc_result_t result;
|
||||
+ bool empty_wild = (result == DNS_R_EMPTYWILD);
|
||||
|
||||
CCTRACE(ISC_LOG_DEBUG(3), "query_nxdomain");
|
||||
|
||||
@@ -9167,7 +9166,7 @@ query_nxdomain(query_ctx_t *qctx, bool empty_wild) {
|
||||
INSIST(qctx->is_zone || REDIRECT(qctx->client));
|
||||
|
||||
if (!empty_wild) {
|
||||
- result = query_redirect(qctx);
|
||||
+ result = query_redirect(qctx, result);
|
||||
if (result != ISC_R_COMPLETE) {
|
||||
return (result);
|
||||
}
|
||||
@@ -9253,7 +9252,7 @@ cleanup:
|
||||
* redirecting, so query processing should continue past it.
|
||||
*/
|
||||
static isc_result_t
|
||||
-query_redirect(query_ctx_t *qctx) {
|
||||
+query_redirect(query_ctx_t *qctx, isc_result_t saved_result) {
|
||||
isc_result_t result;
|
||||
|
||||
CCTRACE(ISC_LOG_DEBUG(3), "query_redirect");
|
||||
@@ -9294,7 +9293,7 @@ query_redirect(query_ctx_t *qctx) {
|
||||
SAVE(qctx->client->query.redirect.rdataset, qctx->rdataset);
|
||||
SAVE(qctx->client->query.redirect.sigrdataset,
|
||||
qctx->sigrdataset);
|
||||
- qctx->client->query.redirect.result = DNS_R_NCACHENXDOMAIN;
|
||||
+ qctx->client->query.redirect.result = saved_result;
|
||||
dns_name_copynf(qctx->fname,
|
||||
qctx->client->query.redirect.fname);
|
||||
qctx->client->query.redirect.authoritative =
|
||||
@@ -9908,7 +9907,7 @@ query_coveringnsec(query_ctx_t *qctx) {
|
||||
* We now have the proof that we have an NXDOMAIN. Apply
|
||||
* NXDOMAIN redirection if configured.
|
||||
*/
|
||||
- result = query_redirect(qctx);
|
||||
+ result = query_redirect(qctx, DNS_R_COVERINGNSEC);
|
||||
if (result != ISC_R_COMPLETE) {
|
||||
redirected = true;
|
||||
goto cleanup;
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,37 +0,0 @@
|
||||
From 61112d1ce39848e08ec133f280cf8f729cb70d16 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 12 Feb 2024 20:41:43 +0100
|
||||
Subject: [PATCH] Prevent assertion failure if DNS64 and serve-stale is used
|
||||
|
||||
Enabling both DNS64 and serve-stale may cause an assertion failure
|
||||
during recursive resolution.
|
||||
|
||||
6317. [security] Restore DNS64 state when handling a serve-stale timeout.
|
||||
(CVE-2023-5679) [GL #4334]
|
||||
|
||||
Resolves: CVE-2023-5679
|
||||
---
|
||||
lib/ns/query.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index cc1d179..1993800 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -5983,6 +5983,13 @@ query_lookup_stale(ns_client_t *client) {
|
||||
query_ctx_t qctx;
|
||||
|
||||
qctx_init(client, NULL, client->query.qtype, &qctx);
|
||||
+ if (DNS64(client)) {
|
||||
+ qctx.qtype = qctx.type = dns_rdatatype_a;
|
||||
+ qctx.dns64 = true;
|
||||
+ }
|
||||
+ if (DNS64EXCLUDE(client)) {
|
||||
+ qctx.dns64_exclude = true;
|
||||
+ }
|
||||
dns_db_attach(client->view->cachedb, &qctx.db);
|
||||
client->query.attributes &= ~NS_QUERYATTR_RECURSIONOK;
|
||||
client->query.dboptions |= DNS_DBFIND_STALETIMEOUT;
|
||||
--
|
||||
2.43.0
|
||||
|
@ -1,52 +0,0 @@
|
||||
From e91ab7758bed0cf3dcf8ed745f91063d7ec4011c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= <michal@isc.org>
|
||||
Date: Thu, 4 Jan 2024 13:39:27 +0100
|
||||
Subject: [PATCH] Fix map offsets in the "masterformat" system test
|
||||
|
||||
The "masterformat" system test attempts to check named-checkzone
|
||||
behavior when it is fed corrupt map-format zone files. However, despite
|
||||
the RBTDB and RBT structures having evolved over the years, the offsets
|
||||
at which a valid map-format zone file is malformed by the "masterformat"
|
||||
test have not been updated accordingly, causing the relevant checks to
|
||||
introduce a different type of corruption than they were originally meant
|
||||
to cause:
|
||||
|
||||
- the "bad node header" check originally mangled the 'type' member of
|
||||
the rdatasetheader_t structure for cname.example.nil,
|
||||
|
||||
- the "bad node data" check originally mangled the 'serial' and
|
||||
'rdh_ttl' members of the rdatasetheader_t structure for
|
||||
aaaa.example.nil.
|
||||
|
||||
Update the offsets at which the map-format zone file is malformed at by
|
||||
the "masterformat" system test so that the relevant checks fulfill their
|
||||
original purpose again.
|
||||
---
|
||||
bin/tests/system/masterformat/tests.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/bin/tests/system/masterformat/tests.sh b/bin/tests/system/masterformat/tests.sh
|
||||
index 364a0d2..bb4e6ec 100755
|
||||
--- a/bin/tests/system/masterformat/tests.sh
|
||||
+++ b/bin/tests/system/masterformat/tests.sh
|
||||
@@ -295,7 +295,7 @@ status=$((status+ret))
|
||||
echo_i "checking corrupt map files fail to load (bad node header) ($n)"
|
||||
ret=0
|
||||
cp map.5 badmap
|
||||
-stomp badmap 2754 2 99
|
||||
+stomp badmap 3706 2 99
|
||||
$CHECKZONE -D -f map -F text -o text.5 example.nil badmap > /dev/null
|
||||
[ $? = 1 ] || ret=1
|
||||
n=$((n+1))
|
||||
@@ -305,7 +305,7 @@ status=$((status+ret))
|
||||
echo_i "checking corrupt map files fail to load (bad node data) ($n)"
|
||||
ret=0
|
||||
cp map.5 badmap
|
||||
-stomp badmap 2897 5 127
|
||||
+stomp badmap 3137 5 127
|
||||
$CHECKZONE -D -f map -F text -o text.5 example.nil badmap > /dev/null
|
||||
[ $? = 1 ] || ret=1
|
||||
n=$((n+1))
|
||||
--
|
||||
2.44.0
|
||||
|
@ -1,283 +0,0 @@
|
||||
From 6e08fef24d7ba491228a4083ea0f0e33253a1043 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 12 Feb 2024 20:48:57 +0100
|
||||
Subject: [PATCH] Specific recursive query patterns may lead to an
|
||||
out-of-memory condition
|
||||
|
||||
6319. [security] Query patterns that continuously triggered cache
|
||||
database maintenance could exhaust all available memory
|
||||
on the host running named. (CVE-2023-6516) [GL #4383]
|
||||
|
||||
Resolves: CVE-2023-6516
|
||||
---
|
||||
lib/dns/include/dns/rbt.h | 6 ++
|
||||
lib/dns/mapapi | 2 +-
|
||||
lib/dns/rbt.c | 1 +
|
||||
lib/dns/rbtdb.c | 149 +++++++++++++++++++++++++-------------
|
||||
4 files changed, 107 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/lib/dns/include/dns/rbt.h b/lib/dns/include/dns/rbt.h
|
||||
index b67e602..69655b0 100644
|
||||
--- a/lib/dns/include/dns/rbt.h
|
||||
+++ b/lib/dns/include/dns/rbt.h
|
||||
@@ -164,6 +164,12 @@ struct dns_rbtnode {
|
||||
uint16_t locknum; /* note that this is not in the bitfield */
|
||||
isc_refcount_t references;
|
||||
/*@}*/
|
||||
+
|
||||
+ /*%
|
||||
+ * This linked list is used to store nodes from which tree pruning can
|
||||
+ * be started.
|
||||
+ */
|
||||
+ ISC_LINK(dns_rbtnode_t) prunelink;
|
||||
};
|
||||
|
||||
typedef isc_result_t (*dns_rbtfindcallback_t)(dns_rbtnode_t *node,
|
||||
diff --git a/lib/dns/mapapi b/lib/dns/mapapi
|
||||
index 1b502d3..a46e190 100644
|
||||
--- a/lib/dns/mapapi
|
||||
+++ b/lib/dns/mapapi
|
||||
@@ -13,4 +13,4 @@
|
||||
# Whenever releasing a new major release of BIND9, set this value
|
||||
# back to 1.0 when releasing the first alpha. Map files are *never*
|
||||
# compatible across major releases.
|
||||
-MAPAPI=3.0
|
||||
+MAPAPI=4.0
|
||||
diff --git a/lib/dns/rbt.c b/lib/dns/rbt.c
|
||||
index 7f2c2d2..a220368 100644
|
||||
--- a/lib/dns/rbt.c
|
||||
+++ b/lib/dns/rbt.c
|
||||
@@ -2283,6 +2283,7 @@ create_node(isc_mem_t *mctx, const dns_name_t *name, dns_rbtnode_t **nodep) {
|
||||
HASHVAL(node) = 0;
|
||||
|
||||
ISC_LINK_INIT(node, deadlink);
|
||||
+ ISC_LINK_INIT(node, prunelink);
|
||||
|
||||
LOCKNUM(node) = 0;
|
||||
WILD(node) = 0;
|
||||
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
|
||||
index 75f97f5..2707507 100644
|
||||
--- a/lib/dns/rbtdb.c
|
||||
+++ b/lib/dns/rbtdb.c
|
||||
@@ -515,6 +515,10 @@ struct dns_rbtdb {
|
||||
*/
|
||||
rbtnodelist_t *deadnodes;
|
||||
|
||||
+ /* List of nodes from which recursive tree pruning can be started from.
|
||||
+ * Locked by tree_lock. */
|
||||
+ rbtnodelist_t prunenodes;
|
||||
+
|
||||
/*
|
||||
* Heaps. These are used for TTL based expiry in a cache,
|
||||
* or for zone resigning in a zone DB. hmctx is the memory
|
||||
@@ -1060,6 +1064,7 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) {
|
||||
unsigned int i;
|
||||
isc_result_t result;
|
||||
char buf[DNS_NAME_FORMATSIZE];
|
||||
+ dns_rbtnode_t *node = NULL;
|
||||
dns_rbt_t **treep;
|
||||
isc_time_t start;
|
||||
dns_dbonupdatelistener_t *listener, *listener_next;
|
||||
@@ -1086,8 +1091,6 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) {
|
||||
* the overhead of unlinking all nodes here should be negligible.
|
||||
*/
|
||||
for (i = 0; i < rbtdb->node_lock_count; i++) {
|
||||
- dns_rbtnode_t *node;
|
||||
-
|
||||
node = ISC_LIST_HEAD(rbtdb->deadnodes[i]);
|
||||
while (node != NULL) {
|
||||
ISC_LIST_UNLINK(rbtdb->deadnodes[i], node, deadlink);
|
||||
@@ -1095,6 +1098,12 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log, isc_event_t *event) {
|
||||
}
|
||||
}
|
||||
|
||||
+ node = ISC_LIST_HEAD(rbtdb->prunenodes);
|
||||
+ while (node != NULL) {
|
||||
+ ISC_LIST_UNLINK(rbtdb->prunenodes, node, prunelink);
|
||||
+ node = ISC_LIST_HEAD(rbtdb->prunenodes);
|
||||
+ }
|
||||
+
|
||||
if (event == NULL) {
|
||||
rbtdb->quantum = (rbtdb->task != NULL) ? 100 : 0;
|
||||
}
|
||||
@@ -1934,19 +1943,32 @@ is_leaf(dns_rbtnode_t *node) {
|
||||
node->left == NULL && node->right == NULL);
|
||||
}
|
||||
|
||||
+/*%
|
||||
+ * The tree lock must be held when this function is called as it reads and
|
||||
+ * updates rbtdb->prunenodes.
|
||||
+ */
|
||||
static inline void
|
||||
send_to_prune_tree(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
||||
isc_rwlocktype_t locktype) {
|
||||
- isc_event_t *ev;
|
||||
- dns_db_t *db;
|
||||
+ bool pruning_queued = (ISC_LIST_HEAD(rbtdb->prunenodes) != NULL);
|
||||
+
|
||||
+ INSIST(locktype == isc_rwlocktype_write);
|
||||
|
||||
- ev = isc_event_allocate(rbtdb->common.mctx, NULL, DNS_EVENT_RBTPRUNE,
|
||||
- prune_tree, node, sizeof(isc_event_t));
|
||||
new_reference(rbtdb, node, locktype);
|
||||
- db = NULL;
|
||||
- attach((dns_db_t *)rbtdb, &db);
|
||||
- ev->ev_sender = db;
|
||||
- isc_task_send(rbtdb->task, &ev);
|
||||
+ INSIST(!ISC_LINK_LINKED(node, prunelink));
|
||||
+ ISC_LIST_APPEND(rbtdb->prunenodes, node, prunelink);
|
||||
+
|
||||
+ if (!pruning_queued) {
|
||||
+ isc_event_t *ev = NULL;
|
||||
+ dns_db_t *db = NULL;
|
||||
+
|
||||
+ attach((dns_db_t *)rbtdb, &db);
|
||||
+
|
||||
+ ev = isc_event_allocate(rbtdb->common.mctx, NULL,
|
||||
+ DNS_EVENT_RBTPRUNE, prune_tree, db,
|
||||
+ sizeof(isc_event_t));
|
||||
+ isc_task_send(rbtdb->task, &ev);
|
||||
+ }
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -2220,17 +2242,26 @@ restore_locks:
|
||||
}
|
||||
|
||||
/*
|
||||
- * Prune the tree by recursively cleaning-up single leaves. In the worst
|
||||
- * case, the number of iteration is the number of tree levels, which is at
|
||||
- * most the maximum number of domain name labels, i.e, 127. In practice, this
|
||||
- * should be much smaller (only a few times), and even the worst case would be
|
||||
- * acceptable for a single event.
|
||||
+ * Prune the tree by recursively cleaning up single leaves. Go through all
|
||||
+ * nodes stored in the rbtdb->prunenodes list; for each of them, in the worst
|
||||
+ * case, it will be necessary to traverse a number of tree levels equal to the
|
||||
+ * maximum legal number of domain name labels (127); in practice, the number of
|
||||
+ * tree levels to traverse will virtually always be much smaller (a few levels
|
||||
+ * at most). While holding the tree lock throughout this entire operation is
|
||||
+ * less than ideal, so is splitting the latter up by queueing a separate
|
||||
+ * prune_tree() run for each node to start pruning from (as queueing requires
|
||||
+ * allocating memory and can therefore potentially be exploited to exhaust
|
||||
+ * available memory). Also note that actually freeing up the memory used by
|
||||
+ * RBTDB nodes (which is what this function does) is essential to keeping cache
|
||||
+ * memory use in check, so since the tree lock needs to be acquired anyway,
|
||||
+ * freeing as many nodes as possible before the tree lock gets released is
|
||||
+ * prudent.
|
||||
*/
|
||||
static void
|
||||
prune_tree(isc_task_t *task, isc_event_t *event) {
|
||||
- dns_rbtdb_t *rbtdb = event->ev_sender;
|
||||
- dns_rbtnode_t *node = event->ev_arg;
|
||||
- dns_rbtnode_t *parent;
|
||||
+ dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)event->ev_arg;
|
||||
+ dns_rbtnode_t *node = NULL;
|
||||
+ dns_rbtnode_t *parent = NULL;
|
||||
unsigned int locknum;
|
||||
|
||||
UNUSED(task);
|
||||
@@ -2238,44 +2269,60 @@ prune_tree(isc_task_t *task, isc_event_t *event) {
|
||||
isc_event_free(&event);
|
||||
|
||||
RWLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
|
||||
- locknum = node->locknum;
|
||||
- NODE_LOCK(&rbtdb->node_locks[locknum].lock, isc_rwlocktype_write);
|
||||
- do {
|
||||
- parent = node->parent;
|
||||
- decrement_reference(rbtdb, node, 0, isc_rwlocktype_write,
|
||||
- isc_rwlocktype_write, true);
|
||||
|
||||
- if (parent != NULL && parent->down == NULL) {
|
||||
- /*
|
||||
- * node was the only down child of the parent and has
|
||||
- * just been removed. We'll then need to examine the
|
||||
- * parent. Keep the lock if possible; otherwise,
|
||||
- * release the old lock and acquire one for the parent.
|
||||
- */
|
||||
- if (parent->locknum != locknum) {
|
||||
- NODE_UNLOCK(&rbtdb->node_locks[locknum].lock,
|
||||
- isc_rwlocktype_write);
|
||||
- locknum = parent->locknum;
|
||||
- NODE_LOCK(&rbtdb->node_locks[locknum].lock,
|
||||
- isc_rwlocktype_write);
|
||||
+ while ((node = ISC_LIST_HEAD(rbtdb->prunenodes)) != NULL) {
|
||||
+ locknum = node->locknum;
|
||||
+ NODE_LOCK(&rbtdb->node_locks[locknum].lock,
|
||||
+ isc_rwlocktype_write);
|
||||
+ do {
|
||||
+ if (ISC_LINK_LINKED(node, prunelink)) {
|
||||
+ ISC_LIST_UNLINK(rbtdb->prunenodes, node,
|
||||
+ prunelink);
|
||||
}
|
||||
|
||||
- /*
|
||||
- * We need to gain a reference to the node before
|
||||
- * decrementing it in the next iteration.
|
||||
- */
|
||||
- if (ISC_LINK_LINKED(parent, deadlink)) {
|
||||
- ISC_LIST_UNLINK(rbtdb->deadnodes[locknum],
|
||||
+ parent = node->parent;
|
||||
+ decrement_reference(rbtdb, node, 0,
|
||||
+ isc_rwlocktype_write,
|
||||
+ isc_rwlocktype_write, true);
|
||||
+
|
||||
+ if (parent != NULL && parent->down == NULL) {
|
||||
+ /*
|
||||
+ * node was the only down child of the parent
|
||||
+ * and has just been removed. We'll then need
|
||||
+ * to examine the parent. Keep the lock if
|
||||
+ * possible; otherwise, release the old lock and
|
||||
+ * acquire one for the parent.
|
||||
+ */
|
||||
+ if (parent->locknum != locknum) {
|
||||
+ NODE_UNLOCK(
|
||||
+ &rbtdb->node_locks[locknum].lock,
|
||||
+ isc_rwlocktype_write);
|
||||
+ locknum = parent->locknum;
|
||||
+ NODE_LOCK(
|
||||
+ &rbtdb->node_locks[locknum].lock,
|
||||
+ isc_rwlocktype_write);
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * We need to gain a reference to the node
|
||||
+ * before decrementing it in the next iteration.
|
||||
+ */
|
||||
+ if (ISC_LINK_LINKED(parent, deadlink)) {
|
||||
+ ISC_LIST_UNLINK(
|
||||
+ rbtdb->deadnodes[locknum],
|
||||
parent, deadlink);
|
||||
+ }
|
||||
+ new_reference(rbtdb, parent,
|
||||
+ isc_rwlocktype_write);
|
||||
+ } else {
|
||||
+ parent = NULL;
|
||||
}
|
||||
- new_reference(rbtdb, parent, isc_rwlocktype_write);
|
||||
- } else {
|
||||
- parent = NULL;
|
||||
- }
|
||||
|
||||
- node = parent;
|
||||
- } while (node != NULL);
|
||||
- NODE_UNLOCK(&rbtdb->node_locks[locknum].lock, isc_rwlocktype_write);
|
||||
+ node = parent;
|
||||
+ } while (node != NULL);
|
||||
+ NODE_UNLOCK(&rbtdb->node_locks[locknum].lock,
|
||||
+ isc_rwlocktype_write);
|
||||
+ }
|
||||
RWUNLOCK(&rbtdb->tree_lock, isc_rwlocktype_write);
|
||||
|
||||
detach((dns_db_t **)&rbtdb);
|
||||
@@ -8726,6 +8773,8 @@ dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
ISC_LIST_INIT(rbtdb->deadnodes[i]);
|
||||
}
|
||||
|
||||
+ ISC_LIST_INIT(rbtdb->prunenodes);
|
||||
+
|
||||
rbtdb->active = rbtdb->node_lock_count;
|
||||
|
||||
for (i = 0; i < (int)(rbtdb->node_lock_count); i++) {
|
||||
--
|
||||
2.43.0
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,27 +0,0 @@
|
||||
From 7bc5e5abf5a3cd66f11cc649b6ecf4c39c92bd9e Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Fri, 9 Aug 2024 12:32:20 +0200
|
||||
Subject: [PATCH] fixup! Add test for not-loading and not-transfering huge
|
||||
RRSets
|
||||
|
||||
---
|
||||
bin/tests/system/conf.sh.common | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/bin/tests/system/conf.sh.common b/bin/tests/system/conf.sh.common
|
||||
index 9fab00f..e617595 100644
|
||||
--- a/bin/tests/system/conf.sh.common
|
||||
+++ b/bin/tests/system/conf.sh.common
|
||||
@@ -301,6 +301,9 @@ DISABLED_ALGORITHM=ECDSAP384SHA384
|
||||
DISABLED_ALGORITHM_NUMBER=14
|
||||
DISABLED_BITS=384
|
||||
|
||||
+# Default HMAC algorithm.
|
||||
+export DEFAULT_HMAC=hmac-sha256
|
||||
+
|
||||
#
|
||||
# Useful functions in test scripts
|
||||
#
|
||||
--
|
||||
2.45.2
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,582 +0,0 @@
|
||||
From a1c95d5fa479ac722f0cf758c494a37ffe1508c0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
|
||||
Date: Sat, 25 May 2024 11:46:56 +0200
|
||||
Subject: [PATCH] Add a limit to the number of RR types for single name
|
||||
|
||||
Previously, the number of RR types for a single owner name was limited
|
||||
only by the maximum number of the types (64k). As the data structure
|
||||
that holds the RR types for the database node is just a linked list, and
|
||||
there are places where we just walk through the whole list (again and
|
||||
again), adding a large number of RR types for a single owner named with
|
||||
would slow down processing of such name (database node).
|
||||
|
||||
Add a configurable limit to cap the number of the RR types for a single
|
||||
owner. This is enforced at the database (rbtdb, qpzone, qpcache) level
|
||||
and configured with new max-types-per-name configuration option that
|
||||
can be configured globally, per-view and per-zone.
|
||||
|
||||
(cherry picked from commit 00d16211d6368b99f070c1182d8c76b3798ca1db)
|
||||
(cherry picked from commit 89f1779bc28b27adbd00325b974ede7a683f8632)
|
||||
|
||||
fix a memory leak that could occur when signing
|
||||
|
||||
when signatures were not added because of too many types already
|
||||
existing at a node, the diff was not being cleaned up; this led to
|
||||
a memory leak being reported at shutdown.
|
||||
|
||||
(cherry picked from commit 2825bdb1ae5be801e7ed603ba2455ed9a308f1f7)
|
||||
(cherry picked from commit a080317de0efb7f6ffa12415a863729d416007d5)
|
||||
|
||||
Be smarter about refusing to add many RR types to the database
|
||||
|
||||
Instead of outright refusing to add new RR types to the cache, be a bit
|
||||
smarter:
|
||||
|
||||
1. If the new header type is in our priority list, we always add either
|
||||
positive or negative entry at the beginning of the list.
|
||||
|
||||
2. If the new header type is negative entry, and we are over the limit,
|
||||
we mark it as ancient immediately, so it gets evicted from the cache
|
||||
as soon as possible.
|
||||
|
||||
3. Otherwise add the new header after the priority headers (or at the
|
||||
head of the list).
|
||||
|
||||
4. If we are over the limit, evict the last entry on the normal header
|
||||
list.
|
||||
|
||||
(cherry picked from commit 57cd34441a1b4ecc9874a4a106c2c95b8d7a3120)
|
||||
(cherry picked from commit 92a680a3ef708281267e4fd7b1e62b57c929447b)
|
||||
|
||||
Log error when update fails
|
||||
|
||||
The new "too many records" error can make an update fail without the
|
||||
error being logged. This commit fixes that.
|
||||
|
||||
(cherry picked from commit 558923e5405894cf976d102f0d246a28bdbb400c)
|
||||
(cherry picked from commit d72adf4b927d83a2a0ff8e431b911ec1df7aeb88)
|
||||
---
|
||||
bin/named/config.c | 1 +
|
||||
bin/named/server.c | 9 +++++++++
|
||||
bin/named/zoneconf.c | 8 ++++++++
|
||||
bin/tests/system/dyndb/driver/db.c | 3 ++-
|
||||
doc/arm/reference.rst | 12 ++++++++++++
|
||||
lib/dns/cache.c | 12 ++++++++++++
|
||||
lib/dns/db.c | 9 +++++++++
|
||||
lib/dns/dnsrps.c | 3 ++-
|
||||
lib/dns/ecdb.c | 3 ++-
|
||||
lib/dns/include/dns/cache.h | 6 ++++++
|
||||
lib/dns/include/dns/db.h | 11 +++++++++++
|
||||
lib/dns/include/dns/view.h | 7 +++++++
|
||||
lib/dns/include/dns/zone.h | 13 +++++++++++++
|
||||
lib/dns/rbtdb.c | 28 +++++++++++++++++-----------
|
||||
lib/dns/sdb.c | 3 ++-
|
||||
lib/dns/sdlz.c | 3 ++-
|
||||
lib/dns/view.c | 10 ++++++++++
|
||||
lib/dns/zone.c | 16 ++++++++++++++++
|
||||
lib/isccfg/namedconf.c | 3 +++
|
||||
lib/ns/update.c | 15 ++++++++++++---
|
||||
20 files changed, 156 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/bin/named/config.c b/bin/named/config.c
|
||||
index 9cba6f588b..c9888ada65 100644
|
||||
--- a/bin/named/config.c
|
||||
+++ b/bin/named/config.c
|
||||
@@ -218,6 +218,7 @@ options {\n\
|
||||
max-records-per-type 100;\n\
|
||||
max-refresh-time 2419200; /* 4 weeks */\n\
|
||||
max-retry-time 1209600; /* 2 weeks */\n\
|
||||
+ max-types-per-name 100;\n\
|
||||
max-transfer-idle-in 60;\n\
|
||||
max-transfer-idle-out 60;\n\
|
||||
max-transfer-time-in 120;\n\
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 7bf5f2664d..4cc69b54a1 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -5427,6 +5427,15 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
dns_view_setmaxrrperset(view, cfg_obj_asuint32(obj));
|
||||
|
||||
+ /*
|
||||
+ * This is used for the cache and also as a default value
|
||||
+ * for zone databases.
|
||||
+ */
|
||||
+ obj = NULL;
|
||||
+ result = named_config_get(maps, "max-types-per-name", &obj);
|
||||
+ INSIST(result == ISC_R_SUCCESS);
|
||||
+ dns_view_setmaxtypepername(view, cfg_obj_asuint32(obj));
|
||||
+
|
||||
obj = NULL;
|
||||
result = named_config_get(maps, "max-recursion-depth", &obj);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
diff --git a/bin/named/zoneconf.c b/bin/named/zoneconf.c
|
||||
index ae5cc656ee..f6e8c64866 100644
|
||||
--- a/bin/named/zoneconf.c
|
||||
+++ b/bin/named/zoneconf.c
|
||||
@@ -1100,6 +1100,14 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
dns_zone_setmaxrrperset(zone, 0);
|
||||
}
|
||||
|
||||
+ obj = NULL;
|
||||
+ result = named_config_get(maps, "max-types-per-name", &obj);
|
||||
+ INSIST(result == ISC_R_SUCCESS && obj != NULL);
|
||||
+ dns_zone_setmaxtypepername(mayberaw, cfg_obj_asuint32(obj));
|
||||
+ if (zone != mayberaw) {
|
||||
+ dns_zone_setmaxtypepername(zone, 0);
|
||||
+ }
|
||||
+
|
||||
if (raw != NULL && filename != NULL) {
|
||||
#define SIGNED ".signed"
|
||||
size_t signedlen = strlen(filename) + sizeof(SIGNED);
|
||||
diff --git a/bin/tests/system/dyndb/driver/db.c b/bin/tests/system/dyndb/driver/db.c
|
||||
index 6725a3bacd..c95fc8212b 100644
|
||||
--- a/bin/tests/system/dyndb/driver/db.c
|
||||
+++ b/bin/tests/system/dyndb/driver/db.c
|
||||
@@ -593,7 +593,8 @@ static dns_dbmethods_t sampledb_methods = {
|
||||
NULL, /* getservestalerefresh */
|
||||
NULL, /* setgluecachestats */
|
||||
NULL, /* adjusthashsize */
|
||||
- NULL /* setmaxrrperset */
|
||||
+ NULL, /* setmaxrrperset */
|
||||
+ NULL /* setmaxtypepername */
|
||||
};
|
||||
|
||||
/* Auxiliary driver functions. */
|
||||
diff --git a/doc/arm/reference.rst b/doc/arm/reference.rst
|
||||
index b1983ef30d..a8a3c7911d 100644
|
||||
--- a/doc/arm/reference.rst
|
||||
+++ b/doc/arm/reference.rst
|
||||
@@ -2902,6 +2902,18 @@ system.
|
||||
a failure. If set to 0, there is no cap on RRset size. The default is
|
||||
100.
|
||||
|
||||
+``max-types-per-name``
|
||||
+ This sets the maximum number of resource record types that can be stored
|
||||
+ for a single owner name in a database. When configured in ``options``
|
||||
+ or ``view``, it controls the cache database, and also sets
|
||||
+ the default value for zone databases, which can be overridden by setting
|
||||
+ it at the ``zone`` level
|
||||
+
|
||||
+ If set to a positive value, any attempt to cache or to add to a zone an owner
|
||||
+ name with more than the specified number of resource record types will result
|
||||
+ in a failure. If set to 0, there is no cap on RR types number. The default is
|
||||
+ 100.
|
||||
+
|
||||
``recursive-clients``
|
||||
This sets the maximum number (a "hard quota") of simultaneous recursive lookups
|
||||
the server performs on behalf of clients. The default is
|
||||
diff --git a/lib/dns/cache.c b/lib/dns/cache.c
|
||||
index 9f0412dbe7..0b474fc313 100644
|
||||
--- a/lib/dns/cache.c
|
||||
+++ b/lib/dns/cache.c
|
||||
@@ -150,6 +150,7 @@ struct dns_cache {
|
||||
/* Access to the on-disk cache file is also locked by 'filelock'. */
|
||||
|
||||
uint32_t maxrrperset;
|
||||
+ uint32_t maxtypepername;
|
||||
};
|
||||
|
||||
/***
|
||||
@@ -178,6 +179,7 @@ cache_create_db(dns_cache_t *cache, dns_db_t **db) {
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
dns_db_setservestalettl(*db, cache->serve_stale_ttl);
|
||||
dns_db_setmaxrrperset(*db, cache->maxrrperset);
|
||||
+ dns_db_setmaxtypepername(*db, cache->maxtypepername);
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
@@ -1290,6 +1292,16 @@ dns_cache_setmaxrrperset(dns_cache_t *cache, uint32_t value) {
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
+dns_cache_setmaxtypepername(dns_cache_t *cache, uint32_t value) {
|
||||
+ REQUIRE(VALID_CACHE(cache));
|
||||
+
|
||||
+ cache->maxtypepername = value;
|
||||
+ if (cache->db != NULL) {
|
||||
+ dns_db_setmaxtypepername(cache->db, value);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* XXX: Much of the following code has been copied in from statschannel.c.
|
||||
* We should refactor this into a generic function in stats.c that can be
|
||||
diff --git a/lib/dns/db.c b/lib/dns/db.c
|
||||
index 8439265a7f..18583d41c2 100644
|
||||
--- a/lib/dns/db.c
|
||||
+++ b/lib/dns/db.c
|
||||
@@ -1131,3 +1131,12 @@ dns_db_setmaxrrperset(dns_db_t *db, uint32_t value) {
|
||||
(db->methods->setmaxrrperset)(db, value);
|
||||
}
|
||||
}
|
||||
+
|
||||
+void
|
||||
+dns_db_setmaxtypepername(dns_db_t *db, uint32_t value) {
|
||||
+ REQUIRE(DNS_DB_VALID(db));
|
||||
+
|
||||
+ if (db->methods->setmaxtypepername != NULL) {
|
||||
+ (db->methods->setmaxtypepername)(db, value);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/lib/dns/dnsrps.c b/lib/dns/dnsrps.c
|
||||
index 539090d1bd..e1a1b21a8b 100644
|
||||
--- a/lib/dns/dnsrps.c
|
||||
+++ b/lib/dns/dnsrps.c
|
||||
@@ -971,7 +971,8 @@ static dns_dbmethods_t rpsdb_db_methods = {
|
||||
NULL, /* getservestalerefresh */
|
||||
NULL, /* setgluecachestats */
|
||||
NULL, /* adjusthashsize */
|
||||
- NULL /* setmaxrrperset */
|
||||
+ NULL, /* setmaxrrperset */
|
||||
+ NULL /* setmaxtypepername */
|
||||
};
|
||||
|
||||
static dns_rdatasetmethods_t rpsdb_rdataset_methods = {
|
||||
diff --git a/lib/dns/ecdb.c b/lib/dns/ecdb.c
|
||||
index bab5da5503..27d03b4e3a 100644
|
||||
--- a/lib/dns/ecdb.c
|
||||
+++ b/lib/dns/ecdb.c
|
||||
@@ -560,7 +560,8 @@ static dns_dbmethods_t ecdb_methods = {
|
||||
NULL, /* getservestalerefresh */
|
||||
NULL, /* setgluecachestats */
|
||||
NULL, /* adjusthashsize */
|
||||
- NULL /* setmaxrrperset */
|
||||
+ NULL, /* setmaxrrperset */
|
||||
+ NULL /* setmaxtypepername */
|
||||
};
|
||||
|
||||
static isc_result_t
|
||||
diff --git a/lib/dns/include/dns/cache.h b/lib/dns/include/dns/cache.h
|
||||
index 3fa2a891e0..72de21600a 100644
|
||||
--- a/lib/dns/include/dns/cache.h
|
||||
+++ b/lib/dns/include/dns/cache.h
|
||||
@@ -343,6 +343,12 @@ dns_cache_setmaxrrperset(dns_cache_t *cache, uint32_t value);
|
||||
* Set the maximum resource records per RRSet that can be cached.
|
||||
*/
|
||||
|
||||
+void
|
||||
+dns_cache_setmaxtypepername(dns_cache_t *cache, uint32_t value);
|
||||
+/*%<
|
||||
+ * Set the maximum resource record types per owner name that can be cached.
|
||||
+ */
|
||||
+
|
||||
#ifdef HAVE_LIBXML2
|
||||
int
|
||||
dns_cache_renderxml(dns_cache_t *cache, void *writer0);
|
||||
diff --git a/lib/dns/include/dns/db.h b/lib/dns/include/dns/db.h
|
||||
index 732bfe473d..411881d48a 100644
|
||||
--- a/lib/dns/include/dns/db.h
|
||||
+++ b/lib/dns/include/dns/db.h
|
||||
@@ -183,6 +183,7 @@ typedef struct dns_dbmethods {
|
||||
isc_result_t (*setgluecachestats)(dns_db_t *db, isc_stats_t *stats);
|
||||
isc_result_t (*adjusthashsize)(dns_db_t *db, size_t size);
|
||||
void (*setmaxrrperset)(dns_db_t *db, uint32_t value);
|
||||
+ void (*setmaxtypepername)(dns_db_t *db, uint32_t value);
|
||||
} dns_dbmethods_t;
|
||||
|
||||
typedef isc_result_t (*dns_dbcreatefunc_t)(isc_mem_t *mctx,
|
||||
@@ -1791,6 +1792,16 @@ dns_db_setmaxrrperset(dns_db_t *db, uint32_t value);
|
||||
* is nonzero, then any subsequent attempt to add an rdataset with
|
||||
* more than 'value' RRs will return ISC_R_NOSPACE.
|
||||
*/
|
||||
+
|
||||
+void
|
||||
+dns_db_setmaxtypepername(dns_db_t *db, uint32_t value);
|
||||
+/*%<
|
||||
+ * Set the maximum permissible number of RR types per owner name.
|
||||
+ *
|
||||
+ * If 'value' is nonzero, then any subsequent attempt to add an rdataset with a
|
||||
+ * RR type that would exceed the number of already stored RR types will return
|
||||
+ * ISC_R_NOSPACE.
|
||||
+ */
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* DNS_DB_H */
|
||||
diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h
|
||||
index 0d502f4dd2..0a72f58e98 100644
|
||||
--- a/lib/dns/include/dns/view.h
|
||||
+++ b/lib/dns/include/dns/view.h
|
||||
@@ -187,6 +187,7 @@ struct dns_view {
|
||||
uint32_t fail_ttl;
|
||||
dns_badcache_t *failcache;
|
||||
uint32_t maxrrperset;
|
||||
+ uint32_t maxtypepername;
|
||||
|
||||
/*
|
||||
* Configurable data for server use only,
|
||||
@@ -1346,6 +1347,12 @@ dns_view_setmaxrrperset(dns_view_t *view, uint32_t value);
|
||||
* Set the maximum resource records per RRSet that can be cached.
|
||||
*/
|
||||
|
||||
+void
|
||||
+dns_view_setmaxtypepername(dns_view_t *view, uint32_t value);
|
||||
+/*%<
|
||||
+ * Set the maximum resource record types per owner name that can be cached.
|
||||
+ */
|
||||
+
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
#endif /* DNS_VIEW_H */
|
||||
diff --git a/lib/dns/include/dns/zone.h b/lib/dns/include/dns/zone.h
|
||||
index e902043357..6fca11f3fd 100644
|
||||
--- a/lib/dns/include/dns/zone.h
|
||||
+++ b/lib/dns/include/dns/zone.h
|
||||
@@ -356,6 +356,19 @@ dns_zone_setmaxrrperset(dns_zone_t *zone, uint32_t maxrrperset);
|
||||
*\li void
|
||||
*/
|
||||
|
||||
+void
|
||||
+dns_zone_setmaxtypepername(dns_zone_t *zone, uint32_t maxtypepername);
|
||||
+/*%<
|
||||
+ * Sets the maximum number of resource record types per owner name
|
||||
+ * permitted in a zone. 0 implies unlimited.
|
||||
+ *
|
||||
+ * Requires:
|
||||
+ *\li 'zone' to be valid initialised zone.
|
||||
+ *
|
||||
+ * Returns:
|
||||
+ *\li void
|
||||
+ */
|
||||
+
|
||||
void
|
||||
dns_zone_setmaxttl(dns_zone_t *zone, uint32_t maxttl);
|
||||
/*%<
|
||||
diff --git a/lib/dns/rbtdb.c b/lib/dns/rbtdb.c
|
||||
index ca71bb9c03..ed5015c2d4 100644
|
||||
--- a/lib/dns/rbtdb.c
|
||||
+++ b/lib/dns/rbtdb.c
|
||||
@@ -483,6 +483,7 @@ struct dns_rbtdb {
|
||||
rbtdb_serial_t least_serial;
|
||||
rbtdb_serial_t next_serial;
|
||||
uint32_t maxrrperset;
|
||||
+ uint32_t maxtypepername;
|
||||
rbtdb_version_t *current_version;
|
||||
rbtdb_version_t *future_version;
|
||||
rbtdb_versionlist_t open_versions;
|
||||
@@ -6222,19 +6223,13 @@ update_recordsandxfrsize(bool add, rbtdb_version_t *rbtversion,
|
||||
RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_write);
|
||||
}
|
||||
|
||||
-#ifndef DNS_RBTDB_MAX_RTYPES
|
||||
-#define DNS_RBTDB_MAX_RTYPES 100
|
||||
-#endif /* DNS_RBTDB_MAX_RTYPES */
|
||||
-
|
||||
static bool
|
||||
overmaxtype(dns_rbtdb_t *rbtdb, uint32_t ntypes) {
|
||||
- UNUSED(rbtdb);
|
||||
-
|
||||
- if (DNS_RBTDB_MAX_RTYPES == 0) {
|
||||
+ if (rbtdb->maxtypepername == 0) {
|
||||
return (false);
|
||||
}
|
||||
|
||||
- return (ntypes >= DNS_RBTDB_MAX_RTYPES);
|
||||
+ return (ntypes >= rbtdb->maxtypepername);
|
||||
}
|
||||
|
||||
static bool
|
||||
@@ -6794,7 +6789,7 @@ find_header:
|
||||
if (!IS_CACHE(rbtdb) && overmaxtype(rbtdb, ntypes)) {
|
||||
free_rdataset(rbtdb, rbtdb->common.mctx,
|
||||
newheader);
|
||||
- return (ISC_R_QUOTA);
|
||||
+ return (DNS_R_TOOMANYRECORDS);
|
||||
}
|
||||
|
||||
newheader->down = NULL;
|
||||
@@ -8623,6 +8618,15 @@ setmaxrrperset(dns_db_t *db, uint32_t maxrrperset) {
|
||||
rbtdb->maxrrperset = maxrrperset;
|
||||
}
|
||||
|
||||
+static void
|
||||
+setmaxtypepername(dns_db_t *db, uint32_t maxtypepername) {
|
||||
+ dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
||||
+
|
||||
+ REQUIRE(VALID_RBTDB(rbtdb));
|
||||
+
|
||||
+ rbtdb->maxtypepername = maxtypepername;
|
||||
+}
|
||||
+
|
||||
static dns_stats_t *
|
||||
getrrsetstats(dns_db_t *db) {
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
||||
@@ -8747,7 +8751,8 @@ static dns_dbmethods_t zone_methods = { attach,
|
||||
NULL, /* getservestalerefresh */
|
||||
setgluecachestats,
|
||||
adjusthashsize,
|
||||
- setmaxrrperset };
|
||||
+ setmaxrrperset,
|
||||
+ setmaxtypepername };
|
||||
|
||||
static dns_dbmethods_t cache_methods = { attach,
|
||||
detach,
|
||||
@@ -8800,7 +8805,8 @@ static dns_dbmethods_t cache_methods = { attach,
|
||||
getservestalerefresh,
|
||||
NULL,
|
||||
adjusthashsize,
|
||||
- setmaxrrperset };
|
||||
+ setmaxrrperset,
|
||||
+ setmaxtypepername };
|
||||
|
||||
isc_result_t
|
||||
dns_rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
diff --git a/lib/dns/sdb.c b/lib/dns/sdb.c
|
||||
index 84cd324fb4..77a5834b76 100644
|
||||
--- a/lib/dns/sdb.c
|
||||
+++ b/lib/dns/sdb.c
|
||||
@@ -1313,7 +1313,8 @@ static dns_dbmethods_t sdb_methods = {
|
||||
NULL, /* getservestalerefresh */
|
||||
NULL, /* setgluecachestats */
|
||||
NULL, /* adjusthashsize */
|
||||
- NULL /* setmaxrrperset */
|
||||
+ NULL, /* setmaxrrperset */
|
||||
+ NULL /* setmaxtypepername */
|
||||
};
|
||||
|
||||
static isc_result_t
|
||||
diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c
|
||||
index 60a1d23b3b..418a4a14ee 100644
|
||||
--- a/lib/dns/sdlz.c
|
||||
+++ b/lib/dns/sdlz.c
|
||||
@@ -1285,7 +1285,8 @@ static dns_dbmethods_t sdlzdb_methods = {
|
||||
NULL, /* getservestalerefresh */
|
||||
NULL, /* setgluecachestats */
|
||||
NULL, /* adjusthashsize */
|
||||
- NULL /* setmaxrrperset */
|
||||
+ NULL, /* setmaxrrperset */
|
||||
+ NULL /* setmaxtypepername */
|
||||
};
|
||||
|
||||
/*
|
||||
diff --git a/lib/dns/view.c b/lib/dns/view.c
|
||||
index a672aa8bc8..98579f03d9 100644
|
||||
--- a/lib/dns/view.c
|
||||
+++ b/lib/dns/view.c
|
||||
@@ -871,6 +871,7 @@ dns_view_setcache(dns_view_t *view, dns_cache_t *cache, bool shared) {
|
||||
INSIST(DNS_DB_VALID(view->cachedb));
|
||||
|
||||
dns_cache_setmaxrrperset(view->cache, view->maxrrperset);
|
||||
+ dns_cache_setmaxtypepername(view->cache, view->maxtypepername);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -2555,3 +2556,12 @@ dns_view_setmaxrrperset(dns_view_t *view, uint32_t value) {
|
||||
dns_cache_setmaxrrperset(view->cache, value);
|
||||
}
|
||||
}
|
||||
+
|
||||
+void
|
||||
+dns_view_setmaxtypepername(dns_view_t *view, uint32_t value) {
|
||||
+ REQUIRE(DNS_VIEW_VALID(view));
|
||||
+ view->maxtypepername = value;
|
||||
+ if (view->cache != NULL) {
|
||||
+ dns_cache_setmaxtypepername(view->cache, value);
|
||||
+ }
|
||||
+}
|
||||
diff --git a/lib/dns/zone.c b/lib/dns/zone.c
|
||||
index 5c8d97ed18..e1fb9ab50b 100644
|
||||
--- a/lib/dns/zone.c
|
||||
+++ b/lib/dns/zone.c
|
||||
@@ -277,6 +277,7 @@ struct dns_zone {
|
||||
|
||||
uint32_t maxrecords;
|
||||
uint32_t maxrrperset;
|
||||
+ uint32_t maxtypepername;
|
||||
|
||||
isc_sockaddr_t *masters;
|
||||
isc_dscp_t *masterdscps;
|
||||
@@ -9959,6 +9960,7 @@ cleanup:
|
||||
}
|
||||
|
||||
dns_diff_clear(&_sig_diff);
|
||||
+ dns_diff_clear(&post_diff);
|
||||
|
||||
for (i = 0; i < nkeys; i++) {
|
||||
dst_key_free(&zone_keys[i]);
|
||||
@@ -12168,6 +12170,16 @@ dns_zone_setmaxrrperset(dns_zone_t *zone, uint32_t val) {
|
||||
}
|
||||
}
|
||||
|
||||
+void
|
||||
+dns_zone_setmaxtypepername(dns_zone_t *zone, uint32_t val) {
|
||||
+ REQUIRE(DNS_ZONE_VALID(zone));
|
||||
+
|
||||
+ zone->maxtypepername = val;
|
||||
+ if (zone->db != NULL) {
|
||||
+ dns_db_setmaxtypepername(zone->db, val);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
notify_isqueued(dns_zone_t *zone, unsigned int flags, dns_name_t *name,
|
||||
isc_sockaddr_t *addr, dns_tsigkey_t *key) {
|
||||
@@ -14573,6 +14585,8 @@ ns_query(dns_zone_t *zone, dns_rdataset_t *soardataset, dns_stub_t *stub) {
|
||||
}
|
||||
dns_db_settask(stub->db, zone->task);
|
||||
dns_db_setmaxrrperset(stub->db, zone->maxrrperset);
|
||||
+ dns_db_setmaxtypepername(stub->db,
|
||||
+ zone->maxtypepername);
|
||||
}
|
||||
|
||||
result = dns_db_newversion(stub->db, &stub->version);
|
||||
@@ -17295,6 +17309,7 @@ zone_replacedb(dns_zone_t *zone, dns_db_t *db, bool dump) {
|
||||
zone_attachdb(zone, db);
|
||||
dns_db_settask(zone->db, zone->task);
|
||||
dns_db_setmaxrrperset(zone->db, zone->maxrrperset);
|
||||
+ dns_db_setmaxtypepername(zone->db, zone->maxtypepername);
|
||||
DNS_ZONE_SETFLAG(zone, DNS_ZONEFLG_LOADED | DNS_ZONEFLG_NEEDNOTIFY);
|
||||
return (ISC_R_SUCCESS);
|
||||
|
||||
@@ -23444,6 +23459,7 @@ dns_zone_makedb(dns_zone_t *zone, dns_db_t **dbp) {
|
||||
|
||||
dns_db_settask(db, zone->task);
|
||||
dns_db_setmaxrrperset(db, zone->maxrrperset);
|
||||
+ dns_db_setmaxtypepername(db, zone->maxtypepername);
|
||||
|
||||
*dbp = db;
|
||||
|
||||
diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c
|
||||
index dce30537dd..ac9fc2af5e 100644
|
||||
--- a/lib/isccfg/namedconf.c
|
||||
+++ b/lib/isccfg/namedconf.c
|
||||
@@ -2239,6 +2239,9 @@ static cfg_clausedef_t zone_clauses[] = {
|
||||
{ "max-records-per-type", &cfg_type_uint32,
|
||||
CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
|
||||
CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT },
|
||||
+ { "max-types-per-name", &cfg_type_uint32,
|
||||
+ CFG_ZONE_PRIMARY | CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR |
|
||||
+ CFG_ZONE_STUB | CFG_ZONE_STATICSTUB | CFG_ZONE_REDIRECT },
|
||||
{ "max-refresh-time", &cfg_type_uint32,
|
||||
CFG_ZONE_SECONDARY | CFG_ZONE_MIRROR | CFG_ZONE_STUB },
|
||||
{ "max-retry-time", &cfg_type_uint32,
|
||||
diff --git a/lib/ns/update.c b/lib/ns/update.c
|
||||
index c5ce1eaf09..0e0bdc9c03 100644
|
||||
--- a/lib/ns/update.c
|
||||
+++ b/lib/ns/update.c
|
||||
@@ -3112,9 +3112,18 @@ update_action(isc_task_t *task, isc_event_t *event) {
|
||||
dns_diff_clear(&ctx.add_diff);
|
||||
goto failure;
|
||||
}
|
||||
- CHECK(update_one_rr(db, ver, &diff,
|
||||
- DNS_DIFFOP_ADD,
|
||||
- name, ttl, &rdata));
|
||||
+ result = update_one_rr(
|
||||
+ db, ver, &diff, DNS_DIFFOP_ADD,
|
||||
+ name, ttl, &rdata);
|
||||
+ if (result != ISC_R_SUCCESS) {
|
||||
+ update_log(client, zone,
|
||||
+ LOGLEVEL_PROTOCOL,
|
||||
+ "adding an RR "
|
||||
+ "failed: %s",
|
||||
+ isc_result_totext(
|
||||
+ result));
|
||||
+ goto failure;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
} else if (update_class == dns_rdataclass_any) {
|
||||
--
|
||||
2.45.2
|
||||
|
@ -1,40 +0,0 @@
|
||||
From d249889a9c18df7792ca3cd8d97897e4fb5824b5 Mon Sep 17 00:00:00 2001
|
||||
From: Aram Sargsyan <aram@isc.org>
|
||||
Date: Wed, 31 Aug 2022 12:30:38 +0000
|
||||
Subject: [PATCH] Add mctx attach/detach when creating/destroying a memory pool
|
||||
|
||||
This should make sure that the memory context is not destroyed
|
||||
before the memory pool, which is using the context.
|
||||
|
||||
(cherry picked from commit e97c3eea954e055634b72c21325d2611e960ee94)
|
||||
---
|
||||
lib/isc/mem.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/isc/mem.c b/lib/isc/mem.c
|
||||
index f84d300..33ece7a 100644
|
||||
--- a/lib/isc/mem.c
|
||||
+++ b/lib/isc/mem.c
|
||||
@@ -1656,7 +1656,8 @@ isc_mempool_create(isc_mem_t *mctx0, size_t size, isc_mempool_t **mpctxp) {
|
||||
mpctx->common.impmagic = MEMPOOL_MAGIC;
|
||||
mpctx->common.magic = ISCAPI_MPOOL_MAGIC;
|
||||
mpctx->lock = NULL;
|
||||
- mpctx->mctx = mctx;
|
||||
+ mpctx->mctx = NULL;
|
||||
+ isc_mem_attach((isc_mem_t *)mctx, (isc_mem_t **)&mpctx->mctx);
|
||||
/*
|
||||
* Mempools are stored as a linked list of element.
|
||||
*/
|
||||
@@ -1765,7 +1766,8 @@ isc_mempool_destroy(isc_mempool_t **mpctxp) {
|
||||
mpctx->common.impmagic = 0;
|
||||
mpctx->common.magic = 0;
|
||||
|
||||
- isc_mem_put((isc_mem_t *)mpctx->mctx, mpctx, sizeof(isc__mempool_t));
|
||||
+ isc_mem_putanddetach((isc_mem_t **)&mpctx->mctx, mpctx,
|
||||
+ sizeof(isc__mempool_t));
|
||||
|
||||
if (lock != NULL) {
|
||||
UNLOCK(lock);
|
||||
--
|
||||
2.43.2
|
||||
|
@ -1,66 +0,0 @@
|
||||
From 103b09187466b2afbff7e204d166d21e2fbb057c Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Wed, 21 Feb 2024 11:54:27 +0100
|
||||
Subject: [PATCH] Downstream specific changes related to KeyTrap
|
||||
|
||||
Fix for CVE-2023-50387 introduced new additional thread. But because
|
||||
isc_hp functions were removed from later bind 9.16 release, their
|
||||
changes did not contain increase of hazard pointers max thread limit.
|
||||
To prevent obscure memory corruption increase thread max size.
|
||||
|
||||
In addition place at least few INSISTs to check this is catched before
|
||||
random memory overwrites begins. It would be quite difficult to track
|
||||
without any check.
|
||||
---
|
||||
lib/isc/hp.c | 3 +++
|
||||
lib/isc/managers.c | 5 +++--
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/isc/hp.c b/lib/isc/hp.c
|
||||
index 92d160b..5f9bbf7 100644
|
||||
--- a/lib/isc/hp.c
|
||||
+++ b/lib/isc/hp.c
|
||||
@@ -138,6 +138,7 @@ isc_hp_destroy(isc_hp_t *hp) {
|
||||
|
||||
void
|
||||
isc_hp_clear(isc_hp_t *hp) {
|
||||
+ INSIST(tid() < isc__hp_max_threads);
|
||||
for (int i = 0; i < hp->max_hps; i++) {
|
||||
atomic_store_release(&hp->hp[tid()][i], 0);
|
||||
}
|
||||
@@ -152,6 +153,7 @@ uintptr_t
|
||||
isc_hp_protect(isc_hp_t *hp, int ihp, atomic_uintptr_t *atom) {
|
||||
uintptr_t n = 0;
|
||||
uintptr_t ret;
|
||||
+ INSIST(tid() < isc__hp_max_threads);
|
||||
while ((ret = atomic_load(atom)) != n) {
|
||||
atomic_store(&hp->hp[tid()][ihp], ret);
|
||||
n = ret;
|
||||
@@ -173,6 +175,7 @@ isc_hp_protect_release(isc_hp_t *hp, int ihp, atomic_uintptr_t ptr) {
|
||||
|
||||
void
|
||||
isc_hp_retire(isc_hp_t *hp, uintptr_t ptr) {
|
||||
+ INSIST(tid() < isc__hp_max_threads);
|
||||
hp->rl[tid()]->list[hp->rl[tid()]->size++] = ptr;
|
||||
INSIST(hp->rl[tid()]->size < isc__hp_max_retired);
|
||||
|
||||
diff --git a/lib/isc/managers.c b/lib/isc/managers.c
|
||||
index c39a650..3bdca99 100644
|
||||
--- a/lib/isc/managers.c
|
||||
+++ b/lib/isc/managers.c
|
||||
@@ -25,9 +25,10 @@ isc_managers_create(isc_mem_t *mctx, size_t workers, size_t quantum,
|
||||
|
||||
/*
|
||||
* We have ncpus network threads, ncpus old network threads - make
|
||||
- * it 4x just to be on the safe side.
|
||||
+ * it 4x just to be on the safe side. One additional for slow netmgr
|
||||
+ * thread.
|
||||
*/
|
||||
- isc_hp_init(4 * workers);
|
||||
+ isc_hp_init(5 * workers);
|
||||
|
||||
REQUIRE(netmgrp != NULL && *netmgrp == NULL);
|
||||
isc__netmgr_create(mctx, workers, &netmgr);
|
||||
--
|
||||
2.43.2
|
||||
|
@ -1,60 +0,0 @@
|
||||
From 3a161af91bffcd457586ab466e32ac8484028763 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
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 | 35 +++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 35 insertions(+)
|
||||
|
||||
diff --git a/bin/named/named.rst b/bin/named/named.rst
|
||||
index 6fd8f87..3cd6350 100644
|
||||
--- a/bin/named/named.rst
|
||||
+++ b/bin/named/named.rst
|
||||
@@ -228,6 +228,41 @@ 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.
|
||||
+
|
||||
+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.
|
||||
+
|
||||
+*With this extra security comes some restrictions:*
|
||||
+
|
||||
+By default, the SELinux policy does not allow named to write outside directory
|
||||
+/var/named. That directory used to be read-only for named, but write access is
|
||||
+enabled by default now.
|
||||
+
|
||||
+The "named" group must be granted read privelege to
|
||||
+these files in order for named to be enabled to read them.
|
||||
+Any file updated by named must be writeable by named user or named group.
|
||||
+
|
||||
+Any file created in the zone database file directory is automatically assigned
|
||||
+the SELinux file context *named_zone_t* .
|
||||
+
|
||||
+The Red Hat BIND distribution and SELinux policy creates three directories where
|
||||
+named were allowed to create and modify files: */var/named/slaves*, */var/named/dynamic*
|
||||
+*/var/named/data*. The service is able to write and file under */var/named* with appropriate
|
||||
+permissions. They are used for better organisation of zones and backward compatibility.
|
||||
+Files in these directories are automatically assigned the '*named_cache_t*'
|
||||
+file context, which SELinux always allows named to write.
|
||||
+
|
||||
See Also
|
||||
~~~~~~~~
|
||||
|
||||
--
|
||||
2.26.2
|
||||
|
@ -1,216 +0,0 @@
|
||||
From b1871274cd2c97b63f3b90d608b7f8936d4ff3c5 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Andrews <marka@isc.org>
|
||||
Date: Wed, 24 Aug 2022 12:21:50 +1000
|
||||
Subject: [PATCH] Have dns_zt_apply lock the zone table
|
||||
|
||||
There where a number of places where the zone table should have
|
||||
been locked, but wasn't, when dns_zt_apply was called.
|
||||
|
||||
Added a isc_rwlocktype_t type parameter to dns_zt_apply and adjusted
|
||||
all calls to using it. Removed locks in callers.
|
||||
|
||||
Modified upstream commit for v9_16
|
||||
---
|
||||
bin/named/server.c | 12 +++++++-----
|
||||
bin/named/statschannel.c | 12 +++++++-----
|
||||
lib/dns/include/dns/zt.h | 3 ++-
|
||||
lib/dns/tests/zt_test.c | 4 ++--
|
||||
lib/dns/view.c | 3 ++-
|
||||
lib/dns/zt.c | 29 ++++++++++++++++++-----------
|
||||
6 files changed, 38 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/bin/named/server.c b/bin/named/server.c
|
||||
index 860ccae..c2a5887 100644
|
||||
--- a/bin/named/server.c
|
||||
+++ b/bin/named/server.c
|
||||
@@ -9458,7 +9458,8 @@ cleanup:
|
||||
if (result == ISC_R_SUCCESS && strcmp(view->name, "_bind") != 0)
|
||||
{
|
||||
dns_view_setviewrevert(view);
|
||||
- (void)dns_zt_apply(view->zonetable, false, NULL,
|
||||
+ (void)dns_zt_apply(view->zonetable,
|
||||
+ isc_rwlocktype_read, false, NULL,
|
||||
removed, view);
|
||||
}
|
||||
dns_view_detach(&view);
|
||||
@@ -10901,8 +10902,8 @@ add_view_tolist(struct dumpcontext *dctx, dns_view_t *view) {
|
||||
ISC_LIST_INIT(vle->zonelist);
|
||||
ISC_LIST_APPEND(dctx->viewlist, vle, link);
|
||||
if (dctx->dumpzones) {
|
||||
- result = dns_zt_apply(view->zonetable, true, NULL,
|
||||
- add_zone_tolist, dctx);
|
||||
+ result = dns_zt_apply(view->zonetable, isc_rwlocktype_read,
|
||||
+ true, NULL, add_zone_tolist, dctx);
|
||||
}
|
||||
return (result);
|
||||
}
|
||||
@@ -12248,8 +12249,9 @@ named_server_sync(named_server_t *server, isc_lex_t *lex, isc_buffer_t **text) {
|
||||
for (view = ISC_LIST_HEAD(server->viewlist); view != NULL;
|
||||
view = ISC_LIST_NEXT(view, link))
|
||||
{
|
||||
- result = dns_zt_apply(view->zonetable, false, NULL,
|
||||
- synczone, &cleanup);
|
||||
+ result = dns_zt_apply(view->zonetable,
|
||||
+ isc_rwlocktype_none, false,
|
||||
+ NULL, synczone, &cleanup);
|
||||
if (result != ISC_R_SUCCESS && tresult == ISC_R_SUCCESS)
|
||||
{
|
||||
tresult = result;
|
||||
diff --git a/bin/named/statschannel.c b/bin/named/statschannel.c
|
||||
index 8ff2567..832ce93 100644
|
||||
--- a/bin/named/statschannel.c
|
||||
+++ b/bin/named/statschannel.c
|
||||
@@ -2296,8 +2296,9 @@ generatexml(named_server_t *server, uint32_t flags, int *buflen,
|
||||
if ((flags & STATS_XML_ZONES) != 0) {
|
||||
TRY0(xmlTextWriterStartElement(writer,
|
||||
ISC_XMLCHAR "zones"));
|
||||
- result = dns_zt_apply(view->zonetable, true, NULL,
|
||||
- zone_xmlrender, writer);
|
||||
+ result = dns_zt_apply(view->zonetable,
|
||||
+ isc_rwlocktype_read, true,
|
||||
+ NULL, zone_xmlrender, writer);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto error;
|
||||
}
|
||||
@@ -3069,9 +3070,10 @@ generatejson(named_server_t *server, size_t *msglen, const char **msg,
|
||||
CHECKMEM(za);
|
||||
|
||||
if ((flags & STATS_JSON_ZONES) != 0) {
|
||||
- result = dns_zt_apply(view->zonetable, true,
|
||||
- NULL, zone_jsonrender,
|
||||
- za);
|
||||
+ result = dns_zt_apply(view->zonetable,
|
||||
+ isc_rwlocktype_read,
|
||||
+ true, NULL,
|
||||
+ zone_jsonrender, za);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto error;
|
||||
}
|
||||
diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h
|
||||
index 4a1b263..1c6c789 100644
|
||||
--- a/lib/dns/include/dns/zt.h
|
||||
+++ b/lib/dns/include/dns/zt.h
|
||||
@@ -168,7 +168,8 @@ dns_zt_freezezones(dns_zt_t *zt, dns_view_t *view, bool freeze);
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
+dns_zt_apply(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop,
|
||||
+ isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap);
|
||||
/*%<
|
||||
* Apply a given 'action' to all zone zones in the table.
|
||||
diff --git a/lib/dns/tests/zt_test.c b/lib/dns/tests/zt_test.c
|
||||
index 7945a0b..bfacb94 100644
|
||||
--- a/lib/dns/tests/zt_test.c
|
||||
+++ b/lib/dns/tests/zt_test.c
|
||||
@@ -136,8 +136,8 @@ apply(void **state) {
|
||||
assert_non_null(view->zonetable);
|
||||
|
||||
assert_int_equal(nzones, 0);
|
||||
- result = dns_zt_apply(view->zonetable, false, NULL, count_zone,
|
||||
- &nzones);
|
||||
+ result = dns_zt_apply(view->zonetable, isc_rwlocktype_read, false,
|
||||
+ NULL, count_zone, &nzones);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
assert_int_equal(nzones, 1);
|
||||
|
||||
diff --git a/lib/dns/view.c b/lib/dns/view.c
|
||||
index 8c7e40a..dcb0f18 100644
|
||||
--- a/lib/dns/view.c
|
||||
+++ b/lib/dns/view.c
|
||||
@@ -704,7 +704,8 @@ dns_view_dialup(dns_view_t *view) {
|
||||
REQUIRE(DNS_VIEW_VALID(view));
|
||||
REQUIRE(view->zonetable != NULL);
|
||||
|
||||
- (void)dns_zt_apply(view->zonetable, false, NULL, dialup, NULL);
|
||||
+ (void)dns_zt_apply(view->zonetable, isc_rwlocktype_read, false,
|
||||
+ NULL, dialup, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
diff --git a/lib/dns/zt.c b/lib/dns/zt.c
|
||||
index 8ca9cd6..1bfc308 100644
|
||||
--- a/lib/dns/zt.c
|
||||
+++ b/lib/dns/zt.c
|
||||
@@ -223,7 +223,8 @@ flush(dns_zone_t *zone, void *uap) {
|
||||
static void
|
||||
zt_destroy(dns_zt_t *zt) {
|
||||
if (atomic_load_acquire(&zt->flush)) {
|
||||
- (void)dns_zt_apply(zt, false, NULL, flush, NULL);
|
||||
+ (void)dns_zt_apply(zt, isc_rwlocktype_none, false, NULL,
|
||||
+ flush, NULL);
|
||||
}
|
||||
dns_rbt_destroy(&zt->table);
|
||||
isc_rwlock_destroy(&zt->rwlock);
|
||||
@@ -265,9 +266,8 @@ dns_zt_load(dns_zt_t *zt, bool stop, bool newonly) {
|
||||
struct zt_load_params params;
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
params.newonly = newonly;
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply(zt, stop, NULL, load, ¶ms);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply(zt, isc_rwlocktype_read, stop, NULL, load,
|
||||
+ ¶ms);
|
||||
return (result);
|
||||
}
|
||||
|
||||
@@ -338,9 +338,8 @@ dns_zt_asyncload(dns_zt_t *zt, bool newonly, dns_zt_allloaded_t alldone,
|
||||
zt->loaddone = alldone;
|
||||
zt->loaddone_arg = arg;
|
||||
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply(zt, false, NULL, asyncload, zt);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply(zt, isc_rwlocktype_read, false, NULL,
|
||||
+ asyncload, zt);
|
||||
|
||||
/*
|
||||
* Have all the loads completed?
|
||||
@@ -386,9 +385,8 @@ dns_zt_freezezones(dns_zt_t *zt, dns_view_t *view, bool freeze) {
|
||||
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
|
||||
- RWLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
- result = dns_zt_apply(zt, false, &tresult, freezezones, ¶ms);
|
||||
- RWUNLOCK(&zt->rwlock, isc_rwlocktype_read);
|
||||
+ result = dns_zt_apply(zt, isc_rwlocktype_read, false, &tresult,
|
||||
+ freezezones, ¶ms);
|
||||
if (tresult == ISC_R_NOTFOUND) {
|
||||
tresult = ISC_R_SUCCESS;
|
||||
}
|
||||
@@ -522,7 +520,8 @@ dns_zt_setviewrevert(dns_zt_t *zt) {
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
-dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
+dns_zt_apply(dns_zt_t *zt, isc_rwlocktype_t lock, bool stop,
|
||||
+ isc_result_t *sub,
|
||||
isc_result_t (*action)(dns_zone_t *, void *), void *uap) {
|
||||
dns_rbtnode_t *node;
|
||||
dns_rbtnodechain_t chain;
|
||||
@@ -532,6 +531,10 @@ dns_zt_apply(dns_zt_t *zt, bool stop, isc_result_t *sub,
|
||||
REQUIRE(VALID_ZT(zt));
|
||||
REQUIRE(action != NULL);
|
||||
|
||||
+ if (lock != isc_rwlocktype_none) {
|
||||
+ RWLOCK(&zt->rwlock, lock);
|
||||
+ }
|
||||
+
|
||||
dns_rbtnodechain_init(&chain);
|
||||
result = dns_rbtnodechain_first(&chain, zt->table, NULL, NULL);
|
||||
if (result == ISC_R_NOTFOUND) {
|
||||
@@ -568,6 +571,10 @@ cleanup:
|
||||
*sub = tresult;
|
||||
}
|
||||
|
||||
+ if (lock != isc_rwlocktype_none) {
|
||||
+ RWUNLOCK(&zt->rwlock, lock);
|
||||
+ }
|
||||
+
|
||||
return (result);
|
||||
}
|
||||
|
||||
--
|
||||
2.39.2
|
||||
|
@ -1,31 +0,0 @@
|
||||
From 606fc6d4aa8e8884f53f53e72dc1bd7babf37a47 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
|
||||
Date: Mon, 16 Jan 2023 11:06:48 +0000
|
||||
Subject: [PATCH] Merge branch 'feature/main/zt-rwlock.h' into 'main'
|
||||
|
||||
Include isc_rwlocktype_t type definition in zt.h
|
||||
|
||||
See merge request isc-projects/bind9!7376
|
||||
|
||||
(cherry picked from commit d7bcdf8bd6c5395726f708535120ce9a97eaa935)
|
||||
|
||||
395d6fca Include isc_rwlocktype_t type definition in zt.h
|
||||
---
|
||||
lib/dns/include/dns/zt.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/dns/include/dns/zt.h b/lib/dns/include/dns/zt.h
|
||||
index 189092bc3b..2964fc971f 100644
|
||||
--- a/lib/dns/include/dns/zt.h
|
||||
+++ b/lib/dns/include/dns/zt.h
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
+#include <isc/rwlock.h>
|
||||
|
||||
#include <dns/types.h>
|
||||
|
||||
--
|
||||
2.39.0
|
||||
|
@ -1,33 +0,0 @@
|
||||
From 7cc9fd1870e5264abd885ed2c419034945121d0f Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Mon, 19 Feb 2024 22:13:52 +0100
|
||||
Subject: [PATCH] Define variants to empty values
|
||||
|
||||
DNSSEC_VARIANT and NAMED_VARIANT are special Red Hat modifications to
|
||||
allow testing or alternative rebuilds, with support for pkcs11 or sdb.
|
||||
But undefined value breaks some tests, so define them to empty values.
|
||||
That means normal build variant.
|
||||
|
||||
Required to pass upstream test suite cds test correctly.
|
||||
---
|
||||
bin/tests/system/conf.sh.in | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/bin/tests/system/conf.sh.in b/bin/tests/system/conf.sh.in
|
||||
index 7b2b309..c2d6526 100644
|
||||
--- a/bin/tests/system/conf.sh.in
|
||||
+++ b/bin/tests/system/conf.sh.in
|
||||
@@ -24,6 +24,10 @@ TMPDIR=${TMPDIR:-/tmp}
|
||||
# This is not the windows build.
|
||||
CYGWIN=""
|
||||
|
||||
+# RH specific, allow variants testing
|
||||
+: ${DNSSEC_VARIANT:=}
|
||||
+: ${NAMED_VARIANT:=}
|
||||
+
|
||||
# Load common values shared between windows and unix/linux.
|
||||
. $TOP/bin/tests/system/conf.sh.common
|
||||
|
||||
--
|
||||
2.43.2
|
||||
|
@ -1,17 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Comment: GPGTools - https://gpgtools.org
|
||||
|
||||
iQIzBAABAgAdFiEEqtu6UHTxQC97adVrxbTukxqfnf0FAmGKhMcACgkQxbTukxqf
|
||||
nf1EbQ//YXsBbMtyI3c0MoleSi5zwzcpCTZTWTFHqH5WUiruLMDF453j/Fn2zaSC
|
||||
WuaUnhN61dR+BVtX+D2Y8GiVQFICo5X1nJj0jb/TcflXFq7YLWUAO0NPwPkBL1J4
|
||||
/PA0YCp1zYcvBXIxTKaU7AcBxlKmcGLdZcgCyGU6NSKaOJSxHOWXM460uD/crskB
|
||||
iSPEbMevN9TTJs9webztJNKH/3BuNkOD9SFb6JlUIQqwKx1v8rosgdI7BvgGMZqy
|
||||
s+10+GlIRFFvsX2XkX8BnjDlQ1QdzDOAoyCU+Se9rXDqu+zZf1VN4ReUCSDuPYf9
|
||||
z+GW1EbMxuZzEKrEIJvhnVNNiHqtKVaK6IIUX5bHqgPLEx87HxJMOPmbyBc1kDAe
|
||||
0WCmsITaq62WvKOG8Ho8wLrlG4AAO5+A7xit4bJ4XUtLiqyt+9FUIeEFY9nZb/6O
|
||||
OXK9eBMZHZ++r52RtA+GYZllkNRpzwnULOdR/9svVQuc10/MjnRoFqInzLlqwfwm
|
||||
2q6r372oWn8+MUvjQVBgzprn5BvY+HDo2gNEYEi5QyR3ql2dX/Qz7iUdUfhRvMNL
|
||||
FdPt3B3kktfOV98p/imrIwLwVVWwKBlphntkRxLtSZBs3nbo27F/ND54fixC2eCa
|
||||
epB6FF5IquzQ/MOiz4uql3YexNDQQ+7N2IGPJVMwO2ILAyZDNOQ=
|
||||
=pVtf
|
||||
-----END PGP SIGNATURE-----
|
@ -1,29 +0,0 @@
|
||||
From 274463c5b71db87a615694889da23837ba48db9a Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Tue, 16 Jul 2024 19:49:26 +0200
|
||||
Subject: [PATCH] Resolve CVE-2024-4076
|
||||
|
||||
6403. [security] qctx-zversion was not being cleared when it should have
|
||||
been leading to an assertion failure if it needed to be
|
||||
reused. (CVE-2024-4076) [GL #4507]
|
||||
|
||||
Resolves: CVE-2024-4076
|
||||
---
|
||||
lib/ns/query.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/ns/query.c b/lib/ns/query.c
|
||||
index 537d332..be4cbb6 100644
|
||||
--- a/lib/ns/query.c
|
||||
+++ b/lib/ns/query.c
|
||||
@@ -5325,6 +5325,7 @@ qctx_freedata(query_ctx_t *qctx) {
|
||||
ns_client_releasename(qctx->client, &qctx->zfname);
|
||||
dns_db_detachnode(qctx->zdb, &qctx->znode);
|
||||
dns_db_detach(&qctx->zdb);
|
||||
+ qctx->zversion = NULL;
|
||||
}
|
||||
|
||||
if (qctx->event != NULL && !qctx->client->nodetach) {
|
||||
--
|
||||
2.45.2
|
||||
|
@ -0,0 +1,63 @@
|
||||
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
|
@ -0,0 +1,98 @@
|
||||
From facdbb0f2a266c6a3a1fa823afaa09cbd3fc38a5 Mon Sep 17 00:00:00 2001
|
||||
From: Petr Mensik <pemensik@redhat.com>
|
||||
Date: Thu, 26 Nov 2020 12:13:10 +0100
|
||||
Subject: [PATCH] Note specific Red Hat changes in manual page
|
||||
|
||||
Change docbook template instead of generated manual page. Remove
|
||||
system-config-bind reference, package were discontinued.
|
||||
---
|
||||
bin/named/named.docbook | 73 +++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 73 insertions(+)
|
||||
|
||||
diff --git a/bin/named/named.docbook b/bin/named/named.docbook
|
||||
index 7e743a9..802bec3 100644
|
||||
--- a/bin/named/named.docbook
|
||||
+++ b/bin/named/named.docbook
|
||||
@@ -516,6 +516,79 @@
|
||||
|
||||
</refsection>
|
||||
|
||||
+ <refsection><info><title>NOTES</title></info>
|
||||
+ <refsection><info><title>Red Hat SELinux BIND Security Profile</title></info>
|
||||
+
|
||||
+ <para>
|
||||
+ 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.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ 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.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ With this extra security comes some restrictions:
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ By default, the SELinux policy allows 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.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ The "named" group must be granted read privelege to
|
||||
+ these files in order for named to be enabled to read them.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ Any file created in the zone database file directory is automatically assigned
|
||||
+ the SELinux file context named_zone_t .
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ 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.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ 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
|
||||
+ 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'
|
||||
+ file context, which SELinux allows named to write.
|
||||
+ </para>
|
||||
+ </refsection>
|
||||
+
|
||||
+ <refsection><info><title>Red Hat BIND SDB support</title></info>
|
||||
+
|
||||
+ <para>
|
||||
+ 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.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ The SDB modules for LDAP, PostGreSQL, DirDB and SQLite are compiled into <command>named-sdb</command>.
|
||||
+ </para>
|
||||
+
|
||||
+ <para>
|
||||
+ See the documentation for the various SDB modules in /usr/share/doc/bind-sdb-*/ .
|
||||
+ </para>
|
||||
+ </refsection>
|
||||
+
|
||||
+ </refsection>
|
||||
+
|
||||
<refsection><info><title>SEE ALSO</title></info>
|
||||
|
||||
<para><citetitle>RFC 1033</citetitle>,
|
||||
--
|
||||
2.26.2
|
||||
|
@ -0,0 +1,511 @@
|
||||
diff --git a/bin/sdb_tools/Makefile.in b/bin/sdb_tools/Makefile.in
|
||||
index 95ab742..5059a17 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@ zonetodb@EXEEXT@ zone2sqlite@EXEEXT@ ldap2zone@EXEEXT@
|
||||
|
||||
-OBJS = zone2ldap.@O@ zonetodb.@O@ zone2sqlite.@O@
|
||||
+OBJS = zone2ldap.@O@ zonetodb.@O@ zone2sqlite.@O@ ldap2zone.@O@
|
||||
|
||||
-SRCS = zone2ldap.c zonetodb.c zone2sqlite.c
|
||||
+SRCS = zone2ldap.c zonetodb.c zone2sqlite.c ldap2zone.c
|
||||
|
||||
MANPAGES = zone2ldap.1
|
||||
|
||||
@@ -47,6 +47,9 @@ EXT_CFLAGS =
|
||||
zone2ldap@EXEEXT@: zone2ldap.@O@ ${DEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zone2ldap.@O@ -lldap -llber ${LIBS}
|
||||
|
||||
+ldap2zone@EXEEXT@: ldap2zone.@O@ ${DEPLIBS}
|
||||
+ ${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${ALL_CFLAGS} ${LDFLAGS} -o $@ ldap2zone.@O@ -lldap -llber ${LIBS}
|
||||
+
|
||||
zonetodb@EXEEXT@: zonetodb.@O@ ${DEPLIBS}
|
||||
${LIBTOOL_MODE_LINK} ${PURIFY} ${CC} ${CFLAGS} ${LDFLAGS} -o $@ zonetodb.@O@ -lpq ${LIBS}
|
||||
|
||||
@@ -64,4 +67,5 @@ 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}
|
||||
+ ${LIBTOOL_MODE_INSTALL} ${INSTALL_PROGRAM} ldap2zone@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 e0e9207..d59936c 100644
|
||||
--- a/bin/sdb_tools/zone2ldap.c
|
||||
+++ b/bin/sdb_tools/zone2ldap.c
|
||||
@@ -73,7 +73,7 @@ void add_ldap_values (ldap_info * ldinfo);
|
||||
void init_ldap_conn (void);
|
||||
|
||||
/* Ldap error checking */
|
||||
-void ldap_result_check (const char *msg, char *dn, int err);
|
||||
+void ldap_result_check (const char *msg, const char *dn, int err);
|
||||
|
||||
/* Put a hostname into a char ** array */
|
||||
char **hostname_to_dn_list (char *hostname, char *zone, unsigned int flags);
|
||||
@@ -82,7 +82,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 +104,26 @@ 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;
|
||||
|
||||
@@ -120,7 +135,7 @@ static void
|
||||
fatal(const char *msg) {
|
||||
perror(msg);
|
||||
if (conn != NULL)
|
||||
- ldap_unbind_s(conn);
|
||||
+ ldap_unbind_ext_s(conn, NULL, NULL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -132,12 +147,13 @@ 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 *zn, *dcp[2], *znp[2], *rdn[2];
|
||||
dns_fixedname_t fixedzone, fixedname;
|
||||
dns_rdataset_t rdataset;
|
||||
char **dc_list;
|
||||
@@ -150,7 +166,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 +174,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 +197,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)
|
||||
@@ -302,17 +321,51 @@ main (int argc, char **argv)
|
||||
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);
|
||||
+ 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)]; ctmp >= &basedn[0]; ctmp--)
|
||||
+ for (ctmp = &basedn[strlen (basedn)], dcn=0; ctmp >= &basedn[0]; ctmp--)
|
||||
{
|
||||
if ((*ctmp == ',') || (ctmp == &basedn[0]))
|
||||
{
|
||||
base.mod_op = LDAP_MOD_ADD;
|
||||
- base.mod_type = (char*)"objectClass";
|
||||
+ base.mod_type = objectClass;
|
||||
base.mod_values = (char**)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)
|
||||
{
|
||||
@@ -329,6 +382,10 @@ 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 ("initial ldap_add_s", fullbasedn, result);
|
||||
}
|
||||
@@ -408,14 +465,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 +512,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,10 +540,10 @@ 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;
|
||||
@@ -497,7 +555,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 +584,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 +597,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);
|
||||
+ memcpy(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 +626,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 +700,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,30 +775,38 @@ 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;
|
||||
- static char dn[1024];
|
||||
- char tmp[128];
|
||||
+ int x, znlen;
|
||||
+ static char dn[DNS_NAME_MAXTEXT*3/2];
|
||||
+ char tmp[DNS_NAME_MAXTEXT*3/2];
|
||||
+ 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);
|
||||
+ snprintf (tmp, sizeof(tmp), "zoneName=%s + relativeDomainName=%s,", zone, dc_list[x]);
|
||||
else if (x == (size - 2))
|
||||
- sprintf(tmp, "relativeDomainName=%s,",dc_list[x]);
|
||||
+ snprintf(tmp, sizeof(tmp), "zoneName=%s + relativeDomainName=%s,", zone, dc_list[x]);
|
||||
else
|
||||
- sprintf(tmp,"dc=%s,", dc_list[x]);
|
||||
+ snprintf(tmp, sizeof(tmp), "dc=%s,", dc_list[x]);
|
||||
}
|
||||
else
|
||||
{
|
||||
- sprintf(tmp, "dc=%s,", dc_list[x]);
|
||||
+ snprintf(tmp, sizeof(tmp), "dc=%s,", dc_list[x]);
|
||||
}
|
||||
|
||||
|
||||
@@ -732,19 +835,18 @@ 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", "LDAP Bind", result);
|
||||
}
|
||||
|
||||
/* Like isc_result_check, only for LDAP */
|
||||
void
|
||||
-ldap_result_check (const char *msg, char *dn, int err)
|
||||
+ldap_result_check (const char *msg, const char *dn, int err)
|
||||
{
|
||||
if ((err != LDAP_SUCCESS) && (err != LDAP_ALREADY_EXISTS))
|
||||
{
|
||||
- fprintf(stderr, "Error while adding %s (%s):\n",
|
||||
- dn, msg);
|
||||
- ldap_perror (conn, dn);
|
||||
- ldap_unbind_s (conn);
|
||||
+ fprintf(stderr, "Error while adding %s (%s):\n%s",
|
||||
+ dn, msg, ldap_err2string(err));
|
||||
+ ldap_unbind_ext_s (conn, NULL, NULL);
|
||||
exit (-1);
|
||||
}
|
||||
}
|
||||
@@ -758,16 +860,15 @@ 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 +877,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 ");}
|
@ -0,0 +1,230 @@
|
||||
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 <dns/lib.h>
|
||||
#include <dns/ttl.h>
|
||||
|
||||
-#include <named/bdb.h>
|
||||
+#include "bdb.h"
|
||||
#include <named/globals.h>
|
||||
#include <named/config.h>
|
||||
|
||||
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 <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
-#include <pgsql/libpq-fe.h>
|
||||
+#include <libpq-fe.h>
|
||||
|
||||
#include <isc/mem.h>
|
||||
#include <isc/print.h>
|
||||
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 <dns/rdatatype.h>
|
||||
#include <dns/result.h>
|
||||
|
||||
-#include <pgsql/libpq-fe.h>
|
||||
+#include <libpq-fe.h>
|
||||
|
||||
/*
|
||||
* 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];
|
@ -0,0 +1,54 @@
|
||||
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
|
||||
--- 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()
|
||||
{
|
||||
@@ -132,6 +143,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
|
@ -0,0 +1,42 @@
|
||||
diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c
|
||||
index c06c804..e75b8b7 100644
|
||||
--- a/bin/dig/dighost.c
|
||||
+++ b/bin/dig/dighost.c
|
||||
@@ -1816,6 +1816,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)
|
||||
@@ -1841,10 +1848,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);
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -2895,9 +2899,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;
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
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 <config.h>
|
||||
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 <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
@ -1,34 +1,81 @@
|
||||
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 cd44fe3..5b7c539 100644
|
||||
index a8955bc..fc6103b 100644
|
||||
--- a/lib/isc/lex.c
|
||||
+++ b/lib/isc/lex.c
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <isc/string.h>
|
||||
#include <isc/util.h>
|
||||
@@ -434,17 +434,14 @@ isc_lex_gettoken(isc_lex_t *lex, unsigned int options, isc_token_t *tokenp) {
|
||||
if (source->is_file) {
|
||||
stream = source->input;
|
||||
|
||||
+#include "../errno2result.h"
|
||||
+
|
||||
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)) {
|
||||
-#if defined(HAVE_FLOCKFILE) && defined(HAVE_GETCUNLOCKED)
|
||||
- c = getc_unlocked(stream);
|
||||
-#else
|
||||
- c = getc(stream);
|
||||
-#endif
|
||||
- if (c == EOF) {
|
||||
- if (ferror(stream)) {
|
||||
- source->result = ISC_R_IOERROR;
|
||||
+ source->result = isc__errno2result(errno);
|
||||
result = source->result;
|
||||
- result = source->result;
|
||||
+ result = isc_stdio_fgetc(stream, &c);
|
||||
+
|
||||
+ if (result != ISC_R_SUCCESS) {
|
||||
+ if (result != ISC_R_EOF) {
|
||||
+ 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 e3e2644..5e58600 100644
|
||||
index 2f12bcc..5bfd648 100644
|
||||
--- a/lib/isc/unix/errno2result.c
|
||||
+++ b/lib/isc/unix/errno2result.c
|
||||
@@ -37,6 +37,7 @@ isc___errno2result(int posixerrno, bool dolog, const char *file,
|
||||
case EINVAL: /* XXX sometimes this is not for files */
|
||||
@@ -40,6 +40,7 @@ isc___errno2result(int posixerrno, bool dolog,
|
||||
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 e60fa65..77f0b13 100644
|
||||
--- a/lib/isc/unix/stdio.c
|
||||
+++ b/lib/isc/unix/stdio.c
|
||||
@@ -149,3 +149,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 = fgets(f);
|
||||
+#endif
|
||||
+
|
||||
+ if (r == EOF)
|
||||
+ result = ferror(f) ? isc__errno2result(errno) : ISC_R_EOF;
|
||||
+
|
||||
+ *ret = r;
|
||||
+
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
|
@ -0,0 +1,51 @@
|
||||
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,
|
@ -1,31 +1,31 @@
|
||||
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
|
||||
index 31549c6..65a14b6 100644
|
||||
index ecb3ddb..f7f73cd 100644
|
||||
--- a/lib/dns/resolver.c
|
||||
+++ b/lib/dns/resolver.c
|
||||
@@ -1762,7 +1762,7 @@ log_edns(fetchctx_t *fctx) {
|
||||
@@ -1456,7 +1456,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);
|
||||
}
|
||||
@@ -5298,7 +5298,7 @@ log_lame(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo) {
|
||||
"success resolving '%s' (in '%s'?) after %s",
|
||||
fctx->info, domainbuf, fctx->reason);
|
||||
|
||||
@@ -4667,7 +4667,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);
|
||||
}
|
||||
@@ -5316,7 +5316,7 @@ log_formerr(fetchctx_t *fctx, const char *format, ...) {
|
||||
@@ -4685,7 +4685,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 for %s: %s", nsbuf,
|
||||
fctx->info, fctx->clientstr, msgbuf);
|
||||
"DNS format error from %s resolving %s for %s: %s",
|
||||
nsbuf, fctx->info, fctx->clientstr, msgbuf);
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
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)
|
@ -0,0 +1,44 @@
|
||||
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
|
||||
</para>
|
||||
</refsection>
|
||||
|
||||
+ <refsection><info><title>RETURN CODES</title></info>
|
||||
+ <para>
|
||||
+ <command>Dig</command> return codes are:
|
||||
+ <variablelist>
|
||||
+ <varlistentry>
|
||||
+ <listitem>
|
||||
+ <para>0: Everything went well, including things like NXDOMAIN</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <listitem>
|
||||
+ <para>1: Usage error</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <listitem>
|
||||
+ <para>8: Couldn't open batch file</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <listitem>
|
||||
+ <para>9: No reply from server</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ <varlistentry>
|
||||
+ <listitem>
|
||||
+ <para>10: Internal error</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+ </variablelist>
|
||||
+ </para>
|
||||
+ </refsection>
|
||||
+
|
||||
<refsection><info><title>FILES</title></info>
|
||||
|
||||
<para><filename>/etc/resolv.conf</filename>
|
@ -1,534 +0,0 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
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||
H6oXl6Ej4GR3t5uWwHKvEREQer+KPZV3uXRnrTpgITy+PxZ9ywmPwmPBHcD6c0P+
|
||||
g0lNNtDdvw69qy+oh7JaqqYaDvedseN39UgBSx++ewRhq0OTikAD/BCv1zhPizlD
|
||||
9BHAOsCxrgnz0WsONYKFAE8vtNo/wB//djf/zqMsI3iWdbWqM9e/muEEV4jQRWLW
|
||||
TWp1XTqqvkc6TsLBBNO5zisJ0VwSfDyRUplr/IWeUl9FrRngjBJqF2nl90US5p3o
|
||||
uk5wUWdjFa0haFyDgZNFwyFr85mex+o6qIC3oif7UjC4kHPe4wzvHDYAxrHMB6MY
|
||||
QvrcXzULmInot3qRAr5duUNbQbrjdtVvOQFvjowBP5Scu5ZBSzc0O2TUUSKgnJZS
|
||||
Bs7+yswfgyhYzusbxlOdA+iE2Y8GuovamGYTbsdCxDStOMfZnaiXuLL04Uy1PQ==
|
||||
=fX+D
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQINBF/u5KMBEAC0hPiTonjYEe5FqNzFn73KmcN8KGD2wzujmWWLnFXGEVDEpFcS
|
||||
ULQDshhCclwNeXUArUey4nficwpqUe+Xl2h4dP4z7yh3WiL5nA5JRjJjw8KJQGVW
|
||||
AkgiZTnJHH8DrzNt9LnDL516qMDJarTHemDUUUZLNxnuv0RDEhDxsXWiVCQZZcw/
|
||||
41yIY97uCf30dsDwnckVl3iEmYaGTYavWbKP60S8WaxO0YG57RI1etmlIQ0nMmka
|
||||
4bvFnwwb9Jdnwle4LIiRMCGymsheaKCKrEZgIJY+idyBuExLLykiL8iNBj2Pzi7z
|
||||
XSCniH9qcEwfqgZlP/KZwujLhGOc4c4peNwpuDGcmYZoAsUD8CZ8H/LU1FIR2A1u
|
||||
/UrRREtC8nNTDGxCckSMEquHNURfMk1QmDbJ9gaa9aOk0AArxuTxyj6Cn+KQd5l5
|
||||
0mN0R1sDVQq9xWdvnB7N0d3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/NTSCH1EqLsS4YhBTsjpc2T8AqUlgxKrilmLbrj64PXgMsQ9WYm5zwlC5
|
||||
UA5eky5YhETFJ25dIaplMm47aIbPSH5f9y5eYPkfOCoMu5oDzDzoXdH9V1YfsHqa
|
||||
8bboSgTdariC23x38E9PaWQNyY2MFKL6cFt2ilIsMSSD6JAm1x8kBtn1bBopG588
|
||||
7mTDtlqHCw/QrTuLreJG9KJ1dQFJ/Q42+csH09l081wlv4BBuVlN1Xmj+c2sWn90
|
||||
l1BPZfYHd9jhggI96yTZhfTfFbSMSuGPQyqHnwDYdA3cNj5BYievBkO5FZaCe9SZ
|
||||
4xcYgqlVpv15O7VrD+I=
|
||||
=Uugw
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -0,0 +1,148 @@
|
||||
# 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 ) )
|
@ -0,0 +1,41 @@
|
||||
.\" Copyright (C) 2004, 2005 Stig Venaas <venaas@uninett.no>
|
||||
.\"
|
||||
.\" 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
|
@ -0,0 +1,411 @@
|
||||
/*
|
||||
* Copyright (C) 2004, 2005 Stig Venaas <venaas@uninett.no>
|
||||
* $Id: ldap2zone.c,v 1.1 2007/07/24 15:18:00 atkac Exp $
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#define LDAP_DEPRECATED 1
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <ldap.h>
|
||||
|
||||
struct string {
|
||||
void *data;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
struct assstack_entry {
|
||||
struct string key;
|
||||
struct string val;
|
||||
struct assstack_entry *next;
|
||||
};
|
||||
|
||||
struct assstack_entry *assstack_find(struct assstack_entry *stack, struct string *key);
|
||||
void assstack_push(struct assstack_entry **stack, struct assstack_entry *item);
|
||||
void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item);
|
||||
void printsoa(struct string *soa);
|
||||
void printrrs(char *defaultttl, struct assstack_entry *item);
|
||||
void print_zone(char *defaultttl, struct assstack_entry *stack);
|
||||
void usage(char *name);
|
||||
void err(char *name, const char *msg);
|
||||
int putrr(struct assstack_entry **stack, struct berval *name, char *type, char *ttl, struct berval *val);
|
||||
|
||||
struct assstack_entry *assstack_find(struct assstack_entry *stack, struct string *key) {
|
||||
for (; stack; stack = stack->next)
|
||||
if (stack->key.len == key->len && !memcmp(stack->key.data, key->data, key->len))
|
||||
return stack;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void assstack_push(struct assstack_entry **stack, struct assstack_entry *item) {
|
||||
item->next = *stack;
|
||||
*stack = item;
|
||||
}
|
||||
|
||||
void assstack_insertbottom(struct assstack_entry **stack, struct assstack_entry *item) {
|
||||
struct assstack_entry *p;
|
||||
|
||||
item->next = NULL;
|
||||
if (!*stack) {
|
||||
*stack = item;
|
||||
return;
|
||||
}
|
||||
/* find end, should keep track of end somewhere */
|
||||
/* really a queue, not a stack */
|
||||
p = *stack;
|
||||
while (p->next)
|
||||
p = p->next;
|
||||
p->next = item;
|
||||
}
|
||||
|
||||
void printsoa(struct string *soa) {
|
||||
char *s;
|
||||
size_t i;
|
||||
|
||||
s = (char *)soa->data;
|
||||
i = 0;
|
||||
while (i < soa->len) {
|
||||
putchar(s[i]);
|
||||
if (s[i++] == ' ')
|
||||
break;
|
||||
}
|
||||
while (i < soa->len) {
|
||||
putchar(s[i]);
|
||||
if (s[i++] == ' ')
|
||||
break;
|
||||
}
|
||||
printf("(\n\t\t\t\t");
|
||||
while (i < soa->len) {
|
||||
putchar(s[i]);
|
||||
if (s[i++] == ' ')
|
||||
break;
|
||||
}
|
||||
printf("; Serialnumber\n\t\t\t\t");
|
||||
while (i < soa->len) {
|
||||
if (s[i] == ' ')
|
||||
break;
|
||||
putchar(s[i++]);
|
||||
}
|
||||
i++;
|
||||
printf("\t; Refresh\n\t\t\t\t");
|
||||
while (i < soa->len) {
|
||||
if (s[i] == ' ')
|
||||
break;
|
||||
putchar(s[i++]);
|
||||
}
|
||||
i++;
|
||||
printf("\t; Retry\n\t\t\t\t");
|
||||
while (i < soa->len) {
|
||||
if (s[i] == ' ')
|
||||
break;
|
||||
putchar(s[i++]);
|
||||
}
|
||||
i++;
|
||||
printf("\t; Expire\n\t\t\t\t");
|
||||
while (i < soa->len) {
|
||||
putchar(s[i++]);
|
||||
}
|
||||
printf(" )\t; Minimum TTL\n");
|
||||
}
|
||||
|
||||
void printrrs(char *defaultttl, struct assstack_entry *item) {
|
||||
struct assstack_entry *stack;
|
||||
char *s;
|
||||
int first;
|
||||
size_t i;
|
||||
char *ttl, *type;
|
||||
int top;
|
||||
|
||||
s = (char *)item->key.data;
|
||||
|
||||
if (item->key.len == 1 && *s == '@') {
|
||||
top = 1;
|
||||
printf("@\t");
|
||||
} else {
|
||||
top = 0;
|
||||
for (i = 0; i < item->key.len; i++)
|
||||
putchar(s[i]);
|
||||
if (item->key.len < 8)
|
||||
putchar('\t');
|
||||
putchar('\t');
|
||||
}
|
||||
|
||||
first = 1;
|
||||
for (stack = (struct assstack_entry *) item->val.data; stack; stack = stack->next) {
|
||||
ttl = (char *)stack->key.data;
|
||||
s = strchr(ttl, ' ');
|
||||
*s++ = '\0';
|
||||
type = s;
|
||||
|
||||
if (first)
|
||||
first = 0;
|
||||
else
|
||||
printf("\t\t");
|
||||
|
||||
if (strcmp(defaultttl, ttl))
|
||||
printf("%s", ttl);
|
||||
putchar('\t');
|
||||
|
||||
if (top) {
|
||||
top = 0;
|
||||
printf("IN\t%s\t", type);
|
||||
/* Should always be SOA here */
|
||||
if (!strcmp(type, "SOA")) {
|
||||
printsoa(&stack->val);
|
||||
continue;
|
||||
}
|
||||
} else
|
||||
printf("%s\t", type);
|
||||
|
||||
s = (char *)stack->val.data;
|
||||
for (i = 0; i < stack->val.len; i++)
|
||||
putchar(s[i]);
|
||||
putchar('\n');
|
||||
}
|
||||
}
|
||||
|
||||
void print_zone(char *defaultttl, struct assstack_entry *stack) {
|
||||
printf("$TTL %s\n", defaultttl);
|
||||
for (; stack; stack = stack->next)
|
||||
printrrs(defaultttl, stack);
|
||||
};
|
||||
|
||||
void usage(char *name) {
|
||||
fprintf(stderr, "Usage:%s zone-name LDAP-URL default-ttl [serial]\n", name);
|
||||
exit(1);
|
||||
};
|
||||
|
||||
void err(char *name, const char *msg) {
|
||||
fprintf(stderr, "%s: %s\n", name, msg);
|
||||
exit(1);
|
||||
};
|
||||
|
||||
int putrr(struct assstack_entry **stack, struct berval *name, char *type, char *ttl, struct berval *val) {
|
||||
struct string key;
|
||||
struct assstack_entry *rr, *rrdata;
|
||||
|
||||
/* Do nothing if name or value have 0 length */
|
||||
if (!name->bv_len || !val->bv_len)
|
||||
return 0;
|
||||
|
||||
/* see if already have an entry for this name */
|
||||
key.len = name->bv_len;
|
||||
key.data = name->bv_val;
|
||||
|
||||
rr = assstack_find(*stack, &key);
|
||||
if (!rr) {
|
||||
/* Not found, create and push new entry */
|
||||
rr = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
|
||||
if (!rr)
|
||||
return -1;
|
||||
rr->key.len = name->bv_len;
|
||||
rr->key.data = (void *) malloc(rr->key.len);
|
||||
if (!rr->key.data) {
|
||||
free(rr);
|
||||
return -1;
|
||||
}
|
||||
memcpy(rr->key.data, name->bv_val, name->bv_len);
|
||||
rr->val.len = sizeof(void *);
|
||||
rr->val.data = NULL;
|
||||
if (name->bv_len == 1 && *(char *)name->bv_val == '@')
|
||||
assstack_push(stack, rr);
|
||||
else
|
||||
assstack_insertbottom(stack, rr);
|
||||
}
|
||||
|
||||
rrdata = (struct assstack_entry *) malloc(sizeof(struct assstack_entry));
|
||||
if (!rrdata) {
|
||||
free(rr->key.data);
|
||||
free(rr);
|
||||
return -1;
|
||||
}
|
||||
rrdata->key.len = strlen(type) + strlen(ttl) + 1;
|
||||
rrdata->key.data = (void *) malloc(rrdata->key.len);
|
||||
if (!rrdata->key.data) {
|
||||
free(rrdata);
|
||||
free(rr->key.data);
|
||||
free(rr);
|
||||
return -1;
|
||||
}
|
||||
sprintf((char *)rrdata->key.data, "%s %s", ttl, type);
|
||||
|
||||
rrdata->val.len = val->bv_len;
|
||||
rrdata->val.data = (void *) malloc(val->bv_len);
|
||||
if (!rrdata->val.data) {
|
||||
free(rrdata->key.data);
|
||||
free(rrdata);
|
||||
free(rr->key.data);
|
||||
free(rr);
|
||||
return -1;
|
||||
}
|
||||
memcpy(rrdata->val.data, val->bv_val, val->bv_len);
|
||||
|
||||
if (!strcmp(type, "SOA"))
|
||||
assstack_push((struct assstack_entry **) &(rr->val.data), rrdata);
|
||||
else
|
||||
assstack_insertbottom((struct assstack_entry **) &(rr->val.data), rrdata);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char *s, *hostporturl, *base = NULL;
|
||||
char *ttl, *defaultttl;
|
||||
LDAP *ld;
|
||||
char *fltr = NULL;
|
||||
LDAPMessage *res, *e;
|
||||
char *a, **ttlvals, **soavals, *serial;
|
||||
struct berval **vals, **names;
|
||||
char type[64];
|
||||
BerElement *ptr;
|
||||
int i, j, rc, msgid;
|
||||
struct assstack_entry *zone = NULL;
|
||||
|
||||
if (argc < 4 || argc > 5)
|
||||
usage(argv[0]);
|
||||
|
||||
hostporturl = argv[2];
|
||||
|
||||
if (hostporturl != strstr( hostporturl, "ldap"))
|
||||
err(argv[0], "Not an LDAP URL");
|
||||
|
||||
s = strchr(hostporturl, ':');
|
||||
|
||||
if (!s || strlen(s) < 3 || s[1] != '/' || s[2] != '/')
|
||||
err(argv[0], "Not an LDAP URL");
|
||||
|
||||
s = strchr(s+3, '/');
|
||||
if (s) {
|
||||
*s++ = '\0';
|
||||
base = s;
|
||||
s = strchr(base, '?');
|
||||
if (s)
|
||||
err(argv[0], "LDAP URL can only contain host, port and base");
|
||||
}
|
||||
|
||||
defaultttl = argv[3];
|
||||
|
||||
rc = ldap_initialize(&ld, hostporturl);
|
||||
if (rc != LDAP_SUCCESS)
|
||||
err(argv[0], "ldap_initialize() failed");
|
||||
|
||||
if (argc == 5) {
|
||||
/* serial number specified, check if different from one in SOA */
|
||||
fltr = (char *)malloc(strlen(argv[1]) + strlen("(&(relativeDomainName=@)(zoneName=))") + 1);
|
||||
sprintf(fltr, "(&(relativeDomainName=@)(zoneName=%s))", argv[1]);
|
||||
msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
|
||||
if (msgid == -1)
|
||||
err(argv[0], "ldap_search() failed");
|
||||
|
||||
while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
|
||||
/* not supporting continuation references at present */
|
||||
if (rc != LDAP_RES_SEARCH_ENTRY)
|
||||
err(argv[0], "ldap_result() returned cont.ref? Exiting");
|
||||
|
||||
/* only one entry per result message */
|
||||
e = ldap_first_entry(ld, res);
|
||||
if (e == NULL) {
|
||||
ldap_msgfree(res);
|
||||
err(argv[0], "ldap_first_entry() failed");
|
||||
}
|
||||
|
||||
soavals = ldap_get_values(ld, e, "SOARecord");
|
||||
if (soavals)
|
||||
break;
|
||||
}
|
||||
|
||||
ldap_msgfree(res);
|
||||
if (!soavals) {
|
||||
err(argv[0], "No SOA Record found");
|
||||
}
|
||||
|
||||
/* We have a SOA, compare serial numbers */
|
||||
/* Only checkinf first value, should be only one */
|
||||
s = strchr(soavals[0], ' ');
|
||||
s++;
|
||||
s = strchr(s, ' ');
|
||||
s++;
|
||||
serial = s;
|
||||
s = strchr(s, ' ');
|
||||
*s = '\0';
|
||||
if (!strcmp(serial, argv[4])) {
|
||||
ldap_value_free(soavals);
|
||||
err(argv[0], "serial numbers match");
|
||||
}
|
||||
ldap_value_free(soavals);
|
||||
}
|
||||
|
||||
if (!fltr)
|
||||
fltr = (char *)malloc(strlen(argv[1]) + strlen("(zoneName=)") + 1);
|
||||
if (!fltr)
|
||||
err(argv[0], "Malloc failed");
|
||||
sprintf(fltr, "(zoneName=%s)", argv[1]);
|
||||
|
||||
msgid = ldap_search(ld, base, LDAP_SCOPE_SUBTREE, fltr, NULL, 0);
|
||||
if (msgid == -1)
|
||||
err(argv[0], "ldap_search() failed");
|
||||
|
||||
while ((rc = ldap_result(ld, msgid, 0, NULL, &res)) != LDAP_RES_SEARCH_RESULT ) {
|
||||
/* not supporting continuation references at present */
|
||||
if (rc != LDAP_RES_SEARCH_ENTRY)
|
||||
err(argv[0], "ldap_result() returned cont.ref? Exiting");
|
||||
|
||||
/* only one entry per result message */
|
||||
e = ldap_first_entry(ld, res);
|
||||
if (e == NULL) {
|
||||
ldap_msgfree(res);
|
||||
err(argv[0], "ldap_first_entry() failed");
|
||||
}
|
||||
|
||||
names = ldap_get_values_len(ld, e, "relativeDomainName");
|
||||
if (!names)
|
||||
continue;
|
||||
|
||||
ttlvals = ldap_get_values(ld, e, "dNSTTL");
|
||||
ttl = ttlvals ? ttlvals[0] : defaultttl;
|
||||
|
||||
for (a = ldap_first_attribute(ld, e, &ptr); a != NULL; a = ldap_next_attribute(ld, e, ptr)) {
|
||||
char *s;
|
||||
|
||||
for (s = a; *s; s++)
|
||||
*s = toupper(*s);
|
||||
s = strstr(a, "RECORD");
|
||||
if ((s == NULL) || (s == a) || (s - a >= (signed int)sizeof(type))) {
|
||||
ldap_memfree(a);
|
||||
continue;
|
||||
}
|
||||
|
||||
strncpy(type, a, s - a);
|
||||
type[s - a] = '\0';
|
||||
vals = ldap_get_values_len(ld, e, a);
|
||||
if (vals) {
|
||||
for (i = 0; vals[i]; i++)
|
||||
for (j = 0; names[j]; j++)
|
||||
if (putrr(&zone, names[j], type, ttl, vals[i]))
|
||||
err(argv[0], "malloc failed");
|
||||
ldap_value_free_len(vals);
|
||||
}
|
||||
ldap_memfree(a);
|
||||
}
|
||||
|
||||
if (ptr)
|
||||
ber_free(ptr, 0);
|
||||
if (ttlvals)
|
||||
ldap_value_free(ttlvals);
|
||||
ldap_value_free_len(names);
|
||||
/* free this result */
|
||||
ldap_msgfree(res);
|
||||
}
|
||||
|
||||
/* free final result */
|
||||
ldap_msgfree(res);
|
||||
|
||||
print_zone(defaultttl, zone);
|
||||
return 0;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue