pkgsrc-Changes archive

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

CVS commit: pkgsrc/net



Module Name:    pkgsrc
Committed By:   spz
Date:           Sun Nov 24 20:16:55 UTC 2019

Modified Files:
        pkgsrc/net/xymon: Makefile distinfo
        pkgsrc/net/xymon/patches: patch-build_Makefile.Linux
        pkgsrc/net/xymonclient: Makefile distinfo
        pkgsrc/net/xymonclient/patches: patch-build_Makefile.Linux
Added Files:
        pkgsrc/net/xymon/patches: patch-lib_acklog.c patch-lib_availability.c
            patch-lib_availability.h patch-lib_eventlog.c patch-lib_holidays.c
            patch-lib_htmllog.c patch-lib_misc.c patch-lib_stackio.c
            patch-lib_timefunc.c patch-lib_tree.c patch-web_history.c
            patch-web_reportlog.c patch-web_showgraph.c
            patch-xymond_combostatus.c patch-xymond_rrd_do__temperature.c
            patch-xymond_xymond__history.c patch-xymonnet_xymonnet.c

Log Message:
Update xymon and xymonclient to version 4.3.29.
Add patches to xymon from the xymon code repository to fix compatibility
issues in 4.3.29.

Upstream changelog:

   Changes for 4.3.29
   ==================

   Several buffer overflow security issues have been resolved, as well as
   a potential XSS attack on certain CGI interfaces. Although the ability
   to exploit is limited, all users are urged to upgrade.
   The assigned CVE numbers are:

     CVE-2019-13451, CVE-2019-13452, CVE-2019-13455, CVE-2019-13473,
     CVE-2019-13474, CVE-2019-13484, CVE-2019-13485, CVE-2019-13486

   In addition, revisions have been made to a number of places throughout
   the code to convert the most common sprintf statements to snprintf for
   safer processing, which should reduce the impact of similar parsing.
   Additional work on this will continue in the future.

   The affected CGIs are:

        history.c (overflow of histlogfn) = CVE-2019-13451
        reportlog.c (overflow of histlogfn) = CVE-2019-13452
        csvinfo.c (overflow of dbfn) = CVE-2019-13273
        csvinfo.c (reflected XSS) = CVE-2019-13274
        acknowledge.c (overflow of msgline) = CVE-2019-13455

        appfeed.c (overflow of errtxt) = CVE-2019-13484
        history.c (overflow of selfurl) = CVE-2019-13485
        svcstatus.c (overflow of errtxt) = CVE-2019-13486

   We would like to thank the University of Cambridge Computer Security
   Incident Response Team for their assistance in reporting and helping
   resolve these issues.

   Additional Changes:

   On Linux, a few additional tmpfs volumes are ignored by default
   on new (or unmodified) installs. This includes /run/user/<uid>,
   which is a transient, per-session tmpfs on some systems. To re-
   enable monitoring for this (if you are running services under
   a user with a login session), you may need to edit the analysis.cfg(5)
   file.

   After upgrade, these partitions will no longer be alerted on or
   tracked, and their associated RRD files may also be removed:

    /run/user/<uid> (but NOT /run)
    /dev (but NOT /dev/shm)
    /sys/fs/cgroup
    /lib/init/rw

   The default hard limit for an incoming message has been raised from
   10MB to 64MB

   The secure apache config snippet no longer requires a xymongroups file
   to be present (and module loaded), since it's not used by default. This
   will not affect existing installs.

   A --no-cpu-listing option has been added to xymond_client to suppress the
   'top' output in cpu test status messages.

   The conversation used in SMTP checks has been adjusted to perform a proper
   "EHLO" greeting against servers, using the host string 'xymonnet'. If the
   string needs to be adjusted, however, see protocols.cfg(5)

   "Actual" memory usage (as a percentage) may be >100% on some platforms
   in certain situations. This alone will not be tagged as "invalid" data
   and should be graphed in RRD.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 pkgsrc/net/xymon/Makefile
cvs rdiff -u -r1.17 -r1.18 pkgsrc/net/xymon/distinfo
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/xymon/patches/patch-build_Makefile.Linux
cvs rdiff -u -r0 -r1.1 pkgsrc/net/xymon/patches/patch-lib_acklog.c \
    pkgsrc/net/xymon/patches/patch-lib_availability.c \
    pkgsrc/net/xymon/patches/patch-lib_availability.h \
    pkgsrc/net/xymon/patches/patch-lib_eventlog.c \
    pkgsrc/net/xymon/patches/patch-lib_holidays.c \
    pkgsrc/net/xymon/patches/patch-lib_htmllog.c \
    pkgsrc/net/xymon/patches/patch-lib_misc.c \
    pkgsrc/net/xymon/patches/patch-lib_stackio.c \
    pkgsrc/net/xymon/patches/patch-lib_timefunc.c \
    pkgsrc/net/xymon/patches/patch-lib_tree.c \
    pkgsrc/net/xymon/patches/patch-web_history.c \
    pkgsrc/net/xymon/patches/patch-web_reportlog.c \
    pkgsrc/net/xymon/patches/patch-web_showgraph.c \
    pkgsrc/net/xymon/patches/patch-xymond_combostatus.c \
    pkgsrc/net/xymon/patches/patch-xymond_rrd_do__temperature.c \
    pkgsrc/net/xymon/patches/patch-xymond_xymond__history.c \
    pkgsrc/net/xymon/patches/patch-xymonnet_xymonnet.c
cvs rdiff -u -r1.21 -r1.22 pkgsrc/net/xymonclient/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/net/xymonclient/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux

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

Modified files:

Index: pkgsrc/net/xymon/Makefile
diff -u pkgsrc/net/xymon/Makefile:1.56 pkgsrc/net/xymon/Makefile:1.57
--- pkgsrc/net/xymon/Makefile:1.56      Wed Nov 14 22:22:15 2018
+++ pkgsrc/net/xymon/Makefile   Sun Nov 24 20:16:55 2019
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.56 2018/11/14 22:22:15 kleink Exp $
+# $NetBSD: Makefile,v 1.57 2019/11/24 20:16:55 spz Exp $
 #
 
-DISTNAME=              xymon-4.3.28
-PKGREVISION=           4
+DISTNAME=              xymon-4.3.29
+#PKGREVISION=          0
 CATEGORIES=            net
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=xymon/}
 

Index: pkgsrc/net/xymon/distinfo
diff -u pkgsrc/net/xymon/distinfo:1.17 pkgsrc/net/xymon/distinfo:1.18
--- pkgsrc/net/xymon/distinfo:1.17      Thu Sep 28 10:40:35 2017
+++ pkgsrc/net/xymon/distinfo   Sun Nov 24 20:16:55 2019
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.17 2017/09/28 10:40:35 spz Exp $
+$NetBSD: distinfo,v 1.18 2019/11/24 20:16:55 spz Exp $
 
