Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1126914

Summary: Ocetets Truncated with Python Bindings
Product: Red Hat Enterprise Linux 6 Reporter: kurt.frederiksen
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED ERRATA QA Contact: Dalibor Pospíšil <dapospis>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.7CC: dapospis
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Net-SNMP Python bindings did not check input string of netsnmp_set call and copied only part of the string to the outgoing SNMP SET request when the string contained character with ASCII value 0. Consequence: A Python application could send invalid SNMP SET requests Fix: The Python binding copies full string, including any '\0' characters. Result: Applications send valid SNMP SET requests.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:22:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kurt.frederiksen 2014-08-05 15:05:59 UTC
Description of problem:
Ocetets Truncated with Python Bindings.

Version-Release number of selected component (if applicable):
net-snmp-5.5-49.el6_5.1.x86_64

How reproducible:
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.

Actual results:
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.

Expected results:
01/01/2010 00:00 should result i na set of 0x07da0101000f0000.

Additional info:
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.

Comment 2 Jan Safranek 2014-08-06 11:27:47 UTC
Thanks for the report.

Just for reference, this small python snippet sends 'hello' instead of 'hello.world', where '.' should be \0 character.

import netsnmp
oid = netsnmp.Varbind('sysDescr', val='hello\000world', type='OCTETSTR')
netsnmp.snmpset(oid, Version=2, DestHost='localhost', Community='public')

Comment 6 errata-xmlrpc 2015-07-22 07:22:55 UTC
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.

https://rhn.redhat.com/errata/RHSA-2015-1385.html