git: e262f714c32f - main - net-mgmt/xymon-server: Import patches from Debian

From: Mark Felder <feld_at_FreeBSD.org>
Date: Tue, 25 Nov 2025 22:58:29 UTC
The branch main has been updated by feld:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e262f714c32f1d2f00e6331d25446f14c74b7444

commit e262f714c32f1d2f00e6331d25446f14c74b7444
Author:     Mark Felder <feld@FreeBSD.org>
AuthorDate: 2025-11-25 22:53:29 +0000
Commit:     Mark Felder <feld@FreeBSD.org>
CommitDate: 2025-11-25 22:58:17 +0000

    net-mgmt/xymon-server: Import patches from Debian
    
    Development of Xymon has slowed, but is not abandoned. Debian has
    accumulated several patches that have not made it into a release yet
    which we should import.
    
    - Fix bbcombotest: "Could not access hobbitd board, error 0"
    - Fix reading service banners from TLS-1.3-enabled hosts
    - Fix Snapshot and Availability Report on Firefox
    - Fix buffer overflow in md5hash
---
 net-mgmt/xymon-server/Makefile                     |  2 +-
 net-mgmt/xymon-server/files/patch-bbcombotest-fix  | 18 ++++++++++
 net-mgmt/xymon-server/files/patch-fix_tls13_banner | 39 ++++++++++++++++++++++
 .../xymon-server/files/patch-md5_buffer_overflow   | 17 ++++++++++
 net-mgmt/xymon-server/files/patch-nousemultipart   | 29 ++++++++++++++++
 5 files changed, 104 insertions(+), 1 deletion(-)

diff --git a/net-mgmt/xymon-server/Makefile b/net-mgmt/xymon-server/Makefile
index fd0da5d3ac0e..4b2f5cdda735 100644
--- a/net-mgmt/xymon-server/Makefile
+++ b/net-mgmt/xymon-server/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	xymon
 PORTVERSION=	4.3.30
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	net-mgmt www
 MASTER_SITES=	SF/xymon/Xymon/${PORTVERSION}
 PKGNAMESUFFIX=	-server${PKGNAMESUFFIX2}
