pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bind920: apply patch to fix BIND issue #5198.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%uninett.no@localhost>
Pushed By:	he
Date:		Sat Mar 1 20:47:23 2025 +0100
Changeset:	3884d5b060dbba9aa6b2a6419f1fcab5a608c440

Modified Files:
	bind920/Makefile
	bind920/distinfo
Added Files:
	bind920/patches/patch-bin_named_statschannel.c
	bind920/patches/patch-lib_dns_include_dns_zone.h
	bind920/patches/patch-lib_dns_zone.c

Log Message:
bind920: apply patch to fix BIND issue #5198.

Ref. https://gitlab.isc.org/isc-projects/bind9/-/issues/5198
which was an assert failure in the stats handling.

Bump PKGREVISION.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=3884d5b060dbba9aa6b2a6419f1fcab5a608c440

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 bind920/Makefile                                 |  1 +
 bind920/distinfo                                 |  3 ++
 bind920/patches/patch-bin_named_statschannel.c   | 44 ++++++++++++++++++++++++
 bind920/patches/patch-lib_dns_include_dns_zone.h | 30 ++++++++++++++++
 bind920/patches/patch-lib_dns_zone.c             | 35 +++++++++++++++++++
 5 files changed, 113 insertions(+)

diffs:
diff --git a/bind920/Makefile b/bind920/Makefile
index 80b7d11074..19f98b4b13 100644
--- a/bind920/Makefile
+++ b/bind920/Makefile
@@ -2,6 +2,7 @@
 
 DISTNAME=	bind-${BIND_VERSION}
 PKGNAME=	${DISTNAME:S/-P/pl/}
+PKGREVISION=	1
 CATEGORIES=	net
 MASTER_SITES=	https://downloads.isc.org/isc/bind9/${BIND_VERSION}/
 EXTRACT_SUFX=	.tar.xz
diff --git a/bind920/distinfo b/bind920/distinfo
index 28a1ed6036..3bfd60f985 100644
--- a/bind920/distinfo
+++ b/bind920/distinfo
@@ -3,4 +3,7 @@ $NetBSD: distinfo,v 1.20 2024/07/23 13:50:32 taca Exp $
 BLAKE2s (bind-9.20.6.tar.xz) = e9bd08fb5fbea3d8e560adfed64f182d1efb2c6ad0dd0ec1712998990440c484
 SHA512 (bind-9.20.6.tar.xz) = 8582f0f0acde7898ade2aba30bdcf4ef71a3d45c938b815b70bdb06c604680c2213ff508d598472c3962f75741a926edbe2280581841f3f3c95c0cba1c56c96f
 Size (bind-9.20.6.tar.xz) = 5639720 bytes
+SHA1 (patch-bin_named_statschannel.c) = 0be5baa65ad129f5ed551ae239d49091c177d91d
 SHA1 (patch-configure.ac) = f1f672271aa38c10b12d12d48455eb0af82d270c
