Subject: [Pkg-cacti-maint] Processed: Patch is available in the GIT repo

From: [email-masked] (Debian Bug Tracking System)
Date: Sat, 21 Jan 2012 09:00:52 +0000

Processing commands for [email-masked]:

> tags 656613 + pending patch lenny
Bug #656613 [cacti] cacti: SNMP - Interface Statistics data query doesn't work after upgrade to 0.8.7b-2.1+lenny4
Added tag(s) pending, lenny, and patch.
> thanks
Stopping processing here.

Please contact me if you need assistance.
-- 
656613: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656613
Debian Bug Tracking System
Contact [email-masked] with problems

---

From: Paul Gevers <[email-masked]>
Date: Sat, 21 Jan 2012 09:56:02 +0100

Just for the record, we are working on getting an updated security
release, the relevant change is in our GIT repo. In the mean while,
people that really want this fixed asap can use the attached patch on
the file /usr/share/cacti/site/lib/snmp.php

Paul

--- snmp.php.PG 2012-01-08 22:37:52.000000000 +0100
+++ snmp.php    2012-01-19 21:01:42.000000000 +0100
@@ -254,7 +254,6 @@
 
         /* do not attempt to poll invalid combinations */
         if (($version == 0) || (!is_numeric($version)) ||
-               (!is_numeric($max_oids)) ||
                 (!is_numeric($port)) ||
                 (!is_numeric($retries)) ||
                 (!is_numeric($timeout)) ||
@@ -344,7 +343,7 @@
                        $temp_array = exec_into_array(escapeshellcmd(read_config_option("path_snmpwalk")) . " -v$version -t $timeout -r $retries " . escapeshellarg($hostname) . ":$port $snmp_auth " . escapeshellarg($oid));
                }else {
                        if (file_exists($path_snmpbulkwalk) && ($version > 1)) {
-                               $temp_array = exec_into_array(escapeshellcmd($path_snmpbulkwalk) . " -O Qn $snmp_auth -v $version -t $timeout -r $retries -Cr$max_oids " . escapeshellarg($hostname) . ":$port " . escapeshellarg($oid));
+                               $temp_array = exec_into_array(escapeshellcmd($path_snmpbulkwalk) . " -O Qn $snmp_auth -v $version -t $timeout -r $retries -Cr50 " . escapeshellarg($hostname) . ":$port " . escapeshellarg($oid));
                        }else{
                                $temp_array = exec_into_array(escapeshellcmd(read_config_option("path_snmpwalk")) . " -O Qn $snmp_auth -v $version -t $timeout -r $retries " . escapeshellarg($hostname) . ":$port " . escapeshellarg($oid));
                        }

---

From: Luk Claes <[email-masked]>
Date: Sat, 21 Jan 2012 11:24:43 +0100

> the file /usr/share/cacti/site/lib/snmp.php

You get rid of $maxoids in that part of the code to fix the issue and
use a hardcoded 50. It would be cleaner to add a $max_oids argument to
the snmp_walk function with a default value (of 50) IMHO.

Cheers

Luk

---

From: Paul Gevers <[email-masked]>
Date: Sat, 21 Jan 2012 11:32:00 +0100

> the snmp_walk function with a default value (of 50) IMHO.

I agree with you that that would be much nicer, but that function is
used is several places and as I understand it patches to (old-) stable
should be minimal invasive. I merely reverted a part of the patch
introduced by the previous security update to use the original code,
which I believe is more appropriate for old-stable.

If you want the $max_oids argument I can do that (hopefully tomorrow),
so please let me know.

Paul