-SHA1 (xymon-4.3.28.tar.gz) = 9b134af41549e46f46f310b315f70ce42e6668a7
-RMD160 (xymon-4.3.28.tar.gz) = 7d2426a6639c52b0a1f6e3d2e5c4e4607090809d
-SHA512 (xymon-4.3.28.tar.gz) = 589230ee05028c2131d1ddf32dd1a5f302bfcdbf8276bc6ee0fb9590ae2bfe218bf49d931cfa68491160c35818d0bee93b7fcea47b85f924a4f991a5ff608477
-Size (xymon-4.3.28.tar.gz) = 3966200 bytes
+SHA1 (xymon-4.3.29.tar.gz) = faf18c75839b4ec0863cbf309651c54bb2890988
+RMD160 (xymon-4.3.29.tar.gz) = 5a1bac0ae5674db6e3d810a25597373fdc6b7238
+SHA512 (xymon-4.3.29.tar.gz) = 63db006baa0cf0a4e3b85d2cbe0a6e230f87922d0b9cc21792672a1551d40f60ea371a34337a93df248456731709a91bafdb630a219a25ba9d76043e54ded196
+Size (xymon-4.3.29.tar.gz) = 3548283 bytes
 SHA1 (patch-aa) = 227b631c6e002712ebf6019d8473ca4b44904e4a
 SHA1 (patch-ab) = 39a6af51ec216bb8cbdb57a3c07d82fce559b27f
 SHA1 (patch-ac) = 518abacafb7f082ab2de6bcaace27d3e3d4de633
@@ -16,7 +16,7 @@ SHA1 (patch-build_Makefile.Darwin) = 3b8
 SHA1 (patch-build_Makefile.FreeBSD) = 6ebfa5bab2955eaa42b0021de085eb7ba536432b
 SHA1 (patch-build_Makefile.HP-UX) = bdd713b83f3670096bb10def6c59036d0a4aa377
 SHA1 (patch-build_Makefile.IRIX) = b0ce34295d199ffd1e9008569667abbe436a2355
-SHA1 (patch-build_Makefile.Linux) = 3dd75b6613fbf268411ec177f8be5acd48ac8c27
+SHA1 (patch-build_Makefile.Linux) = bddfea6c8400fdd7d8a83a6958f1e4139ef988b6
 SHA1 (patch-build_Makefile.OSF1) = 1a7afce4beeef249b2435c2ef14f45b2c2dbf8a2
 SHA1 (patch-build_Makefile.OSX) = a72b748600b043f458452ab37175c38087375559
 SHA1 (patch-build_Makefile.OpenBSD) = cf40c7839ba6290d349328e2e01a20bdaf274fc6
@@ -26,8 +26,25 @@ SHA1 (patch-build_rrd.sh) = cfafece75def
 SHA1 (patch-build_snmp.sh) = 4141c6e2bebea078ac662b7585e579f2af8ee64f
 SHA1 (patch-common_Makefile) = 32b7da06cd9d22f98ee0f83bb36ed6441c066707
 SHA1 (patch-configure) = 3754b9056c365b8664e5fc9620b17c4e13453b2e
+SHA1 (patch-lib_acklog.c) = 053e63b7b5d55345360c49279eacc7ae470cc3a4
+SHA1 (patch-lib_availability.c) = 04d6133f00811afd1aa1263a00ae6396df5202e3
+SHA1 (patch-lib_availability.h) = 89ac49779c9bd5090718dfdc24949c6eb67b5705
+SHA1 (patch-lib_eventlog.c) = b1b8ee4ffb211f2461cc3d6e3055d9ee045a4da0
+SHA1 (patch-lib_holidays.c) = 980d42b5780e37a483fde6a2059294e050abba85
+SHA1 (patch-lib_htmllog.c) = 7184ec5014f9b19916541b5ac4c7b7f393623a4d
+SHA1 (patch-lib_misc.c) = 2ee78934dfb5c25f78fc9c5400baadd3e2e7b70b
+SHA1 (patch-lib_stackio.c) = 6e97fde074ce41b39c29bf280c560b01d885f875
+SHA1 (patch-lib_timefunc.c) = 7e7d7e17252a8ea2e4b7d5bd8e5c2fa7247b9287
+SHA1 (patch-lib_tree.c) = 13f8d0d89cb0e0cb9e023734b60f9d67707b0a99
 SHA1 (patch-web_Makefile) = a27fbb7e97ce0c2f30093d5b05b0af2708fb594b
+SHA1 (patch-web_history.c) = cdddc0230efdb79dbae3055a93e252f43dc49524
+SHA1 (patch-web_reportlog.c) = 78068e40253ab295dced37368f19bf1bbe5bd747
+SHA1 (patch-web_showgraph.c) = 9c5542975ffd65aff9d2fd03a3d63fde10648ad4
 SHA1 (patch-xymond_client_netbsd.c) = 9034777cbf12e3e168cf1598bfd444468e3a5086
+SHA1 (patch-xymond_combostatus.c) = cce34cc01bfaba9f171e7d90d3ec398a97e4c4d5
 SHA1 (patch-xymond_rrd_do__disk.c) = e72cb0364e4e949e02a045da0abca46083624253
+SHA1 (patch-xymond_rrd_do__temperature.c) = bf78c81b6f189e6424574eae53921cf44d653a0d
 SHA1 (patch-xymond_rrd_do__vmstat.c) = 8062acc24e9b0e767c5abd3373641aa7b9a5b2ae
+SHA1 (patch-xymond_xymond__history.c) = 4fadebc1caaba9a0368de7626ed389040718d1ac
+SHA1 (patch-xymonnet_xymonnet.c) = 849cb3c3f3e673dc3927ce34195f9bc6c594d895
 SHA1 (patch-xymonproxy_Makefile) = 8ecfa4ceb66f66b7d5f40c01339479b26865746e

Index: pkgsrc/net/xymon/patches/patch-build_Makefile.Linux
diff -u pkgsrc/net/xymon/patches/patch-build_Makefile.Linux:1.2 pkgsrc/net/xymon/patches/patch-build_Makefile.Linux:1.3
--- pkgsrc/net/xymon/patches/patch-build_Makefile.Linux:1.2     Thu Sep 28 10:40:35 2017
+++ pkgsrc/net/xymon/patches/patch-build_Makefile.Linux Sun Nov 24 20:16:55 2019
@@ -1,22 +1,24 @@
-$NetBSD: patch-build_Makefile.Linux,v 1.2 2017/09/28 10:40:35 spz Exp $
+$NetBSD: patch-build_Makefile.Linux,v 1.3 2019/11/24 20:16:55 spz Exp $
 
