[net-snmp] fixed truncation of sysObjectID Resolves: #640848
Jan Šafránek
jsafrane at fedoraproject.org
Mon Oct 11 10:25:14 UTC 2010
commit 36d59937b345f4bf20723603d4f0c51be8073bca
Author: Jan Safranek <jsafrane at redhat.com>
Date: Mon Oct 11 12:25:21 2010 +0200
fixed truncation of sysObjectID
Resolves: #640848
net-snmp-5.5-sysobjectid-truncation.patch | 51 +++++++++++++++++++++++++++++
net-snmp.spec | 7 +++-
2 files changed, 57 insertions(+), 1 deletions(-)
---
diff --git a/net-snmp-5.5-sysobjectid-truncation.patch b/net-snmp-5.5-sysobjectid-truncation.patch
new file mode 100644
index 0000000..9af2837
--- /dev/null
+++ b/net-snmp-5.5-sysobjectid-truncation.patch
@@ -0,0 +1,51 @@
+640848: snmpd always returns an incorrect sysObjectID of ".1.3" or ".0.1"
+
+Source: upstream, SVN rev. 19322
+
+Index: net-snmp/agent/mibgroup/mibII/system_mib.c
+===================================================================
+--- net-snmp/agent/mibgroup/mibII/system_mib.c (revision 17596)
++++ net-snmp/agent/mibgroup/mibII/system_mib.c (working copy)
+@@ -60,7 +57,7 @@
+ static char sysName[SYS_STRING_LEN] = NETSNMP_SYS_NAME;
+ static char sysLocation[SYS_STRING_LEN] = NETSNMP_SYS_LOC;
+ static oid sysObjectID[MAX_OID_LEN];
+-static size_t sysObjectIDLength;
++static size_t sysObjectIDByteLength;
+
+ extern oid version_sysoid[];
+ extern int version_sysoid_len;
+@@ -171,12 +168,11 @@
+ static void
+ system_parse_config_sysObjectID(const char *token, char *cptr)
+ {
+- sysObjectIDLength = MAX_OID_LEN;
++ size_t sysObjectIDLength = MAX_OID_LEN;
+ if (!read_objid(cptr, sysObjectID, &sysObjectIDLength)) {
+ netsnmp_config_error("sysobjectid token not a parsable OID:\n\t%s",
+ cptr);
+ memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
+- sysObjectIDLength = version_sysoid_len;
+ }
+ }
+
+@@ -318,7 +314,7 @@
+
+ /* default sysObjectID */
+ memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
+- sysObjectIDLength = version_sysoid_len;
++ sysObjectIDByteLength = version_sysoid_len * sizeof(oid);
+
+ {
+ const oid sysDescr_oid[] = { 1, 3, 6, 1, 2, 1, 1, 1 };
+@@ -340,8 +336,8 @@
+ HANDLER_CAN_RONLY),
+ netsnmp_init_watcher_info6(
+ &sysObjectID_winfo, sysObjectID, 0, ASN_OBJECT_ID,
+- WATCHER_MAX_SIZE | WATCHER_SIZE_IS_PTR,
+- MAX_OID_LEN, &sysObjectIDLength));
++ WATCHER_MAX_SIZE | WATCHER_SIZE_IS_PTR,
++ MAX_OID_LEN, &sysObjectIDByteLength));
+ }
+ {
+ const oid sysUpTime_oid[] = { 1, 3, 6, 1, 2, 1, 1, 3 };
diff --git a/net-snmp.spec b/net-snmp.spec
index f608f9c..b183308 100644
--- a/net-snmp.spec
+++ b/net-snmp.spec
@@ -11,7 +11,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: 5.5
-Release: 20%{?dist}
+Release: 21%{?dist}
Epoch: 1
License: BSD
@@ -38,6 +38,7 @@ Patch9: net-snmp-5.5-include-struct.patch
Patch10: net-snmp-5.5-mktemp-size.patch
Patch11: net-snmp-5.5-apsl-copying.patch
Patch12: net-snmp-5.5-perl-linking.patch
+Patch13: net-snmp-5.5-sysobjectid-truncation.patch
Requires(post): chkconfig
Requires(preun): chkconfig
@@ -174,6 +175,7 @@ Net-SNMP toolkit library.
%patch10 -p1 -b .mktemp-size
%patch11 -p1 -b .apsl
%patch12 -p1 -b .perl-linking
+%patch13 -p1 -b .sysobjectid-truncation
%build
MIBS="host agentx smux \
@@ -422,6 +424,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_datadir}/snmp/mibs/*
%changelog
+* Mon Oct 11 2010 Jan Safranek <jsafrane at redhat.com> - 1:5.5-21
+- fixed truncation of sysObjectID (#640848)
+
* Thu Aug 19 2010 Jan Safranek <jsafrane at redhat.com> - 1:5.5-20
- Remove rpath from net-snmp-config output (#554747)
More information about the scm-commits
mailing list