17758422 50 or more exec options in snmpd.conf results in errors s11-update
authorTomas Klacko <tomas.klacko@oracle.com>
Wed, 30 Apr 2014 13:55:52 -0700
branchs11-update
changeset 3106 2deddd0bf46b
parent 3105 92b9ed82ecc7
child 3107 a46122b84537
17758422 50 or more exec options in snmpd.conf results in errors
components/net-snmp/patches/042.16634190.kernel_sunos5.patch
components/net-snmp/patches/042.17758422.patch
components/net-snmp/patches/043.15805491.hr_filesys.patch
components/net-snmp/patches/043.16634190.kernel_sunos5.patch
components/net-snmp/patches/044.15805491.hr_filesys.patch
--- a/components/net-snmp/patches/042.16634190.kernel_sunos5.patch	Tue Apr 29 16:01:51 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-This patch fixes a Solaris specific issue related to incorrect
-reporting of network interface speed inside a zone. The patch has 
-been submitted to the community but has not been accepted yet.
-
-The details can be found in the following location
-https://sourceforge.net/p/net-snmp/patches/1277/
---- net-snmp-5.4.1.old/agent/mibgroup/kernel_sunos5.c	2014-03-28 14:54:11.259600880 -0400
-+++ net-snmp-5.4.1/agent/mibgroup/kernel_sunos5.c	2014-03-28 14:52:32.837130820 -0400
-@@ -1908,8 +1908,10 @@
-          * this is good 
-          */
- 	havespeed = B_TRUE;
-+    } else if ((getKstatInt("link", name, "ifspeed", &ifp->ifSpeed) == 0) ||
-+               (getKstatInt("link", name, "ifSpeed", &ifp->ifSpeed) == 0)) {
-+        havespeed = B_TRUE;
-     }
--
-     /* make ifOperStatus depend on link status if available */
-     if (ifp->ifAdminStatus == 1) {
-         int i_tmp;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/042.17758422.patch	Wed Apr 30 13:55:52 2014 -0700
@@ -0,0 +1,31 @@
+This has been fixed in upstream version 5.7.2 (see README).
+http://sourceforge.net/p/net-snmp/code/ci/4d38895f459a1df24f68c4a60e4caf6a778d8c1f
+
+--- a/agent/mibgroup/agent/extend.c
++++ b/agent/mibgroup/agent/extend.c
+@@ -473,10 +473,21 @@ extend_parse_config(const char *token, char *cptr)
+             
+     } else if (!strcmp( token, "sh"   ) ||
+                !strcmp( token, "exec" )) {
+-        if ( num_compatability_entries == max_compatability_entries )
++        if ( num_compatability_entries == max_compatability_entries ) {
+             /* XXX - should really use dynamic allocation */
+-            config_perror("No further UCD-compatible entries" );
+-        else
++            netsnmp_old_extend *new_compatability_entries;
++            new_compatability_entries = realloc(compatability_entries,
++                             max_compatability_entries*2*sizeof(netsnmp_old_extend));
++            if (!new_compatability_entries)
++                config_perror("No further UCD-compatible entries" );
++            else {
++                memset(new_compatability_entries+num_compatability_entries, 0,
++                        sizeof(netsnmp_old_extend)*max_compatability_entries);
++                max_compatability_entries *= 2;
++                compatability_entries = new_compatability_entries;
++            }
++        }
++        if (num_compatability_entries != max_compatability_entries)
+             compatability_entries[
+                 num_compatability_entries++ ].exec_entry = extension;
+     }
+
--- a/components/net-snmp/patches/043.15805491.hr_filesys.patch	Tue Apr 29 16:01:51 2014 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-This patch taken from the net-snmp community fixes an issue related to mismatch of the 
-indices in the host resources tables for monitoring disk storage.
- 
-The details for the upstream bug/patch are given below.
-BUG: 1557372: Realign hrFSStorageIndex with hrStorageTable
-http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=revision&revision=17138
-
---- net-snmp-5.4.1.old/agent/mibgroup/host/hr_filesys.c	2014-03-25 07:06:17.172039070 -0400
-+++ net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c	    2014-03-25 07:10:05.467869740 -0400
-@@ -4,6 +4,9 @@
-  */
- 
- #include <net-snmp/net-snmp-config.h>
-+#include <net-snmp/net-snmp-includes.h>
-+#include <net-snmp/agent/net-snmp-agent-includes.h>
-+#include <net-snmp/agent/hardware/memory.h>
- #include "host_res.h"
- #include "hr_filesys.h"
- #include "hr_storage.h"
-@@ -546,7 +549,7 @@
-             long_return = 2;    /* others probably aren't */
-         return (u_char *) & long_return;
-     case HRFSYS_STOREIDX:
--        long_return = fsys_idx + HRS_TYPE_FIXED_MAX;
-+        long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX;
-         return (u_char *) & long_return;
-     case HRFSYS_FULLDUMP:
-         return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/043.16634190.kernel_sunos5.patch	Wed Apr 30 13:55:52 2014 -0700
@@ -0,0 +1,20 @@
+This patch fixes a Solaris specific issue related to incorrect
+reporting of network interface speed inside a zone. The patch has 
+been submitted to the community but has not been accepted yet.
+
+The details can be found in the following location
+https://sourceforge.net/p/net-snmp/patches/1277/
+--- net-snmp-5.4.1.old/agent/mibgroup/kernel_sunos5.c	2014-03-28 14:54:11.259600880 -0400
++++ net-snmp-5.4.1/agent/mibgroup/kernel_sunos5.c	2014-03-28 14:52:32.837130820 -0400
+@@ -1908,8 +1908,10 @@
+          * this is good 
+          */
+ 	havespeed = B_TRUE;
++    } else if ((getKstatInt("link", name, "ifspeed", &ifp->ifSpeed) == 0) ||
++               (getKstatInt("link", name, "ifSpeed", &ifp->ifSpeed) == 0)) {
++        havespeed = B_TRUE;
+     }
+-
+     /* make ifOperStatus depend on link status if available */
+     if (ifp->ifAdminStatus == 1) {
+         int i_tmp;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/net-snmp/patches/044.15805491.hr_filesys.patch	Wed Apr 30 13:55:52 2014 -0700
@@ -0,0 +1,28 @@
+This patch taken from the net-snmp community fixes an issue related to mismatch of the 
+indices in the host resources tables for monitoring disk storage.
+ 
+The details for the upstream bug/patch are given below.
+BUG: 1557372: Realign hrFSStorageIndex with hrStorageTable
+http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=revision&revision=17138
+
+--- net-snmp-5.4.1.old/agent/mibgroup/host/hr_filesys.c	2014-03-25 07:06:17.172039070 -0400
++++ net-snmp-5.4.1/agent/mibgroup/host/hr_filesys.c	    2014-03-25 07:10:05.467869740 -0400
+@@ -4,6 +4,9 @@
+  */
+ 
+ #include <net-snmp/net-snmp-config.h>
++#include <net-snmp/net-snmp-includes.h>
++#include <net-snmp/agent/net-snmp-agent-includes.h>
++#include <net-snmp/agent/hardware/memory.h>
+ #include "host_res.h"
+ #include "hr_filesys.h"
+ #include "hr_storage.h"
+@@ -546,7 +549,7 @@
+             long_return = 2;    /* others probably aren't */
+         return (u_char *) & long_return;
+     case HRFSYS_STOREIDX:
+-        long_return = fsys_idx + HRS_TYPE_FIXED_MAX;
++        long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX;
+         return (u_char *) & long_return;
+     case HRFSYS_FULLDUMP:
+         return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len);