---- build/Makefile.Linux.orig  2012-07-23 11:29:13.000000000 +0000
+--- build/Makefile.Linux.orig  2019-03-11 23:17:41.000000000 +0000
 +++ build/Makefile.Linux
-@@ -6,12 +6,15 @@ OSDEF = -DLINUX
- NETLIBS =
+@@ -5,13 +5,17 @@ OSDEF = -DLINUX
+ # NETLIBS: Use replacement rpc
+ NETLIBS = -ltirpc
  
++# pkgsrcification
++PKGDIR ?= /usr/pkg
++PKGDEF = -I${PKGDIR}/include -L${PKGDIR}/lib -Wl,--rpath=${PKGDIR}/lib
++
  # Compile flags for normal build
-+PKGDIR?=/usr/pkg
  CC = gcc
- GCCVER := $(shell gcc -dumpversion|cut -d. -f1)
- ifeq ($(GCCVER),4)
--   CFLAGS = -g -O2 -Wall -Wno-unused -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
-+   CFLAGS += -g -O2 -Wall -Wno-unused -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF) \
-+       -I${PKGDIR}/include -L${PKGDIR}/lib -Wl,--rpath=${PKGDIR}/lib
+ GCCVER := $(shell test 0`gcc -dumpversion|cut -d. -f1` -ge 4 && echo yes)
+ ifeq ($(GCCVER),yes)
+-   CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
++   CFLAGS += -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF) $(PKGDEF)
  else
--   CFLAGS = -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
-+   CFLAGS += -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF) \
-+       -I${PKGDIR}/include -L${PKGDIR}/lib -Wl,--rpath=${PKGDIR}/lib
+-   CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -D_REENTRANT $(LFSDEF) $(OSDEF)
++   CFLAGS += -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -D_REENTRANT $(LFSDEF) $(OSDEF) $(PKGDEF)
  endif
  
  ifndef PKGBUILD

Index: pkgsrc/net/xymonclient/Makefile
diff -u pkgsrc/net/xymonclient/Makefile:1.21 pkgsrc/net/xymonclient/Makefile:1.22
--- pkgsrc/net/xymonclient/Makefile:1.21        Thu Sep 28 10:40:35 2017
+++ pkgsrc/net/xymonclient/Makefile     Sun Nov 24 20:16:55 2019
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.21 2017/09/28 10:40:35 spz Exp $
+# $NetBSD: Makefile,v 1.22 2019/11/24 20:16:55 spz Exp $
 #
 
-DISTNAME=              xymon-4.3.28
-PKGNAME=               xymonclient-4.3.28
+DISTNAME=              xymon-4.3.29
+PKGNAME=               xymonclient-4.3.29
 CATEGORIES=            net
 MASTER_SITES=          ${MASTER_SITE_SOURCEFORGE:=xymon/}
 

Index: pkgsrc/net/xymonclient/distinfo
diff -u pkgsrc/net/xymonclient/distinfo:1.16 pkgsrc/net/xymonclient/distinfo:1.17
--- pkgsrc/net/xymonclient/distinfo:1.16        Thu Sep 28 10:40:35 2017
+++ pkgsrc/net/xymonclient/distinfo     Sun Nov 24 20:16:55 2019
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.16 2017/09/28 10:40:35 spz Exp $
+$NetBSD: distinfo,v 1.17 2019/11/24 20:16:55 spz Exp $
 
-SHA1 (xymon-4.3.28.tar.gz) = 9b134af41549e46f46f310b315f70ce42e6668a7
-RMD160 (xymon-4.3.28.tar.gz) = 7d2426a6639c52b0a1f6e3d2e5c4e4607090809d
-SHA512 (xymon-4.3.28.tar.gz) = 589230ee05028c2131d1ddf32dd1a5f302bfcdbf8276bc6ee0fb9590ae2bfe218bf49d931cfa68491160c35818d0bee93b7fcea47b85f924a4f991a5ff608477
-Size (xymon-4.3.28.tar.gz) = 3966200 bytes
+SHA1 (xymon-4.3.29.tar.gz) = faf18c75839b4ec0863cbf309651c54bb2890988
+RMD160 (xymon-4.3.29.tar.gz) = 5a1bac0ae5674db6e3d810a25597373fdc6b7238
+SHA512 (xymon-4.3.29.tar.gz) = 63db006baa0cf0a4e3b85d2cbe0a6e230f87922d0b9cc21792672a1551d40f60ea371a34337a93df248456731709a91bafdb630a219a25ba9d76043e54ded196
+Size (xymon-4.3.29.tar.gz) = 3548283 bytes
 SHA1 (patch-aa) = c44f791ef6005c809127175cb563bd8f0ac74642
 SHA1 (patch-ab) = db0c5808cfad75aaf37217509399597191236180
 SHA1 (patch-ac) = d1694c2b67e6f2ae616b2a46de1a01d3199b45f5
@@ -15,7 +15,7 @@ SHA1 (patch-build_Makefile.Darwin) = 3b8
 SHA1 (patch-build_Makefile.FreeBSD) = 18010c36f754f28d50a921eac59382393f90cf4d
 SHA1 (patch-build_Makefile.HP-UX) = bdd713b83f3670096bb10def6c59036d0a4aa377
 SHA1 (patch-build_Makefile.IRIX) = b0ce34295d199ffd1e9008569667abbe436a2355
-SHA1 (patch-build_Makefile.Linux) = 987251358765c00aeb5a13f78e5018a6c768be10
+SHA1 (patch-build_Makefile.Linux) = bddfea6c8400fdd7d8a83a6958f1e4139ef988b6
 SHA1 (patch-build_Makefile.OSF1) = 1a7afce4beeef249b2435c2ef14f45b2c2dbf8a2
 SHA1 (patch-build_Makefile.OSX) = a72b748600b043f458452ab37175c38087375559
 SHA1 (patch-build_Makefile.OpenBSD) = cf40c7839ba6290d349328e2e01a20bdaf274fc6

Index: pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux
diff -u pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux:1.1 pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux:1.2
--- pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux:1.1       Thu Sep 28 10:40:35 2017
+++ pkgsrc/net/xymonclient/patches/patch-build_Makefile.Linux   Sun Nov 24 20:16:55 2019
@@ -1,18 +1,24 @@
-$NetBSD: patch-build_Makefile.Linux,v 1.1 2017/09/28 10:40:35 spz Exp $
+$NetBSD: patch-build_Makefile.Linux,v 1.2 2019/11/24 20:16:55 spz Exp $
 
