From 60ec4d29019c553451d828fe366c8acc46fc8162 Mon Sep 17 00:00:00 2001 From: Vadim Zhukov Date: Wed, 19 Jul 2017 13:55:08 +0300 Subject: Use size_t instead of int when calling sysctl(3). Otherwise, it writes sizeof(size_t) bytes to &oldlen, smashing the stack. --- plugins-root/check_dhcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins-root/check_dhcp.c b/plugins-root/check_dhcp.c index f4c2dafd..ad673237 100644 --- a/plugins-root/check_dhcp.c +++ b/plugins-root/check_dhcp.c @@ -323,7 +323,8 @@ int get_hardware_address(int sock,char *interface_name){ #elif defined(__bsd__) /* King 2004 see ACKNOWLEDGEMENTS */ - int mib[6], len; + size_t len; + int mib[6]; char *buf; unsigned char *ptr; struct if_msghdr *ifm; -- cgit v1.2.3-74-g34f1 From d008be68255b192f0354c523938c40643e39795f Mon Sep 17 00:00:00 2001 From: DaTa Date: Thu, 30 Jan 2020 10:48:45 +0100 Subject: Revert "simplify documentation" This reverts commit 7693af147926d0eb7369a43070d114b6bd79dc70. Now it is wrong: After reading https://www.naemon.org/documentation/usersguide/pluginapi.html#plugin_output_spec the old wording makes more sense. --- doc/developer-guidelines.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 5f480c5f..6f31f365 100644 --- a/doc/developer-guidelines.sgml +++ b/doc/developer-guidelines.sgml @@ -324,8 +324,8 @@
Performance data - Nagios 3 and newer will concatenate the parts following a "|" in - each line of output by the plugin into a string it + Nagios 3 and newer will concatenate the parts following a "|" in a) the first + line output by the plugin, and b) in the second to last line, into a string it passes to whatever performance data processing it has configured. (Note that it currently does not insert additional whitespace between both, so the plugin needs to provide some to prevent the last pair of a) and the first of b) getting run -- cgit v1.2.3-74-g34f1 From 4264e7a6edb651793ef751723537767656a89e44 Mon Sep 17 00:00:00 2001 From: ghciv6 Date: Mon, 13 Apr 2020 20:44:26 +0200 Subject: - workaround for issue #1550 - better use "ping -4" instead of "ping" if supported --- configure.ac | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac b/configure.ac index 08a0e782..4a9a92a8 100644 --- a/configure.ac +++ b/configure.ac @@ -1064,6 +1064,14 @@ then ac_cv_ping_packets_first=yes AC_MSG_RESULT([$with_ping_command]) +elif $PATH_TO_PING -4 -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ + egrep -i "^round-trip|^rtt" >/dev/null +then + # check if -4 is supported - issue #1550 + with_ping_command="$PATH_TO_PING -4 -n -U -w %d -c %d %s" + ac_cv_ping_packets_first=yes + ac_cv_ping_has_timeout=yes + AC_MSG_RESULT([$with_ping_command]) elif $PATH_TO_PING -n -U -w 10 -c 1 127.0.0.1 2>/dev/null | \ egrep -i "^round-trip|^rtt" >/dev/null then -- cgit v1.2.3-74-g34f1