php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79569 State leak between SNMP::walk(oid, false) calls
Submitted: 2020-05-05 22:25 UTC Modified: 2020-05-17 04:22 UTC
From: grzegorz129 at gmail dot com Assigned: cmb (profile)
Status: No Feedback Package: SNMP related
PHP Version: 7.4.5 OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: grzegorz129 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-05-05 22:25 UTC] grzegorz129 at gmail dot com
Description:
------------
When SNMP::walk() is called with a numeric OID it provides generic results any number of times. However, as soon as it's called with the textual OID corresponding to the numeric one any subsequent calls with that numerical OID will suddenly start returning results in a different format (exactly like with the textual one).

It's pretty hard to describe, however looking at the "Actual result" section clearly shows the problem.

Test script:
---------------
/*
No simple script available due to external server being required.

 - \SNMP was configured with v3 protocol including auth & priv
 - oid_output_format = \SNMP_OID_OUTPUT_SUFFIX
 - exceptions_enabled = \SNMP::ERRNO_ANY
 - quick_print = true

 #1 ‌‌->walk('.1.3.6.1.4.1.6574.2.1.1', false);
 #2 ->walk('.1.3.6.1.4.1.6574.2.1.1', false); => result exactly like in #1
 #3 ->walk('SYNOLOGY-DISK-MIB::diskTable', false); => result with names
 #4 ->walk('.1.3.6.1.4.1.6574.2.1.1', false); => result like in #3 instead of #1-#2
*/

Actual result:
--------------
‌‌$snmp->walk('.1.3.6.1.4.1.6574.2.1.1', false);
‌array (
  'synology.2.1.1.2.0' => '"Drive 1"',
  'synology.2.1.1.2.1' => '"Drive 2"',
  'synology.2.1.1.2.2' => '"Drive 3"',
  'synology.2.1.1.2.3' => '"Drive 4"',
  'synology.2.1.1.2.4' => '"Drive 5"',
  'synology.2.1.1.3.0' => '"WD40EFRX-68WT0N0        "',
  'synology.2.1.1.3.1' => '"WD40EFRX-68N32N0        "',
  'synology.2.1.1.3.2' => '"ST6000VN0033-2EE110     "',
  'synology.2.1.1.3.3' => '"WD60EFRX-68L0BN1        "',
  'synology.2.1.1.3.4' => '"ST1000LM010-9YH146      "',
  'synology.2.1.1.4.0' => '"SATA"',
  'synology.2.1.1.4.1' => '"SATA"',
  'synology.2.1.1.4.2' => '"SATA"',
  'synology.2.1.1.4.3' => '"SATA"',
  'synology.2.1.1.4.4' => '"SATA"',
  'synology.2.1.1.5.0' => '1',
  'synology.2.1.1.5.1' => '1',
  'synology.2.1.1.5.2' => '1',
  'synology.2.1.1.5.3' => '1',
  'synology.2.1.1.5.4' => '1',
  'synology.2.1.1.6.0' => '37',
  'synology.2.1.1.6.1' => '34',
  'synology.2.1.1.6.2' => '39',
  'synology.2.1.1.6.3' => '37',
  'synology.2.1.1.6.4' => '31',
)

‌‌$snmp->walk('SYNOLOGY-DISK-MIB::diskTable', false);
‌array (
  'diskID.0' => '"Drive 1"',
  'diskID.1' => '"Drive 2"',
  'diskID.2' => '"Drive 3"',
  'diskID.3' => '"Drive 4"',
  'diskID.4' => '"Drive 5"',
  'diskModel.0' => '"WD40EFRX-68WT0N0        "',
  'diskModel.1' => '"WD40EFRX-68N32N0        "',
  'diskModel.2' => '"ST6000VN0033-2EE110     "',
  'diskModel.3' => '"WD60EFRX-68L0BN1        "',
  'diskModel.4' => '"ST1000LM010-9YH146      "',
  'diskType.0' => '"SATA"',
  'diskType.1' => '"SATA"',
  'diskType.2' => '"SATA"',
  'diskType.3' => '"SATA"',
  'diskType.4' => '"SATA"',
  'diskStatus.0' => '1',
  'diskStatus.1' => '1',
  'diskStatus.2' => '1',
  'diskStatus.3' => '1',
  'diskStatus.4' => '1',
  'diskTemperature.0' => '37',
  'diskTemperature.1' => '34',
  'diskTemperature.2' => '39',
  'diskTemperature.3' => '37',
  'diskTemperature.4' => '31',
)

‌‌$snmp->walk('.1.3.6.1.4.1.6574.2.1.1', false);
‌array (
  'diskID.0' => '"Drive 1"',
  'diskID.1' => '"Drive 2"',
  'diskID.2' => '"Drive 3"',
  'diskID.3' => '"Drive 4"',
  'diskID.4' => '"Drive 5"',
  'diskModel.0' => '"WD40EFRX-68WT0N0        "',
  'diskModel.1' => '"WD40EFRX-68N32N0        "',
  'diskModel.2' => '"ST6000VN0033-2EE110     "',
  'diskModel.3' => '"WD60EFRX-68L0BN1        "',
  'diskModel.4' => '"ST1000LM010-9YH146      "',
  'diskType.0' => '"SATA"',
  'diskType.1' => '"SATA"',
  'diskType.2' => '"SATA"',
  'diskType.3' => '"SATA"',
  'diskType.4' => '"SATA"',
  'diskStatus.0' => '1',
  'diskStatus.1' => '1',
  'diskStatus.2' => '1',
  'diskStatus.3' => '1',
  'diskStatus.4' => '1',
  'diskTemperature.0' => '37',
  'diskTemperature.1' => '34',
  'diskTemperature.2' => '39',
  'diskTemperature.3' => '37',
  'diskTemperature.4' => '31',
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-08 11:28 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-05-08 11:28 UTC] cmb@php.net
Please compare with the behavior of snmpwalk(); would that give
the desired results?
 [2020-05-17 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Oct 04 11:03:58 2022 UTC