+SHA1 (patch-lib_dns_include_dns_zone.h) = 14cc09f7ad1fa9cd29ec089c294111c48a403535
+SHA1 (patch-lib_dns_zone.c) = e6d1e643181271c185bc92fb188becb85f7340fb
diff --git a/bind920/patches/patch-bin_named_statschannel.c b/bind920/patches/patch-bin_named_statschannel.c
new file mode 100644
index 0000000000..3c432824a1
--- /dev/null
+++ b/bind920/patches/patch-bin_named_statschannel.c
@@ -0,0 +1,44 @@
+$NetBSD$
+
+Apply patch from https://gitlab.isc.org/isc-projects/bind9/-/issues/5198
+to work around core dump observed there.
+
+--- bin/named/statschannel.c.orig	2025-02-11 17:35:30.652314501 +0000
++++ bin/named/statschannel.c
+@@ -1606,9 +1606,13 @@ xfrin_xmlrender(dns_zone_t *zone, void *
+ 		isc_sockaddr_format(addrp, addr_buf, sizeof(addr_buf));
+ 		TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
+ 	} else if (is_presoa) {
+-		addr = dns_zone_getprimaryaddr(zone);
+-		isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
+-		TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR addr_buf));
++		if (dns_zone_getprimaryaddr(zone, &addr) == ISC_R_SUCCESS) {
++			isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
++			TRY0(xmlTextWriterWriteString(writer,
++						      ISC_XMLCHAR addr_buf));
++		} else {
++			TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "-"));
++		}
+ 	} else {
+ 		TRY0(xmlTextWriterWriteString(writer, ISC_XMLCHAR "-"));
+ 	}
+@@ -2659,10 +2663,15 @@ xfrin_jsonrender(dns_zone_t *zone, void 
+ 		json_object_object_add(xfrinobj, "remoteaddr",
+ 				       json_object_new_string(addr_buf));
+ 	} else if (is_presoa) {
+-		addr = dns_zone_getprimaryaddr(zone);
+-		isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
+-		json_object_object_add(xfrinobj, "remoteaddr",
+-				       json_object_new_string(addr_buf));
++		if (dns_zone_getprimaryaddr(zone, &addr) == ISC_R_SUCCESS) {
++			isc_sockaddr_format(&addr, addr_buf, sizeof(addr_buf));
++			json_object_object_add(
++				xfrinobj, "remoteaddr",
++				json_object_new_string(addr_buf));
++		} else {
++			json_object_object_add(xfrinobj, "remoteaddr",
++					       json_object_new_string("-"));
++		}
+ 	} else {
+ 		json_object_object_add(xfrinobj, "remoteaddr",
+ 				       json_object_new_string("-"));
diff --git a/bind920/patches/patch-lib_dns_include_dns_zone.h b/bind920/patches/patch-lib_dns_include_dns_zone.h
new file mode 100644
index 0000000000..593ad032fc
--- /dev/null
+++ b/bind920/patches/patch-lib_dns_include_dns_zone.h
@@ -0,0 +1,30 @@
+$NetBSD$
+
+Apply patch from https://gitlab.isc.org/isc-projects/bind9/-/issues/5198
+to work around core dump observed there.
+
+--- lib/dns/include/dns/zone.h.orig	2025-02-11 17:35:30.987333800 +0000
++++ lib/dns/include/dns/zone.h
+@@ -1544,14 +1544,19 @@ dns_zone_getsourceaddr(dns_zone_t *zone)
+  * \li	'zone' has a non-empty primaries list.
+  */
+ 
+-isc_sockaddr_t
+-dns_zone_getprimaryaddr(dns_zone_t *zone);
++isc_result_t
++dns_zone_getprimaryaddr(dns_zone_t *zone, isc_sockaddr_t *dest);
+ /*%<
+- * Get the zone's current primary server.
++ * Get the zone's current primary server into '*dest'.
+  *
+  * Requires:
+  * \li	'zone' to be a valid zone.
+  * \li	'zone' has a non-empty primaries list.
++ * \li	'dest' != NULL.
++ *
++ * Returns:
++ *\li	#ISC_R_SUCCESS if the current primary server was found
++ *\li	#ISC_R_NOMORE if all the primaries failed during the last xfer
+  */
+ 
+ isc_time_t
diff --git a/bind920/patches/patch-lib_dns_zone.c b/bind920/patches/patch-lib_dns_zone.c
new file mode 100644
index 0000000000..5d940949aa
--- /dev/null
+++ b/bind920/patches/patch-lib_dns_zone.c
@@ -0,0 +1,35 @@
+$NetBSD$
+
+Apply patch from https://gitlab.isc.org/isc-projects/bind9/-/issues/5198
+to work around core dump observed there.
+
+--- lib/dns/zone.c.orig	2025-02-11 17:35:31.021335759 +0000
++++ lib/dns/zone.c
+@@ -18212,18 +18212,22 @@ dns_zone_getsourceaddr(dns_zone_t *zone)
+ 	return sourceaddr;
+ }
+ 
+-isc_sockaddr_t
+-dns_zone_getprimaryaddr(dns_zone_t *zone) {
+-	isc_sockaddr_t curraddr;
++isc_result_t
++dns_zone_getprimaryaddr(dns_zone_t *zone, isc_sockaddr_t *dest) {
++	isc_result_t result = ISC_R_NOMORE;
+ 
+ 	REQUIRE(DNS_ZONE_VALID(zone));
++	REQUIRE(dest != NULL);
+ 
+ 	LOCK_ZONE(zone);
+ 	INSIST(dns_remote_count(&zone->primaries) > 0);
+-	curraddr = dns_remote_curraddr(&zone->primaries);
++	if (!dns_remote_done(&zone->primaries)) {
++		*dest = dns_remote_curraddr(&zone->primaries);
++		result = ISC_R_SUCCESS;
++	}
+ 	UNLOCK_ZONE(zone);
+ 
+-	return curraddr;
++	return result;
+ }
+ 
+ isc_time_t


Home | Main Index | Thread Index | Old Index