#22723 [Dup->Bgs]: snmp set does not work properly for shortened OID

From: Date: Fri, 02 May 2003 22:26:03 +0000
Subject: #22723 [Dup->Bgs]: snmp set does not work properly for shortened OID
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38964@lists.php.net to get a copy of this message
ID: 22723 Updated by: derick@php.net Reported By: jamuel at my740il dot com -Status: Duplicate +Status: Bogus Bug Type: SNMP related Operating System: Linux 2.4.18 PHP Version: 4.3.2RC1 New Comment: That is for *us* to decide, leave it bogus. Previous Comments: ------------------------------------------------------------------------ [2003-05-02 16:11:35] jamuel at my740il dot com This should be set to Duplicate not Bogus. ------------------------------------------------------------------------ [2003-03-19 18:01:00] sniper@php.net Please, leave this bogus and add any comments to the other report.. ------------------------------------------------------------------------ [2003-03-19 17:42:14] jamuel at my740il dot com that patch argument should be -p0 (a zero not an "oh"). ------------------------------------------------------------------------ [2003-03-19 17:40:45] jamuel at my740il dot com Ok so the following patch resolves the issue on my system. Not really sure why the existing function call fails but regardless snmpset now works correctly with shortened textual oids, full textual oids, and full numeric oids. I also tested snmpget and it works fine as well. --- snmp.c Fri Feb 21 02:42:01 2003 +++ snmp.c Tue Mar 18 13:58:48 2003 @@ -217,7 +217,7 @@ static void php_snmp_internal(INTERNAL_F if (st >= 2) { /* walk */ rootlen = MAX_NAME_LEN; if (strlen(objid)) { /* on a walk, an empty string means top of tree - no error */ - if (read_objid(objid, root, &rootlen)) { + if (snmp_parse_oid(objid, root, &rootlen)) { gotroot = 1; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid object identifier: %s", objid); Do a patch -po -l from the ../ext/snmp directory and paste the above patch-text into patch, press <CTRL-D> twice to exit patch and you should see "patching file snmp.c". cd back to the root of the PHP-4 source directory, make clean, make all, make install and you should be in business! BTW, no really sure how this form will mangle the patch-text but it's really only a one line change. So you could just manually edit the snmp.c file and look for line 220 and make the change from read_objid to snmp_parse_oid (the parameters remain unchanged.) Hope that helps . . . Cheers, JPS ------------------------------------------------------------------------ [2003-03-15 23:04:03] sniper@php.net Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PHP. See Bug #22529 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/22723 -- Edit this bug report at http://bugs.php.net/?id=22723&edit=1

« previous php.bugs (#38964) next »