[pkg-nagios-changes] [Git][nagios-team/monitoring-plugins][experimental] 7 commits: Adding d/p/14_check_curl_fix_SSL_with_multiple_IPs from upstream

Jan Wagner (@waja) gitlab at salsa.debian.org
Fri Apr 14 15:26:44 BST 2023



Jan Wagner pushed to branch experimental at Debian Nagios Maintainer Group / monitoring-plugins


Commits:
6fb8e25e by Jan Wagner at 2023-03-24T19:10:07+00:00
Adding d/p/14_check_curl_fix_SSL_with_multiple_IPs from upstream

- - - - -
eab1e1d4 by Jan Wagner at 2023-03-24T19:11:41+00:00
Adding d/p/15_check_swap_remove_includes from upstream

- - - - -
983507a1 by Jan Wagner at 2023-03-27T14:02:54+00:00
Adding d/p/34_check_curl_fix_compare_warning from upstream

- - - - -
3ede3478 by Jan Wagner at 2023-03-30T08:36:08+00:00
Adding d/p/16_check_snmp_disable_multiplier_when_unused from upstream

- - - - -
e11debaf by Jan Wagner at 2023-03-30T08:52:13+00:00
Prepare release

- - - - -
deeee853 by Jan Wagner at 2023-03-30T09:33:54+00:00
New changelog

- - - - -
49df534b by Jan Wagner at 2023-04-14T14:23:44+00:00
Merge branch 'master' into experimental

- - - - -


4 changed files:

- debian/changelog
- + debian/patches/16_check_snmp_disable_multiplier_when_unused
- + debian/patches/34_check_curl_fix_compare_warning
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,16 @@
-monitoring-plugins (2.3.3-5) UNRELEASED; urgency=medium
+monitoring-plugins (2.3.3-6) UNRELEASED; urgency=medium
 
   * 
 
- -- Jan Wagner <waja at cyconet.org>  Tue, 07 Mar 2023 14:17:14 +0000
+ -- Jan Wagner <waja at cyconet.org>  Thu, 30 Mar 2023 09:33:25 +0000
+
+monitoring-plugins (2.3.3-5) unstable; urgency=medium
+
+  * [6fb8e25] Adding d/p/14_check_curl_fix_SSL_with_multiple_IPs from upstream
+  * [eab1e1d] Adding d/p/15_check_swap_remove_includes from upstream
+  * [3ede347] Adding d/p/16_check_snmp_disable_multiplier_when_unused from upstream
+
+ -- Jan Wagner <waja at cyconet.org>  Thu, 30 Mar 2023 08:51:53 +0000
 
 monitoring-plugins (2.3.3-4) unstable; urgency=medium
 


