From: Ilia Alshanetsky Date: Tue, 7 Dec 2004 00:34:33 +0000 (+0000) Subject: MFh: Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). X-Git-Tag: php-4.3.10RC2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=14c6cd17887c4b517d83581f3e9e2404a22ae723;p=php MFh: Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). --- diff --git a/NEWS b/NEWS index a55590a1d0..5af1bb8871 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,8 @@ PHP 4 NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Nov 2004, Version 4.3.10 -- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). +- Fixed bug #30995 (snmp extension does not build with net-snmp 5.2). (Ilia) +- Fixed bug #30990 (allow popen() on *NIX to accept 'b' flag). (Ilia) 23 Nov 2004, Version 4.3.10RC1 - Added the %F modifier to *printf to render a non-locale-aware representation diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 178f189496..2bc437ba78 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -769,7 +769,21 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T s->securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol); return (0); #ifdef HAVE_AES - } else if (!strcasecmp(prot, "AES128")) { + } else if (!strcasecmp(prot, "AES128") +#ifdef SNMP_VALIDATE_ERR +/* +* In Net-SNMP before 5.2, the following symbols exist: +* usmAES128PrivProtocol, usmAES192PrivProtocol, usmAES256PrivProtocol +* In an effort to be more standards-compliant, 5.2 removed the last two. +* As of 5.2, the symbols are: +* usmAESPrivProtocol, usmAES128PrivProtocol +* +* As we want this extension to compile on both versions, we use the latter +* symbol on purpose, as it's defined to be the same as the former. +*/ + || !strcasecmp(prot, "AES")) { +#else + ) { s->securityPrivProto = usmAES128PrivProtocol; s->securityPrivProtoLen = OIDSIZE(usmAES128PrivProtocol); return (0); @@ -781,6 +795,7 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot T s->securityPrivProto = usmAES256PrivProtocol; s->securityPrivProtoLen = OIDSIZE(usmAES256PrivProtocol); return (0); +#endif #endif } else if (strlen(prot)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid privacy protocol: %s", prot);