-make sure hardening flags can be inherited
-
---- build/Makefile.Linux.orig  2013-04-21 10:53:38.000000000 +0000
+--- build/Makefile.Linux.orig  2019-03-11 23:17:41.000000000 +0000
 +++ build/Makefile.Linux
-@@ -9,9 +9,9 @@ NETLIBS =
+@@ -5,13 +5,17 @@ OSDEF = -DLINUX
+ # NETLIBS: Use replacement rpc
+ NETLIBS = -ltirpc
+ 
++# pkgsrcification
++PKGDIR ?= /usr/pkg
++PKGDEF = -I${PKGDIR}/include -L${PKGDIR}/lib -Wl,--rpath=${PKGDIR}/lib
++
+ # Compile flags for normal build
  CC = gcc
- GCCVER := $(shell gcc -dumpversion|cut -d. -f1)
- ifeq ($(GCCVER),4)
--   CFLAGS = -g -O2 -Wall -Wno-unused -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
-+   CFLAGS += -g -O2 -Wall -Wno-unused -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
+ GCCVER := $(shell test 0`gcc -dumpversion|cut -d. -f1` -ge 4 && echo yes)
+ ifeq ($(GCCVER),yes)
+-   CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF)
++   CFLAGS += -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -Wno-pointer-sign -D_REENTRANT $(LFSDEF) $(OSDEF) $(PKGDEF)
  else
--   CFLAGS = -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
-+   CFLAGS += -g -O2 -Wall -Wno-unused -D_REENTRANT $(LFSDEF) $(OSDEF)
+-   CFLAGS = -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -D_REENTRANT $(LFSDEF) $(OSDEF)
++   CFLAGS += -g -O2 -Wall -Wno-unused -I/usr/include/tirpc -D_REENTRANT $(LFSDEF) $(OSDEF) $(PKGDEF)
  endif
  
  ifndef PKGBUILD

Added files:

