Index: head/dns/bind911/Makefile =================================================================== --- head/dns/bind911/Makefile (revision 542639) +++ head/dns/bind911/Makefile (revision 542640) @@ -1,257 +1,258 @@ # $FreeBSD$ # pkg-help formatted with fmt 59 63 PORTNAME= bind PORTVERSION= ${ISCVERSION:S/-P/P/:S/b/.b/:S/a/.a/:S/rc/.rc/} -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= dns net MASTER_SITES= ISC/bind9/${ISCVERSION} PKGNAMESUFFIX= 911 DISTNAME= ${PORTNAME}-${ISCVERSION} MAINTAINER= mat@FreeBSD.org COMMENT= BIND DNS suite with updated DNSSEC and DNS64 LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/COPYRIGHT DEPRECATED= End of life, please migrate to a newer version of BIND9 EXPIRATION_DATE= 2021-12-31 LIB_DEPENDS= libxml2.so:textproc/libxml2 RUN_DEPENDS= bind-tools>0:dns/bind-tools USES= cpe libedit pkgconfig # ISC releases things like 9.8.0-P1, which our versioning doesn't like ISCVERSION= 9.11.21 CPE_VENDOR= isc CPE_VERSION= ${ISCVERSION:C/-.*//} .if ${ISCVERSION:M*-*} CPE_UPDATE= ${ISCVERSION:C/.*-//:tl} .endif GNU_CONFIGURE= yes CONFIGURE_ARGS= --localstatedir=/var --disable-linux-caps \ --with-randomdev=/dev/random \ --with-libxml2=${LOCALBASE} \ --with-readline="-L${LOCALBASE}/lib -ledit" \ --with-dlopen=yes \ --with-gost=no \ --without-python \ --sysconfdir=${ETCDIR} ETCDIR= ${PREFIX}/etc/namedb CONFLICTS= bind912 bind913 bind914 bind916 bind9-devel SUB_FILES= pkg-message named.conf USE_RC_SUBR= named MAKE_JOBS_UNSAFE= yes PORTDOCS= * OPTIONS_DEFAULT= SSL THREADS SIGCHASE IDN GSSAPI_NONE JSON \ DLZ_FILESYSTEM LMDB RPZ_NSDNAME RPZ_NSIP TCP_FASTOPEN \ FILTER_AAAA OPTIONS_DEFINE= IDN LARGE_FILE JSON GEOIP \ FIXED_RRSET SIGCHASE IPV6 THREADS FILTER_AAAA \ RPZ_NSIP RPZ_NSDNAME DOCS \ MINCACHE PORTREVISION QUERYTRACE LMDB DNSTAP \ START_LATE TUNING_LARGE TCP_FASTOPEN OPTIONS_RADIO= CRYPTO OPTIONS_RADIO_CRYPTO= SSL NATIVE_PKCS11 OPTIONS_GROUP= DLZ OPTIONS_GROUP_DLZ= DLZ_POSTGRESQL DLZ_MYSQL DLZ_BDB \ DLZ_LDAP DLZ_FILESYSTEM DLZ_STUB OPTIONS_SINGLE= GSSAPI OPTIONS_SINGLE_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE OPTIONS_SUB= yes CRYPTO_DESC= Choose which crypto engine to use DLZ_BDB_DESC= DLZ BDB driver DLZ_DESC= Dynamically Loadable Zones DLZ_FILESYSTEM_DESC= DLZ filesystem driver DLZ_LDAP_DESC= DLZ LDAP driver DLZ_MYSQL_DESC= DLZ MySQL driver (no threading) DLZ_POSTGRESQL_DESC= DLZ Postgres driver DLZ_STUB_DESC= DLZ stub driver DNSTAP_DESC= Provides fast passive logging of DNS messages FILTER_AAAA_DESC= Enable filtering of AAAA records FIXED_RRSET_DESC= Enable fixed rrset ordering GSSAPI_BASE_DESC= Using Heimdal in base GSSAPI_HEIMDAL_DESC= Using security/heimdal GSSAPI_MIT_DESC= Using security/krb5 GSSAPI_NONE_DESC= Disable LARGE_FILE_DESC= 64-bit file support LMDB_DESC= Use LMDB for zone management MINCACHE_DESC= Use the mincachettl patch NATIVE_PKCS11_DESC= Use PKCS\#11 native API (**READ HELP**) PORTREVISION_DESC= Show PORTREVISION in the version string QUERYTRACE_DESC= Enable the very verbose query tracelogging RPZ_NSDNAME_DESC= Enable RPZ NSDNAME policy records RPZ_NSIP_DESC= Enable RPZ NSIP trigger rules SIGCHASE_DESC= dig/host/nslookup will do DNSSEC validation SSL_DESC= Build with OpenSSL (Required for DNSSEC) START_LATE_DESC= Start BIND late in the boot process (see help) TCP_FASTOPEN_DESC= RFC 7413 support TUNING_LARGE_DESC= Tune named for large systems (**READ HELP**) DLZ_BDB_CONFIGURE_ON= --with-dlz-bdb=yes DLZ_BDB_USES= bdb DLZ_FILESYSTEM_CONFIGURE_ON= --with-dlz-filesystem=yes DLZ_LDAP_CONFIGURE_ON= --with-dlz-ldap=yes DLZ_LDAP_USE= openldap=yes DLZ_MYSQL_CONFIGURE_ON= --with-dlz-mysql=yes DLZ_MYSQL_PREVENTS= THREADS DLZ_MYSQL_USES= mysql DLZ_POSTGRESQL_CONFIGURE_ON= --with-dlz-postgres=yes DLZ_POSTGRESQL_USES= pgsql DLZ_STUB_CONFIGURE_ON= --with-dlz-stub=yes DNSTAP_CONFIGURE_ENABLE= dnstap DNSTAP_IMPLIES= THREADS DNSTAP_LIB_DEPENDS= libfstrm.so:devel/fstrm \ libprotobuf-c.so:devel/protobuf-c FILTER_AAAA_CONFIGURE_ENABLE= filter-aaaa FIXED_RRSET_CONFIGURE_ENABLE= fixed-rrset GEOIP_CONFIGURE_WITH= geoip2 GEOIP_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb GEOIP_IMPLIES= THREADS GSSAPI_BASE_CONFIGURE_ON=\ --with-gssapi=${GSSAPIBASEDIR} KRB5CONFIG="${KRB5CONFIG}" GSSAPI_BASE_USES= gssapi GSSAPI_HEIMDAL_CONFIGURE_ON=\ --with-gssapi=${GSSAPIBASEDIR} KRB5CONFIG="${KRB5CONFIG}" GSSAPI_HEIMDAL_USES= gssapi:heimdal GSSAPI_MIT_CONFIGURE_ON=\ --with-gssapi=${GSSAPIBASEDIR} KRB5CONFIG="${KRB5CONFIG}" GSSAPI_MIT_USES= gssapi:mit GSSAPI_NONE_CONFIGURE_ON= --without-gssapi IDN_CONFIGURE_OFF= --without-libidn2 IDN_CONFIGURE_ON= --with-libidn2=${LOCALBASE} ${ICONV_CONFIGURE_BASE} IDN_LIB_DEPENDS= libidn2.so:dns/libidn2 IDN_USES= iconv IPV6_CONFIGURE_ENABLE= ipv6 JSON_CONFIGURE_WITH= libjson=${LOCALBASE} JSON_LIB_DEPENDS= libjson-c.so:devel/json-c LARGE_FILE_CONFIGURE_ENABLE= largefile LMDB_CONFIGURE_WITH= lmdb=${LOCALBASE} LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb +LMDB_EXTRA_PATCHES= ${FILESDIR}/extrapatch-bind-lmdb-lock MINCACHE_EXTRA_PATCHES= ${FILESDIR}/extrapatch-bind-min-override-ttl NATIVE_PKCS11_CONFIGURE_ENABLE= native-pkcs11 NATIVE_PKCS11_IMPLIES= THREADS QUERYTRACE_CONFIGURE_ENABLE= querytrace RPZ_NSDNAME_CONFIGURE_ENABLE= rpz-nsdname RPZ_NSIP_CONFIGURE_ENABLE= rpz-nsip SIGCHASE_CONFIGURE_ON= STD_CDEFINES="-DDIG_SIGCHASE=1" SSL_CONFIGURE_OFF= --disable-openssl-version-check --without-openssl SSL_CONFIGURE_ON= --with-openssl=${OPENSSLBASE} SSL_USES= ssl START_LATE_SUB_LIST= NAMED_REQUIRE="SERVERS cleanvar" \ NAMED_BEFORE="LOGIN" START_LATE_SUB_LIST_OFF=NAMED_REQUIRE="NETWORKING ldconfig syslogd" \ NAMED_BEFORE="SERVERS" THREADS_CONFIGURE_ENABLE= threads TUNING_LARGE_IMPLIES= THREADS TUNING_LARGE_CONFIGURE_ON= --with-tuning=large TUNING_LARGE_CONFIGURE_OFF= --with-tuning=default .include .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-symtable \ --enable-developer USES+= perl5 USE_PERL5= build BUILD_DEPENDS+= cmocka>0:sysutils/cmocka # Developer mode needs ssl, always .if !${PORT_OPTIONS:MSSL} CONFIGURE_ARGS+= --with-openssl=${OPENSSLBASE} USES+= ssl .endif .else CONFIGURE_ARGS+= --disable-symtable .endif .include .if ${SSL_DEFAULT} == base SUB_LIST+= ENGINES=/usr/lib/engines .else SUB_LIST+= ENGINES=${LOCALBASE}/lib/engines .endif post-patch: .for FILE in check/named-checkconf.8 named/named.8 nsupdate/nsupdate.1 \ rndc/rndc.8 @${REINPLACE_CMD} -e 's#/etc/named.conf#${ETCDIR}/named.conf#g' \ -e 's#/etc/rndc.conf#${ETCDIR}/rndc.conf#g' \ -e "s#/var\/run\/named\/named.pid#/var/run/named/pid#" \ ${WRKSRC}/bin/${FILE} .endfor .if ${PORTREVISION:N0} post-patch-PORTREVISION-on: @${REINPLACE_CMD} -e '/EXTENSIONS/s#=$$#=_${PORTREVISION}#' \ ${WRKSRC}/version .endif post-patch-TCP_FASTOPEN-off: @${REINPLACE_CMD} -e 's/#define ISC_PLATFORM_HAVETFO 1/#undef ISC_PLATFORM_HAVETFO/' ${WRKSRC}/configure post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/mtree ${MKDIR} ${STAGEDIR}${ETCDIR} .for i in dynamic master slave working @${MKDIR} ${STAGEDIR}${ETCDIR}/$i .endfor ${INSTALL_DATA} ${WRKDIR}/named.conf ${STAGEDIR}${ETCDIR}/named.conf.sample ${INSTALL_DATA} ${FILESDIR}/named.root ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${FILESDIR}/empty.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/localhost-forward.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/localhost-reverse.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/BIND.chroot.dist ${STAGEDIR}${PREFIX}/etc/mtree/BIND.chroot.dist.sample ${INSTALL_DATA} ${FILESDIR}/BIND.chroot.local.dist ${STAGEDIR}${PREFIX}/etc/mtree/BIND.chroot.local.dist.sample ${INSTALL_DATA} ${WRKSRC}/bin/rndc/rndc.conf \ ${STAGEDIR}${ETCDIR}/rndc.conf.sample post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR}/arm ${INSTALL_DATA} ${WRKSRC}/doc/arm/*.html ${STAGEDIR}${DOCSDIR}/arm ${INSTALL_DATA} ${WRKSRC}/doc/arm/Bv9ARM.pdf ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/CHANGES \ ${WRKSRC}/HISTORY* ${WRKSRC}/README* ${STAGEDIR}${DOCSDIR} .include Index: head/dns/bind911/files/extrapatch-bind-lmdb-lock =================================================================== --- head/dns/bind911/files/extrapatch-bind-lmdb-lock (nonexistent) +++ head/dns/bind911/files/extrapatch-bind-lmdb-lock (revision 542640) @@ -0,0 +1,235 @@ +--- bin/named/server.c.orig 2020-06-10 18:00:37 UTC ++++ bin/named/server.c +@@ -6797,6 +6797,8 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, i + "for view '%s'", + view->new_zone_db, view->name); + ++ LOCK(&view->new_zone_lock); ++ + CHECK(nzd_count(view, &n)); + + *num_zonesp = n; +@@ -6811,6 +6813,8 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, i + if (result != ISC_R_SUCCESS) + *num_zonesp = 0; + ++ UNLOCK(&view->new_zone_lock); ++ + return (ISC_R_SUCCESS); + } + +@@ -7116,6 +7120,8 @@ typedef isc_result_t (*newzone_cfg_cb_t)(const cfg_obj + * Immediately interrupt processing if an error is encountered while + * transforming NZD data into a zone configuration object or if "callback" + * returns an error. ++ * ++ * Caller must hold 'view->new_zone_lock'. + */ + static isc_result_t + for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config, +@@ -7228,8 +7234,11 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config + return (ISC_R_SUCCESS); + } + ++ LOCK(&view->new_zone_lock); ++ + result = nzd_open(view, MDB_RDONLY, &txn, &dbi); + if (result != ISC_R_SUCCESS) { ++ UNLOCK(&view->new_zone_lock); + return (ISC_R_SUCCESS); + } + +@@ -7256,6 +7265,9 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config + } + + (void) nzd_close(&txn, false); ++ ++ UNLOCK(&view->new_zone_lock); ++ + return (result); + } + +@@ -7277,6 +7289,8 @@ get_newzone_config(dns_view_t *view, const char *zonen + + INSIST(zoneconfig != NULL && *zoneconfig == NULL); + ++ LOCK(&view->new_zone_lock); ++ + CHECK(nzd_open(view, MDB_RDONLY, &txn, &dbi)); + + isc_log_write(ns_g_lctx, +@@ -7310,6 +7324,8 @@ get_newzone_config(dns_view_t *view, const char *zonen + cleanup: + (void) nzd_close(&txn, false); + ++ UNLOCK(&view->new_zone_lock); ++ + if (zoneconf != NULL) { + cfg_obj_destroy(ns_g_addparser, &zoneconf); + } +@@ -11638,8 +11654,6 @@ nzd_save(MDB_txn **txnp, MDB_dbi dbi, dns_zone_t *zone + + nzd_setkey(&key, dns_zone_getorigin(zone), namebuf, sizeof(namebuf)); + +- LOCK(&view->new_zone_lock); +- + if (zconfig == NULL) { + /* We're deleting the zone from the database */ + status = mdb_del(*txnp, dbi, &key, NULL); +@@ -11739,8 +11753,6 @@ nzd_save(MDB_txn **txnp, MDB_dbi dbi, dns_zone_t *zone + } + *txnp = NULL; + +- UNLOCK(&view->new_zone_lock); +- + if (text != NULL) { + isc_buffer_free(&text); + } +@@ -11748,6 +11760,11 @@ nzd_save(MDB_txn **txnp, MDB_dbi dbi, dns_zone_t *zone + return (result); + } + ++/* ++ * Check whether the new zone database for 'view' can be opened for writing. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_writable(dns_view_t *view) { + isc_result_t result = ISC_R_SUCCESS; +@@ -11779,6 +11796,11 @@ nzd_writable(dns_view_t *view) { + return (result); + } + ++/* ++ * Open the new zone database for 'view' and start a transaction for it. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_open(dns_view_t *view, unsigned int flags, MDB_txn **txnp, MDB_dbi *dbi) { + int status; +@@ -11909,6 +11931,13 @@ nzd_env_reopen(dns_view_t *view) { + return (result); + } + ++/* ++ * If 'commit' is true, commit the new zone database transaction pointed to by ++ * 'txnp'; otherwise, abort that transaction. ++ * ++ * Caller must hold 'view->new_zone_lock' for the view that the transaction ++ * pointed to by 'txnp' was started for. ++ */ + static isc_result_t + nzd_close(MDB_txn **txnp, bool commit) { + isc_result_t result = ISC_R_SUCCESS; +@@ -11931,6 +11960,12 @@ nzd_close(MDB_txn **txnp, bool commit) { + return (result); + } + ++/* ++ * Count the zones configured in the new zone database for 'view' and store the ++ * result in 'countp'. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_count(dns_view_t *view, int *countp) { + isc_result_t result; +@@ -11979,6 +12014,8 @@ migrate_nzf(dns_view_t *view) { + MDB_val key, data; + ns_dzarg_t dzarg; + ++ LOCK(&view->new_zone_lock); ++ + /* + * If NZF file doesn't exist, or NZD DB exists and already + * has data, return without attempting migration. +@@ -12122,6 +12159,8 @@ migrate_nzf(dns_view_t *view) { + result = nzd_close(&txn, commit); + } + ++ UNLOCK(&view->new_zone_lock); ++ + if (text != NULL) { + isc_buffer_free(&text); + } +@@ -12325,6 +12364,7 @@ do_addzone(ns_server_t *server, ns_cfgctx_t *cfg, dns_ + MDB_dbi dbi; + + UNUSED(zoneconf); ++ LOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + /* Zone shouldn't already exist */ +@@ -12465,6 +12505,7 @@ do_addzone(ns_server_t *server, ns_cfgctx_t *cfg, dns_ + #else /* HAVE_LMDB */ + if (txn != NULL) + (void) nzd_close(&txn, false); ++ UNLOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + if (zone != NULL) +@@ -12488,6 +12529,7 @@ do_modzone(ns_server_t *server, ns_cfgctx_t *cfg, dns_ + #else /* HAVE_LMDB */ + MDB_txn *txn = NULL; + MDB_dbi dbi; ++ LOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + /* Zone must already exist */ +@@ -12667,6 +12709,7 @@ do_modzone(ns_server_t *server, ns_cfgctx_t *cfg, dns_ + #else /* HAVE_LMDB */ + if (txn != NULL) + (void) nzd_close(&txn, false); ++ UNLOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + if (zone != NULL) +@@ -12816,6 +12859,7 @@ rmzone(isc_task_t *task, isc_event_t *event) { + if (added && cfg != NULL) { + #ifdef HAVE_LMDB + /* Make sure we can open the NZD database */ ++ LOCK(&view->new_zone_lock); + result = nzd_open(view, 0, &txn, &dbi); + if (result != ISC_R_SUCCESS) { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, +@@ -12834,6 +12878,11 @@ rmzone(isc_task_t *task, isc_event_t *event) { + "delete zone configuration: %s", + isc_result_totext(result)); + } ++ ++ if (txn != NULL) { ++ (void)nzd_close(&txn, false); ++ } ++ UNLOCK(&view->new_zone_lock); + #else + result = delete_zoneconf(view, cfg->add_parser, + cfg->nzf_config, +@@ -12926,10 +12975,6 @@ rmzone(isc_task_t *task, isc_event_t *event) { + } + } + +-#ifdef HAVE_LMDB +- if (txn != NULL) +- (void) nzd_close(&txn, false); +-#endif + if (raw != NULL) + dns_zone_detach(&raw); + dns_zone_detach(&zone); +--- lib/dns/include/dns/view.h.orig 2020-06-10 18:00:37 UTC ++++ lib/dns/include/dns/view.h +@@ -240,12 +240,7 @@ struct dns_view { + + #ifdef HAVE_LMDB + #include +-/* +- * MDB_NOTLS is used to prevent problems after configuration is reloaded, due +- * to the way LMDB's use of thread-local storage (TLS) interacts with the BIND9 +- * thread model. +- */ +-#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOTLS) ++#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOLOCK) + #ifndef __OpenBSD__ + #define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS) + #else /* __OpenBSD__ */ Property changes on: head/dns/bind911/files/extrapatch-bind-lmdb-lock ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/dns/bind916/Makefile =================================================================== --- head/dns/bind916/Makefile (revision 542639) +++ head/dns/bind916/Makefile (revision 542640) @@ -1,275 +1,276 @@ # $FreeBSD$ # pkg-help formatted with fmt 59 63 PORTNAME= bind PORTVERSION= ${ISCVERSION:S/-P/P/:S/b/.b/:S/a/.a/:S/rc/.rc/} .if defined(BIND_TOOLS_SLAVE) # dns/bind-tools here PORTREVISION= 0 .else # dns/bind916 here -PORTREVISION= 0 +PORTREVISION= 1 .endif CATEGORIES= dns net MASTER_SITES= ISC/bind9/${ISCVERSION} .if defined(BIND_TOOLS_SLAVE) PKGNAMESUFFIX= -tools .else PKGNAMESUFFIX= 916 .endif DISTNAME= ${PORTNAME}-${ISCVERSION} MAINTAINER= mat@FreeBSD.org .if defined(BIND_TOOLS_SLAVE) COMMENT= Command line tools from BIND: delv, dig, host, nslookup... .else COMMENT= BIND DNS suite with updated DNSSEC and DNS64 .endif # Uncomment when bind920 comes of age. # DEPRECATED= End of life, please migrate to a newer version of BIND9 # EXPIRATION_DATE= 2023-12-31 LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/COPYRIGHT LIB_DEPENDS= libuv.so:devel/libuv \ libxml2.so:textproc/libxml2 .if !defined(BIND_TOOLS_SLAVE) RUN_DEPENDS= bind-tools>0:dns/bind-tools .endif USES= compiler:c11 cpe libedit pkgconfig ssl tar:xz # ISC releases things like 9.8.0-P1, which our versioning doesn't like ISCVERSION= 9.16.5 CPE_VENDOR= isc CPE_VERSION= ${ISCVERSION:C/-.*//} .if ${ISCVERSION:M*-*} CPE_UPDATE= ${ISCVERSION:C/.*-//:tl} .endif GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-linux-caps \ --localstatedir=/var \ --sysconfdir=${ETCDIR} \ --with-dlopen=yes \ --with-libxml2 \ --with-openssl=${OPENSSLBASE} \ --with-readline="-L${LOCALBASE}/lib -ledit" ETCDIR= ${PREFIX}/etc/namedb .if defined(BIND_TOOLS_SLAVE) CONFIGURE_ARGS+= --disable-shared EXTRA_PATCHES= ${PATCHDIR}/extrapatch-bind-tools .else USE_RC_SUBR= named SUB_FILES= named.conf pkg-message EXTRA_PATCHES= ${PATCHDIR}/extrapatch-no-bind-tools PORTDOCS= * CONFLICTS= bind911 bind912 bind913 bind914 bind9-devel .endif # BIND_TOOLS_SLAVE MAKE_JOBS_UNSAFE= yes OPTIONS_DEFAULT= DLZ_FILESYSTEM GSSAPI_NONE IDN JSON LMDB PYTHON \ SIGCHASE TCP_FASTOPEN MANPAGES OPTIONS_DEFINE= DNSTAP DOCS FIXED_RRSET GEOIP IDN JSON LARGE_FILE LMDB \ OVERRIDECACHE PORTREVISION PYTHON QUERYTRACE SIGCHASE \ START_LATE TCP_FASTOPEN TUNING_LARGE MANPAGES OPTIONS_RADIO= CRYPTO OPTIONS_RADIO_CRYPTO= NATIVE_PKCS11 OPTIONS_GROUP= DLZ OPTIONS_GROUP_DLZ= DLZ_BDB DLZ_FILESYSTEM DLZ_LDAP DLZ_MYSQL \ DLZ_POSTGRESQL DLZ_STUB OPTIONS_SINGLE= GSSAPI OPTIONS_SINGLE_GSSAPI= GSSAPI_BASE GSSAPI_HEIMDAL GSSAPI_MIT GSSAPI_NONE .if defined(BIND_TOOLS_SLAVE) OPTIONS_EXCLUDE= ${OPTIONS_GROUP_DLZ} DNSTAP DOCS GEOIP LMDB \ OVERRIDECACHE PORTREVISION QUERYTRACE START_LATE \ TCP_FASTOPEN TUNING_LARGE .else OPTIONS_EXCLUDE= PYTHON .endif # BIND_TOOLS_SLAVE OPTIONS_SUB= yes CRYPTO_DESC= Choose which crypto engine to use DLZ_BDB_DESC= DLZ BDB driver DLZ_DESC= Dynamically Loadable Zones DLZ_FILESYSTEM_DESC= DLZ filesystem driver DLZ_LDAP_DESC= DLZ LDAP driver DLZ_MYSQL_DESC= DLZ MySQL driver (no threading) DLZ_POSTGRESQL_DESC= DLZ Postgres driver DLZ_STUB_DESC= DLZ stub driver DNSTAP_DESC= Provides fast passive logging of DNS messages FIXED_RRSET_DESC= Enable fixed rrset ordering GSSAPI_BASE_DESC= Using Heimdal in base GSSAPI_HEIMDAL_DESC= Using security/heimdal GSSAPI_MIT_DESC= Using security/krb5 GSSAPI_NONE_DESC= Disable LARGE_FILE_DESC= 64-bit file support LMDB_DESC= Use LMDB for zone management OVERRIDECACHE_DESC= Use the override-cache patch NATIVE_PKCS11_DESC= Use PKCS\#11 native API (**READ HELP**) PORTREVISION_DESC= Show PORTREVISION in the version string PYTHON_DESC= Build with Python utilities QUERYTRACE_DESC= Enable the very verbose query tracelogging SIGCHASE_DESC= dig/host/nslookup will do DNSSEC validation START_LATE_DESC= Start BIND late in the boot process (see help) TCP_FASTOPEN_DESC= RFC 7413 support TUNING_LARGE_DESC= Tune named for large systems (**READ HELP**) DLZ_BDB_CONFIGURE_ON= --with-dlz-bdb=yes DLZ_BDB_USES= bdb DLZ_FILESYSTEM_CONFIGURE_ON= --with-dlz-filesystem=yes DLZ_LDAP_CONFIGURE_ON= --with-dlz-ldap=yes DLZ_LDAP_USE= OPENLDAP=yes DLZ_MYSQL_CONFIGURE_ON= --with-dlz-mysql=yes DLZ_MYSQL_USES= mysql DLZ_POSTGRESQL_CONFIGURE_ON= --with-dlz-postgres=yes DLZ_POSTGRESQL_USES= pgsql DLZ_STUB_CONFIGURE_ON= --with-dlz-stub=yes DNSTAP_CONFIGURE_ENABLE= dnstap DNSTAP_LIB_DEPENDS= libfstrm.so:devel/fstrm \ libprotobuf-c.so:devel/protobuf-c FIXED_RRSET_CONFIGURE_ENABLE= fixed-rrset GEOIP_CONFIGURE_ENABLE= geoip GEOIP_CONFIGURE_WITH= maxminddb GEOIP_LIB_DEPENDS= libmaxminddb.so:net/libmaxminddb GSSAPI_BASE_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} \ KRB5CONFIG="${KRB5CONFIG}" GSSAPI_BASE_USES= gssapi GSSAPI_HEIMDAL_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} \ KRB5CONFIG="${KRB5CONFIG}" GSSAPI_HEIMDAL_USES= gssapi:heimdal GSSAPI_MIT_CONFIGURE_ON= --with-gssapi=${GSSAPIBASEDIR} \ KRB5CONFIG="${KRB5CONFIG}" GSSAPI_MIT_USES= gssapi:mit GSSAPI_NONE_CONFIGURE_ON= --without-gssapi IDN_CONFIGURE_OFF= --without-libidn2 IDN_CONFIGURE_ON= ${ICONV_CONFIGURE_BASE} \ --with-libidn2=${LOCALBASE} IDN_LIB_DEPENDS= libidn2.so:dns/libidn2 IDN_USES= iconv JSON_CONFIGURE_WITH= json-c JSON_LIB_DEPENDS= libjson-c.so:devel/json-c JSON_LDFLAGS= -L${LOCALBASE}/lib -ljson-c LARGE_FILE_CONFIGURE_ENABLE= largefile LMDB_CONFIGURE_WITH= lmdb=${LOCALBASE} LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb +LMDB_EXTRA_PATCHES= ${FILESDIR}/extrapatch-bind-lmdb-lock MANPAGES_BUILD_DEPENDS= sphinx-build:textproc/py-sphinx OVERRIDECACHE_EXTRA_PATCHES= ${FILESDIR}/extrapatch-bind-min-override-ttl NATIVE_PKCS11_CONFIGURE_ENABLE= native-pkcs11 PYTHON_BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ply>=0:devel/py-ply@${PY_FLAVOR} PYTHON_CONFIGURE_WITH= python=${PYTHON_CMD} PYTHON_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}ply>=0:devel/py-ply@${PY_FLAVOR} PYTHON_USES= python QUERYTRACE_CONFIGURE_ENABLE= querytrace SIGCHASE_CONFIGURE_ON= STD_CDEFINES="-DDIG_SIGCHASE=1" START_LATE_SUB_LIST= NAMED_BEFORE="LOGIN" \ NAMED_REQUIRE="SERVERS cleanvar" START_LATE_SUB_LIST_OFF= NAMED_BEFORE="SERVERS" \ NAMED_REQUIRE="NETWORKING ldconfig syslogd" TCP_FASTOPEN_CONFIGURE_ENABLE= tcp-fastopen TUNING_LARGE_CONFIGURE_ON= --with-tuning=large TUNING_LARGE_CONFIGURE_OFF= --with-tuning=default .include .if defined(WITH_DEBUG) CONFIGURE_ARGS+= --enable-developer \ --enable-symtable USES+= perl5 USE_PERL5= build BUILD_DEPENDS+= cmocka>0:sysutils/cmocka .else CONFIGURE_ARGS+= --disable-symtable .endif .include .if ${SSL_DEFAULT} == base SUB_LIST+= ENGINES=/usr/lib/engines .else SUB_LIST+= ENGINES=${LOCALBASE}/lib/engines .endif post-patch: .for FILE in named-checkconf.8 named.8 nsupdate.1 \ rndc.8 @${REINPLACE_CMD} -e 's#/etc/named.conf#${ETCDIR}/named.conf#g' \ -e 's#/etc/rndc.conf#${ETCDIR}/rndc.conf#g' \ -e "s#/var\/run\/named\/named.pid#/var/run/named/pid#" \ ${WRKSRC}/doc/man/${FILE}in .endfor .if !defined(BIND_TOOLS_SLAVE) . if ${PORTREVISION:N0} post-patch-PORTREVISION-on: @${REINPLACE_CMD} -e '/EXTENSIONS/s#=$$#=_${PORTREVISION}#' \ ${WRKSRC}/version . endif post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/etc/mtree ${MKDIR} ${STAGEDIR}${ETCDIR} . for i in dynamic master slave working @${MKDIR} ${STAGEDIR}${ETCDIR}/$i . endfor ${INSTALL_DATA} ${WRKDIR}/named.conf ${STAGEDIR}${ETCDIR}/named.conf.sample ${INSTALL_DATA} ${FILESDIR}/named.root ${STAGEDIR}${ETCDIR} ${INSTALL_DATA} ${FILESDIR}/empty.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/localhost-forward.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/localhost-reverse.db ${STAGEDIR}${ETCDIR}/master ${INSTALL_DATA} ${FILESDIR}/BIND.chroot.dist ${STAGEDIR}${PREFIX}/etc/mtree/BIND.chroot.dist.sample ${INSTALL_DATA} ${FILESDIR}/BIND.chroot.local.dist ${STAGEDIR}${PREFIX}/etc/mtree/BIND.chroot.local.dist.sample ${INSTALL_DATA} ${WRKSRC}/bin/rndc/rndc.conf \ ${STAGEDIR}${ETCDIR}/rndc.conf.sample post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/CHANGES* ${WRKSRC}/HISTORY.md \ ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} .else post-install-MANPAGES-on: @(cd ${WRKSRC}/doc/man && ${SETENV} ${MAKE_ENV} ${FAKEROOT} ${MAKE_CMD} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET}) # Can't use USE_PYTHON=autoplist post-install-PYTHON-on: @${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -type f | ${SED} -e 's|${STAGEDIR}||' >> ${TMPPLIST} .endif # BIND_TOOLS_SLAVE .include Index: head/dns/bind916/files/extrapatch-bind-lmdb-lock =================================================================== --- head/dns/bind916/files/extrapatch-bind-lmdb-lock (nonexistent) +++ head/dns/bind916/files/extrapatch-bind-lmdb-lock (revision 542640) @@ -0,0 +1,236 @@ +--- bin/named/server.c.orig 2020-06-10 21:01:43 UTC ++++ bin/named/server.c +@@ -7578,6 +7578,8 @@ count_newzones(dns_view_t *view, ns_cfgctx_t *nzcfg, i + "for view '%s'", + view->new_zone_db, view->name); + ++ LOCK(&view->new_zone_lock); ++ + CHECK(nzd_count(view, &n)); + + *num_zonesp = n; +@@ -7592,6 +7594,8 @@ cleanup: + *num_zonesp = 0; + } + ++ UNLOCK(&view->new_zone_lock); ++ + return (ISC_R_SUCCESS); + } + +@@ -7920,6 +7924,8 @@ typedef isc_result_t (*newzone_cfg_cb_t)(const cfg_obj + * Immediately interrupt processing if an error is encountered while + * transforming NZD data into a zone configuration object or if "callback" + * returns an error. ++ * ++ * Caller must hold 'view->new_zone_lock'. + */ + static isc_result_t + for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config, +@@ -8028,8 +8034,11 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config + return (ISC_R_SUCCESS); + } + ++ LOCK(&view->new_zone_lock); ++ + result = nzd_open(view, MDB_RDONLY, &txn, &dbi); + if (result != ISC_R_SUCCESS) { ++ UNLOCK(&view->new_zone_lock); + return (ISC_R_SUCCESS); + } + +@@ -8055,6 +8064,9 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config + } + + (void)nzd_close(&txn, false); ++ ++ UNLOCK(&view->new_zone_lock); ++ + return (result); + } + +@@ -8075,6 +8087,8 @@ get_newzone_config(dns_view_t *view, const char *zonen + + INSIST(zoneconfig != NULL && *zoneconfig == NULL); + ++ LOCK(&view->new_zone_lock); ++ + CHECK(nzd_open(view, MDB_RDONLY, &txn, &dbi)); + + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, +@@ -8108,6 +8122,8 @@ get_newzone_config(dns_view_t *view, const char *zonen + cleanup: + (void)nzd_close(&txn, false); + ++ UNLOCK(&view->new_zone_lock); ++ + if (zoneconf != NULL) { + cfg_obj_destroy(named_g_addparser, &zoneconf); + } +@@ -12566,8 +12582,6 @@ nzd_save(MDB_txn **txnp, MDB_dbi dbi, dns_zone_t *zone + + nzd_setkey(&key, dns_zone_getorigin(zone), namebuf, sizeof(namebuf)); + +- LOCK(&view->new_zone_lock); +- + if (zconfig == NULL) { + /* We're deleting the zone from the database */ + status = mdb_del(*txnp, dbi, &key, NULL); +@@ -12647,8 +12661,6 @@ cleanup: + } + *txnp = NULL; + +- UNLOCK(&view->new_zone_lock); +- + if (text != NULL) { + isc_buffer_free(&text); + } +@@ -12656,6 +12668,11 @@ cleanup: + return (result); + } + ++/* ++ * Check whether the new zone database for 'view' can be opened for writing. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_writable(dns_view_t *view) { + isc_result_t result = ISC_R_SUCCESS; +@@ -12685,6 +12702,11 @@ nzd_writable(dns_view_t *view) { + return (result); + } + ++/* ++ * Open the new zone database for 'view' and start a transaction for it. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_open(dns_view_t *view, unsigned int flags, MDB_txn **txnp, MDB_dbi *dbi) { + int status; +@@ -12812,6 +12834,13 @@ cleanup: + return (result); + } + ++/* ++ * If 'commit' is true, commit the new zone database transaction pointed to by ++ * 'txnp'; otherwise, abort that transaction. ++ * ++ * Caller must hold 'view->new_zone_lock' for the view that the transaction ++ * pointed to by 'txnp' was started for. ++ */ + static isc_result_t + nzd_close(MDB_txn **txnp, bool commit) { + isc_result_t result = ISC_R_SUCCESS; +@@ -12834,6 +12863,12 @@ nzd_close(MDB_txn **txnp, bool commit) { + return (result); + } + ++/* ++ * Count the zones configured in the new zone database for 'view' and store the ++ * result in 'countp'. ++ * ++ * Caller must hold 'view->new_zone_lock'. ++ */ + static isc_result_t + nzd_count(dns_view_t *view, int *countp) { + isc_result_t result; +@@ -12881,6 +12916,8 @@ migrate_nzf(dns_view_t *view) { + MDB_val key, data; + ns_dzarg_t dzarg; + ++ LOCK(&view->new_zone_lock); ++ + /* + * If NZF file doesn't exist, or NZD DB exists and already + * has data, return without attempting migration. +@@ -13016,6 +13053,8 @@ cleanup: + result = nzd_close(&txn, commit); + } + ++ UNLOCK(&view->new_zone_lock); ++ + if (text != NULL) { + isc_buffer_free(&text); + } +@@ -13225,6 +13264,7 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, d + MDB_dbi dbi; + + UNUSED(zoneconf); ++ LOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + /* Zone shouldn't already exist */ +@@ -13378,6 +13418,7 @@ cleanup: + if (txn != NULL) { + (void)nzd_close(&txn, false); + } ++ UNLOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + if (zone != NULL) { +@@ -13401,6 +13442,7 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, d + #else /* HAVE_LMDB */ + MDB_txn *txn = NULL; + MDB_dbi dbi; ++ LOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + /* Zone must already exist */ +@@ -13598,6 +13640,7 @@ cleanup: + if (txn != NULL) { + (void)nzd_close(&txn, false); + } ++ UNLOCK(&view->new_zone_lock); + #endif /* HAVE_LMDB */ + + if (zone != NULL) { +@@ -13761,6 +13804,7 @@ rmzone(isc_task_t *task, isc_event_t *event) { + if (added && cfg != NULL) { + #ifdef HAVE_LMDB + /* Make sure we can open the NZD database */ ++ LOCK(&view->new_zone_lock); + result = nzd_open(view, 0, &txn, &dbi); + if (result != ISC_R_SUCCESS) { + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, +@@ -13778,6 +13822,11 @@ rmzone(isc_task_t *task, isc_event_t *event) { + "delete zone configuration: %s", + isc_result_totext(result)); + } ++ ++ if (txn != NULL) { ++ (void)nzd_close(&txn, false); ++ } ++ UNLOCK(&view->new_zone_lock); + #else /* ifdef HAVE_LMDB */ + result = delete_zoneconf(view, cfg->add_parser, cfg->nzf_config, + dns_zone_getorigin(zone), +@@ -13867,11 +13916,6 @@ rmzone(isc_task_t *task, isc_event_t *event) { + } + } + +-#ifdef HAVE_LMDB +- if (txn != NULL) { +- (void)nzd_close(&txn, false); +- } +-#endif /* ifdef HAVE_LMDB */ + if (raw != NULL) { + dns_zone_detach(&raw); + } +--- lib/dns/include/dns/lmdb.h.orig 2020-06-10 21:01:43 UTC ++++ lib/dns/include/dns/lmdb.h +@@ -10,12 +10,7 @@ + */ + + #include +-/* +- * MDB_NOTLS is used to prevent problems after configuration is reloaded, due +- * to the way LMDB's use of thread-local storage (TLS) interacts with the BIND9 +- * thread model. +- */ +-#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOTLS) ++#define DNS_LMDB_COMMON_FLAGS (MDB_CREATE | MDB_NOSUBDIR | MDB_NOLOCK) + #ifndef __OpenBSD__ + #define DNS_LMDB_FLAGS (DNS_LMDB_COMMON_FLAGS) + #else /* __OpenBSD__ */ Property changes on: head/dns/bind916/files/extrapatch-bind-lmdb-lock ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property