diff --git a/net-mgmt/xymon-server/files/patch-bbcombotest-fix b/net-mgmt/xymon-server/files/patch-bbcombotest-fix
new file mode 100644
index 000000000000..a71d722b739b
--- /dev/null
+++ b/net-mgmt/xymon-server/files/patch-bbcombotest-fix
@@ -0,0 +1,18 @@
+Description: Fix bbcombotest: "Could not access hobbitd board, error 0"
+Author: Christoph Berg <myon@debian.org>
+Forwarded: no
+Last-Update: 2015-09-10
+
+Index: xymon/xymond/combostatus.c
+===================================================================
+--- xymond/combostatus.c	2012-07-23 23:39:37.000000000 +0200
++++ xymond/combostatus.c	2012-07-23 23:41:04.000000000 +0200
+@@ -207,7 +207,7 @@
+ 		xymondresult = sendmessage("xymondboard fields=hostname,testname,color", NULL, XYMON_TIMEOUT, sres);
+ 		board = getsendreturnstr(sres, 1);
+ 
+-		if ((xymondresult != XYMONSEND_OK) || (board == NULL)) {
++		if (xymondresult != XYMONSEND_OK) {
+ 			board = "";
+ 			*errptr += sprintf(*errptr, "Could not access xymond board, error %d\n", xymondresult);
+ 			return COL_CLEAR;
diff --git a/net-mgmt/xymon-server/files/patch-fix_tls13_banner b/net-mgmt/xymon-server/files/patch-fix_tls13_banner
new file mode 100644
index 000000000000..ebcffdcfdf30
--- /dev/null
+++ b/net-mgmt/xymon-server/files/patch-fix_tls13_banner
@@ -0,0 +1,39 @@
+From: Andreas Oberritter <obi@saftware.de>
+Date: Tue, 11 May 2021 13:05:10 +0200
+Subject: Fix reading service banners from TLS-1.3-enabled hosts
+
+Bug-Debian: https://bugs.debian.org/930532
+Forwarded: https://lists.xymon.com/archive/2024-February/048290.html
+Last-Update: 2021-05-11
+
+
+Related discussion:
+https://lists.xymon.com/archive/2019-July/046585.html
+https://lists.xymon.com/archive/2019-November/046893.html
+https://lists.xymon.com/archive/2020-February/046986.html
+https://lists.xymon.com/archive/2020-March/046987.html
+https://sourceforge.net/p/xymon/discussion/435278/thread/c0359f08e7/
+---
+ xymonnet/contest.c | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- xymonnet/contest.c
++++ xymonnet/contest.c
+@@ -1347,13 +1347,12 @@ restartselect:
+ 							}
+ 						}
+ 
+-						if ((item->svcinfo->flags & TCP_HTTP) && 
+-						    ((res > 0) || item->sslagain)     &&
+-						    (!datadone) ) {
++						if (((item->svcinfo->flags & TCP_HTTP) && res > 0) || item->sslagain) {
+ 							/*
+-							 * HTTP : Grab the entire response.
++							 * Grab the entire HTTP response or wait for
++							 * TLS handshake to complete.
+ 							 */
+-							wantmoredata = 1;
++							wantmoredata = !datadone;
+ 						}
+ 
+ 						if (!wantmoredata) {
diff --git a/net-mgmt/xymon-server/files/patch-md5_buffer_overflow b/net-mgmt/xymon-server/files/patch-md5_buffer_overflow
new file mode 100644
index 000000000000..3b4d1a92ae89
--- /dev/null
+++ b/net-mgmt/xymon-server/files/patch-md5_buffer_overflow
@@ -0,0 +1,17 @@
+From: Roland Rosenfeld <roland@debian.org>
+Date: Tue, 24 Sep 2024 21:53:18 +0200
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xymon/+bug/2078638
+Subject: Fix buffer overflow in md5hash
+ This is triggered/found by -D_FORTIFY_SOURCE=3
+
+--- lib/digest.c
++++ lib/digest.c
+@@ -41,7 +41,7 @@ char *md5hash(char *input)
+ 	myMD5_Final(md_value, ctx->mdctx);
+ 
+ 	for(i = 0, p = md_string; (i < sizeof(md_value)); i++) 
+-		p += snprintf(p, (sizeof(md_string) - (md_string - p)), "%02x", md_value[i]);
++		p += snprintf(p, (sizeof(md_string) - (p - md_string)), "%02x", md_value[i]);
+ 	*p = '\0';
+ 
+ 	return md_string;
diff --git a/net-mgmt/xymon-server/files/patch-nousemultipart b/net-mgmt/xymon-server/files/patch-nousemultipart
new file mode 100644
index 000000000000..44cc7550971a
--- /dev/null
+++ b/net-mgmt/xymon-server/files/patch-nousemultipart
@@ -0,0 +1,29 @@
+From: Roland Rosenfeld <roland@debian.org>
+Date: Mon, 12 Jul 2021 13:34:10 +0200
+Forwarded: https://lists.xymon.com/archive/2024-February/048287.html
+Subject: Fix Snapshort and Availability Report on Firefox
+
+Bug-Debian: https://bugs.debian.org/990989
+
+--- web/report.c
++++ web/report.c
+@@ -204,7 +204,7 @@ int main(int argc, char *argv[])
+ 	int argi, newargi;
+ 	char *envarea = NULL;
+ 	char *useragent = NULL;
+-	int usemultipart = 1;
++	int usemultipart = 0;
+ 
+ 	SBUF_MALLOC(outdir, PATH_MAX+1024);
+ 	SBUF_MALLOC(xymonwebenv, PATH_MAX+1024);
+--- web/snapshot.c
++++ web/snapshot.c
+@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
+ 	int argi, newargi;
+ 	char *envarea = NULL;
+ 	char *useragent;
+-	int usemultipart = 1;
++	int usemultipart = 0;
+ 
+ 	SBUF_MALLOC(xymongencmd, 2048+PATH_MAX);
+ 	SBUF_MALLOC(xymonwebenv, 4096);