Description of problem:
Ocetets Truncated with Python Bindings.
Version-Release number of selected component (if applicable):
Use net-snmp python bindings to set a SMI object that is of the DateAndTime. Use the date and time of 01/01/2010 00:00. Observe the result on the wire. Observe that the bindings read the '00' characters as a termination character.
Steps to Reproduce:
1. Install net-snmp-python
2. Set DateAndTime object with 01/01/2010 00:00
3. Observe result.
01/01/2010 00:00 is seen as 0x07da0101 on the wire. Which is wrong length per the SMI for DateAndTime per the SNMPv2-TC MIB.
01/01/2010 00:00 should result i na set of 0x07da0101000f0000.
This issue has been resolved in a later version of net-snmp. A patch which backports the fix to net-snmp-5.5-49.el6_5.1.x86_64 can be found here http://sourceforge.net/p/net-snmp/bugs/2552/ . This patch has been tested by rebuilding the redhat rpm and installing it on the system.
Thanks for the report.
Just for reference, this small python snippet sends 'hello' instead of 'hello.world', where '.' should be \0 character.
oid = netsnmp.Varbind('sysDescr', val='hello\000world', type='OCTETSTR')
netsnmp.snmpset(oid, Version=2, DestHost='localhost', Community='public')
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.