diff options
author | Bertrand Jacquin <beber@meleeweb.net> | 2009-01-26 18:23:51 +0100 |
---|---|---|
committer | Bertrand Jacquin <beber@meleeweb.net> | 2009-01-26 18:23:51 +0100 |
commit | 01b71e831e9f7c78f60f94a21a5bc7d9f79f50ed (patch) | |
tree | 9eda42af1ce7babe0f7b5b41bded17efa3240f6f /net-analyzer/net-snmp | |
parent | delete navit (diff) | |
download | portage-01b71e831e9f7c78f60f94a21a5bc7d9f79f50ed.tar.xz |
snmp up
Diffstat (limited to 'net-analyzer/net-snmp')
9 files changed, 1190 insertions, 60 deletions
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest index 11059e06..ce39b9b4 100644 --- a/net-analyzer/net-snmp/Manifest +++ b/net-analyzer/net-snmp/Manifest @@ -1,80 +1,29 @@ AUX multi-tun-segv.patch 7231 RMD160 d02666572b7691d9e279f2586820992b8394a2ef SHA1 c250eebb22385be994d9e7b67fbb67a0dec295ce SHA256 929cc61484fbf69134273acc3416f2644251d9a490850c901d8746b1d2f7c47a -MD5 c6eb08e45ad70e529aa3383f5d73156a files/multi-tun-segv.patch 7231 -RMD160 d02666572b7691d9e279f2586820992b8394a2ef files/multi-tun-segv.patch 7231 -SHA256 929cc61484fbf69134273acc3416f2644251d9a490850c901d8746b1d2f7c47a files/multi-tun-segv.patch 7231 AUX net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 RMD160 904d195cafa4334f9d8116a3d13eff4181e06d3b SHA1 0101a446e217a95f621e634544b19490fa01c072 SHA256 893180ba84ef69381d270286f042852a200c35b7792f55fe23920a0bcb1d8fb9 -MD5 82d14deda5805e21a60de03e0a69659c files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 -RMD160 904d195cafa4334f9d8116a3d13eff4181e06d3b files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 -SHA256 893180ba84ef69381d270286f042852a200c35b7792f55fe23920a0bcb1d8fb9 files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 AUX net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 RMD160 c11898fcfe7964f2263c64a164b5010741be3e8b SHA1 670a0d4c5de33d79fc026cb4190f8c7f55ac9d10 SHA256 0304fe236b335eab2a42c9009e66310c03c82b9ead9886d6f558fc245f83581c -MD5 bce531dc2d093d0659e02707c28a7b95 files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 -RMD160 c11898fcfe7964f2263c64a164b5010741be3e8b files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 -SHA256 0304fe236b335eab2a42c9009e66310c03c82b9ead9886d6f558fc245f83581c files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 AUX net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 RMD160 05b1099c32c2091e9606f167288a21503510cc20 SHA1 278b48283e536bc76935865ec227c402019e7df6 SHA256 100f18794f11c0d0fe43e9f50cec755158906268b4c2b560f45f8d7ff797422e -MD5 a63107c1d81a8aeb10e84be0658e2794 files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 -RMD160 05b1099c32c2091e9606f167288a21503510cc20 files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 -SHA256 100f18794f11c0d0fe43e9f50cec755158906268b4c2b560f45f8d7ff797422e files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 AUX net-snmp-5.2.2-asneeded.patch 3014 RMD160 4394ac08e2ab0a4c57036b61b554e1bdc7c29ff2 SHA1 9c2f1e4ac9ffab8f604740b47dce9914dd0200f6 SHA256 2caa3beb56a0087e1800d875988ceaf11da0ba1eb5121804f2827d4b53a682b7 -MD5 55644512ad20558e95bedce0d6476278 files/net-snmp-5.2.2-asneeded.patch 3014 -RMD160 4394ac08e2ab0a4c57036b61b554e1bdc7c29ff2 files/net-snmp-5.2.2-asneeded.patch 3014 -SHA256 2caa3beb56a0087e1800d875988ceaf11da0ba1eb5121804f2827d4b53a682b7 files/net-snmp-5.2.2-asneeded.patch 3014 AUX net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 SHA1 e23506ea9f27e82d796e5896158632cb93f0f8ac SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 -MD5 ca3a2ba5a12a796d29087038828f2c21 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 -RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 -SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 AUX net-snmp-5.3.1-retrans-time.patch 3240 RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 SHA1 8ca179d5620a1a0b38f45c04d3f790099a426828 SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b -MD5 5a9189510527a178f92b3b9751d20b6c files/net-snmp-5.3.1-retrans-time.patch 3240 -RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 files/net-snmp-5.3.1-retrans-time.patch 3240 -SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b files/net-snmp-5.3.1-retrans-time.patch 3240 AUX net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 RMD160 4c2d25a50375f950642a49d79678532f89b36ede SHA1 adea9cce4b81e1d66757194257e9d8d489c32d96 SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b -MD5 3f888bb1a96a76d1a54af4f0a50fceff files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 -RMD160 4c2d25a50375f950642a49d79678532f89b36ede files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 -SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 +AUX net-snmp-5.4-exec-crash.patch 567 RMD160 fe110ace0ae451a8cf25d18d4133fb0d85dcaf5c SHA1 4a4538958e4c805981e1f0da4d6f1980a03aeab6 SHA256 2c4d3d281380d394d0d349c37839bb89f3d82d3e1c43513e042d24126441741c AUX net-snmp-5.4-makefile.patch 597 RMD160 90f8e6db0a05fd21c06e98b65b4bbd377f931fe9 SHA1 2ff51b2ab2df2224dd34ca1af16430fbf0b97927 SHA256 fd8c6ceda9c5d99cd92f81a7977d2134960ee14fac3ab9f1f8c6d03c6a69edb1 -MD5 d61d49e044489f4b4549cda0b7cbc336 files/net-snmp-5.4-makefile.patch 597 -RMD160 90f8e6db0a05fd21c06e98b65b4bbd377f931fe9 files/net-snmp-5.4-makefile.patch 597 -SHA256 fd8c6ceda9c5d99cd92f81a7977d2134960ee14fac3ab9f1f8c6d03c6a69edb1 files/net-snmp-5.4-makefile.patch 597 +AUX net-snmp-5.4.1-CVE-2008-2292.patch 6212 RMD160 79b2e05df4623972dbaea2dd92dea4a46975c566 SHA1 7fe5f5e9785deeaa1852de76fcba17cbbf9781dc SHA256 10908598aa445bad84708af3ebba1e6a6d985a8008e0c4be42df556851f6a48d AUX net-snmp-5.4.1-clientaddr-fix.patch 2942 RMD160 02893663d464cce39f6b54c3e27776d27fe5fe67 SHA1 fee0d795797f73de463aceaad13ebc24311763b9 SHA256 355b5661d1ecc066a8094969269b8af35e63e406a32547d6b0f8c3c57b1a4685 -MD5 68ccb8d180ff38847ed5e8d2561cbaee files/net-snmp-5.4.1-clientaddr-fix.patch 2942 -RMD160 02893663d464cce39f6b54c3e27776d27fe5fe67 files/net-snmp-5.4.1-clientaddr-fix.patch 2942 -SHA256 355b5661d1ecc066a8094969269b8af35e63e406a32547d6b0f8c3c57b1a4685 files/net-snmp-5.4.1-clientaddr-fix.patch 2942 +AUX net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch 16053 RMD160 1d33a23b165946f7dd4e97b329c79d27c42ec913 SHA1 c4a107c35cf96b3c52a3156ab9f999b46582b693 SHA256 2d3aad8d76046e11a520d45bc5d3304b1ceff91c6d5a5510dc020aae47506b3d +AUX net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch 4740 RMD160 305f962976c6afc39b0ee37706f34d05ea768874 SHA1 93b806c407048cba4f5c63137df1e819c83d0010 SHA256 0872a11f48106f1a2a9c4a8a894abe31b04ee607bdfd44b8207c8e659213ef31 +AUX net-snmp-5.4.1-perl-asneeded.patch 1219 RMD160 caced600c35165603069e62a17a664d7a0180586 SHA1 89bedb2424d65176a9bfba8c9b318b1d50b5b3ed SHA256 42640b545363cd5c6c7eef6b17b10c1d256e189ceb7b7c874baa4041de24e151 +AUX net-snmp-5.4.1-process-count-race.patch 1489 RMD160 221f218270b83afec95d1efd260109b8baf05626 SHA1 3986f4789c145dd7182bf5f7d94a1cda0504ce5c SHA256 74a6e001de7a855079be988dd0cb23190095082e1a9adaefb9a9cac677ffa116 +AUX net-snmp-5.4.1-suppresssuppress-annoying.patch 800 RMD160 aa23a30241ae64aeed6a08a630326fd7c2e0f9fe SHA1 2b99c56d1f659f324c5676d48ab257ea3b55467f SHA256 f5249b782079be96256ab6e7a0d398c04dfbcabffa7f4c716fe1abd39897aabe AUX net-snmp-lm_sensors.patch 13686 RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 SHA1 3e795339fc93306a4d662feeaa16faca2509a058 SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86 -MD5 25d92c9a7adcbb80240a914a8f6bbfe5 files/net-snmp-lm_sensors.patch 13686 -RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 files/net-snmp-lm_sensors.patch 13686 -SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86 files/net-snmp-lm_sensors.patch 13686 AUX net-snmp-maxreps.patch 5495 RMD160 a1a958f292f780f5c4f8ec66a4ec350f261d3214 SHA1 2ed58bb7c1136452532909154a1cb2c2f322467d SHA256 5e37133da687d84cb06eea7899e1be23d9613be1d24f43e8e8555577f3d47da7 -MD5 d12c1aa77ee79717e2dba9ecc058f67c files/net-snmp-maxreps.patch 5495 -RMD160 a1a958f292f780f5c4f8ec66a4ec350f261d3214 files/net-snmp-maxreps.patch 5495 -SHA256 5e37133da687d84cb06eea7899e1be23d9613be1d24f43e8e8555577f3d47da7 files/net-snmp-maxreps.patch 5495 AUX snmpd-5.1.conf 606 RMD160 a243da5c9dfde4a5cfb16bd7d4491cedb7879620 SHA1 5c7c45a434cb566cfec678050384f9ab6af912a9 SHA256 f569766eb6ca203a0c9549b2592d6f36ae4999cfaabc423cad5a864201a86ac9 -MD5 ed2e953a9a923caec45eeca95bec2efc files/snmpd-5.1.conf 606 -RMD160 a243da5c9dfde4a5cfb16bd7d4491cedb7879620 files/snmpd-5.1.conf 606 -SHA256 f569766eb6ca203a0c9549b2592d6f36ae4999cfaabc423cad5a864201a86ac9 files/snmpd-5.1.conf 606 AUX snmpd-5.1.rc6 714 RMD160 1f7cef43888500044be0b0d4938574922b48bcfd SHA1 7468069b6e12b527f5a6a8026b67125f3545d243 SHA256 8f02a26a794a5c37e4cb4092ab61f82a6d7ec5876146738d4630ed147cc9ccf6 -MD5 0dbde7b1bdd9c9dc988039e676800337 files/snmpd-5.1.rc6 714 -RMD160 1f7cef43888500044be0b0d4938574922b48bcfd files/snmpd-5.1.rc6 714 -SHA256 8f02a26a794a5c37e4cb4092ab61f82a6d7ec5876146738d4630ed147cc9ccf6 files/snmpd-5.1.rc6 714 AUX snmpd.conf 598 RMD160 c72a20fe6d4682ceea533587762782d62906b630 SHA1 51ebdca93c68ca04b7f402fad4f504422ec2c6cf SHA256 1f4f07b831c3227588fd546423137ed5c60a602fbee13b0d66edd801e4e7d598 -MD5 cc6b95963357eab99f7f2d55398d5acb files/snmpd.conf 598 -RMD160 c72a20fe6d4682ceea533587762782d62906b630 files/snmpd.conf 598 -SHA256 1f4f07b831c3227588fd546423137ed5c60a602fbee13b0d66edd801e4e7d598 files/snmpd.conf 598 AUX snmpd.rc7 706 RMD160 137d85e5f2b7cae62e214141aabcec495777007e SHA1 8d94d3bb2d3b43e20604030dc585c735685cf99b SHA256 93337ebeac92ec0073c896db0a4384beebf84ee17365bdc2594285fd33ac7dfe -MD5 7f66808dbbe407d788d9bd9676f5d07a files/snmpd.rc7 706 -RMD160 137d85e5f2b7cae62e214141aabcec495777007e files/snmpd.rc7 706 -SHA256 93337ebeac92ec0073c896db0a4384beebf84ee17365bdc2594285fd33ac7dfe files/snmpd.rc7 706 AUX snmptrapd.conf 635 RMD160 aba7b7196835bd359174156a527e13188f76e248 SHA1 0d296caa01c789455c3cd4c67cd81aca5547681d SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 -MD5 791cd8d81154f2c1d01e3f87b86faa44 files/snmptrapd.conf 635 -RMD160 aba7b7196835bd359174156a527e13188f76e248 files/snmptrapd.conf 635 -SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 files/snmptrapd.conf 635 AUX snmptrapd.rc7 557 RMD160 e67117fbcb0a6f8668cb1abbc8fcfcb548ebfdb5 SHA1 dcaac6c0f9e086e49f653f100e0c3f9a7f65db1d SHA256 3594345cdf3c9a5a04073ec11a54e4a19881b27288cdbf22874cca5d0a0f624c -MD5 f12dedff94a6a3359f76a012fad7ec79 files/snmptrapd.rc7 557 -RMD160 e67117fbcb0a6f8668cb1abbc8fcfcb548ebfdb5 files/snmptrapd.rc7 557 -SHA256 3594345cdf3c9a5a04073ec11a54e4a19881b27288cdbf22874cca5d0a0f624c files/snmptrapd.rc7 557 +DIST net-snmp-5.4.1.1.tar.gz 5123861 RMD160 870b6a3e4eb28df3cbdf0df34d23f46bd7de8961 SHA1 cfeef748f242a7b25ad8eea95977ff277984e368 SHA256 b22ecb5e7f0907c20cc7fc9f1e1f31b1b4b2dd81abdc3e2e0bfddf8d060008a2 DIST net-snmp-5.4.1.tar.gz 5122455 RMD160 3723488dab8d164702a7d55c9c72eeaec07dd50c SHA1 ac5ba033c10d53d3057415121f8c4936c643c208 SHA256 0ea976722c993c87dede8eb6348e6feb059e3851bbef2de824bf18ac97cdb565 EBUILD net-snmp-5.4.1-r1.ebuild 5715 RMD160 e4c073bcbcea5977fbd9789498ce956851cb50b6 SHA1 44c350833b0dd7d0ec586f40dfd46fb930a4f2da SHA256 687b4c47bf4e5e37fa284e7a1aa9f3cf7a057b61e152098aa39bd9a348a273e5 -MD5 8fc95b29e4983db685bc640d98c5d400 net-snmp-5.4.1-r1.ebuild 5715 -RMD160 e4c073bcbcea5977fbd9789498ce956851cb50b6 net-snmp-5.4.1-r1.ebuild 5715 -SHA256 687b4c47bf4e5e37fa284e7a1aa9f3cf7a057b61e152098aa39bd9a348a273e5 net-snmp-5.4.1-r1.ebuild 5715 -MD5 2e34b0d7a577176cbcf6ef8d902718fb files/digest-net-snmp-5.4.1-r1 247 -RMD160 eea7a4c51416de3c43bcf3c2404be5affd3f6118 files/digest-net-snmp-5.4.1-r1 247 -SHA256 2f2084a65a62043ef1cb434c7ed0717ed22310fa0bd3225946c19b7fb6864ecb files/digest-net-snmp-5.4.1-r1 247 +EBUILD net-snmp-5.4.1.1.ebuild 6164 RMD160 c0c218a3b71babd4c1e0ff6699676a2ce9c3a181 SHA1 cb669a98b8ca529aff0e60240514e9bfd2f96db6 SHA256 59bf4e572d20dabd303390945231a41f7184bf1c52cec26965c891d56c1c64d1 diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch b/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch new file mode 100644 index 00000000..6dae95a3 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch @@ -0,0 +1,14 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=243536 + +--- net-snmp-5.4/agent/mibgroup/agent/extend.c.orig 2006-10-18 21:07:35.000000000 +0200 ++++ net-snmp-5.4/agent/mibgroup/agent/extend.c 2007-06-27 14:30:08.000000000 +0200 +@@ -448,6 +448,9 @@ + extension->command = strdup( exec_command ); + if (cptr) + extension->args = strdup( cptr ); ++ } else { ++ snmp_log(LOG_ERR, "Duplicate MIBOID '%s' detected in exec statement, only the first one will be used.\n", exec_name); ++ return; + } + + #ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch new file mode 100644 index 00000000..125ccf22 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch @@ -0,0 +1,192 @@ +r16770 | dts12 | 2007-12-22 22:22:44 +0300 (Сбт, 22 Дек 2007) | 2 lines + +CHANGES: perl: BUG: 1826174: Check for buffer overflow when printing values. + +CHANGES: python: BUG: 1826174: Check for buffer overflow when printing values. +Addresses CVE-2008-2292 + +--- perl/SNMP/SNMP.xs (revision 16769) ++++ perl/SNMP/SNMP.xs (revision 16770) +@@ -470,14 +470,16 @@ + if (flag == USE_ENUMS) { + for(ep = tp->enums; ep; ep = ep->next) { + if (ep->value == *var->val.integer) { +- strcpy(buf, ep->label); ++ strncpy(buf, ep->label, buf_len); ++ buf[buf_len-1] = '\0'; + len = strlen(buf); + break; + } + } + } + if (!len) { +- sprintf(buf,"%ld", *var->val.integer); ++ snprintf(buf, buf_len, "%ld", *var->val.integer); ++ buf[buf_len-1] = '\0'; + len = strlen(buf); + } + break; +@@ -486,21 +488,25 @@ + case ASN_COUNTER: + case ASN_TIMETICKS: + case ASN_UINTEGER: +- sprintf(buf,"%lu", (unsigned long) *var->val.integer); ++ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer); ++ buf[buf_len-1] = '\0'; + len = strlen(buf); + break; + + case ASN_OCTET_STR: + case ASN_OPAQUE: +- memcpy(buf, (char*)var->val.string, var->val_len); + len = var->val_len; ++ if ( len > buf_len ) ++ len = buf_len; ++ memcpy(buf, (char*)var->val.string, len); + break; + + case ASN_IPADDRESS: +- ip = (u_char*)var->val.string; +- sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); +- len = strlen(buf); +- break; ++ ip = (u_char*)var->val.string; ++ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); ++ buf[buf_len-1] = '\0'; ++ len = strlen(buf); ++ break; + + case ASN_NULL: + break; +@@ -512,14 +518,14 @@ + break; + + case SNMP_ENDOFMIBVIEW: +- sprintf(buf,"%s", "ENDOFMIBVIEW"); +- break; ++ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW"); ++ break; + case SNMP_NOSUCHOBJECT: +- sprintf(buf,"%s", "NOSUCHOBJECT"); +- break; ++ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT"); ++ break; + case SNMP_NOSUCHINSTANCE: +- sprintf(buf,"%s", "NOSUCHINSTANCE"); +- break; ++ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE"); ++ break; + + case ASN_COUNTER64: + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES +@@ -538,19 +544,19 @@ + #endif + + case ASN_BIT_STR: +- snprint_bitstring(buf, sizeof(buf), var, NULL, NULL, NULL); ++ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL); + len = strlen(buf); + break; + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES + case ASN_OPAQUE_FLOAT: +- if (var->val.floatVal) +- sprintf(buf,"%f", *var->val.floatVal); +- break; ++ if (var->val.floatVal) ++ snprintf(buf, buf_len, "%f", *var->val.floatVal); ++ break; + + case ASN_OPAQUE_DOUBLE: +- if (var->val.doubleVal) +- sprintf(buf,"%f", *var->val.doubleVal); +- break; ++ if (var->val.doubleVal) ++ snprintf(buf, buf_len, "%f", *var->val.doubleVal); ++ break; + #endif + + case ASN_NSAP: +--- python/netsnmp/client_intf.c (revision 16961) ++++ python/netsnmp/client_intf.c (revision 16962) +@@ -330,14 +330,15 @@ + if (flag == USE_ENUMS) { + for(ep = tp->enums; ep; ep = ep->next) { + if (ep->value == *var->val.integer) { +- strcpy(buf, ep->label); ++ strncpy(buf, ep->label, buf_len); ++ buf[buf_len -1] = 0; + len = STRLEN(buf); + break; + } + } + } + if (!len) { +- sprintf(buf,"%ld", *var->val.integer); ++ snprintf(buf,"%ld", buf_len, *var->val.integer); + len = STRLEN(buf); + } + break; +@@ -346,19 +347,21 @@ + case ASN_COUNTER: + case ASN_TIMETICKS: + case ASN_UINTEGER: +- sprintf(buf,"%lu", (unsigned long) *var->val.integer); ++ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer); + len = STRLEN(buf); + break; + + case ASN_OCTET_STR: + case ASN_OPAQUE: +- memcpy(buf, (char*)var->val.string, var->val_len); + len = var->val_len; ++ if (len > buf_len) ++ len = buf_len; ++ memcpy(buf, (char*)var->val.string, len); + break; + + case ASN_IPADDRESS: + ip = (u_char*)var->val.string; +- sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); ++ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); + len = STRLEN(buf); + break; + +@@ -372,13 +375,13 @@ + break; + + case SNMP_ENDOFMIBVIEW: +- sprintf(buf,"%s", "ENDOFMIBVIEW"); ++ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW"); + break; + case SNMP_NOSUCHOBJECT: +- sprintf(buf,"%s", "NOSUCHOBJECT"); ++ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT"); + break; + case SNMP_NOSUCHINSTANCE: +- sprintf(buf,"%s", "NOSUCHINSTANCE"); ++ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE"); + break; + + case ASN_COUNTER64: +@@ -398,18 +401,18 @@ + #endif + + case ASN_BIT_STR: +- snprint_bitstring(buf, sizeof(buf), var, NULL, NULL, NULL); ++ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL); + len = STRLEN(buf); + break; + #ifdef OPAQUE_SPECIAL_TYPES + case ASN_OPAQUE_FLOAT: + if (var->val.floatVal) +- sprintf(buf,"%f", *var->val.floatVal); ++ snprintf(buf, buf_len, "%f", *var->val.floatVal); + break; + + case ASN_OPAQUE_DOUBLE: + if (var->val.doubleVal) +- sprintf(buf,"%f", *var->val.doubleVal); ++ snprintf(buf, buf_len, "%f", *var->val.doubleVal); + break; + #endif + diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch new file mode 100644 index 00000000..03af69f9 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch @@ -0,0 +1,538 @@ +r16694 | rstory | 2007-09-14 17:11:59 +0400 (Птн, 14 Сен 2007) | 3 lines + +Apple patches +- add/fix disk/partition tables on darwin + +Also fixes incorrect hrFSStorageIndex + +http://bugs.gentoo.org/show_bug.cgi?id=211660 +http://sourceforge.net/tracker/index.php?func=detail&aid=1696044&group_id=12694&atid=312694 + +--- agent/mibgroup/host/hr_partition.c (revision 16693) ++++ agent/mibgroup/host/hr_partition.c (revision 16694) +@@ -1,8 +1,17 @@ +- + /* + * Host Resources MIB - partition device group implementation - hr_partition.c + * + */ ++/* Portions of this file are subject to the following copyright(s). See ++ * the Net-SNMP's COPYING file for more details and other copyrights ++ * that may apply: ++ */ ++/* ++ * Portions of this file are copyrighted by: ++ * Copyright (C) 2007 Apple, Inc. All rights reserved. ++ * Use is subject to license terms specified in the COPYING file ++ * distributed with the Net-SNMP package. ++ */ + + #include <net-snmp/net-snmp-config.h> + #include <fcntl.h> +@@ -35,6 +44,9 @@ + static int HRP_savedDiskIndex; + static int HRP_savedPartIndex; + static char HRP_savedName[1024]; ++#ifdef NETSNMP_CAN_GET_DISK_LABEL ++static char HRP_savedLabel[1024]; ++#endif + + static int HRP_DiskIndex; + +@@ -135,6 +147,7 @@ + (name[HRPART_DISK_NAME_LENGTH] & + ((1 << HRDEV_TYPE_SHIFT) - 1)); + ++ DEBUGMSGTL(("host/hr_partition", "... low index %d\n", LowDiskIndex)); + while (HRP_DiskIndex < LowDiskIndex) { + Init_HR_Partition(); /* moves to next disk */ + if (HRP_DiskIndex == -1) +@@ -144,6 +157,7 @@ + + for (;;) { + part_idx = Get_Next_HR_Partition(); ++ DEBUGMSGTL(("host/hr_partition", "... part index %d\n", part_idx)); + if (part_idx == 0) + break; + newname[HRPART_DISK_NAME_LENGTH] = +@@ -225,8 +239,13 @@ + long_return = part_idx; + return (u_char *) & long_return; + case HRPART_LABEL: ++#ifdef NETSNMP_CAN_GET_DISK_LABEL ++ *var_len = strlen(HRP_savedLabel); ++ return (u_char *) HRP_savedLabel; ++#else + *var_len = strlen(HRP_savedName); + return (u_char *) HRP_savedName; ++#endif + case HRPART_ID: /* Use the device number */ + sprintf(string, "0x%x", (int) stat_buf.st_rdev); + *var_len = strlen(string); +@@ -259,9 +278,11 @@ + static void + Init_HR_Partition(void) + { ++ DEBUGMSGTL(("host/hr_partition", "Init_HR_Partition\n")); + HRP_DiskIndex = Get_Next_HR_Disk(); + if (HRP_DiskIndex != -1) + HRP_DiskIndex &= ((1 << HRDEV_TYPE_SHIFT) - 1); ++ DEBUGMSGTL(("host/hr_partition", "... %d\n",HRP_DiskIndex)); + + HRP_index = -1; + } +@@ -272,6 +293,7 @@ + char string[1024]; + int fd; + ++ DEBUGMSGTL(("host/hr_partition", "Get_Next_HR_Partition %d\n",HRP_DiskIndex)); + if (HRP_DiskIndex == -1) { + return 0; + } +@@ -309,4 +331,7 @@ + HRP_savedDiskIndex = disk_idx; + HRP_savedPartIndex = part_idx; + (void) Get_Next_HR_Disk_Partition(HRP_savedName, sizeof(HRP_savedName), HRP_index); ++#ifdef NETSNMP_CAN_GET_DISK_LABEL ++ (void) Get_HR_Disk_Label(HRP_savedLabel, sizeof(HRP_savedLabel), HRP_savedName); ++#endif + } +Index: agent/mibgroup/host/hr_filesys.c +=================================================================== +--- agent/mibgroup/host/hr_filesys.c (revision 16693) ++++ agent/mibgroup/host/hr_filesys.c (revision 16694) +@@ -2,11 +2,25 @@ + * Host Resources MIB - File System device group implementation - hr_filesys.c + * + */ ++/* Portions of this file are subject to the following copyright(s). See ++ * the Net-SNMP's COPYING file for more details and other copyrights ++ * that may apply: ++ */ ++/* ++ * Portions of this file are copyrighted by: ++ * Copyright (C) 2007 Apple, Inc. All rights reserved. ++ * Use is subject to license terms specified in the COPYING file ++ * distributed with the Net-SNMP package. ++ */ + + #include <net-snmp/net-snmp-config.h> ++#include <net-snmp/net-snmp-includes.h> ++#include <net-snmp/agent/net-snmp-agent-includes.h> ++#include <net-snmp/agent/hardware/memory.h> + #include "host_res.h" + #include "hr_filesys.h" + #include "hr_storage.h" ++#include "hr_disk.h" + #include <net-snmp/utilities.h> + + #if HAVE_MNTENT_H +@@ -535,7 +549,7 @@ + long_return = 2; /* others probably aren't */ + return (u_char *) & long_return; + case HRFSYS_STOREIDX: +- long_return = fsys_idx + HRS_TYPE_FIXED_MAX; ++ long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX; + return (u_char *) & long_return; + case HRFSYS_FULLDUMP: + return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len); +Index: agent/mibgroup/host/hr_disk.c +=================================================================== +--- agent/mibgroup/host/hr_disk.c (revision 16693) ++++ agent/mibgroup/host/hr_disk.c (revision 16694) +@@ -2,6 +2,16 @@ + * Host Resources MIB - disk device group implementation - hr_disk.c + * + */ ++/* Portions of this file are subject to the following copyright(s). See ++ * the Net-SNMP's COPYING file for more details and other copyrights ++ * that may apply: ++ */ ++/* ++ * Portions of this file are copyrighted by: ++ * Copyright (C) 2007 Apple, Inc. All rights reserved. ++ * Use is subject to license terms specified in the COPYING file ++ * distributed with the Net-SNMP package. ++ */ + + #include <net-snmp/net-snmp-config.h> + #include "host_res.h" +@@ -65,6 +75,15 @@ + #include <limits.h> + #endif + ++#ifdef darwin ++#include <CoreFoundation/CoreFoundation.h> ++#include <IOKit/IOKitLib.h> ++#include <IOKit/storage/IOBlockStorageDriver.h> ++#include <IOKit/storage/IOMedia.h> ++#include <IOKit/IOBSD.h> ++#include <DiskArbitration/DADisk.h> ++#endif ++ + #ifdef linux + /* + * define BLKGETSIZE from <linux/fs.h>: +@@ -79,6 +98,27 @@ + + #define HRD_MONOTONICALLY_INCREASING + ++/************************************************************* ++ * constants for enums for the MIB node ++ * hrDiskStorageAccess (INTEGER / ASN_INTEGER) ++ */ ++#define HRDISKSTORAGEACCESS_READWRITE 1 ++#define HRDISKSTORAGEACCESS_READONLY 2 ++ ++ ++/************************************************************* ++ * constants for enums for the MIB node ++ * hrDiskStorageMedia (INTEGER / ASN_INTEGER) ++ */ ++#define HRDISKSTORAGEMEDIA_OTHER 1 ++#define HRDISKSTORAGEMEDIA_UNKNOWN 2 ++#define HRDISKSTORAGEMEDIA_HARDDISK 3 ++#define HRDISKSTORAGEMEDIA_FLOPPYDISK 4 ++#define HRDISKSTORAGEMEDIA_OPTICALDISKROM 5 ++#define HRDISKSTORAGEMEDIA_OPTICALDISKWORM 6 ++#define HRDISKSTORAGEMEDIA_OPTICALDISKRW 7 ++#define HRDISKSTORAGEMEDIA_RAMDISK 8 ++ + /********************* + * + * Kernel & interface information, +@@ -132,6 +172,19 @@ + static struct disklabel HRD_info; + #endif + ++#ifdef darwin ++static int64_t HRD_cap; ++static int HRD_access; ++static int HRD_type; ++static int HRD_removeble; ++static char HRD_model[40]; ++static int HRD_saved_access; ++static int HRD_saved_type; ++static int HRD_saved_removeble; ++static int _get_type_from_protocol( const char *prot ); ++static int _get_type_value( const char *str_type ); ++#endif ++ + static void parse_disk_config(const char *, char *); + static void free_disk_config(void); + +@@ -185,6 +238,8 @@ + "/dev/rdsk/c%dt%dd0s0", 0, 7); + Add_HR_Disk_entry("/dev/rdsk/c%dd%ds%d", 0, 7, 0, 15, + "/dev/rdsk/c%dd%ds0", 0, 7); ++#elif defined(darwin) ++ Add_HR_Disk_entry("/dev/disk%ds%d", -1, -1, 0, 32, "/dev/disk%d", 1, 32); + #elif defined(freebsd4) || defined(freebsd5) + Add_HR_Disk_entry("/dev/ad%ds%d%c", 0, 1, 1, 4, "/dev/ad%ds%d", 'a', 'h'); + Add_HR_Disk_entry("/dev/da%ds%d%c", 0, 1, 1, 4, "/dev/da%ds%d", 'a', 'h'); +@@ -484,6 +539,7 @@ + Init_HR_Disk(); + for (;;) { + disk_idx = Get_Next_HR_Disk(); ++ DEBUGMSGTL(("host/hr_disk", "... index %d\n", disk_idx)); + if (disk_idx == -1) + break; + newname[HRDISK_ENTRY_NAME_LENGTH] = disk_idx; +@@ -749,7 +805,13 @@ + HRD_history[iindex] = 0; + return ((HRDEV_DISK << HRDEV_TYPE_SHIFT) + iindex); + } ++ DEBUGMSGTL(("host/hr_disk", ++ "Get_Next_HR_Disk: can't query %s\n", string)); + } ++ else { ++ DEBUGMSGTL(("host/hr_disk", ++ "Get_Next_HR_Disk: can't open %s\n", string)); ++ } + HRD_history[iindex] = now; + HRD_index++; + } +@@ -801,6 +863,66 @@ + return 0; + } + ++#ifdef darwin ++int ++Get_HR_Disk_Label(char *string, size_t str_len, const char *devfull) ++{ ++ DASessionRef sess_ref; ++ DADiskRef disk; ++ CFDictionaryRef desc; ++ CFStringRef str_ref; ++ CFStringEncoding sys_encoding = CFStringGetSystemEncoding(); ++ ++ DEBUGMSGTL(("host/hr_disk", "Disk Label type %s\n", devfull)); ++ ++ sess_ref = DASessionCreate( NULL ); ++ if (NULL == sess_ref) { ++ strncpy(string, devfull, str_len); ++ string[str_len-1] = 0; ++ return -1; ++ } ++ ++ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull ); ++ if (NULL == disk) { ++ CFRelease(sess_ref); ++ strncpy(string, devfull, str_len); ++ string[str_len-1] = 0; ++ return -1; ++ } ++ ++ desc = DADiskCopyDescription( disk ); ++ if (NULL == desc) { ++ snmp_log(LOG_ERR, ++ "diskmgr: couldn't get disk description for %s, skipping\n", ++ devfull); ++ CFRelease(disk); ++ CFRelease(sess_ref); ++ strncpy(string, devfull, str_len); ++ return -1; ++ } ++ ++ /** model */ ++ str_ref = (CFStringRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionMediaNameKey); ++ if (str_ref) { ++ strncpy(string, CFStringGetCStringPtr(str_ref, sys_encoding), ++ str_len); ++ string[str_len-1] = 0; ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " name %s\n", string)); ++ } ++ else { ++ strncpy(string, devfull, str_len); ++ string[str_len-1] = 0; ++ } ++ ++ CFRelease(disk); ++ CFRelease(desc); ++ CFRelease(sess_ref); ++ ++ return 0; ++} ++#endif ++ + static void + Save_HR_Disk_Specific(void) + { +@@ -822,6 +944,13 @@ + #ifdef DIOCGDINFO + HRD_savedCapacity = HRD_info.d_secperunit / 2; + #endif ++#ifdef darwin ++ HRD_savedCapacity = HRD_cap / 1024; ++ HRD_saved_access = HRD_access; ++ HRD_saved_type = HRD_type; ++ HRD_saved_removeble = HRD_removeble; ++#endif ++ + } + + static void +@@ -845,6 +974,11 @@ + sizeof(HRD_savedModel)-1); + HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; + #endif ++#ifdef darwin ++ strncpy(HRD_savedModel, HRD_model, ++ sizeof(HRD_savedModel)-1); ++ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; ++#endif + } + + static const char * +@@ -900,6 +1034,104 @@ + result = ioctl(fd, DIOCGDINFO, &HRD_info); + #endif + ++#ifdef darwin ++ DASessionRef sess_ref; ++ DADiskRef disk; ++ CFDictionaryRef desc; ++ CFStringRef str_ref; ++ CFNumberRef number_ref; ++ CFBooleanRef bool_ref; ++ CFStringEncoding sys_encoding = CFStringGetSystemEncoding(); ++ ++ sess_ref = DASessionCreate( NULL ); ++ if (NULL == sess_ref) ++ return -1; ++ ++ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull ); ++ if (NULL == disk) { ++ CFRelease(sess_ref); ++ return -1; ++ } ++ ++ desc = DADiskCopyDescription( disk ); ++ if (NULL == desc) { ++ CFRelease(disk); ++ CFRelease(sess_ref); ++ return -1; ++ } ++ ++ number_ref = (CFNumberRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionMediaSizeKey); ++ if (number_ref) ++ CFNumberGetValue(number_ref, kCFNumberSInt64Type, &HRD_cap); ++ else ++ HRD_cap = 0; ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " size %lld\n", HRD_cap)); ++ ++ /** writable? */ ++ bool_ref = (CFBooleanRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionMediaWritableKey); ++ if (bool_ref) { ++ HRD_access = CFBooleanGetValue(bool_ref); ++ } ++ else ++ HRD_access = 0; ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " writable %d\n", ++ HRD_access)); ++ ++ /** removable? */ ++ bool_ref = (CFBooleanRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionMediaRemovableKey); ++ if (bool_ref) { ++ HRD_removeble = CFBooleanGetValue(bool_ref); ++ } ++ else ++ HRD_removeble = 0; ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " removable %d\n", ++ HRD_removeble)); ++ ++ /** get type */ ++ str_ref = (CFStringRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionMediaTypeKey); ++ if (str_ref) { ++ HRD_type = _get_type_value(CFStringGetCStringPtr(str_ref, ++ sys_encoding)); ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n", ++ CFStringGetCStringPtr(str_ref, sys_encoding), ++ HRD_type)); ++ } ++ else { ++ str_ref = (CFStringRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceProtocolKey); ++ if (str_ref) { ++ HRD_type = ++ _get_type_from_protocol(CFStringGetCStringPtr(str_ref, ++ sys_encoding)); ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n", ++ CFStringGetCStringPtr(str_ref, sys_encoding), ++ HRD_type)); ++ } ++ else ++ HRD_type = HRDISKSTORAGEMEDIA_UNKNOWN; ++ } ++ ++ /** model */ ++ str_ref = (CFStringRef) ++ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceModelKey); ++ if (str_ref) { ++ strncpy(HRD_model, CFStringGetCStringPtr(str_ref, sys_encoding), ++ sizeof(HRD_model)); ++ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; ++ DEBUGMSGTL(("verbose:diskmgr:darwin", " model %s\n", HRD_model)); ++ } ++ else ++ HRD_model[0] = 0; ++ CFRelease(disk); ++ CFRelease(desc); ++ CFRelease(sess_ref); ++ result = 0; ++#endif ++ + return (result); + } + +@@ -918,6 +1150,11 @@ + return (2); /* read only */ + #endif + ++#ifdef darwin ++ if (!HRD_access) ++ return (2); ++#endif ++ + return (1); /* read-write */ + } + +@@ -990,6 +1227,9 @@ + } + #endif + ++#ifdef darwin ++ return HRD_type; ++#endif + + return (2); /* Unknown */ + } +@@ -1020,5 +1260,63 @@ + return (1); /* true */ + #endif + ++#ifdef darwin ++ if (HRD_removeble) ++ return (1); ++#endif ++ + return (2); /* false */ + } ++ ++#ifdef darwin ++typedef struct type_value_map_s { ++ const char *type; ++ uint32_t value; ++} type_value_map; ++ ++static type_value_map media_type_map[] = { ++ { "CD-ROM", HRDISKSTORAGEMEDIA_OPTICALDISKROM}, ++ { "DVD-R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM}, ++ { "DVD+R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM}, ++}; ++static int media_types = sizeof(media_type_map)/sizeof(media_type_map[0]); ++ ++static int ++_get_type_value( const char *str_type ) ++{ ++ int i, len; ++ ++ if (NULL == str_type) ++ return HRDISKSTORAGEMEDIA_UNKNOWN; ++ ++ len = strlen(str_type); ++ for(i=0; i < media_types; ++i) { ++ if (0 == strcmp(media_type_map[i].type, str_type)) ++ return media_type_map[i].value; ++ } ++ ++ return HRDISKSTORAGEMEDIA_UNKNOWN; ++} ++ ++static type_value_map proto_map[] = { ++ { "ATA", HRDISKSTORAGEMEDIA_HARDDISK}, ++ { "ATAPI", HRDISKSTORAGEMEDIA_OPTICALDISKROM} ++}; ++static int proto_maps = sizeof(proto_map)/sizeof(proto_map[0]); ++ ++static int _get_type_from_protocol( const char *prot ) ++{ ++ int i, len; ++ ++ if (NULL == prot) ++ return TV_FALSE; ++ ++ len = strlen(prot); ++ for(i=0; i < proto_maps; ++i) { ++ if (0 == strcmp(proto_map[i].type, prot)) ++ return proto_map[i].value; ++ } ++ ++ return HRDISKSTORAGEMEDIA_UNKNOWN; ++} ++#endif diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch new file mode 100644 index 00000000..900d51d2 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch @@ -0,0 +1,134 @@ +r16804 | magfr | 2008-02-14 02:37:48 +0300 (Чтв, 14 Фев 2008) | 2 lines + +NEWS: snmplib: Change CONTAINER_INSERT to not do partial inserts in containers with multiple indices when one insert fails. + +http://sourceforge.net/tracker/index.php?func=detail&aid=1733344&group_id=12694&atid=112694 + +http://bugs.gentoo.org/show_bug.cgi?id=203127 + +Index: snmplib/container.c +=================================================================== +--- snmplib/container.c (revision 16803) ++++ snmplib/container.c (revision 16804) +@@ -282,31 +282,41 @@ + * These functions should EXACTLY match the inline version in + * container.h. If you change one, change them both. + */ +-int CONTAINER_INSERT(netsnmp_container *x, const void *k) +-{ +- int rc2, rc = 0; +- +- /** start at first container */ +- while(x->prev) +- x = x->prev; +- for(; x; x = x->next) { +- if ((NULL != x->insert_filter) && +- (x->insert_filter(x,k) == 1)) +- continue; +- rc2 = x->insert(x,k); +- if (rc2) { ++int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) ++{ ++ while(x && x->insert_filter && x->insert_filter(x,k) == 1) ++ x = x->next; ++ if(x) { ++ int rc = x->insert(x,k); ++ if(rc) + snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", +- x->container_name ? x->container_name : "", rc2); +- rc = rc2; ++ x->container_name ? x->container_name : "", rc); ++ else { ++ rc = CONTAINER_INSERT_HELPER(x->next, k); ++ if(rc) ++ x->remove(x,k); + } ++ return rc; + } +- return rc; ++ return 0; + } + + /*------------------------------------------------------------------ + * These functions should EXACTLY match the inline version in + * container.h. If you change one, change them both. + */ ++int CONTAINER_INSERT(netsnmp_container* x, const void* k) ++{ ++ /** start at first container */ ++ while(x->prev) ++ x = x->prev; ++ return CONTAINER_INSERT_HELPER(x, k); ++} ++ ++/*------------------------------------------------------------------ ++ * These functions should EXACTLY match the inline version in ++ * container.h. If you change one, change them both. ++ */ + int CONTAINER_REMOVE(netsnmp_container *x, const void *k) + { + int rc2, rc = 0; +Index: include/net-snmp/library/container.h +=================================================================== +--- include/net-snmp/library/container.h (revision 16803) ++++ include/net-snmp/library/container.h (revision 16804) +@@ -364,32 +364,43 @@ + * container.c. If you change one, change them both. + */ + NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ +- int CONTAINER_INSERT(netsnmp_container *x, const void *k) ++ int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) + { +- int rc2, rc = 0; +- +- /** start at first container */ +- while(x->prev) +- x = x->prev; +- for(; x; x = x->next) { +- if ((NULL != x->insert_filter) && +- (x->insert_filter(x,k) == 1)) +- continue; +- rc2 = x->insert(x,k); +- if (rc2) { ++ while(x && x->insert_filter && x->insert_filter(x,k) == 1) ++ x = x->next; ++ if(x) { ++ int rc = x->insert(x,k); ++ if(rc) + snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", +- x->container_name ? x->container_name : "", rc2); +- rc = rc2; ++ x->container_name ? x->container_name : "", rc); ++ else { ++ rc = CONTAINER_INSERT_HELPER(x->next, k); ++ if(rc) ++ x->remove(x,k); + } ++ return rc; + } +- return rc; ++ return 0; + } +- ++ + /*------------------------------------------------------------------ + * These functions should EXACTLY match the function version in + * container.c. If you change one, change them both. + */ + NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ ++ int CONTAINER_INSERT(netsnmp_container* x, const void* k) ++ { ++ /** start at first container */ ++ while(x->prev) ++ x = x->prev; ++ return CONTAINER_INSERT_HELPER(x, k); ++ } ++ ++ /*------------------------------------------------------------------ ++ * These functions should EXACTLY match the function version in ++ * container.c. If you change one, change them both. ++ */ ++ NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ + int CONTAINER_REMOVE(netsnmp_container *x, const void *k) + { + int rc2, rc = 0; diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch new file mode 100644 index 00000000..766436e3 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch @@ -0,0 +1,33 @@ +Index: net-snmp-5.4.1/configure.in +=================================================================== +--- net-snmp-5.4.1.orig/configure.in ++++ net-snmp-5.4.1/configure.in +@@ -2,7 +2,7 @@ + # the Net-SNMP's COPYING file for more details and other copyrights + # that may apply: + # +-# Portions Copyright © 2003 Sun Microsystems, Inc. All rights reserved. ++# Portions Copyright © 2003 Sun Microsystems, Inc. All rights reserved. + # Use is subject to license terms specified in the COPYING file + # distributed with the Net-SNMP package. + # +@@ -3097,8 +3097,8 @@ fi + + # check needed functions + if test "x$embed_perl" != "xno" ; then +- OLDLDFLAGS="$LDFLAGS" +- LDFLAGS="$LDFLAGS $netsnmp_perlldopts" ++ OLDLIBS="$LIBS" ++ LIBS="$LIBS $netsnmp_perlldopts" + + # newer perl vs older perl call functions + AC_CHECK_FUNCS(eval_pv) +@@ -3109,7 +3109,7 @@ if test "x$embed_perl" != "xno" ; then + AC_CHECK_FUNC(perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_LC)) + AC_CHECK_FUNC(Perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_UC)) + +- LDFLAGS="$OLDLDFLAGS" ++ LIBS="$OLDLIBS" + + + if test "x$ac_cv_func_perl_eval_pv" != "xyes" -a "x$ac_cv_func_Perl_eval_pv" != "xyes" -a "x$ac_cv_func_eval_pv" != "xyes" ; then diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch new file mode 100644 index 00000000..56defedd --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch @@ -0,0 +1,52 @@ +r16705 | tanders | 2007-09-21 01:55:49 +0400 (Птн, 21 Сен 2007) | 3 lines + +CHANGES: snmpd: PATCH: 1746831: from cunnijd: fix process checking race +condition under Linux and platform #ifdefs + +--- agent/mibgroup/ucd-snmp/proc.c (revision 16704) ++++ agent/mibgroup/ucd-snmp/proc.c (revision 16705) +@@ -427,7 +427,7 @@ + return count; + } + +-#elif OSTYPE == NETSNMP_LINUXID ++#elif NETSNMP_OSTYPE == NETSNMP_LINUXID + + #include <dirent.h> + #include <fcntl.h> +@@ -452,7 +452,7 @@ + #ifdef USE_PROC_CMDLINE /* old method */ + /* read /proc/XX/cmdline */ + sprintf(cmdline,"/proc/%s/cmdline",ent->d_name); +- if((fd = open(cmdline, O_RDONLY)) < 0) break; ++ if((fd = open(cmdline, O_RDONLY)) < 0) continue; + len = read(fd,cmdline,sizeof(cmdline) - 1); + close(fd); + if(len <= 0) continue; +@@ -464,7 +464,7 @@ + /* read /proc/XX/status */ + sprintf(cmdline,"/proc/%s/status",ent->d_name); + if ((status = fopen(cmdline, "r")) == NULL) +- break; ++ continue; + if (fgets(cmdline, sizeof(cmdline), status) == NULL) { + fclose(status); + break; +@@ -507,7 +507,7 @@ + return total; + } + +-#elif OSTYPE == NETSNMP_ULTRIXID ++#elif NETSNMP_OSTYPE == NETSNMP_ULTRIXID + + #define NPROCS 32 /* number of proces to read at once */ + +@@ -688,7 +688,7 @@ + return (0); + return (1); + } +-#elif OSTYPE == NETSNMP_SOLARISID ++#elif NETSNMP_OSTYPE == NETSNMP_SOLARISID + + #ifdef _SLASH_PROC_METHOD_ + diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch new file mode 100644 index 00000000..f08d8f71 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch @@ -0,0 +1,17 @@ +NEWS: agent: suppress annoying "registration != duplicate" warning for root oids +(otherwise, you'll get this message on almost every startup) + +http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=16669 + +--- branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/20 08:06:42 16668 ++++ branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/22 21:56:23 16669 +@@ -532,7 +532,8 @@ + + if (next && (next->namelen == new_sub->namelen) && + (next->priority == new_sub->priority)) { +- netsnmp_assert(!"registration != duplicate"); /* always false */ ++ if (new_sub->namelen != 1) /* ignore root OID dups */ ++ netsnmp_assert(!"registration != duplicate"); /* always false */ + return MIB_DUPLICATE_REGISTRATION; + } + diff --git a/net-analyzer/net-snmp/net-snmp-5.4.1.1.ebuild b/net-analyzer/net-snmp/net-snmp-5.4.1.1.ebuild new file mode 100644 index 00000000..3731b193 --- /dev/null +++ b/net-analyzer/net-snmp/net-snmp-5.4.1.1.ebuild @@ -0,0 +1,201 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/net-snmp-5.4.1.1.ebuild,v 1.9 2008/06/23 18:59:58 ranger Exp $ + +inherit fixheadtails flag-o-matic perl-module python autotools + +DESCRIPTION="Software for generating and retrieving SNMP data" +HOMEPAGE="http://net-snmp.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +LICENSE="as-is BSD" +SLOT="0" +KEYWORDS="alpha amd64 ~arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86" +IUSE="diskio doc elf ipv6 lm_sensors mfd-rewrites minimal perl python rpm selinux smux ssl tcpd X sendmail extensible" + +DEPEND="ssl? ( >=dev-libs/openssl-0.9.6d ) + tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) + rpm? ( + app-arch/rpm + dev-libs/popt + app-arch/bzip2 + >=sys-libs/zlib-1.1.4 + ) + elf? ( dev-libs/elfutils ) + lm_sensors? ( sys-apps/lm_sensors ) + python? ( dev-python/setuptools )" + +RDEPEND="${DEPEND} + perl? ( + X? ( dev-perl/perl-tk ) + !minimal? ( dev-perl/TermReadKey ) + ) + selinux? ( sec-policy/selinux-snmpd )" + +# Dependency on autoconf due to bug #225893 +DEPEND="${DEPEND} + >=sys-devel/autoconf-2.61-r2 + >=sys-apps/sed-4 + doc? ( app-doc/doxygen )" + +src_unpack() { + unpack ${A} + cd "${S}" + + # fix access violation in make check + sed -i -e 's/\(snmpd.*\)-Lf/\1-l/' testing/eval_tools.sh || \ + die "sed eval_tools.sh failed" + # fix path in fixproc + sed -i -e 's|\(database_file =.*\)/local\(.*\)$|\1\2|' local/fixproc || \ + die "sed fixproc failed" + + if use python ; then + python_version + PYTHON_MODNAME="netsnmp" + PYTHON_DIR=/usr/$(get_libdir)/python${PYVER}/site-packages + sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${D}':" Makefile.in || die "sed python failed" + fi + + # snmpd crashes when snmpd.conf contains more than one "exec shelltest" line + epatch "${FILESDIR}"/${PN}-5.4-exec-crash.patch + # agent: suppress annoying "registration != duplicate" warning for root oids + epatch "${FILESDIR}"/${PN}-5.4.1-suppresssuppress-annoying.patch + # Crash when more then one interface have the same IP, bug 203127 + epatch "${FILESDIR}"/${PN}-5.4.1-ipAddressTable-crash-with-double-free.patch + # snmpconf generates config files with proper selinux context + use selinux && epatch "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch + epatch "${FILESDIR}"/${PN}-5.4.1-clientaddr-fix.patch #180266 + epatch "${FILESDIR}"/${PN}-5.4.1-CVE-2008-2292.patch #222265 + epatch "${FILESDIR}"/${PN}-5.4.1-process-count-race.patch #213415 + epatch "${FILESDIR}"/${PN}-5.4.1-incorrect-hrFSStorageIndex.patch #211660 + epatch "${FILESDIR}"/${PN}-5.4.1-perl-asneeded.patch #224251 + + # Fix version number to report 5.4.1.1: + sed -i -e 's:NetSnmpVersionInfo = "5.4.1":NetSnmpVersionInfo = "5.4.1.1":' snmplib/snmp_version.c + + eautoreconf + + ht_fix_all +} + +src_compile() { + local mibs + + strip-flags + + mibs="host ucd-snmp/dlmod" + use smux && mibs="${mibs} smux" + use sendmail && mibs="${mibs} mibII/mta_sendmail" + use lm_sensors && mibs="${mibs} ucd-snmp/lmSensors" + use diskio && mibs="${mibs} ucd-snmp/diskio" + use extensible && mibs="${mibs} ucd-snmp/extensible" + + econf \ + --with-install-prefix="${D}" \ + --with-sys-location="Unknown" \ + --with-sys-contact="root@Unknown" \ + --with-default-snmp-version="3" \ + --with-mib-modules="${mibs}" \ + --with-logfile="/var/log/net-snmpd.log" \ + --with-persistent-directory="/var/lib/net-snmp" \ + --enable-ucd-snmp-compatibility \ + --enable-shared \ + --enable-as-needed \ + --with-endianness=little \ + $(use_enable mfd-rewrites) \ + $(use_enable perl embedded-perl) \ + $(use_enable ipv6) \ + $(use_enable !ssl internal-md5) \ + $(use_with ssl openssl) \ + $(use_with tcpd libwrap) \ + $(use_with rpm) \ + $(use_with rpm bzip2) \ + $(use_with rpm zlib) \ + $(use_with elf) \ + $(use_with python python-modules) \ + || die "econf failed" + + emake -j1 || die "emake failed" + + if use perl ; then + emake perlmodules || die "compile perl modules problem" + fi + + if use python ; then + emake pythonmodules || die "compile python modules problem" + fi + + if use doc ; then + einfo "Building HTML Documentation" + make docsdox || die "failed to build docs" + fi +} + +src_test() { + cd testing + if ! make test ; then + echo + einfo "Don't be alarmed if a few tests FAIL." + einfo "This could happen for several reasons:" + einfo " - You don't already have a working configuration." + einfo " - Your ethernet interface isn't properly configured." + echo + fi +} + +src_install () { + make DESTDIR="${D}" install || die "make install failed" + + if use perl ; then + make DESTDIR="${D}" perlinstall || die "make perlinstall failed" + fixlocalpod + + use X || rm -f "${D}/usr/bin/tkmib" + else + rm -f "${D}/usr/bin/mib2c" "${D}/usr/bin/tkmib" "${D}/usr/bin/snmpcheck" + fi + + if use python ; then + mkdir -p "${D}/${PYTHON_DIR}" || die "Couldn't make $PYTHON_DIR" + make pythoninstall || die "make pythoninstall failed" + fi + + dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO + newdoc EXAMPLE.conf.def EXAMPLE.conf + + use doc && dohtml docs/html/* + + keepdir /etc/snmp /var/lib/net-snmp + + newinitd "${FILESDIR}"/snmpd.rc7 snmpd + newconfd "${FILESDIR}"/snmpd.conf snmpd + + newinitd "${FILESDIR}"/snmptrapd.rc7 snmptrapd + newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd + + # Remove everything, keeping only the snmpd, snmptrapd, MIBs, libs, and includes. + if use minimal; then + elog "USE=minimal is set. Cleaning up excess cruft for a embedded/minimal/server only install." + rm -rf + "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,snmpcheck}} + rm -rf "${D}"/usr/share/snmp/snmpconf-data "${D}"/usr/share/snmp/*.conf + rm -rf "${D}"/usr/bin/{fixproc,traptoemail} "${D}"/usr/bin/snmpc{heck,onf} + find "${D}" -name '*.pl' -exec rm -f '{}' \; + use ipv6 || rm -rf "${D}"/usr/share/snmp/mibs/IPV6* + fi + + # bug 113788, install example config + insinto /etc/snmp + newins "${S}"/EXAMPLE.conf snmpd.conf.example +} + +pkg_postrm() { + if use python ; then + python_mod_cleanup + fi +} + +pkg_postinst() { + elog "An example configuration file has been installed in" + elog "/etc/snmp/snmpd.conf.example." +} |