Your message dated Thu, 14 Jun 2012 10:18:54 +0000
with message-id <[email protected]>
and subject line Bug#514588: fixed in nagios-plugins 1.4.16~pre1-1
has caused the Debian Bug report #514588,
regarding check_ping: incorrectly parses ping6 output sometimes
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
514588: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=514588
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: nagios-plugins-basic
Version: 1.4.5-1etch1
Severity: normal
Tags: patch


problem can usually (depending on network config) be reproduced by:
check_ping -H [invalid-ipv6-address] -w 5000,100% -c 5000,100% -p 1

Debian's ping6 may produce output in the following format:

3 packets transmitted, 0 received, +3 errors, 100% packet loss, time
2009ms

There's a corresponding pattern in check_ping.c:450:

"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss"

but the pattern in check_ping.c:448 matches first:

"%*d packets transmitted, %*d received, %d%% loss, time"

because sscanf interprets "+3" as a match for "%d". Although the rest
of the pattern doesn't match, the number of successful assignments
(and thus the return value of sscanf) is still 1.

A simple way to make sure the whole pattern matches is to add a "%n"
specifier at the end, which will assign the number of characters
matched by that point. (The same trick is used in check_http.c.)
There seems to be some confusion whether "%n" affects the return value
of sscanf, so it's safer to check the assigned number of characters.

A bug was reported a year ago to the upstream
http://sourceforge.net/tracker/index.php?func=detail&aid=1894850&group_id=29880&atid=397597
but it seems to be dead.

Patch to fix it attached.


-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.24-etchnhalf.1-amd64
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages nagios-plugins-basic depends on:
ii  iputils-ping           3:20020927-6      Tools to test the reachability of 
ii  libc6                  2.3.6.ds1-13etch8 GNU C Library: Shared libraries
ii  libssl0.9.8            0.9.8c-4etch4     SSL shared libraries
ii  procps                 1:3.2.7-3         /proc file system utilities
ii  ucf                    2.0020            Update Configuration File: preserv

nagios-plugins-basic recommends no packages.