=====================================
debian/patches/16_check_snmp_disable_multiplier_when_unused
=====================================
@@ -0,0 +1,90 @@
+From c874f950e8e5b6a805d8adf759d521501b22c7ce Mon Sep 17 00:00:00 2001
+From: Sven Nierlein <Sven.Nierlein at consol.de>
+Date: Wed, 15 Mar 2023 09:51:18 +0100
+Subject: [PATCH 1/2] check_snmp: disable multiplier when unused
+
+ - if no multiplier is set, simply return the given string. Otherwise we would strip off the unit.
+ - if used, allocate new space to hold the result which might be larger than the initial input
+
+Signed-off-by: Sven Nierlein <sven at consol.de>
+---
+ plugins/check_snmp.c | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
+index d3968a27d..c4ddd0edd 100644
+--- a/plugins/check_snmp.c
++++ b/plugins/check_snmp.c
+@@ -46,6 +46,7 @@ const char *email = "devel at monitoring-plugins.org";
+ #define DEFAULT_PRIV_PROTOCOL "DES"
+ #define DEFAULT_DELIMITER "="
+ #define DEFAULT_OUTPUT_DELIMITER " "
++#define DEFAULT_BUFFER_SIZE 100
+ 
+ #define mark(a) ((a)!=0?"*":"")
+ 
+@@ -157,6 +158,7 @@ int perf_labels = 1;
+ char* ip_version = "";
+ double multiplier = 1.0;
+ char *fmtstr = "";
++char buffer[DEFAULT_BUFFER_SIZE];
+ 
+ static char *fix_snmp_range(char *th)
+ {
+@@ -1169,6 +1171,9 @@ multiply (char *str)
+ 	double val;
+ 	char *conv = "%f";
+ 
++	if(multiplier == 1)
++		return(str);
++
+ 	if(verbose>2)
+ 		printf("    multiply input: %s\n", str);
+ 
+@@ -1187,15 +1192,15 @@ multiply (char *str)
+ 		conv = fmtstr;
+ 	}
+ 	if (val == (int)val) {
+-		sprintf(str, "%.0f", val);
++		snprintf(buffer, DEFAULT_BUFFER_SIZE, "%.0f", val);
+ 	} else {
+ 		if(verbose>2)
+ 			printf("    multiply using format: %s\n", conv);
+-		sprintf(str, conv, val);
++		snprintf(buffer, DEFAULT_BUFFER_SIZE, conv, val);
+ 	}
+ 	if(verbose>2)
+-		printf("    multiply result: %s\n", str);
+-	return str;
++		printf("    multiply result: %s\n", buffer);
++	return buffer;
+ }
+ 
+ 
+
+From 6e64973a4486248ff6c3de7d72637e44b6474c3e Mon Sep 17 00:00:00 2001
+From: Sven Nierlein <sven at consol.de>
+Date: Mon, 27 Mar 2023 12:59:53 +0200
+Subject: [PATCH 2/2] simplify code
+
+if statement is always true at this point, so remove it.
+---
+ plugins/check_snmp.c | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
+index c4ddd0edd..aefda3d29 100644
+--- a/plugins/check_snmp.c
++++ b/plugins/check_snmp.c
+@@ -1179,10 +1179,7 @@ multiply (char *str)
+ 
+ 	val = strtod (str, &endptr);
+ 	if ((val == 0.0) && (endptr == str)) {
+-		if(multiplier != 1) {
+-			die(STATE_UNKNOWN, _("multiplier set (%.1f), but input is not a number: %s"), multiplier, str);
+-		}
+-		return str;
++		die(STATE_UNKNOWN, _("multiplier set (%.1f), but input is not a number: %s"), multiplier, str);
+ 	}
+ 
+ 	if(verbose>2)


=====================================
debian/patches/34_check_curl_fix_compare_warning
=====================================
@@ -0,0 +1,31 @@
+From cf90f0de7b3c347a6860b50de6a610bd7132668c Mon Sep 17 00:00:00 2001
+From: Andreas Baumann <mail at andreasbaumann.cc>
+Date: Thu, 16 Mar 2023 16:21:46 +0100
+Subject: [PATCH] check_curk: including netinet/in.h (for FreeBSD), fixed an
+ ambigous compare warning
+
+---
+ plugins/check_curl.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/check_curl.c b/plugins/check_curl.c
+index e5be1ad56..c51914a9a 100644
+--- a/plugins/check_curl.c
++++ b/plugins/check_curl.c
+@@ -55,6 +55,7 @@ const char *email = "devel at monitoring-plugins.org";
+ #include "uriparser/Uri.h"
+ 
+ #include <arpa/inet.h>
++#include <netinet/in.h>
+ 
+ #if defined(HAVE_SSL) && defined(USE_OPENSSL)
+ #include <openssl/opensslv.h>
+@@ -541,7 +542,7 @@ check_http (void)
+   /* compose URL: use the address we want to connect to, set Host: header later */
+   snprintf (url, DEFAULT_BUFFER_SIZE, "%s://%s:%d%s",
+       use_ssl ? "https" : "http",
+-      use_ssl & host_name != NULL ? host_name : server_address,
++      ( use_ssl & ( host_name != NULL ) ) ? host_name : server_address,
+       server_port,
+       server_url
+   );


=====================================
debian/patches/series
=====================================
@@ -7,8 +7,10 @@
 13_check_icmp_improvements
 14_check_curl_fix_SSL_with_multiple_IPs
 15_check_swap_remove_includes
+16_check_snmp_disable_multiplier_when_unused
 # feature patches
 30_check_radius_radcli_1.3.1_support
 31_checl_mailq_separate_submission_queue
 32_check_disk_add_ignore_missing
 33_check_procs_exclude-process
+34_check_curl_fix_compare_warning



View it on GitLab: https://salsa.debian.org/nagios-team/monitoring-plugins/-/compare/6f89be83806b412706bd45e1ffaeb57431d2ae32...49df534b72e6727b82d431cbdd0371572afb6ce0

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/monitoring-plugins/-/compare/6f89be83806b412706bd45e1ffaeb57431d2ae32...49df534b72e6727b82d431cbdd0371572afb6ce0
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20230414/efa1712e/attachment-0001.htm>


More information about the pkg-nagios-changes mailing list