Index: pkgsrc/net/xymon/patches/patch-lib_acklog.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_acklog.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_acklog.c Sun Nov 24 20:16:55 2019
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_acklog.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/acklog.c.orig  2019-07-23 14:46:51.000000000 +0000
++++ lib/acklog.c
+@@ -126,10 +126,14 @@ void do_acklog(FILE *output, int maxcoun
+                       /* Show only the first 30 characters in message */
+                       if (strlen(ackmsg) > 30) ackmsg[30] = '\0';
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+                       #pragma GCC diagnostic push
+                       #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+                       snprintf(ackfn, sizeof(ackfn), "%s/ack.%s", xgetenv("XYMONACKDIR"), hosttest);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+                       #pragma GCC diagnostic pop
++#endif  // __GNUC__
+ 
+                       testname = strrchr(hosttest, '.');
+                       if (testname) {
Index: pkgsrc/net/xymon/patches/patch-lib_availability.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_availability.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_availability.c   Sun Nov 24 20:16:55 2019
@@ -0,0 +1,200 @@
+$NetBSD: patch-lib_availability.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8081/
+Fix assorted crashes with xymongen report generation after string changes
+
+--- lib/availability.c.orig    2019-07-23 14:46:51.000000000 +0000
++++ lib/availability.c
+@@ -31,6 +31,7 @@ static int reptimecnt = 0;
+ 
+ replog_t *reploghead = NULL;
+ 
++/* TODO: This logic differs from elsewhere below */
+ char *durationstr(time_t duration)
+ {
+       static char dur[100];
+@@ -42,13 +43,13 @@ char *durationstr(time_t duration)
+       else {
+               dur[0] = '\0';
+               if (duration > 86400) {
+-                      snprintf(dhelp, sizeof(dhelp), "%u days ", (unsigned int)(duration / 86400));
++                      snprintf(dhelp, 100, "%u days ", (unsigned int)(duration / 86400));
+                       duration %= 86400;
+-                      strncpy(dur, dhelp, sizeof(dur));
++                      strncpy(dur, dhelp, 100);
+               }
+-              snprintf(dhelp, sizeof(dhelp), "%u:%02u:%02u", (unsigned int)(duration / 3600), 
++              snprintf(dhelp, 100, "%u:%02u:%02u", (unsigned int)(duration / 3600), 
+                       (unsigned int)((duration % 3600) / 60), (unsigned int)(duration % 60));
+-              strncat(dur, dhelp, (sizeof(dur) - strlen(dur)));
++              strncat(dur, dhelp, (100 - strlen(dur)));
+       }
+ 
+       return dur;
+@@ -162,21 +163,21 @@ static char *parse_histlogfile(char *hos
+ 
+       cause[0] = '\0';
+ 
+-      snprintf(fn, sizeof(fn), "%s/%s", xgetenv("XYMONHISTLOGS"), commafy(hostname));
++      snprintf(fn, PATH_MAX, "%s/%s", xgetenv("XYMONHISTLOGS"), commafy(hostname));
+       for (p = strrchr(fn, '/'); (*p); p++) if (*p == ',') *p = '_';
+-      snprintf(p, (sizeof(fn) - (p - fn)), "/%s/%s", servicename, timespec);
++      snprintf(p, (PATH_MAX - (p - fn)), "/%s/%s", servicename, timespec);
+ 
+       dbgprintf("Looking at history logfile %s\n", fn);
+       fd = fopen(fn, "r");
+       if (fd != NULL) {
+-              while (!causefull && fgets(l, sizeof(l), fd)) {
++              while (!causefull && fgets(l, MAX_LINE_LEN, fd)) {
+                       p = strchr(l, '\n'); if (p) *p = '\0';
+ 
+                       if ((l[0] == '&') && (strncmp(l, "&green", 6) != 0)) {
+                               p = skipwhitespace(skipword(l));
+-                              if ((strlen(cause) + strlen(p) + strlen("<BR>\n") + 1) < sizeof(cause)) {
+-                                      strncat(cause, p, (sizeof(cause) - strlen(cause)));
+-                                      strncat(cause, "<BR>\n", (sizeof(cause) - strlen(cause)));
++                              if ((strlen(cause) + strlen(p) + strlen("<BR>\n") + 1) < MAX_LINE_LEN) {
++                                      strncat(cause, p, (MAX_LINE_LEN - strlen(cause)));
++                                      strncat(cause, "<BR>\n", (MAX_LINE_LEN - strlen(cause)));
+                               }
+                               else causefull = 1;
+                       }
+@@ -184,7 +185,7 @@ static char *parse_histlogfile(char *hos
+ 
+ #if 1
+               if (strlen(cause) == 0) {
+-                      strncpy(cause, "See detailed log", sizeof(cause));
++                      strncpy(cause, "See detailed log", MAX_LINE_LEN);
+               }
+ #else
+               /* What is this code supposed to do ? The sscanf seemingly never succeeds */
+@@ -192,28 +193,28 @@ static char *parse_histlogfile(char *hos
+               if (strlen(cause) == 0) {
+                       int offset;
+                       rewind(fd);
+-                      if (fgets(l, sizeof(l), fd)) {
++                      if (fgets(l, MAX_LINE_LEN, fd)) {
+                               p = strchr(l, '\n'); if (p) *p = '\0';
+                               if (sscanf(l, "%*s %*s %*s %*s %*s %*s %*s %n", &offset) == 1) {
+-                                      strncpy(cause, l+offset, sizeof(cause));
++                                      strncpy(cause, l+offset, MAX_LINE_LEN);
+                               }
+                               else {
+                                       errprintf("Scan of file %s failed, l='%s'\n", fn, l);
+                               }
+-                              cause[sizeof(cause)-1] = '\0';
++                              cause[MAX_LINE_LEN-1] = '\0';
+                       }
+               }
+ #endif
+ 
+               if (causefull) {
+-                      cause[sizeof(cause) - strlen(" [Truncated]") - 1] = '\0';
+-                      strncat(cause, " [Truncated]", (sizeof(cause) - strlen(cause)));
++                      cause[MAX_LINE_LEN - strlen(" [Truncated]") - 1] = '\0';
++                      strncat(cause, " [Truncated]", (MAX_LINE_LEN - strlen(cause)));
+               }
+ 
+               fclose(fd);
+       }
+       else {
+-              strncpy(cause, "No historical status available", sizeof(cause));
++              strncpy(cause, "No historical status available", MAX_LINE_LEN);
+       }
+ 
+       return strdup(cause);
+@@ -358,7 +359,7 @@ static char *timename(char *timestring)
+ 
+       if (tokens[4]) {
+               /* Got all 5 elements */
+-              snprintf(timespec, sizeof(timespec), "%s_%s_%s_%s_%s",
++              snprintf(timespec, 25, "%s_%s_%s_%s_%s",
+                        tokens[0], tokens[1], tokens[2], tokens[3], tokens[4]);
+       }
+       else {
+@@ -404,17 +405,17 @@ int parse_historyfile(FILE *fd, reportin
+       /* If for_history and fromtime is 0, don't do any seeking */
+       if (!for_history || (fromtime > 0)) {
+               fileerrors = scan_historyfile(fd, fromtime, totime, 
+-                                    l, sizeof(l), &starttime, &duration, colstr, sizeof(colstr));
++                                    l, MAX_LINE_LEN, &starttime, &duration, colstr, MAX_LINE_LEN);
+       }
+       else {
+               /* Already positioned (probably in a pipe) */
+-              if (get_historyline(l, sizeof(l), fd, &fileerrors, colstr, &uistart, &uidur, &scanres)) {
++              if (get_historyline(l, MAX_LINE_LEN, fd, &fileerrors, colstr, &uistart, &uidur, &scanres)) {
+                       starttime = uistart; duration = uidur;
+                       if (scanres == 2) duration = getcurrenttime(NULL) - starttime;
+               }
+               else {
+                       starttime = getcurrenttime(NULL); duration = 0;
+-                      strncpy(colstr, "clear", sizeof(colstr));
++                      strncpy(colstr, "clear", MAX_LINE_LEN);
+                       fileerrors = 1;
+               }
+       }
+@@ -437,7 +438,7 @@ int parse_historyfile(FILE *fd, reportin
+       do {
+               /* If event ends after our reportend, adjust duration */
+               if ((starttime + duration) > totime) duration = (totime - starttime);
+-              strncat(colstr, " ", (sizeof(colstr) - strlen(colstr))); color = parse_color(colstr);
++              strncat(colstr, " ", (MAX_LINE_LEN - strlen(colstr))); color = parse_color(colstr);
+ 
+               if (color != -1) {
+                       unsigned long sladuration = 0;
+@@ -474,7 +475,7 @@ int parse_historyfile(FILE *fd, reportin
+               }
+ 
+               if ((starttime + duration) < totime) {
+-                      if (get_historyline(l, sizeof(l), fd, &fileerrors, colstr, &uistart, &uidur, &scanres)) {
++                      if (get_historyline(l, MAX_LINE_LEN, fd, &fileerrors, colstr, &uistart, &uidur, &scanres)) {
+                               starttime = uistart; duration = uidur;
+                               if (scanres == 2) duration = getcurrenttime(NULL) - starttime;
+                       }
+@@ -560,9 +561,9 @@ int history_color(FILE *fd, time_t snaps
+       char *p;
+ 
+       *histlogname = NULL;
+-      scan_historyfile(fd, snapshot, snapshot, l, sizeof(l), starttime, &duration, colstr, sizeof(colstr));
++      scan_historyfile(fd, snapshot, snapshot, l, MAX_LINE_LEN, starttime, &duration, colstr, MAX_LINE_LEN);
+       
+-      strncat(colstr, " ", (sizeof(colstr) - strlen(colstr)));
++      strncat(colstr, " ", (MAX_LINE_LEN - strlen(colstr)));
+       color = parse_color(colstr);
+       if ((color == COL_PURPLE) || (color == -1)) {
+               color = -2;
+@@ -621,25 +622,25 @@ int main(int argc, char *argv[])
+       fclose(fd);
+ 
+       for (rwalk = reploghead; (rwalk); rwalk = rwalk->next) {
+-              char start[30];
+-              char end[30];
+-              char dur[30], dhelp[30];
++              char start[MAXDURSIZE];
++              char end[MAXDURSIZE];
++              char dur[MAXDURSIZE], dhelp[MAXDURSIZE];
+               time_t endtime;
+               time_t duration;
+ 
+-              strftime(start, sizeof(start), "%a %b %d %H:%M:%S %Y", localtime(&rwalk->starttime));
++              strftime(start, MAXDURSIZE, "%a %b %d %H:%M:%S %Y", localtime(&rwalk->starttime));
+               endtime = rwalk->starttime + rwalk->duration;
+-              strftime(end, sizeof(end), "%a %b %d %H:%M:%S %Y", localtime(&endtime));
++              strftime(end, MAXDURSIZE, "%a %b %d %H:%M:%S %Y", localtime(&endtime));
+ 
+               duration = rwalk->duration;
+               dur[0] = '\0';
+               if (duration > 86400) {
+-                      snprintf(dhelp, sizeof(dhelp), "%lu days ", (duration / 86400));
++                      snprintf(dhelp, MAXDURSIZE, "%lu days ", (duration / 86400));
+                       duration %= 86400;
+-                      strncpy(dur, dhelp, sizeof(dur));
++                      strncpy(dur, dhelp, MAXDURSIZE);
+               }
+-              snprintf(dhelp, sizeof(dhelp), "%lu:%02lu:%02lu", duration / 3600, ((duration % 3600) / 60), (duration % 60));
+-              strncat(dur, dhelp, (sizeof(dur) - strlen(dur)));
++              snprintf(dhelp, MAXDURSIZE, "%lu:%02lu:%02lu", duration / 3600, ((duration % 3600) / 60), (duration % 60));
++              strncat(dur, dhelp, (MAXDURSIZE - strlen(dur)));
+ 
+               dbgprintf("Start: %s, End: %s, Color: %s, Duration: %s, Cause: %s\n",
+                       start, end, colorname(rwalk->color), dur, rwalk->cause);
Index: pkgsrc/net/xymon/patches/patch-lib_availability.h
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_availability.h:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_availability.h   Sun Nov 24 20:16:55 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-lib_availability.h,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8081/
+Fix assorted crashes with xymongen report generation after string changes
+
+--- lib/availability.h.orig    2011-07-31 21:01:52.000000000 +0000
++++ lib/availability.h
+@@ -42,6 +42,7 @@ typedef struct replog_t {
+ 
+ extern replog_t *reploghead;
+ 
++#define MAXDURSIZE 30
+ extern char *durationstr(time_t duration);
+ extern int parse_historyfile(FILE *fd, reportinfo_t *repinfo, char *hostname, char *servicename, 
+                               time_t fromtime, time_t totime, int for_history,
Index: pkgsrc/net/xymon/patches/patch-lib_eventlog.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_eventlog.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_eventlog.c       Sun Nov 24 20:16:55 2019
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_eventlog.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/eventlog.c.orig        2019-07-23 14:46:51.000000000 +0000
++++ lib/eventlog.c
+@@ -42,10 +42,14 @@ static int wanted_eventcolumn(char *serv
+ 
+       if (!eventignorecolumns || (strlen(service) > (sizeof(svc)-3))) return 1;
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic push
+       #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+       snprintf(svc, sizeof(svc), ",%s,", service);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic pop
++#endif  // __GNUC__
+ 
+       result = (strstr(eventignorecolumns, svc) == NULL);
+ 
Index: pkgsrc/net/xymon/patches/patch-lib_holidays.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_holidays.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_holidays.c       Sun Nov 24 20:16:55 2019
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_holidays.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/holidays.c.orig        2019-07-23 14:46:51.000000000 +0000
++++ lib/holidays.c
+@@ -596,10 +596,14 @@ void printholidays(char *key, strbuffer_
+                       if ((tm.tm_mon >= mfirst) && (tm.tm_mon <= mlast)) {
+                               strftime(dstr, sizeof(dstr), fmt, localtime(&t));
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+                               #pragma GCC diagnostic push
+                               #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+                               snprintf(oneh, sizeof(oneh), "<tr><td>%s</td><td>%s</td>\n", desc, dstr);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+                               #pragma GCC diagnostic pop
++#endif  // __GNUC__
+                               addtobuffer(buf, oneh);
+                       }
+               }
Index: pkgsrc/net/xymon/patches/patch-lib_htmllog.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_htmllog.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_htmllog.c        Sun Nov 24 20:16:55 2019
@@ -0,0 +1,29 @@
+$NetBSD: patch-lib_htmllog.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/htmllog.c.orig 2019-07-23 14:46:51.000000000 +0000
++++ lib/htmllog.c
+@@ -647,8 +647,10 @@ char *hostnamehtml(char *hostname, char 
+        * else just put the hostname there.
+        */
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic push
+       #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+       if (documentationurl) {
+               snprintf(result, sizeof(result), "<A HREF=\"%s\" %s><FONT %s>%s</FONT></A>",
+                       urldoclink(documentationurl, hostname),
+@@ -668,8 +670,10 @@ char *hostnamehtml(char *hostname, char 
+               snprintf(result, sizeof(result), "<FONT %s>%s</FONT>",
+                       xgetenv("XYMONPAGEROWFONT"), nameandcomment(hinfo, hostname, usetooltip));
+       }
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic pop
+ 
++#endif  // __GNUC__
+       return result;
+ }
+ 
Index: pkgsrc/net/xymon/patches/patch-lib_misc.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_misc.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_misc.c   Sun Nov 24 20:16:55 2019
@@ -0,0 +1,18 @@
+$NetBSD: patch-lib_misc.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/misc.c.orig    2019-07-23 14:46:51.000000000 +0000
++++ lib/misc.c
+@@ -465,10 +465,6 @@ char *u32toIP(unsigned int ip32)
+       ip3 = ((ip32 >> 8) & 0xFF);
+       ip4 = (ip32 & 0xFF);
+ 
+-      #pragma GCC diagnostic push
+-      #pragma GCC diagnostic ignored "-Wformat-truncation"
+-      #pragma GCC diagnostic pop
+-
+       snprintf(result, result_buflen, "%d.%d.%d.%d", ip1, ip2, ip3, ip4);
+       return result;
+ }
Index: pkgsrc/net/xymon/patches/patch-lib_stackio.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_stackio.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_stackio.c        Sun Nov 24 20:16:55 2019
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_stackio.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/stackio.c.orig 2019-07-23 14:46:51.000000000 +0000
++++ lib/stackio.c
+@@ -380,10 +380,14 @@ static void addtofnlist(char *dirname, i
+               if ((fnlen >= 8) && ((strcmp(d->d_name + fnlen - 8, ".rpmsave") == 0) || (strcmp(d->d_name + fnlen - 8, ".rpmorig") == 0) ) ) continue;
+               if ((fnlen >= 7) && (strcmp(d->d_name + fnlen - 7, ".rpmnew") == 0)) continue;
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+               #pragma GCC diagnostic push
+               #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+               snprintf(fn, sizeof(fn), "%s/%s", dirfn, d->d_name);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+               #pragma GCC diagnostic pop
++#endif  // __GNUC__
+               if (stat(fn, &st) == -1) continue;
+ 
+               if (S_ISDIR(st.st_mode)) {
Index: pkgsrc/net/xymon/patches/patch-lib_timefunc.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_timefunc.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_timefunc.c       Sun Nov 24 20:16:55 2019
@@ -0,0 +1,22 @@
+$NetBSD: patch-lib_timefunc.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/timefunc.c.orig        2019-07-23 14:46:51.000000000 +0000
++++ lib/timefunc.c
+@@ -393,10 +393,14 @@ char *histlogtime(time_t histtime)
+       if (d2[0] == '0') { d2[0] = d2[1]; d2[1] = '\0'; }
+         strftime(d3, sizeof(d3), "_%H:%M:%S_%Y", localtime(&histtime));
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic push
+       #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+       snprintf(result, result_buflen, "%s%s%s", d1, d2, d3);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+       #pragma GCC diagnostic pop
++#endif  // __GNUC__
+ 
+       MEMUNDEFINE(d1); MEMUNDEFINE(d2); MEMUNDEFINE(d3);
+ 
Index: pkgsrc/net/xymon/patches/patch-lib_tree.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-lib_tree.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-lib_tree.c   Sun Nov 24 20:16:55 2019
@@ -0,0 +1,27 @@
+$NetBSD: patch-lib_tree.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- lib/tree.c.orig    2019-07-23 14:46:51.000000000 +0000
++++ lib/tree.c
+@@ -472,8 +472,10 @@ void *xtreeDelete(void *treehandle, char
+ 
+ 
+ #ifdef STANDALONE
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wunused-result"
++#endif  // __GNUC__
+ 
+ int main(int argc, char **argv)
+ {
+@@ -542,6 +544,8 @@ int main(int argc, char **argv)
+ 
+       return 0;
+ }
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+ #pragma GCC diagnostic pop
++#endif  // __GNUC__
+ #endif
+ 
Index: pkgsrc/net/xymon/patches/patch-web_history.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-web_history.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-web_history.c        Sun Nov 24 20:16:55 2019
@@ -0,0 +1,16 @@
+$NetBSD: patch-web_history.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8072/
+Fix reports with dashes or underscores not visible in history logs (Thanks, Tom Schmidt)
+
+--- web/history.c.orig 2019-07-23 14:46:51.000000000 +0000
++++ web/history.c
+@@ -605,7 +605,7 @@ static void parse_query(void)
+                */
+ 
+               if (strcasecmp(cwalk->name, "HISTFILE") == 0) {
+-                      char *p = cwalk->value + strspn(cwalk->value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,");
++                      char *p = cwalk->value + strspn(cwalk->value, "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:,.\\/_-");
+                       *p = '\0';
+ 
+                       p = strrchr(cwalk->value, '.');
Index: pkgsrc/net/xymon/patches/patch-web_reportlog.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-web_reportlog.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-web_reportlog.c      Sun Nov 24 20:16:55 2019
@@ -0,0 +1,31 @@
+$NetBSD: patch-web_reportlog.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8072/
+Fix reports with dashes or underscores not visible in history logs (Thanks, Tom Schmidt)
+
+--- web/reportlog.c.orig       2019-07-23 14:46:51.000000000 +0000
++++ web/reportlog.c
+@@ -55,7 +55,7 @@ static void parse_query(void)
+                */
+ 
+               if (strcasecmp(cwalk->name, "HOSTSVC") == 0) {
+-                      char *p = cwalk->value + strspn(cwalk->value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,");
++                      char *p = cwalk->value + strspn(cwalk->value, "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:,.\\/_-");
+                       *p = '\0';
+ 
+                       p = strrchr(cwalk->value, '.');
+@@ -64,12 +64,12 @@ static void parse_query(void)
+                       while ((p = strchr(hostname, ','))) *p = '.';
+               }
+               else if (strcasecmp(cwalk->name, "HOST") == 0) {
+-                      char *p = cwalk->value + strspn(cwalk->value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,");
++                      char *p = cwalk->value + strspn(cwalk->value, "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:,.\\/_-");
+                       *p = '\0';
+                       hostname = strdup(basename(cwalk->value));
+               }
+               else if (strcasecmp(cwalk->name, "SERVICE") == 0) {
+-                      char *p = cwalk->value + strspn(cwalk->value, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.,");
++                      char *p = cwalk->value + strspn(cwalk->value, "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ:,.\\/_-");
+                       *p = '\0';
+                       service = strdup(basename(cwalk->value));
+               }
Index: pkgsrc/net/xymon/patches/patch-web_showgraph.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-web_showgraph.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-web_showgraph.c      Sun Nov 24 20:16:55 2019
@@ -0,0 +1,20 @@
+$NetBSD: patch-web_showgraph.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8076/
+Fix truncation on exec strings causing missing custom RRD titles (Thanks, Tom Schmidt)
+
+--- web/showgraph.c.orig       2019-07-23 14:46:51.000000000 +0000
++++ web/showgraph.c
+@@ -1081,10 +1084,10 @@ void generate_graph(char *gdeffn, char *
+               for (i=0; (i<rrddbcount); i++) pcmdlen += (strlen(rrddbs[i].rrdfn) + 3);
+ 
+               p = pcmd = (char *)malloc(pcmdlen+1);
+-              p += snprintf(p, (pcmdlen - (p - pcmd)), param_str, gdef->title+5, displayname, service, glegend);
++              p += snprintf(p, pcmdlen+1, param_str, gdef->title+5, displayname, service, glegend);
+               for (i=0; (i<rrddbcount); i++) {
+                       if ((firstidx == -1) || ((i >= firstidx) && (i <= lastidx))) {
+-                              p += snprintf(p, (pcmdlen - (p - pcmd)), " \"%s\"", rrddbs[i].rrdfn);
++                              p += snprintf(p, (pcmdlen - (p - pcmd) + 1), " \"%s\"", rrddbs[i].rrdfn);
+                       }
+               }
+               pfd = popen(pcmd, "r");
Index: pkgsrc/net/xymon/patches/patch-xymond_combostatus.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-xymond_combostatus.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-xymond_combostatus.c Sun Nov 24 20:16:55 2019
@@ -0,0 +1,15 @@
+$NetBSD: patch-xymond_combostatus.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8106/
+Fix problems with meta-combostatuses (Thanks, Dominique Delporte)
+
+--- xymond/combostatus.c.orig  2015-11-03 01:37:39.000000000 +0000
++++ xymond/combostatus.c
+@@ -251,6 +251,7 @@ static long getvalue(char *hostname, cha
+       for (walk = testhead; (walk && ( (strcmp(walk->reshostname, hostname) != 0) || (strcmp(walk->restestname, testname) != 0) ) ); walk = walk->next);
+       if (walk != NULL) {
+               /* It is a combo test they want the result of. */
++              *color = (walk->result ? COL_GREEN : COL_RED);
+               return walk->result;
+       }
+ 
Index: pkgsrc/net/xymon/patches/patch-xymond_rrd_do__temperature.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-xymond_rrd_do__temperature.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-xymond_rrd_do__temperature.c Sun Nov 24 20:16:55 2019
@@ -0,0 +1,59 @@
+$NetBSD: patch-xymond_rrd_do__temperature.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8073/
+Really fix do_temperature.c report parsing for parentheses (Thanks, Tom Schmidt)
+
+--- xymond/rrd/do_temperature.c.orig   2019-04-17 23:56:30.000000000 +0000
++++ xymond/rrd/do_temperature.c
+@@ -41,4 +41,17 @@ Device                              Temp    High    Crit
+ -----------------------------------------------------
+ 
++Device                   Temp(C)  Temp(F)    Lo(C)  LoWarn(C)  HiWarn(C)  Hi(C)
++-------------------------------------------------------------------------------
++&green CPU 0 Die                79      174     (-10        0         88      90)
++&green CPU 0 Ambient            23       73     (-10        0         40      60)
++-------------------------------------------------------------------------------
++
++Device                  Temp(C)  Temp(F)  Threshold(C)
++------------------------------------------------------
++&green System Board Inlet Temp    21       69     ( 42)
++&green CPU1 Temp               32       89     ( 93)
++&green CPU2 Temp               31       87     ( 93)
++------------------------------------------------------
++
+ */
+ 
+@@ -51,5 +64,5 @@ int do_temperature_rrd(char *hostname, c
+       static void *temperature_tpl      = NULL;
+ 
+-      char *bol, *eol, *p;
++      char *bol, *eol, *comment, *p;
+       int tmpC;
+ 
+@@ -63,4 +76,9 @@ int do_temperature_rrd(char *hostname, c
+               eol = strchr(bol, '\n'); if (eol) *eol = '\0';
+ 
++              /* See if there's a comment in parenthesis */
++              comment = strchr(bol, '('); /* Begin comment */
++              p = strchr(bol, ')');       /* End comment */
++              if (comment && p && (comment < p)) *comment = '\0'; /* Cut off the comment */
++
+               if      (strncmp(bol, "&green", 6) == 0)  { bol += 6; gotone = 1; }
+               else if (strncmp(bol, "&yellow", 7) == 0) { bol += 7; gotone = 1; }
+@@ -71,4 +89,10 @@ int do_temperature_rrd(char *hostname, c
+                       char savech;
+ 
++                      /* Strip off any leading bold and italic HTML tags */
++                      if      (strncasecmp(bol, "<i><b>", 6) == 0)  { bol += 6; }
++                      else if (strncasecmp(bol, "<i>", 3) == 0)  { bol += 3; }
++                      else if (strncasecmp(bol, "<b><i>", 6) == 0)  { bol += 6; }
++                      else if (strncasecmp(bol, "<b>", 3) == 0)  { bol += 3; }
++
+                       bol += strspn(bol, " \t");
+ 
+@@ -84,4 +108,5 @@ int do_temperature_rrd(char *hostname, c
+               }
+ 
++              if (comment) *comment = '(';
+               if (eol) *eol = '\n';
+       }
Index: pkgsrc/net/xymon/patches/patch-xymond_xymond__history.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-xymond_xymond__history.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-xymond_xymond__history.c     Sun Nov 24 20:16:55 2019
@@ -0,0 +1,20 @@
+$NetBSD: patch-xymond_xymond__history.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8080/
+Don't crash on a missing allevents file
+
+--- xymond/xymond_history.c.orig       2015-10-01 14:42:42.000000000 +0000
++++ xymond/xymond_history.c
+@@ -170,8 +170,11 @@ int main(int argc, char *argv[])
+               alleventsfd = fopen(alleventsfn, "a");
+               if (alleventsfd == NULL) {
+                       errprintf("Cannot open the all-events file '%s'\n", alleventsfn);
++                      return 1;
++              }
++              else {
++                      setvbuf(alleventsfd, (char *)NULL, _IOLBF, 0);
+               }
+-              setvbuf(alleventsfd, (char *)NULL, _IOLBF, 0);
+       }
+ 
+       /* For picking up lost children */
Index: pkgsrc/net/xymon/patches/patch-xymonnet_xymonnet.c
diff -u /dev/null pkgsrc/net/xymon/patches/patch-xymonnet_xymonnet.c:1.1
--- /dev/null   Sun Nov 24 20:16:55 2019
+++ pkgsrc/net/xymon/patches/patch-xymonnet_xymonnet.c  Sun Nov 24 20:16:55 2019
@@ -0,0 +1,58 @@
+$NetBSD: patch-xymonnet_xymonnet.c,v 1.1 2019/11/24 20:16:55 spz Exp $
+
+from https://sourceforge.net/p/xymon/code/8078/
+RPC buffer calculation on snprintf taking improper sizeof (Thanks, Tom Schmidt)
+
+from https://sourceforge.net/p/xymon/code/8084/
+Add guards around GCC diagnostics pragma to allow for building on older vers
+
+--- xymonnet/xymonnet.c.orig   2019-07-23 14:46:51.000000000 +0000
++++ xymonnet/xymonnet.c
+@@ -56,6 +56,7 @@ extern struct rpcent *getrpcbyname(char 
+ #include "ldaptest.h"
+ 
+ #define DEFAULT_PING_CHILD_COUNT 1
++#define MSGBUFSIZE 4096
+ 
+ char *reqenv[] = {
+       "NONETPAGE",
+@@ -1310,9 +1310,11 @@ int finish_ping_service(service_t *servi
+                                               pingcmd, WEXITSTATUS(pingstatus));
+               }
+ 
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+               /* Ignore gcc warnings about truncating filenames when adding a number */
+               #pragma GCC diagnostic push
+               #pragma GCC diagnostic ignored "-Wformat-truncation"
++#endif  // __GNUC__
+ 
+               /* Open the new ping result file */
+               snprintf(fn, sizeof(fn), "%s.%02d", pinglog, i);
+@@ -1336,7 +1338,9 @@ int finish_ping_service(service_t *servi
+                       if (errfd) fclose(errfd);
+               }
+               if (!debug) unlink(fn);
++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+               #pragma GCC diagnostic pop
++#endif  // __GNUC__
+ 
+               if (failed) {
+                       /* Flag all ping tests as "undecided" */
+@@ -1848,7 +1849,7 @@ void send_rpcinfo_results(service_t *ser
+       char            *msgbuf;
+       char            causetext[1024];
+ 
+-      msgbuf = (char *)malloc(4096);
++      msgbuf = (char *)malloc(MSGBUFSIZE);
+ 
+       for (t=service->items; (t); t = t->next) {
+               char *wantedrpcsvcs = NULL;
+@@ -1904,7 +1905,7 @@ void send_rpcinfo_results(service_t *ser
+                                       snprintf(msgline, sizeof(msgline), "&%s Unknown RPC service %s\n",
+                                               colorname(COL_RED), rpcsvc);
+                               }
+-                              strncat(msgbuf, msgline, (sizeof(msgbuf) - strlen(msgbuf)));
++                              strncat(msgbuf, msgline, (MSGBUFSIZE - strlen(msgbuf)));
+ 
+                               rpcsvc = strtok(NULL, ",");
+                       }



Home | Main Index | Thread Index | Old Index