[BACK]Return to patch-xymond_rrd_do__temperature.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / net / xymon / patches

File: [cvs.NetBSD.org] / pkgsrc / net / xymon / patches / Attic / patch-xymond_rrd_do__temperature.c (download)

Revision 1.1, Sun Nov 24 20:16:55 2019 UTC (3 years, 10 months ago) by spz
Branch: MAIN
CVS Tags: pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4

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.

$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';
 	}