Bug #75782 [NEW]: SNMP Issue with backslash in OID
From: steve dot cleveland at oregonstate dot edu
Operating system:
PHP version: 7.2.1
Package: SNMP related
Bug Type: Bug
Bug description:SNMP Issue with backslash in OID
Description:
------------
When performing a walk on dot1dTpFdbAddress (.1.3.6.1.2.1.17.4.3.1.1)
with an HP Procurve switch (it's a bridge between the port and the mac
address table), I believe the PHP SNMP module is interpreting the
response incorrectly when a backslash is in the OID.
I'm not sure how the dot1dTpFdbAddress 'names' are created or what
exactly they represent, but in this case, it appears if the 'name'
includes a backslash, PHP is assigning the name as the value. I'm
guessing it's an incorrect regex.
This is the first time I've run into this issue, so I think it's rare.
I've tried various output options (quick_print, enum_print,
output_format and valueretrieval), but the value doesn't change.
I've tried both PHP versions 7.0.27 and 7.2.1
Test script:
---------------
# Command line snmpwalk command
% snmpwalk -v 2c -c public switch1 .1.3.6.1.2.1.17.4.3.1.1
BRIDGE-MIB::dot1dTpFdbAddress.'lbmP\=' = STRING: 6c:62:6d:50:5c:3d
BRIDGE-MIB::dot1dTpFdbAddress.'l.....' = STRING: 6c:f3:7f:c6:88:d6
BRIDGE-MIB::dot1dTpFdbAddress.'pM{&..' = STRING: 70:4d:7b:26:e3:4
BRIDGE-MIB::dot1dTpFdbAddress.'pZ....' = STRING: 70:5a:f:12:a2:11
# PHP either OOP or procedural
$snmp = new \SNMP(SNMP::VERSION_2c, 'switch1', 'public');
$snmp->walk('.1.3.6.1.2.1.17.4.3.1.1');
# or
snmp2_real_walk('switch1', 'public', '.1.3.6.1.2.1.17.4.3.1.1');
[SNMPv2-SMI::mib-2.17.4.3.1.1.108.98.109.80.92.61] => STRING: "lbmP\\="
[SNMPv2-SMI::mib-2.17.4.3.1.1.108.243.127.198.136.214] => Hex-STRING: 6C
F3 7F C6 88 D6
[SNMPv2-SMI::mib-2.17.4.3.1.1.112.77.123.38.227.4] => Hex-STRING: 70 4D
7B 26 E3 04
[SNMPv2-SMI::mib-2.17.4.3.1.1.112.90.15.18.162.17] => Hex-STRING: 70 5A
0F 12 A2 11
Expected result:
----------------
The first output in the example should return a MAC address, not lbmP\\=
--
Edit bug report at https://bugs.php.net/bug.php?id=75782&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75782&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75782&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75782&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75782&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75782&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75782&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75782&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75782&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75782&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75782&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75782&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75782&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75782&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75782&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75782&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75782&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75782&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75782&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75782&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75782&r=mysqlcfg
Thread (1 message)
- steve dot cleveland at oregonstate dot edu