-- no debconf information
--- plugins/check_ping.c~
+++ plugins/check_ping.c
@@ -424,6 +424,7 @@
 {
 	char buf[MAX_INPUT_BUFFER];
 	int result = STATE_UNKNOWN;
+	int match;
 
 	if ((child_process = spopen (cmd)) == NULL)
 		die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
@@ -440,28 +441,29 @@
 		result = max_state (result, error_scan (buf, addr));
 
 		/* get the percent loss statistics */
-		if(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time", &pl)==1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time", &pl)==1 ||
-			 sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1 ||
-			 sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss", &pl) == 1
+		match = 0;
+		if((sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match) ||
+			 (sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss%n",&pl,&match) && match)
 			 )
 			continue;
 
 		/* get the round trip average */
 		else
-			if(sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f",&rta)==1 ||
-				 sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
-				 sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",&rta)==1)
+			if((sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f%n",&rta,&match) && match) ||
+				 (sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms%n",&rta,&match) && match))
 			continue;
 	}
 

--- End Message ---
--- Begin Message ---
Source: nagios-plugins
Source-Version: 1.4.16~pre1-1

We believe that the bug you reported is fixed in the latest version of
nagios-plugins, which is due to be installed in the Debian FTP archive:

nagios-plugins-basic_1.4.16~pre1-1_i386.deb
  to main/n/nagios-plugins/nagios-plugins-basic_1.4.16~pre1-1_i386.deb
nagios-plugins-common_1.4.16~pre1-1_i386.deb
  to main/n/nagios-plugins/nagios-plugins-common_1.4.16~pre1-1_i386.deb
nagios-plugins-standard_1.4.16~pre1-1_i386.deb
  to main/n/nagios-plugins/nagios-plugins-standard_1.4.16~pre1-1_i386.deb
nagios-plugins_1.4.16~pre1-1.diff.gz
  to main/n/nagios-plugins/nagios-plugins_1.4.16~pre1-1.diff.gz
nagios-plugins_1.4.16~pre1-1.dsc
  to main/n/nagios-plugins/nagios-plugins_1.4.16~pre1-1.dsc
nagios-plugins_1.4.16~pre1-1_all.deb
  to main/n/nagios-plugins/nagios-plugins_1.4.16~pre1-1_all.deb
nagios-plugins_1.4.16~pre1.orig.tar.gz
  to main/n/nagios-plugins/nagios-plugins_1.4.16~pre1.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jan Wagner <[email protected]> (supplier of updated nagios-plugins package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 14 Jun 2012 10:39:44 +0200
Source: nagios-plugins
Binary: nagios-plugins nagios-plugins-common nagios-plugins-basic 
nagios-plugins-standard
Architecture: source all i386
Version: 1.4.16~pre1-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Nagios Maintainer Group 
<[email protected]>
Changed-By: Jan Wagner <[email protected]>
Description: 
 nagios-plugins - Plugins for nagios compatible monitoring systems (metapackage)
 nagios-plugins-basic - Plugins for nagios compatible monitoring systems
 nagios-plugins-common - Common files for plugins for nagios compatible 
monitoring
 nagios-plugins-standard - Plugins for nagios compatible monitoring systems
Closes: 514588 662638
Changes: 
 nagios-plugins (1.4.16~pre1-1) unstable; urgency=medium
 .
   * New upstream snapshot (Closes: #662638, #514588)
   * Droped the following upstream integrated patches
     - 10_check_disk_smb_spaces.dpatch
     - 11_check_disk_smb_NT_STATUS_ACCESS_DENIED.dpatch
     - 12_check_snmp_1.4.15_regression.dpatch
     - 13_check_smtp_greeting.dpatch
     - 14_check_icmp_multiple_ips.dpatch
     - 15_check_sensors_fault.dpatch
     - 16_check_raduis_fix_format-security.dpatch
     - 17_check_tcp_fix_duplicate_cert_message.dpatch
     - 17_check_smtp_fix_duplicate_cert_message.dpatch
     - 18_check_snmp_labels.dpatch
     - 19_check_http_help.dpatch
   * Added the following upstream patches
     - 10_check_dhcp_Fix-handling-of-pad-options.dpatch
     - 11_check_dhcp_Don-t-misinterpret-the-siaddr-field.dpatch
   * Add 00_fix_release_version.dpatch to fix release version
   * Bump Standards-Version to 3.9.3, no changes needed
Checksums-Sha1: 
 87d6d52f967d84088919cde238aa1949c476c2d4 1793 nagios-plugins_1.4.16~pre1-1.dsc
 0ec29d6bdb30bc150c5c7648409a92d6a8b65265 2194622 
nagios-plugins_1.4.16~pre1.orig.tar.gz
 436c615d4f0824d6171b9fd59916d9b04e252f69 35940 
nagios-plugins_1.4.16~pre1-1.diff.gz
 5fd08e0d8604be4a7383ac34fc07cf0e595a1818 22020 
nagios-plugins_1.4.16~pre1-1_all.deb
 f211e1d11f641c3c62a3245f63b8b1f3178dfbf5 194380 
nagios-plugins-common_1.4.16~pre1-1_i386.deb
 4505971233745748f0ebe4e633f289d54e616f91 791272 
nagios-plugins-basic_1.4.16~pre1-1_i386.deb
 8ae719e6f8515366dcbaa1efe3f976814f6e2ec0 390290 
nagios-plugins-standard_1.4.16~pre1-1_i386.deb
Checksums-Sha256: 
 600875bee1b039b894f924ec277550cf8439f0a92b21106c0abce90dc86dc529 1793 
nagios-plugins_1.4.16~pre1-1.dsc
 84fa08ecd726a5c5fb0f11190a1d44ac6c297ed0b5558f233ddf0e979f7b365c 2194622 
nagios-plugins_1.4.16~pre1.orig.tar.gz
 e78257ea9c2d1f65b150d94cd162499f78ce0adf8f9c4b7f5a6dbad3bf7f1933 35940 
nagios-plugins_1.4.16~pre1-1.diff.gz
 b18a54d4b84d60b7b76b12a7d3c64bc618d7489154b3f13d4e2894c239237e95 22020 
nagios-plugins_1.4.16~pre1-1_all.deb
 473565b03dfadb2aa91e04d34178cadb159e3b26629030b94786ba2965364281 194380 
nagios-plugins-common_1.4.16~pre1-1_i386.deb
 9caad671eeaf985ef4222db736d8ed76205e33c261ce6293048441680bb5edba 791272 
nagios-plugins-basic_1.4.16~pre1-1_i386.deb
 78ad4fa11934c775e1c1c85aa876af04e1aea32cc6490461d60566a275940e62 390290 
nagios-plugins-standard_1.4.16~pre1-1_i386.deb
Files: 
 952f475747c4d916c45b2eb2675b0c5d 1793 net extra 
nagios-plugins_1.4.16~pre1-1.dsc
 c56dae7127e0af0ebe5abf68e2491105 2194622 net extra 
nagios-plugins_1.4.16~pre1.orig.tar.gz
 75ca136a18d3fbc51d30aec80d73fad0 35940 net extra 
nagios-plugins_1.4.16~pre1-1.diff.gz
 bb3549498d17a91f1d1c0beb58efe9f7 22020 net extra 
nagios-plugins_1.4.16~pre1-1_all.deb
 6e00fc621d6d37221c512b2b405e1085 194380 net extra 
nagios-plugins-common_1.4.16~pre1-1_i386.deb
 bcd42056f6a7ee1a78a89fbea36a59b8 791272 net extra 
nagios-plugins-basic_1.4.16~pre1-1_i386.deb
 b361740824ef489f318caa5bbbdcf1b7 390290 net extra 
nagios-plugins-standard_1.4.16~pre1-1_i386.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iD8DBQFP2bc79u6Dud+QFyQRAlKrAJwN0oy9vYWgVKa/fiMkRqLtzGj2CACeMeEt
n9fNWpoz/ejNyXcEaseiplw=
=RLqe
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to