From 03eed47b242df415b7e1129f700727d32a3eddf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 26 Aug 2020 15:17:31 +0200 Subject: [PATCH 01/81] New upstream release 5.9 --- .gitignore | 1 + net-snmp-5.5-perl-linking.patch | 16 - net-snmp-5.7.2-autoreconf.patch | 10 - net-snmp-5.7.3-Remove-U64-typedef.patch | 2519 ----------------- net-snmp-5.7.3-mariadb-connector-c.patch | 12 - net-snmp-5.7.3-mariadb102.patch | 38 - net-snmp-5.7.3-modern-rpm-api.patch | 90 - net-snmp-5.7.3-openssl.patch | 303 -- net-snmp-5.7.3-python3.patch | 641 ----- net-snmp-5.7.3-strstr.patch | 13 - net-snmp-5.8-aes-config.patch | 100 - net-snmp-5.8-agent-of-death.patch | 122 - net-snmp-5.8-agentx-disconnect-crash.patch | 12 - net-snmp-5.8-autofs-skip.patch | 199 -- net-snmp-5.8-cflags.patch | 112 - net-snmp-5.8-coverity.patch | 68 - net-snmp-5.8-dir-fix.patch | 12 - net-snmp-5.8-flood-messages.patch | 26 - net-snmp-5.8-ipv6-clientaddr.patch | 12 - net-snmp-5.8-key-leak-backport.patch | 56 - net-snmp-5.8-licensing.patch | 404 --- net-snmp-5.8-memory-reporting.patch | 35 - net-snmp-5.8-python3.patch | 720 ----- net-snmp-5.8-sec-counter.patch | 146 - net-snmp-5.8-sec-memory-leak.patch | 84 - net-snmp-5.8-test-debug.patch | 30 - net-snmp-5.8-trapsink.patch | 21 - net-snmp-5.8-usage-exit.patch | 11 - net-snmp-5.8-v3-forward.patch | 357 --- net-snmp-5.9-aes-config.patch | 18 + net-snmp-5.9-autofs-skip.patch | 46 + net-snmp-5.9-cflags.patch | 36 + net-snmp-5.9-coverity.patch | 22 + net-snmp-5.9-dir-fix.patch | 24 + ...tch => net-snmp-5.9-dskTable-dynamic.patch | 25 +- ...9-libnetsnmptrapd-against-MYSQL_LIBS.patch | 11 +- net-snmp-5.9-memory-reporting.patch | 28 + ...tilib.patch => net-snmp-5.9-multilib.patch | 27 +- ...-5.7.2-pie.patch => net-snmp-5.9-pie.patch | 20 +- ....patch => net-snmp-5.9-proxy-getnext.patch | 9 +- ...atch => net-snmp-5.9-python-ld-flags.patch | 9 +- net-snmp-5.9-python3.patch | 38 + net-snmp-5.9-test-debug.patch | 110 + net-snmp-5.9-usage-exit.patch | 12 + net-snmp.spec | 139 +- sources | 2 +- 46 files changed, 442 insertions(+), 6304 deletions(-) delete mode 100644 net-snmp-5.5-perl-linking.patch delete mode 100644 net-snmp-5.7.2-autoreconf.patch delete mode 100644 net-snmp-5.7.3-Remove-U64-typedef.patch delete mode 100644 net-snmp-5.7.3-mariadb-connector-c.patch delete mode 100644 net-snmp-5.7.3-mariadb102.patch delete mode 100644 net-snmp-5.7.3-modern-rpm-api.patch delete mode 100644 net-snmp-5.7.3-openssl.patch delete mode 100644 net-snmp-5.7.3-python3.patch delete mode 100644 net-snmp-5.7.3-strstr.patch delete mode 100644 net-snmp-5.8-aes-config.patch delete mode 100644 net-snmp-5.8-agent-of-death.patch delete mode 100644 net-snmp-5.8-agentx-disconnect-crash.patch delete mode 100644 net-snmp-5.8-autofs-skip.patch delete mode 100644 net-snmp-5.8-cflags.patch delete mode 100644 net-snmp-5.8-coverity.patch delete mode 100644 net-snmp-5.8-dir-fix.patch delete mode 100644 net-snmp-5.8-flood-messages.patch delete mode 100644 net-snmp-5.8-ipv6-clientaddr.patch delete mode 100644 net-snmp-5.8-key-leak-backport.patch delete mode 100644 net-snmp-5.8-licensing.patch delete mode 100644 net-snmp-5.8-memory-reporting.patch delete mode 100644 net-snmp-5.8-python3.patch delete mode 100644 net-snmp-5.8-sec-counter.patch delete mode 100644 net-snmp-5.8-sec-memory-leak.patch delete mode 100644 net-snmp-5.8-test-debug.patch delete mode 100644 net-snmp-5.8-trapsink.patch delete mode 100644 net-snmp-5.8-usage-exit.patch delete mode 100644 net-snmp-5.8-v3-forward.patch create mode 100644 net-snmp-5.9-aes-config.patch create mode 100644 net-snmp-5.9-autofs-skip.patch create mode 100644 net-snmp-5.9-cflags.patch create mode 100644 net-snmp-5.9-coverity.patch create mode 100644 net-snmp-5.9-dir-fix.patch rename net-snmp-5.8-dskTable-dynamic.patch => net-snmp-5.9-dskTable-dynamic.patch (86%) rename net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch => net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch (57%) create mode 100644 net-snmp-5.9-memory-reporting.patch rename net-snmp-5.8-multilib.patch => net-snmp-5.9-multilib.patch (62%) rename net-snmp-5.7.2-pie.patch => net-snmp-5.9-pie.patch (56%) rename net-snmp-5.8-proxy-getnext.patch => net-snmp-5.9-proxy-getnext.patch (60%) rename net-snmp-5.8-python-ld-flags.patch => net-snmp-5.9-python-ld-flags.patch (80%) create mode 100644 net-snmp-5.9-python3.patch create mode 100644 net-snmp-5.9-test-debug.patch create mode 100644 net-snmp-5.9-usage-exit.patch diff --git a/.gitignore b/.gitignore index 96662cf..eedf3ab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.7.2.tar.gz /net-snmp-5.7.3.tar.gz /net-snmp-5.8.tar.gz +/net-snmp-5.9.tar.gz diff --git a/net-snmp-5.5-perl-linking.patch b/net-snmp-5.5-perl-linking.patch deleted file mode 100644 index ceb6363..0000000 --- a/net-snmp-5.5-perl-linking.patch +++ /dev/null @@ -1,16 +0,0 @@ -554747 - net-snmp-config should not contain perl options - -Remove rpath from net-snmp-config --agent-libs output. - -diff -up net-snmp-5.7/net-snmp-config.in.perl-linking net-snmp-5.7/net-snmp-config.in ---- net-snmp-5.7/net-snmp-config.in.perl-linking 2011-07-02 00:35:46.000000000 +0200 -+++ net-snmp-5.7/net-snmp-config.in 2011-07-07 13:30:01.635798817 +0200 -@@ -50,7 +50,7 @@ NSC_LDFLAGS="@LDFLAGS@" - - NSC_LIBS="@LIBS@" - NSC_LNETSNMPLIBS="@LNETSNMPLIBS@" --NSC_LAGENTLIBS="@LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@" -+NSC_LAGENTLIBS="@LAGENTLIBS@" - NSC_LMIBLIBS="@LMIBLIBS@" - - NSC_INCLUDEDIR=${includedir} diff --git a/net-snmp-5.7.2-autoreconf.patch b/net-snmp-5.7.2-autoreconf.patch deleted file mode 100644 index a5618e8..0000000 --- a/net-snmp-5.7.2-autoreconf.patch +++ /dev/null @@ -1,10 +0,0 @@ -926223 - net-snmp: Does not support aarch64 in f19 and rawhide - -Update autoconf version to make the test suite happy. - -diff -up net-snmp-5.7.2/dist/autoconf-version.autoreconf net-snmp-5.7.2/dist/autoconf-version ---- net-snmp-5.7.2/dist/autoconf-version.autoreconf 2013-03-25 13:00:15.002745347 +0100 -+++ net-snmp-5.7.2/dist/autoconf-version 2013-03-25 13:00:17.207736442 +0100 -@@ -1 +1 @@ --2.68 -+2.69 diff --git a/net-snmp-5.7.3-Remove-U64-typedef.patch b/net-snmp-5.7.3-Remove-U64-typedef.patch deleted file mode 100644 index a506c06..0000000 --- a/net-snmp-5.7.3-Remove-U64-typedef.patch +++ /dev/null @@ -1,2519 +0,0 @@ -From 477b4307ef12ddce3b6a9205e0bdddbfb2e0e9b6 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Sat, 20 Feb 2016 18:58:18 -0800 -Subject: [PATCH] Remove U64 typedef - -The U64 typedef conflicts with a typedef in a Perl header file. Hence -remove the U64 typedef from the Net-SNMP header files. This patch does -not modify the Net-SNMP ABI. ---- - agent/mibgroup/if-mib/ifXTable/ifXTable.c | 16 +- - agent/mibgroup/if-mib/ifXTable/ifXTable.h | 48 +- - .../mibgroup/if-mib/ifXTable/ifXTable_interface.c | 32 +- - .../ip-mib/data_access/systemstats_common.c | 2 +- - .../ipIfStatsTable/ipIfStatsTable_data_get.c | 28 +- - .../ipIfStatsTable/ipIfStatsTable_data_get.h | 28 +- - .../ipIfStatsTable/ipIfStatsTable_interface.c | 56 +- - .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.c | 28 +- - .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.h | 921 ++------------------- - .../ipSystemStatsTable_interface.c | 56 +- - include/net-snmp/data_access/ipstats.h | 42 +- - include/net-snmp/library/int64.h | 34 +- - snmplib/int64.c | 38 +- - snmplib/read_config.c | 6 +- - testing/fulltests/unit-tests/T015int64_clib.c | 10 +- - 15 files changed, 274 insertions(+), 1071 deletions(-) - -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.c b/agent/mibgroup/if-mib/ifXTable/ifXTable.c -index bb3e736..0c952ba 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable.c -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.c -@@ -722,7 +722,7 @@ The total number of octets received on the interface, - */ - int - ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInOctets_val_ptr) -+ struct counter64 *ifHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInOctets_val_ptr); -@@ -779,7 +779,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInUcastPkts_val_ptr) -+ struct counter64 *ifHCInUcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr); -@@ -838,7 +838,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInMulticastPkts_val_ptr) -+ struct counter64 *ifHCInMulticastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInMulticastPkts_val_ptr); -@@ -897,7 +897,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInBroadcastPkts_val_ptr) -+ struct counter64 *ifHCInBroadcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInBroadcastPkts_val_ptr); -@@ -955,7 +955,7 @@ The total number of octets transmitted out of the - */ - int - ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutOctets_val_ptr) -+ struct counter64 *ifHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutOctets_val_ptr); -@@ -1013,7 +1013,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutUcastPkts_val_ptr) -+ struct counter64 *ifHCOutUcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutUcastPkts_val_ptr); -@@ -1074,7 +1074,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutMulticastPkts_val_ptr) -+ struct counter64 *ifHCOutMulticastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutMulticastPkts_val_ptr); -@@ -1134,7 +1134,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutBroadcastPkts_val_ptr) -+ struct counter64 *ifHCOutBroadcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutBroadcastPkts_val_ptr); -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.h b/agent/mibgroup/if-mib/ifXTable/ifXTable.h -index ba22f97..925af13 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable.h -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.h -@@ -143,28 +143,28 @@ config_require(if-mib/ifXTable/ifXTable_data_access) - u_long * - ifOutBroadcastPkts_val_ptr); - int ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInOctets_val_ptr); -+ struct counter64 *ifHCInOctets_val_ptr); - int ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInUcastPkts_val_ptr); -+ struct counter64 *ifHCInUcastPkts_val_ptr); - int ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCInMulticastPkts_val_ptr); - int ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCInBroadcastPkts_val_ptr); - int ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutOctets_val_ptr); -+ struct counter64 *ifHCOutOctets_val_ptr); - int ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutUcastPkts_val_ptr); -+ struct counter64 *ifHCOutUcastPkts_val_ptr); - int ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCOutMulticastPkts_val_ptr); - int ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCOutBroadcastPkts_val_ptr); - int ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx * - rowreq_ctx, -@@ -284,86 +284,86 @@ config_require(if-mib/ifXTable/ifXTable_data_access) - - int ifHCInOctets_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInOctets_val); -+ struct counter64 ifHCInOctets_val); - int ifHCInOctets_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInOctets_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCInOctets_val); -+ struct counter64 ifHCInOctets_val); - int ifHCInOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCInUcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInUcastPkts_val); -+ struct counter64 ifHCInUcastPkts_val); - int ifHCInUcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCInUcastPkts_val); -+ struct counter64 ifHCInUcastPkts_val); - int ifHCInUcastPkts_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCInMulticastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCInMulticastPkts_val); - int ifHCInMulticastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInMulticastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInMulticastPkts_val); -+ struct counter64 ifHCInMulticastPkts_val); - int ifHCInMulticastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCInBroadcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCInBroadcastPkts_val); - int ifHCInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInBroadcastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInBroadcastPkts_val); -+ struct counter64 ifHCInBroadcastPkts_val); - int ifHCInBroadcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutOctets_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutOctets_val); -+ struct counter64 ifHCOutOctets_val); - int ifHCOutOctets_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutOctets_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCOutOctets_val); -+ struct counter64 ifHCOutOctets_val); - int ifHCOutOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCOutUcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutUcastPkts_val); -+ struct counter64 ifHCOutUcastPkts_val); - int ifHCOutUcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCOutUcastPkts_val); -+ struct counter64 ifHCOutUcastPkts_val); - int ifHCOutUcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutMulticastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCOutMulticastPkts_val); - int ifHCOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutMulticastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutMulticastPkts_val); -+ struct counter64 ifHCOutMulticastPkts_val); - int ifHCOutMulticastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutBroadcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCOutBroadcastPkts_val); - int ifHCOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutBroadcastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutBroadcastPkts_val); -+ struct counter64 ifHCOutBroadcastPkts_val); - int ifHCOutBroadcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -index 23b50d0..e561842 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -@@ -729,72 +729,72 @@ _ifXTable_get_column(ifXTable_rowreq_ctx * rowreq_ctx, - * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINUCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInUcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINMULTICASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINBROADCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTUCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutUcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTMULTICASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTBROADCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -index 29109bd..7434b3a 100644 ---- a/agent/mibgroup/ip-mib/data_access/systemstats_common.c -+++ b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -@@ -264,7 +264,7 @@ _calculate_entries(netsnmp_systemstats_entry * entry) - && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] - && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) { - -- U64 tmp, tmp2, tmp3; -+ struct counter64 tmp, tmp2, tmp3; - tmp = entry->stats.HCOutRequests; - u64Incr(&tmp, &entry->stats.HCOutForwDatagrams); - u64Incr(&tmp, &entry->stats.HCOutFragCreates); -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -index db673dc..fec36b2 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -@@ -270,7 +270,7 @@ The total number of input IP datagrams received, including - */ - int - ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInReceives_val_ptr) -+ struct counter64 *ipIfStatsHCInReceives_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInReceives_val_ptr); -@@ -395,7 +395,7 @@ The total number of octets received in input IP datagrams, - */ - int - ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInOctets_val_ptr) -+ struct counter64 *ipIfStatsHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInOctets_val_ptr); -@@ -862,7 +862,7 @@ The number of input datagrams for which this entity was not - */ - int - ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInForwDatagrams_val_ptr) -+ struct counter64 *ipIfStatsHCInForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInForwDatagrams_val_ptr); -@@ -1267,7 +1267,7 @@ The total number of datagrams successfully delivered to IP - */ - int - ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInDelivers_val_ptr) -+ struct counter64 *ipIfStatsHCInDelivers_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInDelivers_val_ptr); -@@ -1396,7 +1396,7 @@ The total number of IP datagrams that local IP user- - */ - int - ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutRequests_val_ptr) -+ struct counter64 *ipIfStatsHCOutRequests_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutRequests_val_ptr); -@@ -1532,7 +1532,7 @@ The number of datagrams for which this entity was not their - */ - int - ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutForwDatagrams_val_ptr) -+ struct counter64 *ipIfStatsHCOutForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutForwDatagrams_val_ptr); -@@ -1999,7 +1999,7 @@ The total number of IP datagrams that this entity supplied - */ - int - ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutTransmits_val_ptr) -+ struct counter64 *ipIfStatsHCOutTransmits_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutTransmits_val_ptr); -@@ -2123,7 +2123,7 @@ The total number of octets in IP datagrams delivered to the - */ - int - ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutOctets_val_ptr) -+ struct counter64 *ipIfStatsHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutOctets_val_ptr); -@@ -2245,7 +2245,7 @@ The number of IP multicast datagrams received. This object - */ - int - ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInMcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCInMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInMcastPkts_val_ptr); -@@ -2372,7 +2372,7 @@ The total number of octets received in IP multicast - */ - int - ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInMcastOctets_val_ptr) -+ struct counter64 *ipIfStatsHCInMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInMcastOctets_val_ptr); -@@ -2497,7 +2497,7 @@ The number of IP multicast datagrams transmitted. This - */ - int - ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutMcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCOutMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutMcastPkts_val_ptr); -@@ -2621,7 +2621,7 @@ The total number of octets transmitted in IP multicast - */ - int - ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutMcastOctets_val_ptr) -+ struct counter64 *ipIfStatsHCOutMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutMcastOctets_val_ptr); -@@ -2743,7 +2743,7 @@ The number of IP broadcast datagrams received. This object - */ - int - ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInBcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCInBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInBcastPkts_val_ptr); -@@ -2865,7 +2865,7 @@ The number of IP broadcast datagrams transmitted. This - */ - int - ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutBcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCOutBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutBcastPkts_val_ptr); -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -index 0cc7e47..ad5d8a0 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -@@ -50,7 +50,7 @@ extern "C" { - ipIfStatsInReceives_val_ptr); - int ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInReceives_val_ptr); - int ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -58,7 +58,7 @@ extern "C" { - ipIfStatsInOctets_val_ptr); - int ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInOctets_val_ptr); - int ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -87,7 +87,7 @@ extern "C" { - int - ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInForwDatagrams_val_ptr); - int ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -111,7 +111,7 @@ extern "C" { - ipIfStatsInDelivers_val_ptr); - int ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInDelivers_val_ptr); - int ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -119,7 +119,7 @@ extern "C" { - ipIfStatsOutRequests_val_ptr); - int ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutRequests_val_ptr); - int ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -@@ -128,7 +128,7 @@ extern "C" { - int - ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutForwDatagrams_val_ptr); - int ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -156,7 +156,7 @@ extern "C" { - ipIfStatsOutTransmits_val_ptr); - int ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutTransmits_val_ptr); - int ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -164,7 +164,7 @@ extern "C" { - ipIfStatsOutOctets_val_ptr); - int ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutOctets_val_ptr); - int ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -172,7 +172,7 @@ extern "C" { - ipIfStatsInMcastPkts_val_ptr); - int ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInMcastPkts_val_ptr); - int ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -180,7 +180,7 @@ extern "C" { - ipIfStatsInMcastOctets_val_ptr); - int ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInMcastOctets_val_ptr); - int ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -188,7 +188,7 @@ extern "C" { - ipIfStatsOutMcastPkts_val_ptr); - int ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutMcastPkts_val_ptr); - int ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -196,7 +196,7 @@ extern "C" { - ipIfStatsOutMcastOctets_val_ptr); - int ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutMcastOctets_val_ptr); - int ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -204,7 +204,7 @@ extern "C" { - ipIfStatsInBcastPkts_val_ptr); - int ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInBcastPkts_val_ptr); - int ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -212,7 +212,7 @@ extern "C" { - ipIfStatsOutBcastPkts_val_ptr); - int ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutBcastPkts_val_ptr); - int - ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx * -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -index 559d1c1..4955a8b 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -@@ -722,10 +722,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINRECEIVES: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInReceives_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -741,9 +741,9 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ipIfStatsHCInOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ipIfStatsHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -@@ -810,10 +810,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -869,10 +869,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINDELIVERS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInDelivers_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -889,10 +889,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTREQUESTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutRequests_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -909,10 +909,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -979,10 +979,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTTRANSMITS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutTransmits_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -999,9 +999,9 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -@@ -1018,10 +1018,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1038,10 +1038,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1058,10 +1058,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1078,10 +1078,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1098,10 +1098,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1118,10 +1118,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -index 10587e2..5a9323f 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -@@ -452,7 +452,7 @@ The total number of input IP datagrams received, including - */ - int - ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInReceives_val_ptr) -+ struct counter64 *ipSystemStatsHCInReceives_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr); -@@ -579,7 +579,7 @@ The total number of octets received in input IP datagrams, - */ - int - ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInOctets_val_ptr) -+ struct counter64 *ipSystemStatsHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr); -@@ -1058,7 +1058,7 @@ The number of input datagrams for which this entity was not - int - ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -1474,7 +1474,7 @@ The total number of datagrams successfully delivered to IP - */ - int - ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInDelivers_val_ptr) -+ struct counter64 *ipSystemStatsHCInDelivers_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr); -@@ -1602,7 +1602,7 @@ The total number of IP datagrams which local IP user- - */ - int - ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutRequests_val_ptr) -+ struct counter64 *ipSystemStatsHCOutRequests_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr); -@@ -1809,7 +1809,7 @@ The number of datagrams for which this entity was not their - int - ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -2288,7 +2288,7 @@ The total number of IP datagrams that this entity supplied - */ - int - ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutTransmits_val_ptr) -+ struct counter64 *ipSystemStatsHCOutTransmits_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr); -@@ -2415,7 +2415,7 @@ The total number of octets in IP datagrams delivered to the - */ - int - ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutOctets_val_ptr) -+ struct counter64 *ipSystemStatsHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr); -@@ -2539,7 +2539,7 @@ The number of IP multicast datagrams received. This object - */ - int - ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInMcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCInMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr); -@@ -2665,7 +2665,7 @@ The total number of octets received in IP multicast - int - ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -2790,7 +2790,7 @@ The number of IP multicast datagrams transmitted. This - */ - int - ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutMcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCOutMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr); -@@ -2921,7 +2921,7 @@ The total number of octets transmitted in IP multicast - int - ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -3046,7 +3046,7 @@ The number of IP broadcast datagrams received. This object - */ - int - ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInBcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCInBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr); -@@ -3170,7 +3170,7 @@ The number of IP broadcast datagrams transmitted. This - */ - int - ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutBcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCOutBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr); -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -index ca1e1f3..5c3823e 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -@@ -144,93 +144,22 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - ********************************************************************* - * function prototypes - */ -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_pre_request(ipSystemStatsTable_registration * -+ int ipSystemStatsTable_pre_request(ipSystemStatsTable_registration * - user_context); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_post_request(ipSystemStatsTable_registration * -+ int ipSystemStatsTable_post_request(ipSystemStatsTable_registration * - user_context, int rc); - -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - void *user_init_ctx); - void -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx - * rowreq_ctx); - - ipSystemStatsTable_data *ipSystemStatsTable_allocate_data(void); - void ipSystemStatsTable_release_data(ipSystemStatsTable_data - * data); -- -- -- -- -- -- -- -- -- ipSystemStatsTable_rowreq_ctx -+ ipSystemStatsTable_rowreq_ctx - * ipSystemStatsTable_row_find_by_mib_index - (ipSystemStatsTable_mib_index * mib_idx); - -@@ -265,226 +194,50 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - * indexes - */ - -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInReceives_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInReceives_val_ptr); - int ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx - * rowreq_ctx, - u_long * - ipSystemStatsInOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * ipSystemStatsHCInOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * -+ struct counter64 *ipSystemStatsHCInOctets_val_ptr); -+ int ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInHdrErrors_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInNoRoutes_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInAddrErrors_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInUnknownProtos_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInTruncatedPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsReasmReqds_val_ptr); -@@ -492,690 +245,142 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - * rowreq_ctx, - u_long * - ipSystemStatsReasmOKs_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsReasmFails_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInDiscards_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInDelivers_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInDelivers_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutRequests_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutRequests_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutNoRoutes_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutDiscards_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragReqds_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragOKs_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragFails_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragCreates_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutTransmits_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutTransmits_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsDiscontinuityTime_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsRefreshRate_val_ptr); -- -- -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index -+ int ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index - * tbl_idx, - u_long - ipSystemStatsIPVersion_val); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long ipSystemStatsIPVersion_val); - -- -- - /* - ********************************************************************* - * SET function declarations -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -index e1ca2cb..09c061f 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -@@ -674,10 +674,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINRECEIVES: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInReceives_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -694,10 +694,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -764,10 +764,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -824,10 +824,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINDELIVERS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInDelivers_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -844,10 +844,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutRequests_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -874,10 +874,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -944,10 +944,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -964,10 +964,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -984,10 +984,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1004,10 +1004,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1024,10 +1024,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1044,10 +1044,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1064,10 +1064,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1084,10 +1084,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -diff --git a/include/net-snmp/data_access/ipstats.h b/include/net-snmp/data_access/ipstats.h -index f782459..f0df46b 100644 ---- a/include/net-snmp/data_access/ipstats.h -+++ b/include/net-snmp/data_access/ipstats.h -@@ -58,45 +58,45 @@ typedef struct netsnmp_ipstats_s { - * other columns, when underlying OS does not provide them. - * Always fill at least 32 bits, the table is periodically polled -> 32 bit - * overflow shall be detected and 64 bit value should be computed automatically. */ -- U64 HCInReceives; -- U64 HCInOctets; -+ struct counter64 HCInReceives; -+ struct counter64 HCInOctets; - u_long InHdrErrors; -- U64 HCInNoRoutes; -+ struct counter64 HCInNoRoutes; - u_long InAddrErrors; - u_long InUnknownProtos; - u_long InTruncatedPkts; - - /* optional, can be computed from HCInNoRoutes and HCOutForwDatagrams */ -- U64 HCInForwDatagrams; -+ struct counter64 HCInForwDatagrams; - - u_long ReasmReqds; - u_long ReasmOKs; - u_long ReasmFails; - u_long InDiscards; -- U64 HCInDelivers; -- U64 HCOutRequests; -- U64 HCOutNoRoutes; -- U64 HCOutForwDatagrams; -- U64 HCOutDiscards; -+ struct counter64 HCInDelivers; -+ struct counter64 HCOutRequests; -+ struct counter64 HCOutNoRoutes; -+ struct counter64 HCOutForwDatagrams; -+ struct counter64 HCOutDiscards; - - /* optional, can be computed from HCOutFragOKs + HCOutFragFails*/ -- U64 HCOutFragReqds; -- U64 HCOutFragOKs; -- U64 HCOutFragFails; -- U64 HCOutFragCreates; -+ struct counter64 HCOutFragReqds; -+ struct counter64 HCOutFragOKs; -+ struct counter64 HCOutFragFails; -+ struct counter64 HCOutFragCreates; - - /* optional, can be computed from - * HCOutRequests +HCOutForwDatagrams + HCOutFragCreates - * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards */ -- U64 HCOutTransmits; -+ struct counter64 HCOutTransmits; - -- U64 HCOutOctets; -- U64 HCInMcastPkts; -- U64 HCInMcastOctets; -- U64 HCOutMcastPkts; -- U64 HCOutMcastOctets; -- U64 HCInBcastPkts; -- U64 HCOutBcastPkts; -+ struct counter64 HCOutOctets; -+ struct counter64 HCInMcastPkts; -+ struct counter64 HCInMcastOctets; -+ struct counter64 HCOutMcastPkts; -+ struct counter64 HCOutMcastOctets; -+ struct counter64 HCInBcastPkts; -+ struct counter64 HCOutBcastPkts; - - /* Array of available columns.*/ - int columnAvail[IPSYSTEMSTATSTABLE_LAST+1]; -diff --git a/include/net-snmp/library/int64.h b/include/net-snmp/library/int64.h -index 9c7c894..3a85213 100644 ---- a/include/net-snmp/library/int64.h -+++ b/include/net-snmp/library/int64.h -@@ -5,31 +5,29 @@ - extern "C" { - #endif - -- typedef struct counter64 U64; -- - #define I64CHARSZ 21 - -- void divBy10(U64, U64 *, unsigned int *); -- void multBy10(U64, U64 *); -- void incrByU16(U64 *, unsigned int); -- void incrByU32(U64 *, unsigned int); -+ void divBy10(struct counter64, struct counter64 *, unsigned int *); -+ void multBy10(struct counter64, struct counter64 *); -+ void incrByU16(struct counter64 *, unsigned int); -+ void incrByU32(struct counter64 *, unsigned int); - NETSNMP_IMPORT -- void zeroU64(U64 *); -- int isZeroU64(const U64 *); -+ void zeroU64(struct counter64 *); -+ int isZeroU64(const struct counter64 *); - NETSNMP_IMPORT -- void printU64(char *, const U64 *); -+ void printU64(char *, const struct counter64 *); - NETSNMP_IMPORT -- void printI64(char *, const U64 *); -- int read64(U64 *, const char *); -+ void printI64(char *, const struct counter64 *); -+ int read64(struct counter64 *, const char *); - NETSNMP_IMPORT -- void u64Subtract(const U64 * pu64one, const U64 * pu64two, -- U64 * pu64out); -- void u64Incr(U64 * pu64out, const U64 * pu64one); -- void u64UpdateCounter(U64 * pu64out, const U64 * pu64one, -- const U64 * pu64two); -- void u64Copy(U64 * pu64one, const U64 * pu64two); -+ void u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two, -+ struct counter64 *pu64out); -+ void u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one); -+ void u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one, -+ const struct counter64 *pu64two); -+ void u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two); - -- int netsnmp_c64_check_for_32bit_wrap(U64 *old_val, U64 *new_val, -+ int netsnmp_c64_check_for_32bit_wrap(struct counter64 *old_val, struct counter64 *new_val, - int adjust); - NETSNMP_IMPORT - int netsnmp_c64_check32_and_update(struct counter64 *prev_val, -diff --git a/snmplib/int64.c b/snmplib/int64.c -index 51f1f32..951f813 100644 ---- a/snmplib/int64.c -+++ b/snmplib/int64.c -@@ -33,7 +33,7 @@ - * @param[out] puR Remainder. - */ - void --divBy10(U64 u64, U64 * pu64Q, unsigned int *puR) -+divBy10(struct counter64 u64, struct counter64 *pu64Q, unsigned int *puR) - { - unsigned long ulT; - unsigned long ulQ; -@@ -83,7 +83,7 @@ divBy10(U64 u64, U64 * pu64Q, unsigned int *puR) - * @param[out] pu64P Product. - */ - void --multBy10(U64 u64, U64 * pu64P) -+multBy10(struct counter64 u64, struct counter64 *pu64P) - { - unsigned long ulT; - unsigned long ulP; -@@ -130,7 +130,7 @@ multBy10(U64 u64, U64 * pu64P) - * - */ - void --incrByU16(U64 * pu64, unsigned int u16) -+incrByU16(struct counter64 *pu64, unsigned int u16) - { - incrByU32(pu64, u16); - } -@@ -143,7 +143,7 @@ incrByU16(U64 * pu64, unsigned int u16) - * - */ - void --incrByU32(U64 * pu64, unsigned int u32) -+incrByU32(struct counter64 *pu64, unsigned int u32) - { - uint32_t tmp; - -@@ -161,7 +161,7 @@ incrByU32(U64 * pu64, unsigned int u32) - * @param[out] pu64out pu64one - pu64two. - */ - void --u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out) -+u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two, struct counter64 *pu64out) - { - int carry; - -@@ -177,7 +177,7 @@ u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out) - * @param[in,out] pu64out pu64out += pu64one. - */ - void --u64Incr(U64 * pu64out, const U64 * pu64one) -+u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one) - { - pu64out->high = (uint32_t)(pu64out->high + pu64one->high); - incrByU32(pu64out, pu64one->low); -@@ -191,9 +191,9 @@ u64Incr(U64 * pu64out, const U64 * pu64one) - * @param[out] pu64out pu64out += (pu64one - pu64two) - */ - void --u64UpdateCounter(U64 * pu64out, const U64 * pu64one, const U64 * pu64two) -+u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one, const struct counter64 *pu64two) - { -- U64 tmp; -+ struct counter64 tmp; - - u64Subtract(pu64one, pu64two, &tmp); - u64Incr(pu64out, &tmp); -@@ -208,7 +208,7 @@ netsnmp_feature_child_of(u64copy, netsnmp_unused) - * @param[out] pu64one Where to store the copy - *pu64one = *pu64two. - */ - void --u64Copy(U64 * pu64one, const U64 * pu64two) -+u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two) - { - *pu64one = *pu64two; - } -@@ -220,7 +220,7 @@ u64Copy(U64 * pu64one, const U64 * pu64two) - * @param[in] pu64 Number to be zeroed. - */ - void --zeroU64(U64 * pu64) -+zeroU64(struct counter64 *pu64) - { - pu64->low = 0; - pu64->high = 0; -@@ -232,7 +232,7 @@ zeroU64(U64 * pu64) - * @param[in] pu64 Number to be checked. - */ - int --isZeroU64(const U64 * pu64) -+isZeroU64(const struct counter64 *pu64) - { - return pu64->low == 0 && pu64->high == 0; - } -@@ -390,10 +390,10 @@ netsnmp_c64_check32_and_update(struct counter64 *prev_val, struct counter64 *new - /** Convert an unsigned 64-bit number to ASCII. */ - void - printU64(char *buf, /* char [I64CHARSZ+1]; */ -- const U64 * pu64) -+ const struct counter64 *pu64) - { -- U64 u64a; -- U64 u64b; -+ struct counter64 u64a; -+ struct counter64 u64b; - - char aRes[I64CHARSZ + 1]; - unsigned int u; -@@ -414,9 +414,9 @@ printU64(char *buf, /* char [I64CHARSZ+1]; */ - /** Convert a signed 64-bit number to ASCII. */ - void - printI64(char *buf, /* char [I64CHARSZ+1]; */ -- const U64 * pu64) -+ const struct counter64 *pu64) - { -- U64 u64a; -+ struct counter64 u64a; - - if (pu64->high & 0x80000000) { - u64a.high = (uint32_t) ~pu64->high; -@@ -429,11 +429,11 @@ printI64(char *buf, /* char [I64CHARSZ+1]; */ - } - } - --/** Convert a signed 64-bit integer from ASCII to U64. */ -+/** Convert a signed 64-bit integer from ASCII to struct counter64. */ - int --read64(U64 * i64, const char *str) -+read64(struct counter64 *i64, const char *str) - { -- U64 i64p; -+ struct counter64 i64p; - unsigned int u; - int sign = 0; - int ok = 0; -diff --git a/snmplib/read_config.c b/snmplib/read_config.c -index e159c27..ab5b6a3 100644 ---- a/snmplib/read_config.c -+++ b/snmplib/read_config.c -@@ -2279,10 +2279,10 @@ read_config_read_memory(int type, char *readfrom, - return readfrom; - - case ASN_COUNTER64: -- if (*len < sizeof(U64)) -+ if (*len < sizeof(struct counter64)) - return NULL; -- *len = sizeof(U64); -- read64((U64 *) dataptr, readfrom); -+ *len = sizeof(struct counter64); -+ read64((struct counter64 *) dataptr, readfrom); - readfrom = skip_token(readfrom); - return readfrom; - } -diff --git a/testing/fulltests/unit-tests/T015int64_clib.c b/testing/fulltests/unit-tests/T015int64_clib.c -index 5f5f4b6..66f66b7 100644 ---- a/testing/fulltests/unit-tests/T015int64_clib.c -+++ b/testing/fulltests/unit-tests/T015int64_clib.c -@@ -1,4 +1,4 @@ --/* HEADER Testing 64-bit integer operations (U64). */ -+/* HEADER Testing 64-bit integer operations (struct counter64). */ - - int i, j; - char buf[22]; -@@ -15,7 +15,7 @@ static const int64_t intval[] = { - }; - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { -- U64 a, b; -+ struct counter64 a, b; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); - printI64(buf, &a); -@@ -27,7 +27,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) { -- U64 a, b; -+ struct counter64 a, b; - uint64_t d; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); -@@ -43,7 +43,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) { -- U64 a, b, c; -+ struct counter64 a, b, c; - uint64_t d; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); -@@ -58,7 +58,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - } - - { -- U64 old_val, new_val; -+ struct counter64 old_val, new_val; - old_val.low = 7; - old_val.high = 0; - new_val = old_val; --- -2.5.5 - diff --git a/net-snmp-5.7.3-mariadb-connector-c.patch b/net-snmp-5.7.3-mariadb-connector-c.patch deleted file mode 100644 index 3175c2e..0000000 --- a/net-snmp-5.7.3-mariadb-connector-c.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urNp old/apps/snmptrapd_sql.c new/apps/snmptrapd_sql.c ---- old/apps/snmptrapd_sql.c 2017-12-13 22:40:04.963569347 +0100 -+++ new/apps/snmptrapd_sql.c 2017-12-13 22:44:38.640761652 +0100 -@@ -50,8 +50,6 @@ - #undef PACKAGE_STRING - #undef PACKAGE_TARNAME - #undef PACKAGE_VERSION --#include --#include - #include - #include - #include diff --git a/net-snmp-5.7.3-mariadb102.patch b/net-snmp-5.7.3-mariadb102.patch deleted file mode 100644 index 8867cad..0000000 --- a/net-snmp-5.7.3-mariadb102.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff -urNp old/apps/snmptrapd_sql.c new/apps/snmptrapd_sql.c ---- old/apps/snmptrapd_sql.c 2017-07-18 09:44:00.655109694 +0200 -+++ new/apps/snmptrapd_sql.c 2017-07-19 12:51:14.836148821 +0200 -@@ -54,6 +54,7 @@ - #include - #include - #include -+#include - - netsnmp_feature_require(container_fifo) - -@@ -437,6 +438,7 @@ netsnmp_mysql_init(void) - return -1; - } - -+#if MYSQL_VERSION_ID < 100000 - #ifdef HAVE_BROKEN_LIBMYSQLCLIENT - my_init(); - #else -@@ -445,6 +447,7 @@ netsnmp_mysql_init(void) - - /** load .my.cnf values */ - load_defaults ("my", _sql.groups, ¬_argc, ¬_argv); -+#endif - for(i=0; i < not_argc; ++i) { - if (NULL == not_argv[i]) - continue; -@@ -542,6 +545,10 @@ netsnmp_mysql_init(void) - return -1; - } - -+#if MYSQL_VERSION_ID > 100000 -+ mysql_options(_sql.conn, MYSQL_READ_DEFAULT_GROUP, "snmptrapd"); -+#endif -+ - /** try to connect; we'll try again later if we fail */ - (void) netsnmp_mysql_connect(); - diff --git a/net-snmp-5.7.3-modern-rpm-api.patch b/net-snmp-5.7.3-modern-rpm-api.patch deleted file mode 100644 index 9c982a9..0000000 --- a/net-snmp-5.7.3-modern-rpm-api.patch +++ /dev/null @@ -1,90 +0,0 @@ -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c 2017-08-11 00:16:35.232470439 +0200 -@@ -96,8 +96,7 @@ - - rpmdbMatchIterator mi; - Header h; -- char *n, *v, *r, *g; -- int32_t *t; -+ const char *n, *v, *r, *g; - time_t install_time; - size_t date_len; - int i = 1; -@@ -119,11 +118,11 @@ - CONTAINER_INSERT(container, entry); - - h = headerLink( h ); -- headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL); -- headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL); -- headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL); -- headerGetEntry( h, RPMTAG_GROUP, NULL, (void**)&g, NULL); -- headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL); -+ n = headerGetString( h, RPMTAG_NAME); -+ v = headerGetString( h, RPMTAG_VERSION); -+ r = headerGetString( h, RPMTAG_RELEASE); -+ g = headerGetString( h, RPMTAG_GROUP); -+ install_time = headerGetNumber( h, RPMTAG_INSTALLTIME); - - entry->swName_len = snprintf( entry->swName, sizeof(entry->swName), - "%s-%s-%s", n, v, r); -@@ -133,7 +132,6 @@ - ? 2 /* operatingSystem */ - : 4; /* application */ - -- install_time = *t; - dt = date_n_time( &install_time, &date_len ); - if (date_len != 8 && date_len != 11) { - snmp_log(LOG_ERR, "Bogus length from date_n_time for %s", entry->swName); -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c 2017-08-11 00:17:07.488544492 +0200 -@@ -484,9 +484,9 @@ - } - #else - # ifdef HAVE_LIBRPM -- char *rpm_groups; -- if ( headerGetEntry(swi->swi_h, RPMTAG_GROUP, NULL, (void **) &rpm_groups, NULL) ) { -- if ( strstr(rpm_groups, "System Environment") != NULL ) -+ const char *rpm_group = headerGetString(swi->swi_h, RPMTAG_GROUP); -+ if ( NULL != rpm_group ) { -+ if ( strstr(rpm_group, "System Environment") != NULL ) - long_return = 2; /* operatingSystem */ - else - long_return = 4; /* applcation */ -@@ -503,9 +503,8 @@ - case HRSWINST_DATE: - { - #ifdef HAVE_LIBRPM -- int32_t *rpm_data; -- if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) { -- time_t installTime = *rpm_data; -+ time_t installTime = headerGetNumber(swi->swi_h, RPMTAG_INSTALLTIME); -+ if ( 0 != installTime) { - ret = date_n_time(&installTime, var_len); - } else { - ret = date_n_time(NULL, var_len); -@@ -665,7 +664,7 @@ - if (1 <= ix && ix <= swi->swi_nrec && ix != swi->swi_prevx) { - int offset; - Header h; -- char *n, *v, *r; -+ const char *n, *v, *r; - - offset = swi->swi_recs[ix - 1]; - -@@ -690,11 +689,9 @@ - swi->swi_h = h; - swi->swi_prevx = ix; - -- headerGetEntry(swi->swi_h, RPMTAG_NAME, NULL, (void **) &n, NULL); -- headerGetEntry(swi->swi_h, RPMTAG_VERSION, NULL, (void **) &v, -- NULL); -- headerGetEntry(swi->swi_h, RPMTAG_RELEASE, NULL, (void **) &r, -- NULL); -+ n = headerGetString(swi->swi_h, RPMTAG_NAME); -+ v = headerGetString(swi->swi_h, RPMTAG_VERSION); -+ r = headerGetString(swi->swi_h, RPMTAG_RELEASE); - snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r); - swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0; - } diff --git a/net-snmp-5.7.3-openssl.patch b/net-snmp-5.7.3-openssl.patch deleted file mode 100644 index 0651a24..0000000 --- a/net-snmp-5.7.3-openssl.patch +++ /dev/null @@ -1,303 +0,0 @@ -diff -urNp old/apps/snmpusm.c new/apps/snmpusm.c ---- old/apps/snmpusm.c 2014-12-08 21:23:22.000000000 +0100 -+++ new/apps/snmpusm.c 2017-02-20 15:20:36.994022905 +0100 -@@ -190,7 +190,7 @@ get_USM_DH_key(netsnmp_variable_list *va - oid *keyoid, size_t keyoid_len) { - u_char *dhkeychange; - DH *dh; -- BIGNUM *other_pub; -+ BIGNUM *p, *g, *pub_key, *other_pub; - u_char *key; - size_t key_len; - -@@ -205,25 +205,29 @@ get_USM_DH_key(netsnmp_variable_list *va - dh = d2i_DHparams(NULL, &cp, dhvar->val_len); - } - -- if (!dh || !dh->g || !dh->p) { -+ if (dh) -+ DH_get0_pqg(dh, &p, NULL, &g); -+ -+ if (!dh || !g || !p) { - SNMP_FREE(dhkeychange); - return SNMPERR_GENERR; - } - -- DH_generate_key(dh); -- if (!dh->pub_key) { -+ if (!DH_generate_key(dh)) { - SNMP_FREE(dhkeychange); - return SNMPERR_GENERR; - } - -- if (vars->val_len != (unsigned int)BN_num_bytes(dh->pub_key)) { -+ DH_get0_key(dh, &pub_key, NULL); -+ -+ if (vars->val_len != (unsigned int)BN_num_bytes(pub_key)) { - SNMP_FREE(dhkeychange); - fprintf(stderr,"incorrect diffie-helman lengths (%lu != %d)\n", -- (unsigned long)vars->val_len, BN_num_bytes(dh->pub_key)); -+ (unsigned long)vars->val_len, BN_num_bytes(pub_key)); - return SNMPERR_GENERR; - } - -- BN_bn2bin(dh->pub_key, dhkeychange + vars->val_len); -+ BN_bn2bin(pub_key, dhkeychange + vars->val_len); - - key_len = DH_size(dh); - if (!key_len) { -diff -urNp old/configure new/configure ---- old/configure 2017-02-20 10:08:16.440396223 +0100 -+++ new/configure 2017-02-20 10:57:15.749734281 +0100 -@@ -23176,9 +23176,9 @@ $as_echo "#define HAVE_AES_CFB128_ENCRYP - fi - - -- as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_create" | $as_tr_sh` --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_create in -l${CRYPTO}" >&5 --$as_echo_n "checking for EVP_MD_CTX_create in -l${CRYPTO}... " >&6; } -+ as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_new" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -l${CRYPTO}" >&5 -+$as_echo_n "checking for EVP_MD_CTX_new in -l${CRYPTO}... " >&6; } - if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 - else -@@ -23193,11 +23193,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ - #ifdef __cplusplus - extern "C" - #endif --char EVP_MD_CTX_create (); -+char EVP_MD_CTX_new (); - int - main () - { --return EVP_MD_CTX_create (); -+return EVP_MD_CTX_new (); - ; - return 0; - } -@@ -23216,10 +23216,10 @@ eval ac_res=\$$as_ac_Lib - $as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - --$as_echo "#define HAVE_EVP_MD_CTX_CREATE /**/" >>confdefs.h -+$as_echo "#define HAVE_EVP_MD_CTX_NEW /**/" >>confdefs.h - - --$as_echo "#define HAVE_EVP_MD_CTX_DESTROY /**/" >>confdefs.h -+$as_echo "#define HAVE_EVP_MD_CTX_FREE /**/" >>confdefs.h - - fi - -@@ -23293,7 +23293,7 @@ char SSL_library_init (); - int - main () - { --return SSL_library_init (); -+return OPENSSL_init_ssl(0, NULL); - ; - return 0; - } -diff -urNp old/configure.d/config_os_libs2 new/configure.d/config_os_libs2 ---- old/configure.d/config_os_libs2 2014-12-08 21:23:22.000000000 +0100 -+++ new/configure.d/config_os_libs2 2017-02-20 10:56:21.041616611 +0100 -@@ -292,11 +292,11 @@ if test "x$tryopenssl" != "xno" -a "x$tr - AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1, - [Define to 1 if you have the `AES_cfb128_encrypt' function.])) - -- AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create, -- AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [], -- [Define to 1 if you have the `EVP_MD_CTX_create' function.]) -- AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [], -- [Define to 1 if you have the `EVP_MD_CTX_destroy' function.])) -+ AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_new, -+ AC_DEFINE([HAVE_EVP_MD_CTX_NEW], [], -+ [Define to 1 if you have the `EVP_MD_CTX_new' function.]) -+ AC_DEFINE([HAVE_EVP_MD_CTX_FREE], [], -+ [Define to 1 if you have the `EVP_MD_CTX_free' function.])) - fi - if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then - AC_CHECK_LIB(ssl, DTLSv1_method, -@@ -307,7 +307,7 @@ if test "x$tryopenssl" != "xno" -a "x$tr - TLSPROG=yes - fi - if echo " $transport_result_list " | $GREP "TLS" > /dev/null; then -- AC_CHECK_LIB(ssl, SSL_library_init, -+ AC_CHECK_LIB(ssl, OPENSSL_init_ssl, - AC_DEFINE(HAVE_LIBSSL, 1, - [Define to 1 if you have the `ssl' library (-lssl).]) - LIBCRYPTO=" -lssl $LIBCRYPTO", -diff -urNp old/include/net-snmp/net-snmp-config.h.in new/include/net-snmp/net-snmp-config.h.in ---- old/include/net-snmp/net-snmp-config.h.in 2017-02-20 10:08:16.443522417 +0100 -+++ new/include/net-snmp/net-snmp-config.h.in 2017-02-20 10:24:05.790584283 +0100 -@@ -149,11 +149,11 @@ - /* Define to 1 if you have the `eval_pv' function. */ - #undef HAVE_EVAL_PV - --/* Define to 1 if you have the `EVP_MD_CTX_create' function. */ --#undef HAVE_EVP_MD_CTX_CREATE -+/* Define to 1 if you have the `EVP_MD_CTX_new' function. */ -+#undef HAVE_EVP_MD_CTX_NEW - --/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */ --#undef HAVE_EVP_MD_CTX_DESTROY -+/* Define to 1 if you have the `EVP_MD_CTX_free' function. */ -+#undef HAVE_EVP_MD_CTX_FREE - - /* Define if you have EVP_sha224/256 in openssl */ - #undef HAVE_EVP_SHA224 -diff -urNp old/snmplib/keytools.c new/snmplib/keytools.c ---- old/snmplib/keytools.c 2014-12-08 21:23:22.000000000 +0100 -+++ new/snmplib/keytools.c 2017-02-20 10:30:27.412068264 +0100 -@@ -149,8 +149,8 @@ generate_Ku(const oid * hashtype, u_int - */ - #ifdef NETSNMP_USE_OPENSSL - --#ifdef HAVE_EVP_MD_CTX_CREATE -- ctx = EVP_MD_CTX_create(); -+#ifdef HAVE_EVP_MD_CTX_NEW -+ ctx = EVP_MD_CTX_new(); - #else - ctx = malloc(sizeof(*ctx)); - if (!EVP_MD_CTX_init(ctx)) -@@ -259,8 +259,8 @@ generate_Ku(const oid * hashtype, u_int - memset(buf, 0, sizeof(buf)); - #ifdef NETSNMP_USE_OPENSSL - if (ctx) { --#ifdef HAVE_EVP_MD_CTX_DESTROY -- EVP_MD_CTX_destroy(ctx); -+#ifdef HAVE_EVP_MD_CTX_FREE -+ EVP_MD_CTX_free(ctx); - #else - EVP_MD_CTX_cleanup(ctx); - free(ctx); -diff -urNp old/snmplib/scapi.c new/snmplib/scapi.c ---- old/snmplib/scapi.c 2014-12-08 21:23:22.000000000 +0100 -+++ new/snmplib/scapi.c 2017-02-20 10:27:34.152379515 +0100 -@@ -486,14 +486,14 @@ sc_hash(const oid * hashtype, size_t has - } - - /** initialize the pointer */ --#ifdef HAVE_EVP_MD_CTX_CREATE -- cptr = EVP_MD_CTX_create(); -+#ifdef HAVE_EVP_MD_CTX_NEW -+ cptr = EVP_MD_CTX_new(); - #else - cptr = malloc(sizeof(*cptr)); - #if defined(OLD_DES) - memset(cptr, 0, sizeof(*cptr)); - #else -- EVP_MD_CTX_init(cptr); -+ EVP_MD_CTX_init(&cptr); - #endif - #endif - if (!EVP_DigestInit(cptr, hashfn)) { -@@ -507,11 +507,11 @@ sc_hash(const oid * hashtype, size_t has - /** do the final pass */ - EVP_DigestFinal(cptr, MAC, &tmp_len); - *MAC_len = tmp_len; --#ifdef HAVE_EVP_MD_CTX_DESTROY -- EVP_MD_CTX_destroy(cptr); -+#ifdef HAVE_EVP_MD_CTX_FREE -+ EVP_MD_CTX_free(cptr); - #else - #if !defined(OLD_DES) -- EVP_MD_CTX_cleanup(cptr); -+ EVP_MD_CTX_cleanup(&cptr); - #endif - free(cptr); - #endif -diff -urNp old/snmplib/snmp_openssl.c new/snmplib/snmp_openssl.c ---- old/snmplib/snmp_openssl.c 2014-12-08 21:23:22.000000000 +0100 -+++ new/snmplib/snmp_openssl.c 2017-02-20 12:46:00.059727928 +0100 -@@ -47,7 +47,7 @@ void netsnmp_init_openssl(void) { - DEBUGMSGTL(("snmp_openssl", "initializing\n")); - - /* Initializing OpenSSL */ -- SSL_library_init(); -+ OPENSSL_init_ssl(0, NULL); - SSL_load_error_strings(); - ERR_load_BIO_strings(); - OpenSSL_add_all_algorithms(); -@@ -164,11 +164,11 @@ netsnmp_openssl_cert_dump_names(X509 *oc - oname_entry = X509_NAME_get_entry(osubj_name, i); - netsnmp_assert(NULL != oname_entry); - -- if (oname_entry->value->type != V_ASN1_PRINTABLESTRING) -+ if (X509_NAME_ENTRY_get_data(oname_entry)->type != V_ASN1_PRINTABLESTRING) - continue; - - /** get NID */ -- onid = OBJ_obj2nid(oname_entry->object); -+ onid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(oname_entry)); - if (onid == NID_undef) { - prefix_long = prefix_short = "UNKNOWN"; - } -@@ -179,9 +179,9 @@ netsnmp_openssl_cert_dump_names(X509 *oc - - DEBUGMSGT(("9:cert:dump:names", - "[%02d] NID type %d, ASN type %d\n", i, onid, -- oname_entry->value->type)); -+ X509_NAME_ENTRY_get_data(oname_entry)->type)); - DEBUGMSGT(("9:cert:dump:names", "%s/%s: '%s'\n", prefix_long, -- prefix_short, ASN1_STRING_data(oname_entry->value))); -+ prefix_short, ASN1_STRING_data(X509_NAME_ENTRY_get_data(oname_entry)))); - } - } - #endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */ -@@ -470,7 +470,7 @@ netsnmp_openssl_cert_get_hash_type(X509 - if (NULL == ocert) - return 0; - -- return _nid2ht(OBJ_obj2nid(ocert->sig_alg->algorithm)); -+ return _nid2ht(X509_get_signature_nid(ocert)); - } - - /** -@@ -487,7 +487,7 @@ netsnmp_openssl_cert_get_fingerprint(X50 - if (NULL == ocert) - return NULL; - -- nid = OBJ_obj2nid(ocert->sig_alg->algorithm); -+ nid = X509_get_signature_nid(ocert); - DEBUGMSGT(("9:openssl:fingerprint", "alg %d, cert nid %d (%d)\n", alg, nid, - _nid2ht(nid))); - -diff -urNp old/win32/net-snmp/net-snmp-config.h new/win32/net-snmp/net-snmp-config.h ---- old/win32/net-snmp/net-snmp-config.h 2014-12-08 21:23:22.000000000 +0100 -+++ new/win32/net-snmp/net-snmp-config.h 2017-02-20 10:23:20.796778512 +0100 -@@ -1366,11 +1366,11 @@ - /* Define to 1 if you have the header file. */ - #define HAVE_OPENSSL_AES_H 1 - --/* Define to 1 if you have the `EVP_MD_CTX_create' function. */ --#define HAVE_EVP_MD_CTX_CREATE 1 -+/* Define to 1 if you have the `EVP_MD_CTX_new' function. */ -+#define HAVE_EVP_MD_CTX_NEW 1 - --/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */ --#define HAVE_EVP_MD_CTX_DESTROY 1 -+/* Define to 1 if you have the `EVP_MD_CTX_free' function. */ -+#define HAVE_EVP_MD_CTX_FREE 1 - - /* Define to 1 if you have the `AES_cfb128_encrypt' function. */ - #define HAVE_AES_CFB128_ENCRYPT 1 -diff -urNp old/win32/net-snmp/net-snmp-config.h.in new/win32/net-snmp/net-snmp-config.h.in ---- old/win32/net-snmp/net-snmp-config.h.in 2014-12-08 21:23:22.000000000 +0100 -+++ new/win32/net-snmp/net-snmp-config.h.in 2017-02-20 10:22:51.348367754 +0100 -@@ -1366,11 +1366,11 @@ - /* Define to 1 if you have the header file. */ - #define HAVE_OPENSSL_AES_H 1 - --/* Define to 1 if you have the `EVP_MD_CTX_create' function. */ --#define HAVE_EVP_MD_CTX_CREATE 1 -+/* Define to 1 if you have the `EVP_MD_CTX_new' function. */ -+#define HAVE_EVP_MD_CTX_NEW 1 - --/* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */ --#define HAVE_EVP_MD_CTX_DESTROY 1 -+/* Define to 1 if you have the `EVP_MD_CTX_free' function. */ -+#define HAVE_EVP_MD_CTX_FREE 1 - - /* Define to 1 if you have the `AES_cfb128_encrypt' function. */ - #define HAVE_AES_CFB128_ENCRYPT 1 diff --git a/net-snmp-5.7.3-python3.patch b/net-snmp-5.7.3-python3.patch deleted file mode 100644 index 5e46e37..0000000 --- a/net-snmp-5.7.3-python3.patch +++ /dev/null @@ -1,641 +0,0 @@ -diff -urNp old/configure new/configure ---- old/configure 2018-05-29 08:27:03.342448982 +0200 -+++ new/configure 2018-05-29 08:27:15.317394863 +0200 -@@ -6412,8 +6412,8 @@ $as_echo "no" >&6; } - fi - - --# Extract the first word of "python", so it can be a program name with args. --set dummy python; ac_word=$2 -+# Extract the first word of "python3", so it can be a program name with args. -+set dummy python3; ac_word="python3" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if ${ac_cv_path_PYTHONPROG+:} false; then : -diff -urNp old/configure.d/config_os_progs new/configure.d/config_os_progs ---- old/configure.d/config_os_progs 2018-05-29 08:27:03.368448865 +0200 -+++ new/configure.d/config_os_progs 2018-05-29 08:27:15.341394754 +0200 -@@ -57,7 +57,7 @@ AC_PATH_PROG(AUTOCONF, autoconf) - AC_PATH_PROG(AUTOHEADER, autoheader) - AC_PATH_PROG([PERLPROG], perl) - AC_PATH_PROG([PSPROG], ps) --AC_PATH_PROG([PYTHONPROG],python) -+AC_PATH_PROG([PYTHONPROG],python3) - - AC_PATH_PROG([UNAMEPROG], uname) - AC_DEFINE_UNQUOTED(UNAMEPROG,"$UNAMEPROG", [Where is the uname command]) -diff -urNp old/Makefile.in new/Makefile.in ---- old/Makefile.in 2018-05-29 08:27:03.340448991 +0200 -+++ new/Makefile.in 2018-05-29 08:27:15.307394908 +0200 -@@ -222,7 +222,7 @@ perlcleanfeatures: - - # python specific build rules - # --PYMAKE=$(PYTHON) setup.py $(PYTHONARGS) -+PYMAKE=/usr/bin/python3 setup.py $(PYTHONARGS) - pythonmodules: subdirs - @(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \ - if test $$? != 0 ; then \ -diff -urNp old/python/netsnmp/client_intf.c new/python/netsnmp/client_intf.c ---- old/python/netsnmp/client_intf.c 2018-05-29 08:27:03.390448765 +0200 -+++ new/python/netsnmp/client_intf.c 2018-05-31 10:28:43.202727021 +0200 -@@ -1,11 +1,5 @@ - #include - --#if PY_VERSION_HEX < 0x02050000 --typedef int Py_ssize_t; --#define PY_SSIZE_T_MAX INT_MAX --#define PY_SSIZE_T_MIN INT_MIN --#endif -- - #include - #include - #include -@@ -978,8 +972,40 @@ py_netsnmp_attr_string(PyObject *obj, ch - if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { -+ *val = PyUnicode_AsUTF8AndSize(attr, len); -+ Py_DECREF(attr); -+ return 0; -+ } -+ } -+ -+ return -1; -+} -+ -+static int -+py_netsnmp_attr_set_bytes(PyObject *obj, char *attr_name, -+ char *val, size_t len) -+{ -+ int ret = -1; -+ if (obj && attr_name) { -+ PyObject* val_obj = (val ? -+ PyBytes_FromStringAndSize(val, len) : -+ Py_BuildValue("")); -+ ret = PyObject_SetAttrString(obj, attr_name, val_obj); -+ Py_DECREF(val_obj); -+ } -+ return ret; -+} -+ -+static int -+py_netsnmp_attr_bytes(PyObject *obj, char * attr_name, char **val, -+ Py_ssize_t *len) -+{ -+ *val = NULL; -+ if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { -+ PyObject *attr = PyObject_GetAttrString(obj, attr_name); -+ if (attr) { - int retval; -- retval = PyString_AsStringAndSize(attr, val, len); -+ retval = PyBytes_AsStringAndSize(attr, val, len); - Py_DECREF(attr); - return retval; - } -@@ -996,7 +1022,7 @@ py_netsnmp_attr_long(PyObject *obj, char - if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { -- val = PyInt_AsLong(attr); -+ val = PyLong_AsLong(attr); - Py_DECREF(attr); - } - } -@@ -1079,11 +1105,11 @@ __py_netsnmp_update_session_errors(PyObj - - py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str)); - -- tmp_for_conversion = PyInt_FromLong(err_num); -+ tmp_for_conversion = PyLong_FromLong(err_num); - PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion); - Py_DECREF(tmp_for_conversion); - -- tmp_for_conversion = PyInt_FromLong(err_ind); -+ tmp_for_conversion = PyLong_FromLong(err_ind); - PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion); - Py_DECREF(tmp_for_conversion); - } -@@ -1588,7 +1614,7 @@ netsnmp_get(PyObject *self, PyObject *ar - len = __snprint_value((char *) str_buf, sizeof(str_buf), - vars, tp, type, sprintval_flag); - str_buf[len] = '\0'; -- py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, len); -+ py_netsnmp_attr_set_bytes(varbind, "val", (char *) str_buf, len); - - /* save in return tuple as well */ - if ((type == SNMP_ENDOFMIBVIEW) || -@@ -1808,7 +1834,7 @@ netsnmp_getnext(PyObject *self, PyObject - vars, tp, type, sprintval_flag); - str_buf[len] = '\0'; - -- py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, len); -+ py_netsnmp_attr_set_bytes(varbind, "val", (char *) str_buf, len); - - /* save in return tuple as well */ - if ((type == SNMP_ENDOFMIBVIEW) || -@@ -2138,7 +2164,7 @@ netsnmp_walk(PyObject *self, PyObject *a - vars,tp,type,sprintval_flag); - str_buf[len] = '\0'; - -- py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, -+ py_netsnmp_attr_set_bytes(varbind, "val", (char *) str_buf, - len); - - /* push the varbind onto the return varbinds */ -@@ -2386,7 +2412,7 @@ netsnmp_getbulk(PyObject *self, PyObject - - __get_type_str(type, type_str); - -- py_netsnmp_attr_set_string(varbind, "type", type_str, -+ py_netsnmp_attr_set_bytes(varbind, "type", type_str, - strlen(type_str)); - - len = __snprint_value((char *) str_buf, sizeof(str_buf), -@@ -2527,7 +2553,7 @@ netsnmp_set(PyObject *self, PyObject *ar - } - } - -- if (py_netsnmp_attr_string(varbind, "val", &val, &tmplen) < 0) { -+ if (py_netsnmp_attr_bytes(varbind, "val", &val, &tmplen) < 0) { - snmp_free_pdu(pdu); - goto done; - } -@@ -2607,10 +2633,23 @@ static PyMethodDef ClientMethods[] = { - {NULL, NULL, 0, NULL} /* Sentinel */ - }; - -+static struct PyModuleDef ModuleDefinition = { -+ PyModuleDef_HEAD_INIT, -+ "client_intf", -+ NULL, -+ -1, -+ ClientMethods, -+ NULL, -+ NULL, -+ NULL, -+ NULL -+}; -+ - PyMODINIT_FUNC --initclient_intf(void) -+PyInit_client_intf(void) - { -- (void) Py_InitModule("client_intf", ClientMethods); -+ PyObject *module = PyModule_Create(&ModuleDefinition); -+ return module; - } - - -diff -urNp old/python/netsnmp/client.py new/python/netsnmp/client.py ---- old/python/netsnmp/client.py 2018-05-29 08:27:03.390448765 +0200 -+++ new/python/netsnmp/client.py 2018-05-31 09:27:03.964289879 +0200 -@@ -1,8 +1,8 @@ --import client_intf - import string - import re - import types - from sys import stderr -+from netsnmp import client_intf - - # control verbosity of error output - verbose = 1 -@@ -35,12 +35,12 @@ def _parse_session_args(kargs): - 'TheirHostname':'', - 'TrustCert':'' - } -- keys = kargs.keys() -+ keys = list(kargs.keys()) - for key in keys: -- if sessArgs.has_key(key): -+ if key in sessArgs: - sessArgs[key] = kargs[key] - else: -- print >>stderr, "ERROR: unknown key", key -+ print("ERROR: unknown key", key, file=stderr) - return sessArgs - - def STR(obj): -@@ -53,7 +53,7 @@ class Varbind(object): - def __init__(self, tag=None, iid=None, val=None, type=None): - self.tag = STR(tag) - self.iid = STR(iid) -- self.val = STR(val) -+ self.val = val - self.type = STR(type) - # parse iid out of tag if needed - if iid == None and tag != None: -@@ -63,7 +63,10 @@ class Varbind(object): - (self.tag, self.iid) = match.group(1,2) - - def __setattr__(self, name, val): -- self.__dict__[name] = STR(val) -+ if name == 'val': -+ self.__dict__[name] = val -+ else: -+ self.__dict__[name] = STR(val) - - def print_str(self): - return self.tag, self.iid, self.val, self.type -@@ -127,7 +130,7 @@ class Session(object): - - sess_args = _parse_session_args(args) - -- for k,v in sess_args.items(): -+ for k,v in list(sess_args.items()): - self.__dict__[k] = v - - -diff -urNp old/python/netsnmp/__init__.py new/python/netsnmp/__init__.py ---- old/python/netsnmp/__init__.py 2018-05-29 08:27:03.390448765 +0200 -+++ new/python/netsnmp/__init__.py 2018-05-29 08:27:15.362394659 +0200 -@@ -1 +1 @@ --from client import * -+from .client import * -diff -urNp old/python/netsnmp/tests/test.py new/python/netsnmp/tests/test.py ---- old/python/netsnmp/tests/test.py 2018-05-29 08:27:03.390448765 +0200 -+++ new/python/netsnmp/tests/test.py 2018-05-29 08:27:15.363394655 +0200 -@@ -8,7 +8,7 @@ import time - - class BasicTests(unittest.TestCase): - def testFuncs(self): -- print "" -+ print ("") - var = netsnmp.Varbind('sysDescr.0') - var = netsnmp.Varbind('sysDescr','0') - var = netsnmp.Varbind( -@@ -19,67 +19,67 @@ class BasicTests(unittest.TestCase): - - var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0') - -- print "---v1 GET tests -------------------------------------\n" -+ print ("---v1 GET tests -------------------------------------\n") - res = netsnmp.snmpget(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpget result: ", res, "\n" -+ print(("v1 snmpget result: ", res, "\n")) - -- print "v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(("v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v1 GETNEXT tests-------------------------------------\n" -+ print ("---v1 GETNEXT tests-------------------------------------\n") - res = netsnmp.snmpgetnext(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpgetnext result: ", res, "\n" -+ print(("v1 snmpgetnext result: ", res, "\n")) - -- print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v1 SET tests-------------------------------------\n" -+ print ("---v1 SET tests-------------------------------------\n") - var = netsnmp.Varbind('sysLocation','0', 'my new location') - res = netsnmp.snmpset(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpset result: ", res, "\n" -+ print(("v1 snmpset result: ", res, "\n")) - -- print "v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(("v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v1 walk tests-------------------------------------\n" -+ print ("---v1 walk tests-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - -- print "v1 varlist walk in: " -+ print ("v1 varlist walk in: ") - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((" ",var.tag, var.iid, "=", var.val, '(',var.type,')')) - - res = netsnmp.snmpwalk(vars, - Version = 1, - DestHost='localhost', - Community='public') -- print "v1 snmpwalk result: ", res, "\n" -+ print(("v1 snmpwalk result: ", res, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) - - -- print "---v1 walk 2-------------------------------------\n" -+ print ("---v1 walk 2-------------------------------------\n") - -- print "v1 varbind walk in: " -+ print ("v1 varbind walk in: ") - var = netsnmp.Varbind('system') - res = netsnmp.snmpwalk(var, - Version = 1, - DestHost='localhost', - Community='public') -- print "v1 snmpwalk result (should be = orig): ", res, "\n" -+ print(("v1 snmpwalk result (should be = orig): ", res, "\n")) - -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v1 multi-varbind test-------------------------------------\n" -+ print ("---v1 multi-varbind test-------------------------------------\n") - sess = netsnmp.Session(Version=1, - DestHost='localhost', - Community='public') -@@ -88,16 +88,16 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(vars) -- print "v1 sess.get result: ", vals, "\n" -+ print(("v1 sess.get result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) - - vals = sess.getnext(vars) -- print "v1 sess.getnext result: ", vals, "\n" -+ print(("v1 sess.getnext result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -106,28 +106,28 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v1 sess.getbulk result: ", vals, "\n" -+ print(("v1 sess.getbulk result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v1 set2-------------------------------------\n" -+ print ("---v1 set2-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation', '0', 'my newer location')) - res = sess.set(vars) -- print "v1 sess.set result: ", res, "\n" -+ print(("v1 sess.set result: ", res, "\n")) - -- print "---v1 walk3-------------------------------------\n" -+ print ("---v1 walk3-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v1 sess.walk result: ", vals, "\n" -+ print(("v1 sess.walk result: ", vals, "\n")) - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((" ",var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v2c get-------------------------------------\n" -+ print ("---v2c get-------------------------------------\n") - - sess = netsnmp.Session(Version=2, - DestHost='localhost', -@@ -140,22 +140,22 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(vars) -- print "v2 sess.get result: ", vals, "\n" -+ print(("v2 sess.get result: ", vals, "\n")) - -- print "---v2c getnext-------------------------------------\n" -+ print ("---v2c getnext-------------------------------------\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - - vals = sess.getnext(vars) -- print "v2 sess.getnext result: ", vals, "\n" -+ print(("v2 sess.getnext result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - -- print "---v2c getbulk-------------------------------------\n" -+ print ("---v2c getbulk-------------------------------------\n") - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -164,30 +164,30 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v2 sess.getbulk result: ", vals, "\n" -+ print(("v2 sess.getbulk result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - -- print "---v2c set-------------------------------------\n" -+ print ("---v2c set-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation','0','my even newer location')) - - res = sess.set(vars) -- print "v2 sess.set result: ", res, "\n" -+ print(("v2 sess.set result: ", res, "\n")) - -- print "---v2c walk-------------------------------------\n" -+ print ("---v2c walk-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v2 sess.walk result: ", vals, "\n" -+ print(("v2 sess.walk result: ", vals, "\n")) - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((" ",var.tag, var.iid, "=", var.val, '(',var.type,')')) - -- print "---v3 setup-------------------------------------\n" -+ print ("---v3 setup-------------------------------------\n") - sess = netsnmp.Session(Version=3, - DestHost='localhost', - SecLevel='authPriv', -@@ -200,22 +200,22 @@ class BasicTests(unittest.TestCase): - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) -- print "---v3 get-------------------------------------\n" -+ print ("---v3 get-------------------------------------\n") - vals = sess.get(vars) -- print "v3 sess.get result: ", vals, "\n" -+ print(("v3 sess.get result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - -- print "---v3 getnext-------------------------------------\n" -+ print ("---v3 getnext-------------------------------------\n") - - vals = sess.getnext(vars) -- print "v3 sess.getnext result: ", vals, "\n" -+ print(("v3 sess.getnext result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -224,37 +224,37 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v3 sess.getbulk result: ", vals, "\n" -+ print(("v3 sess.getbulk result: ", vals, "\n")) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - -- print "---v3 set-------------------------------------\n" -+ print ("---v3 set-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation','0', 'my final destination')) - res = sess.set(vars) -- print "v3 sess.set result: ", res, "\n" -+ print(("v3 sess.set result: ", res, "\n")) - -- print "---v3 walk-------------------------------------\n" -+ print ("---v3 walk-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v3 sess.walk result: ", vals, "\n" -+ print(("v3 sess.walk result: ", vals, "\n")) - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print((" ",var.tag, var.iid, "=", var.val, '(',var.type,')')) - - - class SetTests(unittest.TestCase): - def testFuncs(self): -- print "\n-------------- SET Test Start ----------------------------\n" -+ print ("\n-------------- SET Test Start ----------------------------\n") - - var = netsnmp.Varbind('sysUpTime','0') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "uptime = ", res[0] -+ print(("uptime = ", res[0])) - - - var = netsnmp.Varbind('versionRestartAgent','0', 1) -@@ -264,19 +264,19 @@ class SetTests(unittest.TestCase): - var = netsnmp.Varbind('sysUpTime','0') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "uptime = ", res[0] -+ print(("uptime = ", res[0])) - - var = netsnmp.Varbind('nsCacheEntry') - res = netsnmp.snmpgetnext(var, Version = 1, DestHost='localhost', - Community='public') -- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')')) - - var.val = 65 - res = netsnmp.snmpset(var, Version = 1, DestHost='localhost', - Community='public') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')')) - - sess = netsnmp.Session(Version = 1, DestHost='localhost', - Community='public') -@@ -286,7 +286,7 @@ class SetTests(unittest.TestCase): - netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4)) - res = sess.set(vars) - -- print "res = ", res -+ print(("res = ", res)) - - vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), - netsnmp.Varbind('snmpTargetAddrTAddress'), -@@ -295,14 +295,14 @@ class SetTests(unittest.TestCase): - res = sess.getnext(vars) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - - vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 6)) - - res = sess.set(vars) - -- print "res = ", res -+ print(("res = ", res)) - - vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), - netsnmp.Varbind('snmpTargetAddrTAddress'), -@@ -311,10 +311,10 @@ class SetTests(unittest.TestCase): - res = sess.getnext(vars) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print((var.tag, var.iid, "=", var.val, '(',var.type,')')) -+ print ("\n") - -- print "\n-------------- SET Test End ----------------------------\n" -+ print ("\n-------------- SET Test End ----------------------------\n") - - - if __name__=='__main__': -diff -urNp old/python/setup.py new/python/setup.py ---- old/python/setup.py 2018-05-29 08:27:03.389448770 +0200 -+++ new/python/setup.py 2018-05-29 08:27:15.362394659 +0200 -@@ -9,9 +9,9 @@ intree=0 - - args = sys.argv[:] - for arg in args: -- if string.find(arg,'--basedir=') == 0: -- basedir = string.split(arg,'=')[1] -- sys.argv.remove(arg) -+ if arg.find('--basedir=') == 0: -+ basedir = arg.split('=')[1] -+ sys.argv.remove(arg) - intree=1 - - if intree: diff --git a/net-snmp-5.7.3-strstr.patch b/net-snmp-5.7.3-strstr.patch deleted file mode 100644 index 82c4c57..0000000 --- a/net-snmp-5.7.3-strstr.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -urNp old/agent/mibgroup/host/data_access/swinst_rpm.c new/agent/mibgroup/host/data_access/swinst_rpm.c ---- old/agent/mibgroup/host/data_access/swinst_rpm.c 2012-10-10 00:28:58.000000000 +0200 -+++ new/agent/mibgroup/host/data_access/swinst_rpm.c 2017-03-23 13:39:44.695386498 +0100 -@@ -129,7 +129,7 @@ netsnmp_swinst_arch_load( netsnmp_contai - "%s-%s-%s", n, v, r); - if (entry->swName_len > sizeof(entry->swName)) - entry->swName_len = sizeof(entry->swName); -- entry->swType = (NULL != strstr( g, "System Environment")) -+ entry->swType = (g != NULL && NULL != strstr( g, "System Environment")) - ? 2 /* operatingSystem */ - : 4; /* application */ - - diff --git a/net-snmp-5.8-aes-config.patch b/net-snmp-5.8-aes-config.patch deleted file mode 100644 index a1ce69c..0000000 --- a/net-snmp-5.8-aes-config.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 0be093688013b90896f2db3204bb20e790d70149 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Mon, 27 Apr 2020 08:23:16 -0700 -Subject: [PATCH] configure: Report supported authentication and encryption - modes correctly - -Commit 9e49de2e03b1 ("NEWS: snmplib: AES-192/AES-256 compatibility with SNMP -Research / CISCO") removed SHA-128 and SHA-192 support and added support for -SHA-224, SHA-256, SHA-384 and SHA-512. Commit 329a9d3c9d63 ("revamp auth/priv -protocol constants handling") added support for several AES encryption modes. -Make the configure script report which modes are supported. ---- - configure | 15 ++++++++++++++- - configure.d/config_os_misc2 | 15 ++++++++++++++- - 2 files changed, 28 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index 46402589f..7481ebd07 100755 ---- a/configure -+++ b/configure -@@ -26453,7 +26453,13 @@ $as_echo "#define NETSNMP_USE_INTERNAL_CRYPTO 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Internal Crypto Support" >&5 - $as_echo "Internal Crypto Support" >&6; } - elif test "x$useopenssl" != "xno" ; then -- authmodes="MD5 SHA1 SHA512 SHA384 SHA256 SHA192" -+ authmodes="MD5 SHA1" -+ if test "x$ac_cv_func_EVP_sha224" = xyes; then -+ authmodes="$authmodes SHA224 SHA256" -+ fi -+ if test "x$ac_cv_func_EVP_sha384" = xyes; then -+ authmodes="$authmodes SHA384 SHA512" -+ fi - if test "x$enable_privacy" != "xno" ; then - if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then - encrmodes="DES AES" -@@ -26492,6 +26498,13 @@ fi - if test "x$enable_md5" = "xno"; then - authmodes=`echo $authmodes | $SED 's/MD5 *//;'` - fi -+if test "x$ac_cv_func_AES_cfb128_encrypt" = xyes || -+ test "x$CRYPTO" = xinternal; then -+ encrmodes="$encrmodes AES128" -+ if test "x$aes_capable" = "xyes"; then -+ encrmodes="$encrmodes AES192 AES192C AES256 AES256C" -+ fi -+fi - - - -diff --git a/configure.d/config_os_misc2 b/configure.d/config_os_misc2 -index 1df9bf0a2..be0bccec0 100644 ---- a/configure.d/config_os_misc2 -+++ b/configure.d/config_os_misc2 -@@ -53,7 +53,13 @@ if test "x$CRYPTO" = "xinternal" ; then - AC_DEFINE(NETSNMP_USE_INTERNAL_CRYPTO, 1, "Define if internal cryptography code should be used") - AC_MSG_RESULT(Internal Crypto Support) - elif test "x$useopenssl" != "xno" ; then -- authmodes="MD5 SHA1 SHA512 SHA384 SHA256 SHA192" -+ authmodes="MD5 SHA1" -+ if test "x$ac_cv_func_EVP_sha224" = xyes; then -+ authmodes="$authmodes SHA224 SHA256" -+ fi -+ if test "x$ac_cv_func_EVP_sha384" = xyes; then -+ authmodes="$authmodes SHA384 SHA512" -+ fi - if test "x$enable_privacy" != "xno" ; then - if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then - encrmodes="DES AES" -@@ -86,6 +92,13 @@ fi - if test "x$enable_md5" = "xno"; then - authmodes=`echo $authmodes | $SED 's/MD5 *//;'` - fi -+if test "x$ac_cv_func_AES_cfb128_encrypt" = xyes || -+ test "x$CRYPTO" = xinternal; then -+ encrmodes="$encrmodes AES128" -+ if test "x$aes_capable" = "xyes"; then -+ encrmodes="$encrmodes AES192 AES192C AES256 AES256C" -+ fi -+fi - AC_SUBST(LNETSNMPLIBS) - AC_SUBST(LAGENTLIBS) - - -diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in ---- a/net-snmp-create-v3-user.in 2020-06-15 12:59:05.117432700 +0200 -+++ b/net-snmp-create-v3-user.in 2020-06-15 13:01:36.151905241 +0200 -@@ -58,11 +58,11 @@ case $1 in - exit 1 - fi - case $1 in -- DES|AES|AES128) -+ DES|AES|AES128|AES192|AES256) - Xalgorithm=$1 - shift - ;; -- des|aes|aes128) -+ des|aes|aes128|aes192|aes256) - Xalgorithm=`echo $1 | tr a-z A-Z` - shift - ;; diff --git a/net-snmp-5.8-agent-of-death.patch b/net-snmp-5.8-agent-of-death.patch deleted file mode 100644 index dcafbb1..0000000 --- a/net-snmp-5.8-agent-of-death.patch +++ /dev/null @@ -1,122 +0,0 @@ -diff -urNp a/agent/agent_trap.c b/agent/agent_trap.c ---- a/agent/agent_trap.c 2019-02-13 13:10:36.862269252 +0100 -+++ b/agent/agent_trap.c 2019-02-13 15:02:11.396042356 +0100 -@@ -174,6 +174,11 @@ _trap_version_incr(int version) - case SNMP_VERSION_3: - ++_v2_sessions; - break; -+#ifdef USING_AGENTX_PROTOCOL_MODULE -+ case AGENTX_VERSION_1: -+ /* agentx registers in sinks, no need to count */ -+ break; -+#endif - default: - snmp_log(LOG_ERR, "unknown snmp version %d\n", version); - } -@@ -201,6 +206,11 @@ _trap_version_decr(int version) - _v2_sessions = 0; - } - break; -+#ifdef USING_AGENTX_PROTOCOL_MODULE -+ case AGENTX_VERSION_1: -+ /* agentx registers in sinks, no need to count */ -+ break; -+#endif - default: - snmp_log(LOG_ERR, "unknown snmp version %d\n", version); - } -diff -urNp old/agent/mibgroup/agentx/master.c new/agent/mibgroup/agentx/master.c ---- old/agent/mibgroup/agentx/master.c 2019-04-03 12:13:55.115769783 +0200 -+++ new/agent/mibgroup/agentx/master.c 2019-04-10 09:49:53.277168497 +0200 -@@ -280,6 +280,11 @@ agentx_got_response(int operation, - netsnmp_free_delegated_cache(cache); - return 0; - -+ case NETSNMP_CALLBACK_OP_RESEND: -+ DEBUGMSGTL(("agentx/master", "resend on session %8p req=0x%x\n", -+ session, (unsigned)reqid)); -+ return 0; -+ - case NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE: - /* - * This session is alive -diff -urNp old/snmplib/snmp_api.c new/snmplib/snmp_api.c ---- old/snmplib/snmp_api.c 2019-04-24 00:28:34.904357292 +0200 -+++ new/snmplib/snmp_api.c 2019-04-24 00:24:40.101830685 +0200 -@@ -352,6 +352,7 @@ static int snmpv3_build(u_char ** p - netsnmp_pdu *pdu); - static int snmp_parse_version(u_char *, size_t); - static int snmp_resend_request(struct session_list *slp, -+ netsnmp_request_list *orp, - netsnmp_request_list *rp, - int incr_retries); - static void register_default_handlers(void); -@@ -5717,7 +5718,7 @@ _sess_process_packet_handle_pdu(void *se - * * inifinite resend - */ - if (rp->retries <= sp->retries) { -- snmp_resend_request(slp, rp, TRUE); -+ snmp_resend_request(slp, orp, rp, TRUE); - break; - } else { - /* We're done with retries, so no longer waiting for a response */ -@@ -6662,9 +6663,22 @@ snmp_timeout(void) - snmp_res_unlock(MT_LIBRARY_ID, MT_LIB_SESSION); - } - -+static void -+remove_request(struct snmp_internal_session *isp, -+ netsnmp_request_list *orp, netsnmp_request_list *rp) -+{ -+ if (orp) -+ orp->next_request = rp->next_request; -+ else -+ isp->requests = rp->next_request; -+ if (isp->requestsEnd == rp) -+ isp->requestsEnd = orp; -+ snmp_free_pdu(rp->pdu); -+} -+ - static int --snmp_resend_request(struct session_list *slp, netsnmp_request_list *rp, -- int incr_retries) -+snmp_resend_request(struct session_list *slp, netsnmp_request_list *orp, -+ netsnmp_request_list *rp, int incr_retries) - { - struct snmp_internal_session *isp; - netsnmp_session *sp; -@@ -6731,9 +6745,11 @@ snmp_resend_request(struct session_list - sp->s_snmp_errno = SNMPERR_BAD_SENDTO; - sp->s_errno = errno; - snmp_set_detail(strerror(errno)); -- if (rp->callback) -+ if (rp->callback) { - rp->callback(NETSNMP_CALLBACK_OP_SEND_FAILED, sp, - rp->pdu->reqid, rp->pdu, rp->cb_data); -+ remove_request(isp, orp, rp); -+ } - return -1; - } else { - netsnmp_get_monotonic_clock(&now); -@@ -6813,19 +6829,12 @@ snmp_sess_timeout(void *sessp) - callback(NETSNMP_CALLBACK_OP_TIMED_OUT, sp, - rp->pdu->reqid, rp->pdu, magic); - } -- if (orp) -- orp->next_request = rp->next_request; -- else -- isp->requests = rp->next_request; -- if (isp->requestsEnd == rp) -- isp->requestsEnd = orp; -- snmp_free_pdu(rp->pdu); -+ remove_request(isp, orp, rp); - freeme = rp; - continue; /* don't update orp below */ - } else { -- if (snmp_resend_request(slp, rp, TRUE)) { -+ if (snmp_resend_request(slp, orp, rp, TRUE)) - break; -- } - } - } - orp = rp; diff --git a/net-snmp-5.8-agentx-disconnect-crash.patch b/net-snmp-5.8-agentx-disconnect-crash.patch deleted file mode 100644 index da84313..0000000 --- a/net-snmp-5.8-agentx-disconnect-crash.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urNp a/agent/mibgroup/agentx/master.c b/agent/mibgroup/agentx/master.c ---- a/agent/mibgroup/agentx/master.c 2018-07-18 12:13:49.953014652 +0200 -+++ b/agent/mibgroup/agentx/master.c 2018-07-18 12:20:23.537626773 +0200 -@@ -221,7 +221,7 @@ agentx_got_response(int operation, - /* response is too late, free the cache */ - if (magic) - netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic); -- return 0; -+ return 1; - } - requests = cache->requests; - diff --git a/net-snmp-5.8-autofs-skip.patch b/net-snmp-5.8-autofs-skip.patch deleted file mode 100644 index e6de4f3..0000000 --- a/net-snmp-5.8-autofs-skip.patch +++ /dev/null @@ -1,199 +0,0 @@ -diff -urNp b/agent/mibgroup/hardware/fsys/fsys_mntctl.c net-snmp-5.8/agent/mibgroup/hardware/fsys/fsys_mntctl.c ---- b/agent/mibgroup/hardware/fsys/fsys_mntctl.c 2018-07-18 16:12:20.674499629 +0200 -+++ net-snmp-5.8/agent/mibgroup/hardware/fsys/fsys_mntctl.c 2018-07-18 16:15:46.782859398 +0200 -@@ -43,8 +43,9 @@ _fsys_type( int type) - - case MNT_NFS: - case MNT_NFS3: -- case MNT_AUTOFS: - return NETSNMP_FS_TYPE_NFS; -+ case MNT_AUTOFS: -+ return NETSNMP_FS_TYPE_AUTOFS; - - /* - * The following code covers selected filesystems -@@ -156,10 +157,12 @@ netsnmp_fsys_arch_load( void ) - - /* - * Optionally skip retrieving statistics for remote mounts -+ * AUTOFS is skipped by default - */ -- if ( (entry->flags & NETSNMP_FS_FLAG_REMOTE) && -+ if ( ((entry->flags & NETSNMP_FS_FLAG_REMOTE) && - netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, -- NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) -+ NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) || -+ entry->type == (NETSNMP_FS_TYPE_AUTOFS)) - continue; - - if ( statfs( entry->path, &stat_buf ) < 0 ) { -diff -urNp b/agent/mibgroup/hardware/fsys/fsys_mntent.c net-snmp-5.8/agent/mibgroup/hardware/fsys/fsys_mntent.c ---- b/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-07-18 16:12:20.674499629 +0200 -+++ net-snmp-5.8/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-07-18 16:15:46.782859398 +0200 -@@ -150,6 +150,13 @@ _fsys_type( char *typename ) - !strcmp(typename, MNTTYPE_LOFS)) - return NETSNMP_FS_TYPE_OTHER; - -+ /* Detection of AUTOFS. -+ * This file system will be ignored by default -+ */ -+ else if ( !strcmp(typename, MNTTYPE_AUTOFS)) -+ return NETSNMP_FS_TYPE_AUTOFS; -+ -+ - /* - * All other types are silently skipped - */ -@@ -239,6 +246,10 @@ netsnmp_fsys_arch_load( void ) - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES)) - continue; - -+ /* Skip AUTOFS enteries */ -+ if ( entry->type == (NETSNMP_FS_TYPE_AUTOFS)) -+ continue; -+ - #ifdef irix6 - if ( NSFS_STATFS( entry->path, &stat_buf, sizeof(struct statfs), 0) < 0 ) - #else -diff -urNp b/agent/mibgroup/hardware/fsys/mnttypes.h net-snmp-5.8/agent/mibgroup/hardware/fsys/mnttypes.h ---- b/agent/mibgroup/hardware/fsys/mnttypes.h 2018-07-18 16:12:20.674499629 +0200 -+++ net-snmp-5.8/agent/mibgroup/hardware/fsys/mnttypes.h 2018-07-18 16:15:46.782859398 +0200 -@@ -165,6 +165,9 @@ - #ifndef MNTTYPE_APP - #define MNTTYPE_APP "app" - #endif -+#ifndef MNTTYPE_AUTOFS -+#define MNTTYPE_AUTOFS "autofs" -+#endif - #ifndef MNTTYPE_DEVPTS - #define MNTTYPE_DEVPTS "devpts" - #endif -diff -urNp b/agent/mibgroup/host/hr_filesys.c net-snmp-5.8/agent/mibgroup/host/hr_filesys.c ---- b/agent/mibgroup/host/hr_filesys.c 2018-07-18 16:12:20.668499652 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hr_filesys.c 2018-07-18 16:15:46.783859399 +0200 -@@ -834,6 +834,27 @@ Check_HR_FileSys_NFS (void) - return 0; /* no NFS file system */ - } - -+/* This function checks whether current file system is an AutoFs -+ * HRFS_entry must be valid prior to calling this function -+ * return 1 if AutoFs, 0 otherwise -+ */ -+int -+Check_HR_FileSys_AutoFs (void) -+{ -+#if HAVE_GETFSSTAT -+ if ( HRFS_entry->HRFS_type != NULL && -+#if defined(MNTTYPE_AUTOFS) -+ !strcmp( HRFS_entry->HRFS_type, MNTTYPE_AUTOFS) -+#else -+ !strcmp( HRFS_entry->HRFS_type, "autofs") -+#endif -+ ) -+#endif /* HAVE_GETFSSTAT */ -+ return 1; /* AUTOFS */ -+ -+ return 0; /* no AUTOFS */ -+} -+ - void - End_HR_FileSys(void) - { -diff -urNp b/agent/mibgroup/host/hr_filesys.h net-snmp-5.8/agent/mibgroup/host/hr_filesys.h ---- b/agent/mibgroup/host/hr_filesys.h 2018-07-18 16:12:20.669499648 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hr_filesys.h 2018-07-18 16:15:46.784859400 +0200 -@@ -10,6 +10,7 @@ extern void Init_HR_FileSys(void); - extern FindVarMethod var_hrfilesys; - extern int Get_Next_HR_FileSys(void); - extern int Check_HR_FileSys_NFS(void); -+extern int Check_HR_FileSys_AutoFs(void); - - extern int Get_FSIndex(char *); - extern long Get_FSSize(char *); /* Temporary */ -diff -urNp b/agent/mibgroup/host/hrh_filesys.c net-snmp-5.8/agent/mibgroup/host/hrh_filesys.c ---- b/agent/mibgroup/host/hrh_filesys.c 2018-07-18 16:12:20.668499652 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hrh_filesys.c 2018-07-18 16:15:46.785859402 +0200 -@@ -429,3 +429,9 @@ Check_HR_FileSys_NFS (void) - { - return (HRFS_entry->flags & NETSNMP_FS_FLAG_REMOTE) ? 1 : 0; - } -+ -+int -+Check_HR_FileSys_AutoFs (void) -+{ -+ return (HRFS_entry->type == (NETSNMP_FS_TYPE_AUTOFS)) ? 1 : 0; -+} -diff -urNp b/agent/mibgroup/host/hrh_filesys.h net-snmp-5.8/agent/mibgroup/host/hrh_filesys.h ---- b/agent/mibgroup/host/hrh_filesys.h 2018-07-18 16:12:20.669499648 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hrh_filesys.h 2018-07-18 16:15:46.785859402 +0200 -@@ -10,6 +10,7 @@ extern void Init_HR_FileSys(void); - extern FindVarMethod var_hrhfilesys; - extern int Get_Next_HR_FileSys(void); - extern int Check_HR_FileSys_NFS(void); -+extern int Check_HR_FileSys_AutoFs(void); - - extern int Get_FSIndex(char *); - extern long Get_FSSize(char *); /* Temporary */ -diff -urNp b/agent/mibgroup/host/hrh_storage.c net-snmp-5.8/agent/mibgroup/host/hrh_storage.c ---- b/agent/mibgroup/host/hrh_storage.c 2018-07-18 16:12:20.668499652 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hrh_storage.c 2018-07-18 16:15:46.786859402 +0200 -@@ -367,9 +367,10 @@ really_try_next: - store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; - if (HRFS_entry && - store_idx > NETSNMP_MEM_TYPE_MAX && -- netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, -+ ((netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS()) -+ Check_HR_FileSys_NFS()) || -+ Check_HR_FileSys_AutoFs())) - return NULL; - if (store_idx <= NETSNMP_MEM_TYPE_MAX ) { - mem = (netsnmp_memory_info*)ptr; -@@ -508,7 +509,8 @@ Get_Next_HR_Store(void) - if (HRS_index >= 0) { - if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS())) { -+ Check_HR_FileSys_NFS()) && -+ !Check_HR_FileSys_AutoFs()) { - return HRS_index + NETSNMP_MEM_TYPE_MAX; - } - } else { -diff -urNp b/agent/mibgroup/host/hr_storage.c net-snmp-5.8/agent/mibgroup/host/hr_storage.c ---- b/agent/mibgroup/host/hr_storage.c 2018-07-18 16:12:20.670499644 +0200 -+++ net-snmp-5.8/agent/mibgroup/host/hr_storage.c 2018-07-18 16:15:46.786859402 +0200 -@@ -540,9 +540,10 @@ really_try_next: - - store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; - if (store_idx > NETSNMP_MEM_TYPE_MAX ) { -- if ( netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, -+ if ( (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS()) -+ Check_HR_FileSys_NFS()) || -+ Check_HR_FileSys_AutoFs()) - return NULL; /* or goto try_next; */ - if (HRFS_statfs(HRFS_entry->HRFS_mount, &stat_buf) < 0) { - snmp_log_perror(HRFS_entry->HRFS_mount); -@@ -683,7 +684,8 @@ Get_Next_HR_Store(void) - if (HRS_index >= 0) { - if (!(netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS())) { -+ Check_HR_FileSys_NFS()) && -+ !Check_HR_FileSys_AutoFs()) { - return HRS_index + NETSNMP_MEM_TYPE_MAX; - } - } else { -diff -urNp b/include/net-snmp/agent/hardware/fsys.h net-snmp-5.8/include/net-snmp/agent/hardware/fsys.h ---- b/include/net-snmp/agent/hardware/fsys.h 2018-07-18 16:12:20.649499726 +0200 -+++ net-snmp-5.8/include/net-snmp/agent/hardware/fsys.h 2018-07-18 16:19:33.994918912 +0200 -@@ -41,6 +41,7 @@ typedef struct netsnmp_fsys_info_s netsn - #define NETSNMP_FS_TYPE_SYSFS (4 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT) - #define NETSNMP_FS_TYPE_TMPFS (5 | _NETSNMP_FS_TYPE_LOCAL) - #define NETSNMP_FS_TYPE_USBFS (6 | _NETSNMP_FS_TYPE_LOCAL) -+#define NETSNMP_FS_TYPE_AUTOFS (7 | _NETSNMP_FS_TYPE_LOCAL | _NETSNMP_FS_TYPE_SKIP_BIT) - - #define NETSNMP_FS_FLAG_ACTIVE 0x01 - #define NETSNMP_FS_FLAG_REMOTE 0x02 diff --git a/net-snmp-5.8-cflags.patch b/net-snmp-5.8-cflags.patch deleted file mode 100644 index 1809726..0000000 --- a/net-snmp-5.8-cflags.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff -urNp a/net-snmp-config.in b/net-snmp-config.in ---- a/net-snmp-config.in 2018-07-18 13:43:12.264426052 +0200 -+++ b/net-snmp-config.in 2018-07-18 13:52:06.917089518 +0200 -@@ -140,10 +140,10 @@ else - ;; - #################################################### compile - --base-cflags) -- echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR} -+ echo -I${NSC_INCLUDEDIR} - ;; - --cflags|--cf*) -- echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} -+ echo @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} - ;; - --srcdir) - echo $NSC_SRCDIR -diff -urNp a/perl/agent/default_store/Makefile.PL b/perl/agent/default_store/Makefile.PL ---- a/perl/agent/default_store/Makefile.PL 2018-07-18 13:43:12.170426290 +0200 -+++ b/perl/agent/default_store/Makefile.PL 2018-07-18 13:51:31.812176486 +0200 -@@ -83,7 +83,7 @@ sub AgentDefaultStoreInitMakeParams { - " " . $Params{'LIBS'}; - $Params{'CCFLAGS'} = "-I../../../include " . $Params{'CCFLAGS'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/agent/Makefile.PL b/perl/agent/Makefile.PL ---- a/perl/agent/Makefile.PL 2018-07-18 13:43:12.169426292 +0200 -+++ b/perl/agent/Makefile.PL 2018-07-18 13:52:53.884973275 +0200 -@@ -98,7 +98,7 @@ sub AgentInitMakeParams { - $Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . $Params{'LIBS'}; - # $Params{'PREREQ_PM'} = {'NetSNMP::OID' => '0.1'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/agent/Support/Makefile.PL b/perl/agent/Support/Makefile.PL ---- a/perl/agent/Support/Makefile.PL 2018-07-18 13:43:12.169426292 +0200 -+++ b/perl/agent/Support/Makefile.PL 2018-07-18 13:53:11.414929921 +0200 -@@ -90,7 +90,7 @@ sub SupportInitMakeParams { - " " . $Params{'LIBS'}; - $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/ASN/Makefile.PL b/perl/ASN/Makefile.PL ---- a/perl/ASN/Makefile.PL 2018-07-18 13:43:12.171426287 +0200 -+++ b/perl/ASN/Makefile.PL 2018-07-18 13:53:46.652842822 +0200 -@@ -93,7 +93,7 @@ sub AsnInitMakeParams { - " " . $Params{'LIBS'}; - $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/default_store/Makefile.PL b/perl/default_store/Makefile.PL ---- a/perl/default_store/Makefile.PL 2018-07-18 13:43:12.175426277 +0200 -+++ b/perl/default_store/Makefile.PL 2018-07-18 13:54:20.814758441 +0200 -@@ -83,7 +83,7 @@ sub DefaultStoreInitMakeParams { - " " . $Params{'LIBS'}; - $Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/OID/Makefile.PL b/perl/OID/Makefile.PL ---- a/perl/OID/Makefile.PL 2018-07-18 13:43:12.175426277 +0200 -+++ b/perl/OID/Makefile.PL 2018-07-18 13:54:43.348702811 +0200 -@@ -90,7 +90,7 @@ sub OidInitMakeParams { - # } else { - # $Params{'PREREQ_PM'} = {'SNMP' => '5.0'}; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; -diff -urNp a/perl/SNMP/Makefile.PL b/perl/SNMP/Makefile.PL ---- a/perl/SNMP/Makefile.PL 2018-07-18 13:43:12.173426282 +0200 -+++ b/perl/SNMP/Makefile.PL 2018-07-18 13:55:07.220643903 +0200 -@@ -103,7 +103,7 @@ sub SnmpInitMakeParams { - # } else { - # $Params{'PREREQ_PM'} = { 'NetSNMP::default_store' => 0.01 }; - } -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if (!$ENV{'NETSNMP_PREFIX'}) { - $prefix = `$opts->{'nsconfig'} --prefix`; -diff -urNp a/perl/TrapReceiver/Makefile.PL b/perl/TrapReceiver/Makefile.PL ---- a/perl/TrapReceiver/Makefile.PL 2018-07-18 13:43:12.172426285 +0200 -+++ b/perl/TrapReceiver/Makefile.PL 2018-07-18 13:55:43.100647233 +0200 -@@ -132,7 +132,7 @@ sub TrapReceiverInitMakeParams { - $Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . " $Params{'LIBS'}"; - } - -- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings -+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings - $Params{'CCFLAGS'} .= ' -Wformat'; - if ($Params{'CCFLAGS'} eq "") { - die "You need to install net-snmp first (I can't find net-snmp-config)"; diff --git a/net-snmp-5.8-coverity.patch b/net-snmp-5.8-coverity.patch deleted file mode 100644 index 4d41b31..0000000 --- a/net-snmp-5.8-coverity.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff -urNp a/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c ---- a/agent/mibgroup/disman/event/mteTrigger.c 2018-09-27 10:43:38.722444233 +0200 -+++ b/agent/mibgroup/disman/event/mteTrigger.c 2018-09-27 11:01:46.503253963 +0200 -@@ -1012,7 +1012,7 @@ mteTrigger_run( unsigned int reg, void * - * Similarly, if no fallEvent is configured, - * there's no point in trying to fire it either. - */ -- if (entry->mteTThRiseEvent[0] != '\0' ) { -+ if (entry->mteTThFallEvent[0] != '\0' ) { - entry->mteTriggerXOwner = entry->mteTThObjOwner; - entry->mteTriggerXObjects = entry->mteTThObjects; - entry->mteTriggerFired = vp1; -@@ -1105,7 +1105,7 @@ mteTrigger_run( unsigned int reg, void * - * Similarly, if no fallEvent is configured, - * there's no point in trying to fire it either. - */ -- if (entry->mteTThDRiseEvent[0] != '\0' ) { -+ if (entry->mteTThDFallEvent[0] != '\0' ) { - entry->mteTriggerXOwner = entry->mteTThObjOwner; - entry->mteTriggerXObjects = entry->mteTThObjects; - entry->mteTriggerFired = vp1; -diff -urNp a/agent/mibgroup/hardware/cpu/cpu_linux.c b/agent/mibgroup/hardware/cpu/cpu_linux.c ---- a/agent/mibgroup/hardware/cpu/cpu_linux.c 2018-09-27 10:43:38.697444449 +0200 -+++ b/agent/mibgroup/hardware/cpu/cpu_linux.c 2018-09-27 11:12:07.109024625 +0200 -@@ -122,6 +122,7 @@ int netsnmp_cpu_arch_load( netsnmp_cache - bsize = getpagesize()-1; - buff = (char*)malloc(bsize+1); - if (buff == NULL) { -+ close(statfd); - return -1; - } - } -diff -urNp a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c 2018-09-27 10:43:38.711444328 +0200 -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c 2018-09-27 11:16:45.532231535 +0200 -@@ -543,15 +543,18 @@ netsnmp_access_ipaddress_extra_prefix_in - status = send (sd, &req, req.nlhdr.nlmsg_len, 0); - if (status < 0) { - snmp_log(LOG_ERR, "could not send netlink request\n"); -+ close(sd); - return -1; - } - status = recv (sd, buf, sizeof(buf), 0); - if (status < 0) { - snmp_log (LOG_ERR, "could not recieve netlink request\n"); -+ close(sd); - return -1; - } - if (status == 0) { - snmp_log (LOG_ERR, "nothing to read\n"); -+ close(sd); - return -1; - } - for (nlmp = (struct nlmsghdr *)buf; status > sizeof(*nlmp); ){ -@@ -561,11 +564,13 @@ netsnmp_access_ipaddress_extra_prefix_in - - if (req_len < 0 || len > status) { - snmp_log (LOG_ERR, "invalid netlink message\n"); -+ close(sd); - return -1; - } - - if (!NLMSG_OK (nlmp, status)) { - snmp_log (LOG_ERR, "invalid NLMSG message\n"); -+ close(sd); - return -1; - } - rtmp = (struct ifaddrmsg *)NLMSG_DATA(nlmp); diff --git a/net-snmp-5.8-dir-fix.patch b/net-snmp-5.8-dir-fix.patch deleted file mode 100644 index 2c47d52..0000000 --- a/net-snmp-5.8-dir-fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in ---- a/net-snmp-create-v3-user.in 2018-07-18 11:11:53.227015237 +0200 -+++ b/net-snmp-create-v3-user.in 2018-07-18 11:12:13.375010176 +0200 -@@ -137,7 +137,7 @@ fi - echo $line >> $outfile - prefix="@prefix@" - datarootdir="@datarootdir@" --outfile="@datadir@/snmp/snmpd.conf" -+outfile="/etc/snmp/snmpd.conf" - line="$token $user" - echo "adding the following line to $outfile:" - echo " " $line diff --git a/net-snmp-5.8-flood-messages.patch b/net-snmp-5.8-flood-messages.patch deleted file mode 100644 index 49e8e44..0000000 --- a/net-snmp-5.8-flood-messages.patch +++ /dev/null @@ -1,26 +0,0 @@ -From cd09fd82522861830aaf9d237b26eef5f9ba50d2 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Wed, 21 Nov 2018 20:47:42 -0800 -Subject: [PATCH] MIB-II: Only log once that opening /proc/net/if_inet6 failed - -If IPv6 has been disabled (ipv6.disable=1) then opening /proc/net/if_inet6 -fails. Only log this once instead of thousand of times a day. - -Reported-by: Fif ---- - agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -index 5ddead3e0..280575ce3 100644 ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c -@@ -234,7 +234,7 @@ _load_v6(netsnmp_container *container, int idx_offset) - - #define PROCFILE "/proc/net/if_inet6" - if (!(in = fopen(PROCFILE, "r"))) { -- snmp_log_perror("ipaddress_linux: could not open " PROCFILE); -+ NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE)); - return -2; - } - diff --git a/net-snmp-5.8-ipv6-clientaddr.patch b/net-snmp-5.8-ipv6-clientaddr.patch deleted file mode 100644 index b8cadcf..0000000 --- a/net-snmp-5.8-ipv6-clientaddr.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urNp a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c ---- a/snmplib/transports/snmpUDPIPv6Domain.c 2019-01-24 09:03:05.606441678 +0100 -+++ b/snmplib/transports/snmpUDPIPv6Domain.c 2019-02-07 08:59:26.434587244 +0100 -@@ -464,7 +464,7 @@ netsnmp_udp6_transport(const struct sock - NETSNMP_DS_LIB_CLIENT_ADDR); - if (client_socket) { - struct sockaddr_in6 client_addr; -- if(!netsnmp_sockaddr_in6_2(&client_addr, client_socket, NULL)) { -+ if(netsnmp_sockaddr_in6_2(&client_addr, client_socket, NULL)) { - return netsnmp_udp6_transport_with_source(addr, local, - &client_addr); - } diff --git a/net-snmp-5.8-key-leak-backport.patch b/net-snmp-5.8-key-leak-backport.patch deleted file mode 100644 index 8f04b48..0000000 --- a/net-snmp-5.8-key-leak-backport.patch +++ /dev/null @@ -1,56 +0,0 @@ -diff -urNp a/snmplib/keytools.c b/snmplib/keytools.c ---- a/snmplib/keytools.c 2018-11-27 15:04:59.931217024 +0100 -+++ b/snmplib/keytools.c 2018-11-27 15:07:50.765672477 +0100 -@@ -187,25 +187,25 @@ generate_Ku(const oid * hashtype, u_int - #else - ctx = malloc(sizeof(*ctx)); - if (!EVP_MD_CTX_init(ctx)) -- return SNMPERR_GENERR; -+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); - #endif - if (!EVP_DigestInit(ctx, hashfn)) -- return SNMPERR_GENERR; -+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); - - #elif NETSNMP_USE_INTERNAL_CRYPTO - #ifndef NETSNMP_DISABLE_MD5 - if (NETSNMP_USMAUTH_HMACMD5 == auth_type) { - if (!MD5_Init(&cmd5)) -- return SNMPERR_GENERR; -+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); - cryptotype = TYPE_MD5; - } else - #endif - if (NETSNMP_USMAUTH_HMACSHA1 == auth_type) { - if (!SHA1_Init(&csha1)) -- return SNMPERR_GENERR; -+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); - cryptotype = TYPE_SHA1; - } else { -- return (SNMPERR_GENERR); -+ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); - } - #else - MDbegin(&MD); -diff -urNp a/snmplib/scapi.c b/snmplib/scapi.c ---- a/snmplib/scapi.c 2018-11-27 15:04:59.931217024 +0100 -+++ b/snmplib/scapi.c 2018-11-27 15:14:37.587393891 +0100 -@@ -967,7 +967,8 @@ sc_hash_type(int auth_type, const u_char - #endif - if (!EVP_DigestInit(cptr, hashfn)) { - /* requested hash function is not available */ -- return SNMPERR_SC_NOT_CONFIGURED; -+ rval = SNMPERR_SC_NOT_CONFIGURED; -+ goto sc_hash_type_quit; - } - - /** pass the data */ -@@ -976,6 +977,8 @@ sc_hash_type(int auth_type, const u_char - /** do the final pass */ - EVP_DigestFinal(cptr, MAC, &tmp_len); - *MAC_len = tmp_len; -+ -+sc_hash_type_quit: - #if defined(HAVE_EVP_MD_CTX_FREE) - EVP_MD_CTX_free(cptr); - #elif defined(HAVE_EVP_MD_CTX_DESTROY) diff --git a/net-snmp-5.8-licensing.patch b/net-snmp-5.8-licensing.patch deleted file mode 100644 index f4706a6..0000000 --- a/net-snmp-5.8-licensing.patch +++ /dev/null @@ -1,404 +0,0 @@ -diff -urNp a/agent/mibgroup/host/data_access/swinst_darwin.c b/agent/mibgroup/host/data_access/swinst_darwin.c ---- a/agent/mibgroup/host/data_access/swinst_darwin.c 2019-03-21 09:39:04.745698692 +0100 -+++ b/agent/mibgroup/host/data_access/swinst_darwin.c 1970-01-01 01:00:00.000000000 +0100 -@@ -1,400 +0,0 @@ --/* -- * swinst.c : hrSWInstalledTable data access -- */ --/* -- * 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 --#include --#include --#include --#include --#include --#include --#include --#include "swinst_private.h" -- --#include --#include --#include --#include -- --#define __APPLE_API_EVOLVING 1 --#include /* or else CoreFoundation.h barfs */ --#undef __APPLE_API_EVOLVING -- --#include --#include -- --netsnmp_feature_require(container_directory) --netsnmp_feature_require(date_n_time) -- --/* --------------------------------------------------------------------- -- */ --static int _add_applications_in_dir(netsnmp_container *, const char* path); --static int32_t _index; --static int _check_bundled_app(CFURLRef currentURL, CFStringRef *name, -- CFStringRef *info, const char* path); --static int _check_classic_app(CFURLRef currentURL, CFStringRef *name, -- CFStringRef *info, const char* path); --static netsnmp_container *dirs = NULL; -- --/* --------------------------------------------------------------------- -- */ --void --netsnmp_swinst_arch_init( void ) --{ -- struct stat stat_buf; -- const char *default_dirs[] = { -- "/Applications", -- "/Applications (Mac OS 9)", -- "/System/Library/CoreServices", -- "/System/Library/Extensions", -- "/System/Library/Services" --#ifdef TEST -- , "/Developer/Applications" -- , "/Volumes/audX/Applications (Mac OS 9)" --#endif -- }; -- int i, count = sizeof(default_dirs)/sizeof(default_dirs[0]); -- -- /* -- * create the container, if needed -- */ -- if (NULL == dirs) { -- dirs = netsnmp_container_find("directory_container:cstring"); -- if (NULL == dirs) { -- snmp_log(LOG_ERR, "couldn't allocate container for dir list\n"); -- return; -- } -- dirs->container_name = strdup("directory search list"); -- netsnmp_binary_array_options_set(dirs, 1, CONTAINER_KEY_UNSORTED); -- } -- -- /* -- * add dirs -- */ -- for(i = 0; i < count; ++i) { -- char * tmp; -- /** xxx: get/save the last mod date? */ -- if(-1 == stat(default_dirs[i], &stat_buf)) { -- DEBUGMSGTL(("swinst:arch:darwin", "skipping dir %s\n", -- default_dirs[i])); -- continue; -- } -- DEBUGMSGTL(("swinst:arch:darwin", "adding dir %s\n", -- default_dirs[i])); -- tmp = strdup(default_dirs[i]); -- if (NULL == tmp) { -- snmp_log(LOG_ERR,"strdup failed\n"); -- break; -- } -- CONTAINER_INSERT(dirs, tmp); -- } --} -- --void --netsnmp_swinst_arch_shutdown( void ) --{ -- netsnmp_directory_container_free(dirs); --} -- --/* --------------------------------------------------------------------- -- */ -- --int --netsnmp_swinst_arch_load( netsnmp_container *container, u_int flags ) --{ -- netsnmp_iterator *it; -- const char *dir; -- int rc; -- -- DEBUGMSGTL(("swinst:arch:darwin", "load\n")); -- -- if (NULL == dirs) { -- DEBUGMSGTL(("swinst:arch:darwin", "no dirs to scan!\n")); -- return -1; -- } -- -- _index = 0; -- -- it = CONTAINER_ITERATOR(dirs); -- for (dir = ITERATOR_FIRST(it); dir; dir = ITERATOR_NEXT(it)) { -- rc = _add_applications_in_dir(container, dir); -- } -- ITERATOR_RELEASE(it); -- DEBUGMSGTL(("swinst:arch:darwin", "loaded %d apps\n",_index)); -- -- return 0; --} -- --static void --_dump_flags(u_long flags) --{ -- static struct { -- const char*name; -- u_long bits; -- } names[] = { -- { "kLSItemInfoIsPlainFile", 0x00000001 }, -- { "kLSItemInfoIsPackage", 0x00000002 }, -- { "kLSItemInfoIsApplication", 0x00000004 }, -- { "kLSItemInfoIsContainer", 0x00000008 }, -- { "kLSItemInfoIsAliasFile", 0x00000010 }, -- { "kLSItemInfoIsSymlink", 0x00000020 }, -- { "kLSItemInfoIsInvisible", 0x00000040 }, -- { "kLSItemInfoIsNativeApp", 0x00000080 }, -- { "kLSItemInfoIsClassicApp", 0x00000100 }, -- { "kLSItemInfoAppPrefersNative", 0x00000200 }, -- { "kLSItemInfoAppPrefersClassic", 0x00000400 }, -- { "kLSItemInfoAppIsScriptable", 0x00000800 }, -- { "kLSItemInfoIsVolume", 0x00001000 }, -- { "kLSItemInfoExtensionIsHidden", 0x00100000 } -- }; -- int i, count = sizeof(names)/sizeof(names[0]); -- -- for(i = 0; i < count; ++i) { -- if (flags & names[i].bits) { -- DEBUGMSGTL(("swinst:arch:darwin:flags", "\t%s\n", -- names[i].name)); -- } -- } --} -- --static int --_add_applications_in_dir(netsnmp_container *container, const char* path) --{ -- netsnmp_container *files; -- netsnmp_iterator *it; -- const char *file; -- netsnmp_swinst_entry *entry = NULL; -- struct stat stat_buf; -- size_t date_len; -- u_char *date_buf; -- int rc = 0; -- -- CFStringRef currentPath = NULL; -- CFURLRef currentURL = NULL; -- LSItemInfoRecord itemInfoRecord; -- CFStringRef prodName = NULL; -- CFStringRef version = NULL; -- -- DEBUGMSGTL(("swinst:arch:darwin", " adding files from %s\n", path)); -- files = netsnmp_directory_container_read(NULL, path, 0); -- if (NULL == files) { -- snmp_log(LOG_ERR, "swinst: could not read directory %s\n", path); -- return -1; -- } -- -- it = CONTAINER_ITERATOR(files); -- if (NULL == it) { -- snmp_log(LOG_ERR, "could not get iterator\n"); -- netsnmp_directory_container_free(files); -- return -1; -- } -- for (file = ITERATOR_FIRST(it); -- file; -- file = ITERATOR_NEXT(it), -- CFRelease(currentPath), -- CFRelease(currentURL)) { -- -- int rc2 = 0; -- -- currentPath = -- CFStringCreateWithCStringNoCopy(kCFAllocatorDefault, file, -- kCFStringEncodingUTF8, -- kCFAllocatorNull); -- currentURL = -- CFURLCreateWithFileSystemPath(kCFAllocatorDefault, currentPath, -- kCFURLPOSIXPathStyle, true); -- LSCopyItemInfoForURL(currentURL, -- kLSRequestBasicFlagsOnly|kLSRequestAppTypeFlags, -- &itemInfoRecord); -- if((0 == itemInfoRecord.flags) || -- (kLSItemInfoIsPlainFile == itemInfoRecord.flags) || -- (itemInfoRecord.flags & kLSItemInfoIsInvisible) || -- (itemInfoRecord.flags & kLSItemInfoIsAliasFile)) { -- continue; -- } -- /** recurse on non-application containers (i.e. directory) */ -- if ((itemInfoRecord.flags & kLSItemInfoIsContainer) && -- (!(itemInfoRecord.flags & kLSItemInfoIsApplication))) { -- netsnmp_directory_container_read(files, file, 0); -- continue; -- } -- -- /** skip any other non-application files */ -- if (!(itemInfoRecord.flags & kLSItemInfoIsApplication)) { -- continue; -- } -- -- if ((itemInfoRecord.flags & kLSItemInfoIsPackage) || -- (itemInfoRecord.flags & kLSItemInfoIsContainer)) { -- rc2 = _check_bundled_app(currentURL, &prodName, &version, file); -- } -- else if ((itemInfoRecord.flags & kLSItemInfoIsClassicApp) || -- (itemInfoRecord.flags & kLSItemInfoIsPlainFile)) { -- rc2 = _check_classic_app(currentURL, &prodName, &version, file); -- } else { -- snmp_log(LOG_ERR,"swinst shouldn't get here: %s\n", file); -- _dump_flags(itemInfoRecord.flags); -- continue; -- } -- if (rc2) { /* not an app. if directory, recurse; else continue */ -- _dump_flags(itemInfoRecord.flags); -- if (1 == rc2) -- netsnmp_directory_container_read(files, file, 0); -- continue; -- } -- -- /* -- * allocate entry -- */ -- entry = netsnmp_swinst_entry_create(++_index); -- if (NULL == entry) { -- snmp_log(LOG_ERR, "error creating swinst entry\n"); -- rc = -1; -- SNMP_CFRelease(prodName); -- SNMP_CFRelease(version); -- CFRelease(currentPath); -- CFRelease(currentURL); -- break; -- } -- -- entry->swName_len = -- snprintf(entry->swName, sizeof(entry->swName), -- "%s %s", CFStringGetCStringPtr(prodName,0), -- CFStringGetCStringPtr(version,0)); -- if (entry->swName_len >= sizeof(entry->swName)) -- entry->swName_len = sizeof(entry->swName)-1; -- -- DEBUGMSGTL(("swinst:arch:darwin", "\t%s %s\n", file, entry->swName)); -- -- /** get the last mod date */ -- if(stat(file, &stat_buf) != -1) { -- date_buf = date_n_time(&stat_buf.st_mtime, &date_len); -- entry->swDate_len = date_len; -- memcpy(entry->swDate, date_buf, entry->swDate_len); -- } -- -- CONTAINER_INSERT(container, entry); -- entry = NULL; -- SNMP_CFRelease(prodName); -- SNMP_CFRelease(version); -- } -- ITERATOR_RELEASE(it); -- netsnmp_directory_container_free(files); -- -- return rc; --} -- --static int --_check_bundled_app(CFURLRef currentURL, CFStringRef *prodName, -- CFStringRef *version, const char* file) --{ -- CFBundleRef theBundle = NULL; -- CFDictionaryRef infoDict = NULL; -- -- if ((NULL == prodName) || (NULL == version)) -- return -1; -- -- theBundle = CFBundleCreate (kCFAllocatorDefault, currentURL); -- if(theBundle == NULL) -- return -1; /* not a bundle */ -- -- infoDict = CFBundleGetInfoDictionary(theBundle); -- if(0 == CFDictionaryGetCount(infoDict)) { -- SNMP_CFRelease(theBundle); -- return 1; /* directory */ -- } -- -- *prodName = (CFStringRef) -- CFDictionaryGetValue (infoDict, CFSTR("CFBundleName")); -- if (NULL == *prodName) { -- *prodName = (CFStringRef) -- CFDictionaryGetValue (infoDict, CFSTR("CFBundleDisplayName")); -- if (NULL == *prodName) { -- *prodName = (CFStringRef) CFDictionaryGetValue (infoDict, -- CFSTR("CFBundleExecutable")); -- } -- } -- if(NULL == *prodName) { -- DEBUGMSGTL(("swinst:arch:darwin", "\tmissing name: %s\n",file)); -- /*CFShow(infoDict);*/ -- SNMP_CFRelease(theBundle); -- return -1; -- } -- -- *version = (CFStringRef) -- CFDictionaryGetValue (infoDict, CFSTR("CFBundleShortVersionString")); -- if(NULL == *version) { -- *version = (CFStringRef) -- CFDictionaryGetValue (infoDict, CFSTR("CFBundleVersion")); -- if (*version == NULL) -- *version = (CFStringRef) CFDictionaryGetValue (infoDict, -- CFSTR("CFBundleGetInfoString")); -- } -- if(NULL == *version) { -- DEBUGMSGTL(("swinst:arch:darwin", "\tmissing version: %s\n",file)); -- /*CFShow(infoDict);*/ -- SNMP_CFRelease(theBundle); -- return -1; -- } -- -- if(theBundle != NULL) { -- CFRetain(*prodName); -- CFRetain(*version); -- SNMP_CFRelease(theBundle); -- } -- return 0; --} -- --static int --_check_classic_app(CFURLRef currentURL, CFStringRef *prodName, -- CFStringRef *version, const char* file) --{ -- /* -- * get info for classic or single-file apps -- */ -- FSRef theFSRef; -- int theResFile; -- -- if ((NULL == prodName) || (NULL == version)) -- return -1; -- -- *prodName = CFURLCopyLastPathComponent(currentURL); -- if (! CFURLGetFSRef(currentURL, &theFSRef)) { -- DEBUGMSGTL(("swinst:arch:darwin", "GetFSRef failed: %s\n", file)); -- SNMP_CFRelease(*prodName); -- return -1; -- } -- theResFile = FSOpenResFile(&theFSRef, fsRdPerm); -- if (ResError() != noErr) { -- DEBUGMSGTL(("swinst:arch:darwin", "FSOpenResFile failed: %s\n", file)); -- SNMP_CFRelease(*prodName); -- return -1; -- } -- VersRecHndl versHandle = (VersRecHndl)Get1IndResource('vers', 1); -- if (versHandle != NULL) { -- *version = CFStringCreateWithPascalString(kCFAllocatorDefault, -- (**versHandle).shortVersion, kCFStringEncodingMacRoman); -- if (*version == NULL) { -- StringPtr longVersionPtr = (**versHandle).shortVersion; -- longVersionPtr = (StringPtr)(((Ptr) longVersionPtr) + -- 1 + ((unsigned char) *longVersionPtr)); -- *version = CFStringCreateWithPascalString(kCFAllocatorDefault, -- longVersionPtr, kCFStringEncodingMacRoman); -- } -- ReleaseResource((Handle)versHandle); -- } -- CloseResFile(theResFile); -- if(*version == NULL) { -- DEBUGMSGTL(("swinst:arch:darwin", -- "\tmissing classic/file version: %s\n", file)); -- SNMP_CFRelease(*prodName); -- return -1; -- } -- -- return 0; --} diff --git a/net-snmp-5.8-memory-reporting.patch b/net-snmp-5.8-memory-reporting.patch deleted file mode 100644 index da03a37..0000000 --- a/net-snmp-5.8-memory-reporting.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -urNp a/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c ---- a/agent/mibgroup/hardware/memory/memory_linux.c 2020-06-10 13:36:40.164588176 +0200 -+++ b/agent/mibgroup/hardware/memory/memory_linux.c 2020-06-10 13:38:59.398944829 +0200 -@@ -29,7 +29,7 @@ int netsnmp_mem_arch_load( netsnmp_cache - ssize_t bytes_read; - char *b; - unsigned long memtotal = 0, memfree = 0, memshared = 0, -- buffers = 0, cached = 0, -+ buffers = 0, cached = 0, sreclaimable = 0, - swaptotal = 0, swapfree = 0; - - netsnmp_memory_info *mem; -@@ -127,6 +127,13 @@ int netsnmp_mem_arch_load( netsnmp_cache - if (first) - snmp_log(LOG_ERR, "No SwapTotal line in /proc/meminfo\n"); - } -+ b = strstr(buff, "SReclaimable: "); -+ if (b) -+ sscanf(b, "SReclaimable: %lu", &sreclaimable); -+ else { -+ if (first) -+ snmp_log(LOG_ERR, "No SReclaimable line in /proc/meminfo\n"); -+ } - b = strstr(buff, "SwapFree: "); - if (b) - sscanf(b, "SwapFree: %lu", &swapfree); -@@ -183,7 +190,7 @@ int netsnmp_mem_arch_load( netsnmp_cache - if (!mem->descr) - mem->descr = strdup("Cached memory"); - mem->units = 1024; -- mem->size = cached; -+ mem->size = cached+sreclaimable; - mem->free = 0; /* Report cached size/used as equal */ - mem->other = -1; - } diff --git a/net-snmp-5.8-python3.patch b/net-snmp-5.8-python3.patch deleted file mode 100644 index 8edab40..0000000 --- a/net-snmp-5.8-python3.patch +++ /dev/null @@ -1,720 +0,0 @@ -diff -urNp a/configure b/configure ---- a/configure 2018-07-18 17:11:53.178147565 +0200 -+++ b/configure 2018-07-18 17:14:01.254774416 +0200 -@@ -7742,8 +7742,8 @@ $as_echo "no" >&6; } - fi - - --# Extract the first word of "python", so it can be a program name with args. --set dummy python; ac_word=$2 -+# Extract the first word of "python3", so it can be a program name with args. -+set dummy python3; ac_word=$2 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 - $as_echo_n "checking for $ac_word... " >&6; } - if ${ac_cv_path_PYTHONPROG+:} false; then : -diff -urNp a/configure.d/config_os_progs b/configure.d/config_os_progs ---- a/configure.d/config_os_progs 2018-07-18 17:11:53.197147510 +0200 -+++ b/configure.d/config_os_progs 2018-07-18 17:14:29.963690646 +0200 -@@ -57,7 +57,7 @@ AC_PATH_PROG(AUTOCONF, autoconf, [: - AC_PATH_PROG(AUTOHEADER, autoheader, [:]) - AC_PATH_PROG([PERLPROG], perl) - AC_PATH_PROG([PSPROG], ps) --AC_PATH_PROG([PYTHONPROG],python) -+AC_PATH_PROG([PYTHONPROG],python3) - - AC_PATH_PROG([UNAMEPROG], uname) - AC_DEFINE_UNQUOTED(UNAMEPROG,"$UNAMEPROG", [Where is the uname command]) -diff -urNp a/Makefile.in b/Makefile.in ---- a/Makefile.in 2018-07-18 17:11:53.175147574 +0200 -+++ b/Makefile.in 2018-07-18 17:16:21.331365317 +0200 -@@ -226,7 +226,7 @@ perlcleanfeatures: - - # python specific build rules - # --PYMAKE=$(PYTHON) setup.py $(PYTHONARGS) -+PYMAKE=/usr/bin/python3 setup.py $(PYTHONARGS) - pythonmodules: subdirs - @(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \ - if test $$? != 0 ; then \ -diff -urNp a/python/netsnmp/client_intf.c b/python/netsnmp/client_intf.c ---- a/python/netsnmp/client_intf.c 2018-07-18 17:11:53.262147321 +0200 -+++ b/python/netsnmp/client_intf.c 2018-07-18 17:33:16.495712833 +0200 -@@ -1,11 +1,5 @@ - #include - --#if PY_VERSION_HEX < 0x02050000 --typedef int Py_ssize_t; --#define PY_SSIZE_T_MAX INT_MAX --#define PY_SSIZE_T_MIN INT_MIN --#endif -- - #include - #include - #include -@@ -852,8 +846,40 @@ py_netsnmp_attr_string(PyObject *obj, ch - if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { -+ *val = PyUnicode_AsUTF8AndSize(attr, len); -+ Py_DECREF(attr); -+ return 0; -+ } -+ } -+ -+ return -1; -+} -+ -+static int -+py_netsnmp_attr_set_bytes(PyObject *obj, char *attr_name, -+ char *val, size_t len) -+{ -+ int ret = -1; -+ if (obj && attr_name) { -+ PyObject* val_obj = (val ? -+ PyBytes_FromStringAndSize(val, len) : -+ Py_BuildValue("")); -+ ret = PyObject_SetAttrString(obj, attr_name, val_obj); -+ Py_DECREF(val_obj); -+ } -+ return ret; -+} -+ -+static int -+py_netsnmp_attr_bytes(PyObject *obj, char * attr_name, char **val, -+ Py_ssize_t *len) -+{ -+ *val = NULL; -+ if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { -+ PyObject *attr = PyObject_GetAttrString(obj, attr_name); -+ if (attr) { - int retval; -- retval = PyString_AsStringAndSize(attr, val, len); -+ retval = PyBytes_AsStringAndSize(attr, val, len); - Py_DECREF(attr); - return retval; - } -@@ -870,7 +896,7 @@ py_netsnmp_attr_long(PyObject *obj, char - if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { -- val = PyInt_AsLong(attr); -+ val = PyLong_AsLong(attr); - Py_DECREF(attr); - } - } -@@ -955,13 +981,13 @@ __py_netsnmp_update_session_errors(PyObj - - py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str)); - -- tmp_for_conversion = PyInt_FromLong(err_num); -+ tmp_for_conversion = PyLong_FromLong(err_num); - if (!tmp_for_conversion) - return; /* nothing better to do? */ - PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion); - Py_DECREF(tmp_for_conversion); - -- tmp_for_conversion = PyInt_FromLong(err_ind); -+ tmp_for_conversion = PyLong_FromLong(err_ind); - if (!tmp_for_conversion) - return; /* nothing better to do? */ - PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion); -@@ -1323,7 +1349,7 @@ netsnmp_get(PyObject *self, PyObject *ar - - ss = (SnmpSession *)py_netsnmp_attr_void_ptr(session, "sess_ptr"); - -- if (py_netsnmp_attr_string(session, "ErrorStr", &tmpstr, &tmplen) < 0) { -+ if (py_netsnmp_attr_bytes(session, "ErrorStr", &tmpstr, &tmplen) < 0) { - goto done; - } - -@@ -2015,7 +2041,7 @@ netsnmp_walk(PyObject *self, PyObject *a - vars, tp, type, sprintval_flag); - str_buf[len] = '\0'; - -- py_netsnmp_attr_set_string(varbind, "val", (char *) str_buf, -+ py_netsnmp_attr_set_bytes(varbind, "val", (char *) str_buf, - len); - - /* push the varbind onto the return varbinds */ -@@ -2266,7 +2292,7 @@ netsnmp_getbulk(PyObject *self, PyObject - - __get_type_str(type, type_str); - -- py_netsnmp_attr_set_string(varbind, "type", type_str, -+ py_netsnmp_attr_set_bytes(varbind, "type", type_str, - strlen(type_str)); - - len = __snprint_value((char **)&str_buf, &str_buf_len, -@@ -2409,7 +2435,7 @@ netsnmp_set(PyObject *self, PyObject *ar - } - } - -- if (py_netsnmp_attr_string(varbind, "val", &val, &tmplen) < 0) { -+ if (py_netsnmp_attr_bytes(varbind, "val", &val, &tmplen) < 0) { - snmp_free_pdu(pdu); - goto done; - } -@@ -2467,7 +2493,6 @@ netsnmp_set(PyObject *self, PyObject *ar - return (ret ? ret : Py_BuildValue("")); - } - -- - static PyMethodDef ClientMethods[] = { - {"session", netsnmp_create_session, METH_VARARGS, - "create a netsnmp session."}, -@@ -2490,10 +2515,23 @@ static PyMethodDef ClientMethods[] = { - {NULL, NULL, 0, NULL} /* Sentinel */ - }; - -+static struct PyModuleDef ModuleDefinition = { -+ PyModuleDef_HEAD_INIT, -+ "client_intf", -+ NULL, -+ -1, -+ ClientMethods, -+ NULL, -+ NULL, -+ NULL, -+ NULL -+}; -+ - PyMODINIT_FUNC --initclient_intf(void) -+PyInit_client_intf(void) - { -- (void) Py_InitModule("client_intf", ClientMethods); -+ PyObject *module = PyModule_Create(&ModuleDefinition); -+ return module; - } - - -diff -urNp a/python/netsnmp/client.py b/python/netsnmp/client.py ---- a/python/netsnmp/client.py 2018-07-18 17:11:53.262147321 +0200 -+++ b/python/netsnmp/client.py 2018-07-18 17:37:10.489221397 +0200 -@@ -34,12 +34,12 @@ def _parse_session_args(kargs): - 'TheirHostname':'', - 'TrustCert':'' - } -- keys = kargs.keys() -+ keys = list(kargs.keys()) - for key in keys: -- if sessArgs.has_key(key): -+ if key in sessArgs: - sessArgs[key] = kargs[key] - else: -- print >>stderr, "ERROR: unknown key", key -+ print("ERROR: unknown key", key, file=stderr) - return sessArgs - - def STR(obj): -@@ -55,7 +55,7 @@ class Varbind(object): - def __init__(self, tag=None, iid=None, val=None, type_arg=None): - self.tag = STR(tag) - self.iid = STR(iid) -- self.val = STR(val) -+ self.val = val - self.type = STR(type_arg) - # parse iid out of tag if needed - if iid is None and tag is not None: -@@ -65,7 +65,10 @@ class Varbind(object): - (self.tag, self.iid) = match.group(1, 2) - - def __setattr__(self, name, val): -- self.__dict__[name] = STR(val) -+ if name == 'val': -+ self.__dict__[name] = val -+ else: -+ self.__dict__[name] = STR(val) - - def __str__(self): - return obj_to_str(self) -@@ -132,7 +135,7 @@ class Session(object): - - sess_args = _parse_session_args(args) - -- for k, v in sess_args.items(): -+ for k, v in list(sess_args.items()): - self.__dict__[k] = v - - -diff -urNp a/python/netsnmp/__init__.py b/python/netsnmp/__init__.py ---- a/python/netsnmp/__init__.py 2018-07-18 17:11:53.262147321 +0200 -+++ b/python/netsnmp/__init__.py 2018-07-18 17:37:32.553172525 +0200 -@@ -1 +1 @@ --from client import * -+from .client import * -diff -urNp a/python/netsnmp/tests/test.py b/python/netsnmp/tests/test.py ---- a/python/netsnmp/tests/test.py 2018-07-18 17:11:53.263147318 +0200 -+++ b/python/netsnmp/tests/test.py 2018-07-18 17:38:21.272063355 +0200 -@@ -12,7 +12,7 @@ def snmp_dest(**kwargs): - 'DestHost': 'localhost:' + os.environ.get("SNMP_SNMPD_PORT", 161), - 'Community': 'public', - } -- for key, value in kwargs.iteritems(): -+ for key, value in kwargs.items(): - dest[key] = value - return dest - -@@ -62,107 +62,107 @@ class BasicTests(unittest.TestCase): - self.assertEqual(var.iid, '') - - def test_v1_get(self): -- print "\n" -- print "---v1 GET tests -------------------------------------\n" -+ print("\n") -+ print("---v1 GET tests -------------------------------------\n") - var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') - res = netsnmp.snmpget(var, **snmp_dest()) - -- print "v1 snmpget result: ", res, "\n" -+ print("v1 snmpget result: ", res, "\n") - self.assertEqual(len(res), 1) - -- print "v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print("v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertEqual(var.tag, 'sysDescr') - self.assertEqual(var.iid, '0') - self.assertEqual(var.val, res[0]) - self.assertEqual(var.type, 'OCTETSTR') - - def test_v1_getnext(self): -- print "\n" -- print "---v1 GETNEXT tests-------------------------------------\n" -+ print("\n") -+ print("---v1 GETNEXT tests-------------------------------------\n") - var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') - res = netsnmp.snmpgetnext(var, **snmp_dest()) - -- print "v1 snmpgetnext result: ", res, "\n" -+ print("v1 snmpgetnext result: ", res, "\n") - self.assertEqual(len(res), 1) - -- print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertTrue(var.tag is not None) - self.assertTrue(var.iid is not None) - self.assertTrue(var.val is not None) - self.assertTrue(var.type is not None) - - def test_v1_set(self): -- print "\n" -- print "---v1 SET tests-------------------------------------\n" -+ print("\n") -+ print("---v1 SET tests-------------------------------------\n") - var = netsnmp.Varbind('sysLocation', '0', 'my new location') - res = netsnmp.snmpset(var, **snmp_dest()) - -- print "v1 snmpset result: ", res, "\n" -+ print("v1 snmpset result: ", res, "\n") - self.assertEqual(res, 1) - -- print "v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print("v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertEqual(var.tag, 'sysLocation') - self.assertEqual(var.iid, '0') - self.assertEqual(var.val, 'my new location') - self.assertTrue(var.type is None) - - def test_v1_walk(self): -- print "\n" -- print "---v1 walk tests-------------------------------------\n" -+ print("\n") -+ print("---v1 walk tests-------------------------------------\n") - varlist = netsnmp.VarList(netsnmp.Varbind('system')) - -- print "v1 varlist walk in: " -+ print("v1 varlist walk in: ") - for var in varlist: -- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - - res = netsnmp.snmpwalk(varlist, **snmp_dest()) -- print "v1 snmpwalk result: ", res, "\n" -+ print("v1 snmpwalk result: ", res, "\n") - self.assertTrue(len(res) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') - - def test_v1_walk_2(self): -- print "\n" -- print "---v1 walk 2-------------------------------------\n" -+ print("\n") -+ print("---v1 walk 2-------------------------------------\n") - -- print "v1 varbind walk in: " -+ print("v1 varbind walk in: ") - var = netsnmp.Varbind('system') - self.assertEqual(var.tag, 'system') - self.assertEqual(var.iid, '') - self.assertEqual(var.val, None) - self.assertEqual(var.type, None) - res = netsnmp.snmpwalk(var, **snmp_dest()) -- print "v1 snmpwalk result (should be = orig): ", res, "\n" -+ print("v1 snmpwalk result (should be = orig): ", res, "\n") - self.assertTrue(len(res) > 0) - -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertEqual(var.tag, 'system') - self.assertEqual(var.iid, '') - self.assertEqual(var.val, None) - self.assertEqual(var.type, None) - - def test_v1_mv_get(self): -- print "\n" -- print "---v1 multi-varbind test-------------------------------------\n" -+ print("\n") -+ print("---v1 multi-varbind test-------------------------------------\n") - sess = setup_v1() - - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(varlist) -- print "v1 sess.get result: ", vals, "\n" -+ print("v1 sess.get result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') - - vals = sess.getnext(varlist) -- print "v1 sess.getnext result: ", vals, "\n" -+ print("v1 sess.getnext result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') - - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -171,71 +171,71 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, varlist) -- print "v1 sess.getbulk result: ", vals, "\n" -+ print("v1 sess.getbulk result: ", vals, "\n") - self.assertEqual(vals, None) # GetBulk is not supported for v1 - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') - - def test_v1_set_2(self): -- print "\n" -- print "---v1 set2-------------------------------------\n" -+ print("\n") -+ print("---v1 set2-------------------------------------\n") - - sess = setup_v1() - varlist = netsnmp.VarList( - netsnmp.Varbind('sysLocation', '0', 'my newer location')) - res = sess.set(varlist) -- print "v1 sess.set result: ", res, "\n" -+ print("v1 sess.set result: ", res, "\n") - - def test_v1_walk_3(self): -- print "\n" -- print "---v1 walk3-------------------------------------\n" -+ print("\n") -+ print("---v1 walk3-------------------------------------\n") - - sess = setup_v1() - varlist = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(varlist) -- print "v1 sess.walk result: ", vals, "\n" -+ print("v1 sess.walk result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - - def test_v2c_get(self): -- print "\n" -- print "---v2c get-------------------------------------\n" -+ print("\n") -+ print("---v2c get-------------------------------------\n") - - sess = setup_v2() - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(varlist) -- print "v2 sess.get result: ", vals, "\n" -+ print("v2 sess.get result: ", vals, "\n") - self.assertEqual(len(vals), 3) - - def test_v2c_getnext(self): -- print "\n" -- print "---v2c getnext-------------------------------------\n" -+ print("\n") -+ print("---v2c getnext-------------------------------------\n") - - sess = setup_v2() - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - vals = sess.getnext(varlist) -- print "v2 sess.getnext result: ", vals, "\n" -+ print("v2 sess.getnext result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - def test_v2c_getbulk(self): -- print "\n" -- print "---v2c getbulk-------------------------------------\n" -+ print("\n") -+ print("---v2c getbulk-------------------------------------\n") - - sess = setup_v2() - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), -@@ -245,16 +245,16 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, varlist) -- print "v2 sess.getbulk result: ", vals, "\n" -+ print("v2 sess.getbulk result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - def test_v2c_set(self): -- print "\n" -- print "---v2c set-------------------------------------\n" -+ print("\n") -+ print("---v2c set-------------------------------------\n") - - sess = setup_v2() - -@@ -262,54 +262,54 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysLocation', '0', 'my even newer location')) - - res = sess.set(varlist) -- print "v2 sess.set result: ", res, "\n" -+ print("v2 sess.set result: ", res, "\n") - self.assertEqual(res, 1) - - def test_v2c_walk(self): -- print "\n" -- print "---v2c walk-------------------------------------\n" -+ print("\n") -+ print("---v2c walk-------------------------------------\n") - - sess = setup_v2() - - varlist = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(varlist) -- print "v2 sess.walk result: ", vals, "\n" -+ print("v2 sess.walk result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - - def test_v3_get(self): -- print "\n" -+ print("\n") - sess = setup_v3(); - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) -- print "---v3 get-------------------------------------\n" -+ print("---v3 get-------------------------------------\n") - vals = sess.get(varlist) -- print "v3 sess.get result: ", vals, "\n" -+ print("v3 sess.get result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - def test_v3_getnext(self): -- print "\n" -- print "---v3 getnext-------------------------------------\n" -+ print("\n") -+ print("---v3 getnext-------------------------------------\n") - - sess = setup_v3(); - varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.getnext(varlist) -- print "v3 sess.getnext result: ", vals, "\n" -+ print("v3 sess.getnext result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - def test_v3_getbulk(self): - sess = setup_v3(); -@@ -320,47 +320,47 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, varlist) -- print "v3 sess.getbulk result: ", vals, "\n" -+ print("v3 sess.getbulk result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - def test_v3_set(self): -- print "\n" -- print "---v3 set-------------------------------------\n" -+ print("\n") -+ print("---v3 set-------------------------------------\n") - - sess = setup_v3(); - varlist = netsnmp.VarList( - netsnmp.Varbind('sysLocation', '0', 'my final destination')) - res = sess.set(varlist) -- print "v3 sess.set result: ", res, "\n" -+ print("v3 sess.set result: ", res, "\n") - self.assertEqual(res, 1) - - def test_v3_walk(self): -- print "\n" -- print "---v3 walk-------------------------------------\n" -+ print("\n") -+ print("---v3 walk-------------------------------------\n") - sess = setup_v3(); - varlist = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(varlist) -- print "v3 sess.walk result: ", vals, "\n" -+ print("v3 sess.walk result: ", vals, "\n") - self.assertTrue(len(vals) > 0) - - for var in varlist: -- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - - - class SetTests(unittest.TestCase): - """SNMP set tests for the Net-SNMP Python interface""" - def testFuncs(self): - """Test code""" -- print "\n-------------- SET Test Start ----------------------------\n" -+ print("\n-------------- SET Test Start ----------------------------\n") - - var = netsnmp.Varbind('sysUpTime', '0') - res = netsnmp.snmpget(var, **snmp_dest()) -- print "uptime = ", res[0] -+ print("uptime = ", res[0]) - self.assertEqual(len(res), 1) - - -@@ -370,19 +370,19 @@ class SetTests(unittest.TestCase): - - var = netsnmp.Varbind('sysUpTime', '0') - res = netsnmp.snmpget(var, **snmp_dest()) -- print "uptime = ", res[0] -+ print("uptime = ", res[0]) - self.assertEqual(len(res), 1) - - var = netsnmp.Varbind('nsCacheEntry') - res = netsnmp.snmpgetnext(var, **snmp_dest()) -- print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertEqual(len(res), 1) - - var.val = 65 - res = netsnmp.snmpset(var, **snmp_dest()) - self.assertEqual(res, 1) - res = netsnmp.snmpget(var, **snmp_dest()) -- print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' -+ print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') - self.assertEqual(len(res), 1) - self.assertEqual(res[0], '65'); - -@@ -394,7 +394,7 @@ class SetTests(unittest.TestCase): - netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 4)) - res = sess.set(varlist) - -- print "res = ", res -+ print("res = ", res) - self.assertEqual(res, 1) - - varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), -@@ -414,15 +414,15 @@ class SetTests(unittest.TestCase): - self.assertEqual(varlist[2].val, '3') - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - - varlist = netsnmp.VarList( - netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 6)) - - res = sess.set(varlist) - -- print "res = ", res -+ print("res = ", res) - self.assertEqual(res, 1) - - varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), -@@ -436,10 +436,10 @@ class SetTests(unittest.TestCase): - self.assertNotEqual(varlist[2].tag, 'snmpTargetAddrRowStatus') - - for var in varlist: -- print var.tag, var.iid, "=", var.val, '(', var.type, ')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') -+ print("\n") - -- print "\n-------------- SET Test End ----------------------------\n" -+ print("\n-------------- SET Test End ----------------------------\n") - - - if __name__ == '__main__': -diff -urNp a/python/setup.py b/python/setup.py ---- a/python/setup.py 2018-07-18 17:11:53.262147321 +0200 -+++ b/python/setup.py 2018-07-18 17:40:36.922751382 +0200 -@@ -9,9 +9,9 @@ intree=0 - - args = sys.argv[:] - for arg in args: -- if string.find(arg,'--basedir=') == 0: -- basedir = string.split(arg,'=')[1] -- sys.argv.remove(arg) -+ if arg.find('--basedir=') == 0: -+ basedir = arg.split('=')[1] -+ sys.argv.remove(arg) #tabs - intree=1 - - if intree: diff --git a/net-snmp-5.8-sec-counter.patch b/net-snmp-5.8-sec-counter.patch deleted file mode 100644 index 9514e5b..0000000 --- a/net-snmp-5.8-sec-counter.patch +++ /dev/null @@ -1,146 +0,0 @@ -diff -urNp a/include/net-snmp/library/snmpusm.h b/include/net-snmp/library/snmpusm.h ---- a/include/net-snmp/library/snmpusm.h 2020-03-16 09:54:29.883655600 +0100 -+++ b/include/net-snmp/library/snmpusm.h 2020-03-16 09:55:24.142944520 +0100 -@@ -43,6 +43,7 @@ extern "C" { - * Structures. - */ - struct usmStateReference { -+ int refcnt; - char *usr_name; - size_t usr_name_length; - u_char *usr_engine_id; -diff -urNp a/snmplib/snmp_client.c b/snmplib/snmp_client.c ---- a/snmplib/snmp_client.c 2020-03-16 09:54:29.892655813 +0100 -+++ b/snmplib/snmp_client.c 2020-03-16 09:58:13.214021890 +0100 -@@ -402,27 +402,16 @@ _clone_pdu_header(netsnmp_pdu *pdu) - return NULL; - } - -- if (pdu->securityStateRef && -- pdu->command == SNMP_MSG_TRAP2) { -- -- ret = usm_clone_usmStateReference((struct usmStateReference *) pdu->securityStateRef, -- (struct usmStateReference **) &newpdu->securityStateRef ); -- -- if (ret) -- { -+ sptr = find_sec_mod(newpdu->securityModel); -+ if (sptr && sptr->pdu_clone) { -+ /* call security model if it needs to know about this */ -+ ret = sptr->pdu_clone(pdu, newpdu); -+ if (ret) { - snmp_free_pdu(newpdu); - return NULL; - } - } - -- if ((sptr = find_sec_mod(newpdu->securityModel)) != NULL && -- sptr->pdu_clone != NULL) { -- /* -- * call security model if it needs to know about this -- */ -- (*sptr->pdu_clone) (pdu, newpdu); -- } -- - return newpdu; - } - -diff -urNp a/snmplib/snmpusm.c b/snmplib/snmpusm.c ---- a/snmplib/snmpusm.c 2020-03-16 09:54:29.894655860 +0100 -+++ b/snmplib/snmpusm.c 2020-03-16 10:03:38.870027530 +0100 -@@ -285,43 +285,64 @@ free_enginetime_on_shutdown(int majorid, - struct usmStateReference * - usm_malloc_usmStateReference(void) - { -- struct usmStateReference *retval = (struct usmStateReference *) -- calloc(1, sizeof(struct usmStateReference)); -+ struct usmStateReference *retval; -+ -+ retval = calloc(1, sizeof(struct usmStateReference)); -+ if (retval) -+ retval->refcnt = 1; - - return retval; - } /* end usm_malloc_usmStateReference() */ - -+static int -+usm_clone(netsnmp_pdu *pdu, netsnmp_pdu *new_pdu) -+{ -+ struct usmStateReference *ref = pdu->securityStateRef; -+ struct usmStateReference **new_ref = -+ (struct usmStateReference **)&new_pdu->securityStateRef; -+ int ret = 0; -+ -+ if (!ref) -+ return ret; -+ -+ if (pdu->command == SNMP_MSG_TRAP2) { -+ netsnmp_assert(pdu->securityModel == SNMP_DEFAULT_SECMODEL); -+ ret = usm_clone_usmStateReference(ref, new_ref); -+ } else { -+ netsnmp_assert(ref == *new_ref); -+ ref->refcnt++; -+ } -+ -+ return ret; -+} -+ - - void - usm_free_usmStateReference(void *old) - { -- struct usmStateReference *old_ref = (struct usmStateReference *) old; -+ struct usmStateReference *ref = old; - -- if (old_ref) { -+ if (!ref) -+ return; - -- if (old_ref->usr_name_length) -- SNMP_FREE(old_ref->usr_name); -- if (old_ref->usr_engine_id_length) -- SNMP_FREE(old_ref->usr_engine_id); -- if (old_ref->usr_auth_protocol_length) -- SNMP_FREE(old_ref->usr_auth_protocol); -- if (old_ref->usr_priv_protocol_length) -- SNMP_FREE(old_ref->usr_priv_protocol); -- -- if (old_ref->usr_auth_key_length && old_ref->usr_auth_key) { -- SNMP_ZERO(old_ref->usr_auth_key, old_ref->usr_auth_key_length); -- SNMP_FREE(old_ref->usr_auth_key); -- } -- if (old_ref->usr_priv_key_length && old_ref->usr_priv_key) { -- SNMP_ZERO(old_ref->usr_priv_key, old_ref->usr_priv_key_length); -- SNMP_FREE(old_ref->usr_priv_key); -- } -+ if (--ref->refcnt > 0) -+ return; - -- SNMP_ZERO(old_ref, sizeof(*old_ref)); -- SNMP_FREE(old_ref); -+ SNMP_FREE(ref->usr_name); -+ SNMP_FREE(ref->usr_engine_id); -+ SNMP_FREE(ref->usr_auth_protocol); -+ SNMP_FREE(ref->usr_priv_protocol); - -+ if (ref->usr_auth_key_length && ref->usr_auth_key) { -+ SNMP_ZERO(ref->usr_auth_key, ref->usr_auth_key_length); -+ SNMP_FREE(ref->usr_auth_key); -+ } -+ if (ref->usr_priv_key_length && ref->usr_priv_key) { -+ SNMP_ZERO(ref->usr_priv_key, ref->usr_priv_key_length); -+ SNMP_FREE(ref->usr_priv_key); - } - -+ SNMP_FREE(ref); - } /* end usm_free_usmStateReference() */ - - struct usmUser * -@@ -3316,6 +3337,7 @@ init_usm(void) - def->encode_reverse = usm_secmod_rgenerate_out_msg; - def->encode_forward = usm_secmod_generate_out_msg; - def->decode = usm_secmod_process_in_msg; -+ def->pdu_clone = usm_clone; - def->pdu_free_state_ref = usm_free_usmStateReference; - def->session_setup = usm_session_init; - def->handle_report = usm_handle_report; diff --git a/net-snmp-5.8-sec-memory-leak.patch b/net-snmp-5.8-sec-memory-leak.patch deleted file mode 100644 index 2d5a986..0000000 --- a/net-snmp-5.8-sec-memory-leak.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff -urNp a/agent/snmp_agent.c b/agent/snmp_agent.c ---- a/agent/snmp_agent.c 2020-06-11 10:20:31.646339191 +0200 -+++ b/agent/snmp_agent.c 2020-06-11 10:23:41.178056889 +0200 -@@ -1605,12 +1605,6 @@ free_agent_snmp_session(netsnmp_agent_se - DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p freed\n", - asp, asp->reqinfo)); - -- /* Clean up securityStateRef here to prevent a double free */ -- if (asp->orig_pdu && asp->orig_pdu->securityStateRef) -- snmp_free_securityStateRef(asp->orig_pdu); -- if (asp->pdu && asp->pdu->securityStateRef) -- snmp_free_securityStateRef(asp->pdu); -- - if (asp->orig_pdu) - snmp_free_pdu(asp->orig_pdu); - if (asp->pdu) -diff -urNp a/include/net-snmp/pdu_api.h b/include/net-snmp/pdu_api.h ---- a/include/net-snmp/pdu_api.h 2020-06-11 10:20:31.631339058 +0200 -+++ b/include/net-snmp/pdu_api.h 2020-06-11 10:24:17.261390028 +0200 -@@ -19,8 +19,6 @@ NETSNMP_IMPORT - netsnmp_pdu *snmp_fix_pdu( netsnmp_pdu *pdu, int idx); - NETSNMP_IMPORT - void snmp_free_pdu( netsnmp_pdu *pdu); --NETSNMP_IMPORT --void snmp_free_securityStateRef( netsnmp_pdu *pdu); - - #ifdef __cplusplus - } -diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c ---- a/snmplib/snmp_api.c 2020-06-11 10:20:31.695339627 +0200 -+++ b/snmplib/snmp_api.c 2020-06-11 10:33:55.510891945 +0200 -@@ -4034,17 +4034,6 @@ free_securityStateRef(netsnmp_pdu* pdu) - pdu->securityStateRef = NULL; - } - --/* -- * This function is here to provide a separate call to -- * free the securityStateRef memory. This is needed to prevent -- * a double free if this memory is freed in snmp_free_pdu. -- */ --void --snmp_free_securityStateRef(netsnmp_pdu* pdu) --{ -- free_securityStateRef(pdu); --} -- - #define ERROR_STAT_LENGTH 11 - - int -@@ -5473,6 +5462,8 @@ snmp_free_pdu(netsnmp_pdu *pdu) - if (!pdu) - return; - -+ free_securityStateRef(pdu); -+ - /* - * If the command field is empty, that probably indicates - * that this PDU structure has already been freed. -@@ -5647,12 +5638,6 @@ _sess_process_packet_parse_pdu(void *ses - } - - if (ret != SNMP_ERR_NOERROR) { -- /* -- * Call the security model to free any securityStateRef supplied w/ msg. -- */ -- if (pdu->securityStateRef != NULL) { -- free_securityStateRef(pdu); -- } - snmp_free_pdu(pdu); - return NULL; - } -@@ -5826,12 +5811,6 @@ _sess_process_packet_handle_pdu(void *se - } - } - -- /* -- * Call USM to free any securityStateRef supplied with the message. -- */ -- if (pdu->securityStateRef && pdu->command == SNMP_MSG_TRAP2) -- free_securityStateRef(pdu); -- - if (!handled) { - if (sp->flags & SNMP_FLAGS_SHARED_SOCKET) - return -2; diff --git a/net-snmp-5.8-test-debug.patch b/net-snmp-5.8-test-debug.patch deleted file mode 100644 index 1ecd2ab..0000000 --- a/net-snmp-5.8-test-debug.patch +++ /dev/null @@ -1,30 +0,0 @@ -Don't check tests which depend on DNS - it's disabled in Koji - -diff -urNp a/testing/fulltests/default/T070com2sec_simple b/testing/fulltests/default/T070com2sec_simple ---- a/testing/fulltests/default/T070com2sec_simple 2018-07-18 11:52:56.081185545 +0200 -+++ b/testing/fulltests/default/T070com2sec_simple 2018-07-18 11:54:18.843968880 +0200 -@@ -134,6 +134,10 @@ SAVECHECKAGENT '<"c406a", 255.255.255.25 - SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies - SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies - -+FINISHED -+ -+# don't test the rest, it depends on DNS, which is not available in Koji -+ - CHECKAGENT '<"c408a"' - if [ "$snmp_last_test_result" -eq 0 ] ; then - CHECKAGENT 'line 32: Error:' -diff -urNp a/testing/fulltests/default/T071com2sec6_simple b/testing/fulltests/default/T071com2sec6_simple ---- a/testing/fulltests/default/T071com2sec6_simple 2018-07-18 11:52:56.080185548 +0200 -+++ b/testing/fulltests/default/T071com2sec6_simple 2018-07-18 11:55:17.779818732 +0200 -@@ -132,6 +132,10 @@ SAVECHECKAGENT '<"c606a", ffff:ffff:ffff - SAVECHECKAGENT 'line 27: Error:' - SAVECHECKAGENT 'line 28: Error:' - -+FINISHED -+ -+# don't test the rest, it depends on DNS, which is not available in Koji -+ - # 608 - CHECKAGENT '<"c608a"' - if [ "$snmp_last_test_result" -eq 0 ] ; then diff --git a/net-snmp-5.8-trapsink.patch b/net-snmp-5.8-trapsink.patch deleted file mode 100644 index 5027d7e..0000000 --- a/net-snmp-5.8-trapsink.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -urNp old/snmplib/transports/snmpUDPIPv4BaseDomain.c new/snmplib/transports/snmpUDPIPv4BaseDomain.c ---- old/snmplib/transports/snmpUDPIPv4BaseDomain.c 2019-06-27 08:40:48.663969034 +0200 -+++ new/snmplib/transports/snmpUDPIPv4BaseDomain.c 2019-06-27 08:42:05.293723487 +0200 -@@ -317,7 +317,7 @@ netsnmp_udpipv4base_tspec_transport(nets - if (NULL != tspec->source) { - struct sockaddr_in src_addr, *srcp = &src_addr; - /** get sockaddr from source */ -- if (!netsnmp_sockaddr_in2(&src_addr, tspec->source, NULL)) -+ if (!netsnmp_sockaddr_in2(&src_addr, tspec->source, ":0")) - return NULL; - return netsnmp_udpipv4base_transport_with_source(&addr, local, srcp); - } else { -@@ -364,7 +364,7 @@ netsnmp_udpipv4base_transport(const stru - strcat(client_address, ":0"); - have_port = 1; - } -- rc = netsnmp_sockaddr_in2(&client_addr, client_socket, NULL); -+ rc = netsnmp_sockaddr_in2(&client_addr, client_socket, ":0"); - if (client_address != client_socket) - free(client_address); - if(rc) { diff --git a/net-snmp-5.8-usage-exit.patch b/net-snmp-5.8-usage-exit.patch deleted file mode 100644 index 38b80ac..0000000 --- a/net-snmp-5.8-usage-exit.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -urNp a/agent/snmpd.c b/agent/snmpd.c ---- a/agent/snmpd.c 2018-10-04 10:34:10.939728847 +0200 -+++ b/agent/snmpd.c 2018-10-04 10:34:43.910625603 +0200 -@@ -325,6 +325,7 @@ usage(char *prog) - " -S d|i|0-7\t\tuse -Ls instead\n" - "\n" - ); -+ exit(1); - } - - static void diff --git a/net-snmp-5.8-v3-forward.patch b/net-snmp-5.8-v3-forward.patch deleted file mode 100644 index 24ac379..0000000 --- a/net-snmp-5.8-v3-forward.patch +++ /dev/null @@ -1,357 +0,0 @@ -diff -urNp c/agent/snmp_agent.c d/agent/snmp_agent.c ---- c/agent/snmp_agent.c 2019-09-18 08:44:53.833601845 +0200 -+++ d/agent/snmp_agent.c 2019-09-18 08:46:38.176595597 +0200 -@@ -1604,6 +1604,13 @@ free_agent_snmp_session(netsnmp_agent_se - - DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p freed\n", - asp, asp->reqinfo)); -+ -+ /* Clean up securityStateRef here to prevent a double free */ -+ if (asp->orig_pdu && asp->orig_pdu->securityStateRef) -+ snmp_free_securityStateRef(asp->orig_pdu); -+ if (asp->pdu && asp->pdu->securityStateRef) -+ snmp_free_securityStateRef(asp->pdu); -+ - if (asp->orig_pdu) - snmp_free_pdu(asp->orig_pdu); - if (asp->pdu) -diff -urNp c/include/net-snmp/pdu_api.h d/include/net-snmp/pdu_api.h ---- c/include/net-snmp/pdu_api.h 2019-09-18 08:44:53.822601740 +0200 -+++ d/include/net-snmp/pdu_api.h 2019-09-18 08:47:03.620838212 +0200 -@@ -19,6 +19,8 @@ NETSNMP_IMPORT - netsnmp_pdu *snmp_fix_pdu( netsnmp_pdu *pdu, int idx); - NETSNMP_IMPORT - void snmp_free_pdu( netsnmp_pdu *pdu); -+NETSNMP_IMPORT -+void snmp_free_securityStateRef( netsnmp_pdu *pdu); - - #ifdef __cplusplus - } -diff -urNp c/snmplib/snmp_api.c d/snmplib/snmp_api.c ---- c/snmplib/snmp_api.c 2019-09-18 08:44:53.807601597 +0200 -+++ d/snmplib/snmp_api.c 2019-09-18 08:53:19.937435576 +0200 -@@ -4012,7 +4012,12 @@ snmpv3_parse(netsnmp_pdu *pdu, - static void - free_securityStateRef(netsnmp_pdu* pdu) - { -- struct snmp_secmod_def *sptr = find_sec_mod(pdu->securityModel); -+ struct snmp_secmod_def *sptr; -+ -+ if(!pdu->securityStateRef) -+ return; -+ -+ sptr = find_sec_mod(pdu->securityModel); - if (sptr) { - if (sptr->pdu_free_state_ref) { - (*sptr->pdu_free_state_ref) (pdu->securityStateRef); -@@ -4029,6 +4034,17 @@ free_securityStateRef(netsnmp_pdu* pdu) - pdu->securityStateRef = NULL; - } - -+/* -+ * This function is here to provide a separate call to -+ * free the securityStateRef memory. This is needed to prevent -+ * a double free if this memory is freed in snmp_free_pdu. -+ */ -+void -+snmp_free_securityStateRef(netsnmp_pdu* pdu) -+{ -+ free_securityStateRef(pdu); -+} -+ - #define ERROR_STAT_LENGTH 11 - - int -diff -urNp c/snmplib/snmpusm.c d/snmplib/snmpusm.c ---- c/snmplib/snmpusm.c 2019-09-18 08:44:53.802601550 +0200 -+++ d/snmplib/snmpusm.c 2019-09-18 08:57:35.696872662 +0200 -@@ -299,16 +299,20 @@ usm_free_usmStateReference(void *old) - - if (old_ref) { - -- SNMP_FREE(old_ref->usr_name); -- SNMP_FREE(old_ref->usr_engine_id); -- SNMP_FREE(old_ref->usr_auth_protocol); -- SNMP_FREE(old_ref->usr_priv_protocol); -+ if (old_ref->usr_name_length) -+ SNMP_FREE(old_ref->usr_name); -+ if (old_ref->usr_engine_id_length) -+ SNMP_FREE(old_ref->usr_engine_id); -+ if (old_ref->usr_auth_protocol_length) -+ SNMP_FREE(old_ref->usr_auth_protocol); -+ if (old_ref->usr_priv_protocol_length) -+ SNMP_FREE(old_ref->usr_priv_protocol); - -- if (old_ref->usr_auth_key) { -+ if (old_ref->usr_auth_key_length && old_ref->usr_auth_key) { - SNMP_ZERO(old_ref->usr_auth_key, old_ref->usr_auth_key_length); - SNMP_FREE(old_ref->usr_auth_key); - } -- if (old_ref->usr_priv_key) { -+ if (old_ref->usr_priv_key_length && old_ref->usr_priv_key) { - SNMP_ZERO(old_ref->usr_priv_key, old_ref->usr_priv_key_length); - SNMP_FREE(old_ref->usr_priv_key); - } -@@ -1039,7 +1043,6 @@ usm_generate_out_msg(int msgProcModel, - if ((user = usm_get_user(secEngineID, secEngineIDLen, secName)) - == NULL && secLevel != SNMP_SEC_LEVEL_NOAUTH) { - DEBUGMSGTL(("usm", "Unknown User(%s)\n", secName)); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_UNKNOWNSECURITYNAME; - } - -@@ -1091,7 +1094,6 @@ usm_generate_out_msg(int msgProcModel, - thePrivProtocolLength) == 1) { - DEBUGMSGTL(("usm", "Unsupported Security Level (%d)\n", - theSecLevel)); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL; - } - -@@ -1121,7 +1123,6 @@ usm_generate_out_msg(int msgProcModel, - &msgAuthParmLen, &msgPrivParmLen, &otstlen, - &seq_len, &msgSecParmLen) == -1) { - DEBUGMSGTL(("usm", "Failed calculating offsets.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - -@@ -1143,7 +1144,6 @@ usm_generate_out_msg(int msgProcModel, - ptr = *wholeMsg = globalData; - if (theTotalLength > *wholeMsgLen) { - DEBUGMSGTL(("usm", "Message won't fit in buffer.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - -@@ -1169,7 +1169,6 @@ usm_generate_out_msg(int msgProcModel, - htonl(boots_uint), htonl(time_uint), - &ptr[privParamsOffset]) == -1) { - DEBUGMSGTL(("usm", "Can't set AES iv.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - } -@@ -1185,7 +1184,6 @@ usm_generate_out_msg(int msgProcModel, - &ptr[privParamsOffset]) - == -1)) { - DEBUGMSGTL(("usm", "Can't set DES-CBC salt.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - } -@@ -1198,7 +1196,6 @@ usm_generate_out_msg(int msgProcModel, - &ptr[dataOffset], &encrypted_length) - != SNMP_ERR_NOERROR) { - DEBUGMSGTL(("usm", "encryption error.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_ENCRYPTIONERROR; - } - #ifdef NETSNMP_ENABLE_TESTING_CODE -@@ -1226,7 +1223,6 @@ usm_generate_out_msg(int msgProcModel, - if ((encrypted_length != (theTotalLength - dataOffset)) - || (salt_length != msgPrivParmLen)) { - DEBUGMSGTL(("usm", "encryption length error.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_ENCRYPTIONERROR; - } - -@@ -1362,7 +1358,6 @@ usm_generate_out_msg(int msgProcModel, - - if (temp_sig == NULL) { - DEBUGMSGTL(("usm", "Out of memory.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - -@@ -1376,7 +1371,6 @@ usm_generate_out_msg(int msgProcModel, - SNMP_ZERO(temp_sig, temp_sig_len); - SNMP_FREE(temp_sig); - DEBUGMSGTL(("usm", "Signing failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_AUTHENTICATIONFAILURE; - } - -@@ -1384,7 +1378,6 @@ usm_generate_out_msg(int msgProcModel, - SNMP_ZERO(temp_sig, temp_sig_len); - SNMP_FREE(temp_sig); - DEBUGMSGTL(("usm", "Signing lengths failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_AUTHENTICATIONFAILURE; - } - -@@ -1398,7 +1391,6 @@ usm_generate_out_msg(int msgProcModel, - /* - * endif -- create keyed hash - */ -- usm_free_usmStateReference(secStateRef); - - DEBUGMSGTL(("usm", "USM processing completed.\n")); - -@@ -1548,7 +1540,6 @@ usm_rgenerate_out_msg(int msgProcModel, - if ((user = usm_get_user(secEngineID, secEngineIDLen, secName)) - == NULL && secLevel != SNMP_SEC_LEVEL_NOAUTH) { - DEBUGMSGTL(("usm", "Unknown User\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_UNKNOWNSECURITYNAME; - } - -@@ -1601,7 +1592,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGMSGTL(("usm", "Unsupported Security Level or type (%d)\n", - theSecLevel)); - -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_UNSUPPORTEDSECURITYLEVEL; - } - -@@ -1636,7 +1626,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGMSGTL(("usm", - "couldn't malloc %d bytes for encrypted PDU\n", - (int)ciphertextlen)); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_MALLOC; - } - -@@ -1652,7 +1641,6 @@ usm_rgenerate_out_msg(int msgProcModel, - htonl(boots_uint), htonl(time_uint), - iv) == -1) { - DEBUGMSGTL(("usm", "Can't set AES iv.\n")); -- usm_free_usmStateReference(secStateRef); - SNMP_FREE(ciphertext); - return SNMPERR_USM_GENERICERROR; - } -@@ -1667,7 +1655,6 @@ usm_rgenerate_out_msg(int msgProcModel, - thePrivKeyLength - 8, - iv) == -1)) { - DEBUGMSGTL(("usm", "Can't set DES-CBC salt.\n")); -- usm_free_usmStateReference(secStateRef); - SNMP_FREE(ciphertext); - return SNMPERR_USM_GENERICERROR; - } -@@ -1686,7 +1673,6 @@ usm_rgenerate_out_msg(int msgProcModel, - scopedPdu, scopedPduLen, - ciphertext, &ciphertextlen) != SNMP_ERR_NOERROR) { - DEBUGMSGTL(("usm", "encryption error.\n")); -- usm_free_usmStateReference(secStateRef); - SNMP_FREE(ciphertext); - return SNMPERR_USM_ENCRYPTIONERROR; - } -@@ -1703,7 +1689,6 @@ usm_rgenerate_out_msg(int msgProcModel, - ciphertext, ciphertextlen); - if (rc == 0) { - DEBUGMSGTL(("usm", "Encryption failed.\n")); -- usm_free_usmStateReference(secStateRef); - SNMP_FREE(ciphertext); - return SNMPERR_USM_ENCRYPTIONERROR; - } -@@ -1743,7 +1728,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGINDENTLESS(); - if (rc == 0) { - DEBUGMSGTL(("usm", "building privParams failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1766,7 +1750,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGINDENTLESS(); - if (rc == 0) { - DEBUGMSGTL(("usm", "building authParams failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1789,7 +1772,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGINDENTLESS(); - if (rc == 0) { - DEBUGMSGTL(("usm", "building authParams failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1805,7 +1787,6 @@ usm_rgenerate_out_msg(int msgProcModel, - if (rc == 0) { - DEBUGMSGTL(("usm", - "building msgAuthoritativeEngineTime failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1821,7 +1802,6 @@ usm_rgenerate_out_msg(int msgProcModel, - if (rc == 0) { - DEBUGMSGTL(("usm", - "building msgAuthoritativeEngineBoots failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1833,7 +1813,6 @@ usm_rgenerate_out_msg(int msgProcModel, - DEBUGINDENTLESS(); - if (rc == 0) { - DEBUGMSGTL(("usm", "building msgAuthoritativeEngineID failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1846,7 +1825,6 @@ usm_rgenerate_out_msg(int msgProcModel, - *offset - sp_offset); - if (rc == 0) { - DEBUGMSGTL(("usm", "building usm security parameters failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1860,7 +1838,6 @@ usm_rgenerate_out_msg(int msgProcModel, - - if (rc == 0) { - DEBUGMSGTL(("usm", "building msgSecurityParameters failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1870,7 +1847,6 @@ usm_rgenerate_out_msg(int msgProcModel, - while ((*wholeMsgLen - *offset) < globalDataLen) { - if (!asn_realloc(wholeMsg, wholeMsgLen)) { - DEBUGMSGTL(("usm", "building global data failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - } -@@ -1886,7 +1862,6 @@ usm_rgenerate_out_msg(int msgProcModel, - ASN_CONSTRUCTOR), *offset); - if (rc == 0) { - DEBUGMSGTL(("usm", "building master packet sequence failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_TOO_LONG; - } - -@@ -1904,7 +1879,6 @@ usm_rgenerate_out_msg(int msgProcModel, - - if (temp_sig == NULL) { - DEBUGMSGTL(("usm", "Out of memory.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_GENERICERROR; - } - -@@ -1915,14 +1889,12 @@ usm_rgenerate_out_msg(int msgProcModel, - != SNMP_ERR_NOERROR) { - SNMP_FREE(temp_sig); - DEBUGMSGTL(("usm", "Signing failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_AUTHENTICATIONFAILURE; - } - - if (temp_sig_len != msgAuthParmLen) { - SNMP_FREE(temp_sig); - DEBUGMSGTL(("usm", "Signing lengths failed.\n")); -- usm_free_usmStateReference(secStateRef); - return SNMPERR_USM_AUTHENTICATIONFAILURE; - } - -@@ -1933,7 +1905,6 @@ usm_rgenerate_out_msg(int msgProcModel, - /* - * endif -- create keyed hash - */ -- usm_free_usmStateReference(secStateRef); - DEBUGMSGTL(("usm", "USM processing completed.\n")); - return SNMPERR_SUCCESS; - } /* end usm_rgenerate_out_msg() */ diff --git a/net-snmp-5.9-aes-config.patch b/net-snmp-5.9-aes-config.patch new file mode 100644 index 0000000..ac70142 --- /dev/null +++ b/net-snmp-5.9-aes-config.patch @@ -0,0 +1,18 @@ +diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in +index afd6fa4..07c26fe 100644 +--- a/net-snmp-create-v3-user.in ++++ b/net-snmp-create-v3-user.in +@@ -58,11 +58,11 @@ case $1 in + exit 1 + fi + case $1 in +- DES|AES|AES128) ++ DES|AES|AES128|AES192|AES256) + Xalgorithm=$1 + shift + ;; +- des|aes|aes128) ++ des|aes|aes128|aes192|aes256) + Xalgorithm=`echo $1 | tr a-z A-Z` + shift + ;; diff --git a/net-snmp-5.9-autofs-skip.patch b/net-snmp-5.9-autofs-skip.patch new file mode 100644 index 0000000..0d054b2 --- /dev/null +++ b/net-snmp-5.9-autofs-skip.patch @@ -0,0 +1,46 @@ +diff --git a/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c +index 4f78df3..fd25b3f 100644 +--- a/agent/mibgroup/host/hr_filesys.c ++++ b/agent/mibgroup/host/hr_filesys.c +@@ -704,6 +704,7 @@ static const char *HRFS_ignores[] = { + "shm", + "sockfs", + "sysfs", ++ "tmpfs", + "usbdevfs", + "usbfs", + #endif +diff --git a/agent/mibgroup/host/hr_storage.c b/agent/mibgroup/host/hr_storage.c +index 6b459ec..f7a376b 100644 +--- a/agent/mibgroup/host/hr_storage.c ++++ b/agent/mibgroup/host/hr_storage.c +@@ -540,9 +540,10 @@ really_try_next: + + store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; + if (store_idx > NETSNMP_MEM_TYPE_MAX ) { +- if ( netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, ++ if ( (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, + NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && +- Check_HR_FileSys_NFS()) ++ Check_HR_FileSys_NFS()) || ++ Check_HR_FileSys_AutoFs()) + return NULL; /* or goto try_next; */ + if (Check_HR_FileSys_AutoFs()) + return NULL; +diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c +index 8967d35..9bf2659 100644 +--- a/agent/mibgroup/host/hrh_storage.c ++++ b/agent/mibgroup/host/hrh_storage.c +@@ -366,9 +366,10 @@ really_try_next: + store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; + if (HRFS_entry && + store_idx > NETSNMP_MEM_TYPE_MAX && +- netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, ++ ((netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, + NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && +- Check_HR_FileSys_NFS()) ++ Check_HR_FileSys_NFS()) || ++ Check_HR_FileSys_AutoFs())) + return NULL; + if (HRFS_entry && Check_HR_FileSys_AutoFs()) + return NULL; diff --git a/net-snmp-5.9-cflags.patch b/net-snmp-5.9-cflags.patch new file mode 100644 index 0000000..5099cde --- /dev/null +++ b/net-snmp-5.9-cflags.patch @@ -0,0 +1,36 @@ +diff -urNp a/net-snmp-config.in b/net-snmp-config.in +--- a/net-snmp-config.in 2018-07-18 13:43:12.264426052 +0200 ++++ b/net-snmp-config.in 2018-07-18 13:52:06.917089518 +0200 +@@ -140,10 +140,10 @@ else + ;; + #################################################### compile + --base-cflags) +- echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR} ++ echo -I${NSC_INCLUDEDIR} + ;; + --cflags|--cf*) +- echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} ++ echo @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} + ;; + --srcdir) + echo $NSC_SRCDIR +diff -urNp a/perl/Makefile.PL b/perl/Makefile.PL +--- a/perl/Makefile.PL 2020-08-26 08:32:52.498909823 +0200 ++++ b/perl/Makefile.PL 2020-08-26 09:30:45.584951552 +0200 +@@ -1,3 +1,4 @@ ++use lib '.'; + use strict; + use warnings; + use ExtUtils::MakeMaker; +diff -urNp a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm +--- a/perl/MakefileSubs.pm 2020-08-26 08:32:52.498909823 +0200 ++++ b/perl/MakefileSubs.pm 2020-08-26 08:36:44.097218448 +0200 +@@ -116,7 +116,7 @@ sub AddCommonParams { + append($Params->{'CCFLAGS'}, $cflags); + append($Params->{'CCFLAGS'}, $Config{'ccflags'}); + # Suppress known Perl header shortcomings. +- $Params->{'CCFLAGS'} =~ s/ -W(cast-qual|write-strings)//g; ++ $Params->{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; + append($Params->{'CCFLAGS'}, '-Wformat'); + } + } diff --git a/net-snmp-5.9-coverity.patch b/net-snmp-5.9-coverity.patch new file mode 100644 index 0000000..fa3e043 --- /dev/null +++ b/net-snmp-5.9-coverity.patch @@ -0,0 +1,22 @@ +diff --git a/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c +index e9a8831..5a1d8e7 100644 +--- a/agent/mibgroup/disman/event/mteTrigger.c ++++ b/agent/mibgroup/disman/event/mteTrigger.c +@@ -1012,7 +1012,7 @@ mteTrigger_run( unsigned int reg, void *clientarg) + * Similarly, if no fallEvent is configured, + * there's no point in trying to fire it either. + */ +- if (entry->mteTThRiseEvent[0] != '\0' ) { ++ if (entry->mteTThFallEvent[0] != '\0' ) { + entry->mteTriggerXOwner = entry->mteTThObjOwner; + entry->mteTriggerXObjects = entry->mteTThObjects; + entry->mteTriggerFired = vp1; +@@ -1105,7 +1105,7 @@ mteTrigger_run( unsigned int reg, void *clientarg) + * Similarly, if no fallEvent is configured, + * there's no point in trying to fire it either. + */ +- if (entry->mteTThDRiseEvent[0] != '\0' ) { ++ if (entry->mteTThDFallEvent[0] != '\0' ) { + entry->mteTriggerXOwner = entry->mteTThObjOwner; + entry->mteTriggerXObjects = entry->mteTThObjects; + entry->mteTriggerFired = vp1; diff --git a/net-snmp-5.9-dir-fix.patch b/net-snmp-5.9-dir-fix.patch new file mode 100644 index 0000000..369626f --- /dev/null +++ b/net-snmp-5.9-dir-fix.patch @@ -0,0 +1,24 @@ +diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in +index 452c269..afd6fa4 100644 +--- a/net-snmp-create-v3-user.in ++++ b/net-snmp-create-v3-user.in +@@ -16,6 +16,10 @@ Xalgorithm="DES" + token=rwuser + + while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do ++case "$1" in ++ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; ++ *) optarg= ;; ++esac + + unset shifted + case $1 in +@@ -134,7 +138,7 @@ echo $line >> $outfile + prefix="@prefix@" + # Avoid that configure complains that this script ignores @datarootdir@ + echo "@datarootdir@" >/dev/null +-outfile="@datadir@/snmp/snmpd.conf" ++outfile="/etc/snmp/snmpd.conf" + line="$token $user" + echo "adding the following line to $outfile:" + echo " " $line diff --git a/net-snmp-5.8-dskTable-dynamic.patch b/net-snmp-5.9-dskTable-dynamic.patch similarity index 86% rename from net-snmp-5.8-dskTable-dynamic.patch rename to net-snmp-5.9-dskTable-dynamic.patch index 3ecbe64..3822755 100644 --- a/net-snmp-5.8-dskTable-dynamic.patch +++ b/net-snmp-5.9-dskTable-dynamic.patch @@ -1,7 +1,8 @@ -diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c ---- a/agent/mibgroup/ucd-snmp/disk.c 2020-06-10 09:29:35.867328760 +0200 -+++ b/agent/mibgroup/ucd-snmp/disk.c 2020-06-10 09:44:13.053535421 +0200 -@@ -153,9 +153,10 @@ static void disk_free_config(void) +diff --git a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c +index 5206235..5e98476 100644 +--- a/agent/mibgroup/ucd-snmp/disk.c ++++ b/agent/mibgroup/ucd-snmp/disk.c +@@ -153,9 +153,10 @@ static void disk_free_config(void); static void disk_parse_config(const char *, char *); static void disk_parse_config_all(const char *, char *); #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS @@ -46,7 +47,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c } static void -@@ -313,7 +318,7 @@ disk_parse_config(const char *token, cha +@@ -313,7 +318,7 @@ disk_parse_config(const char *token, char *cptr) * check if the disk already exists, if so then modify its * parameters. if it does not exist then add it */ @@ -55,7 +56,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c #endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */ } -@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, +@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, char *cptr) #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS static void @@ -64,7 +65,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c { int index; -@@ -402,10 +407,16 @@ add_device(char *path, char *device, int +@@ -402,10 +407,16 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) } index = disk_exists(path); @@ -84,7 +85,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c /* add if and only if the device was found */ if(device[0] != 0) { /* The following buffers are cleared above, no need to add '\0' */ -@@ -413,6 +424,7 @@ add_device(char *path, char *device, int +@@ -413,6 +424,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) strlcpy(disks[numdisks].device, device, sizeof(disks[numdisks].device)); disks[numdisks].minimumspace = minspace; disks[numdisks].minpercent = minpercent; @@ -92,7 +93,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c numdisks++; } else { -@@ -420,6 +432,7 @@ add_device(char *path, char *device, int +@@ -420,6 +432,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) disks[numdisks].minpercent = -1; disks[numdisks].path[0] = 0; disks[numdisks].device[0] = 0; @@ -154,7 +155,7 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c } #endif else { -@@ -696,6 +709,10 @@ fill_dsk_entry(int disknum, struct dsk_e +@@ -696,6 +709,10 @@ fill_dsk_entry(int disknum, struct dsk_entry *entry) #endif #endif @@ -165,9 +166,9 @@ diff -ruNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c entry->dskPercentInode = -1; #if defined(HAVE_STATVFS) || defined(HAVE_STATFS) -@@ -826,6 +843,13 @@ var_extensible_disk(struct variable *vp, - static long long_ret; +@@ -827,6 +844,13 @@ var_extensible_disk(struct variable *vp, static char *errmsg; + static char empty_str[1]; + int i; + for (i = 0; i < numdisks; i++){ diff --git a/net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch b/net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch similarity index 57% rename from net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch rename to net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch index 1d1fafb..8f1f2ed 100644 --- a/net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch +++ b/net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch @@ -1,11 +1,12 @@ -diff -urNp a/apps/Makefile.in b/apps/Makefile.in ---- a/apps/Makefile.in 2018-07-18 15:39:28.069251000 +0200 -+++ b/apps/Makefile.in 2018-07-18 15:54:52.261943123 +0200 -@@ -230,7 +230,7 @@ snmppcap$(EXEEXT): snmppcap.$(OSUFFIX +diff --git a/apps/Makefile.in b/apps/Makefile.in +index d4529d3..175242b 100644 +--- a/apps/Makefile.in ++++ b/apps/Makefile.in +@@ -237,7 +237,7 @@ snmppcap$(EXEEXT): snmppcap.$(OSUFFIX) $(USELIBS) $(LINK) ${CFLAGS} -o $@ snmppcap.$(OSUFFIX) ${LDFLAGS} ${LIBS} -lpcap libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS) -- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) +- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LDFLAGS) + $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) $(MYSQL_LIBS) $(RANLIB) $@ diff --git a/net-snmp-5.9-memory-reporting.patch b/net-snmp-5.9-memory-reporting.patch new file mode 100644 index 0000000..3db8d51 --- /dev/null +++ b/net-snmp-5.9-memory-reporting.patch @@ -0,0 +1,28 @@ +diff --git a/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c +index 6d5e86c..68b55d2 100644 +--- a/agent/mibgroup/hardware/memory/memory_linux.c ++++ b/agent/mibgroup/hardware/memory/memory_linux.c +@@ -123,6 +123,13 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { + if (first) + snmp_log(LOG_ERR, "No SwapTotal line in /proc/meminfo\n"); + } ++ b = strstr(buff, "SReclaimable: "); ++ if (b) ++ sscanf(b, "SReclaimable: %lu", &sreclaimable); ++ else { ++ if (first) ++ snmp_log(LOG_ERR, "No SReclaimable line in /proc/meminfo\n"); ++ } + b = strstr(buff, "SwapFree: "); + if (b) + sscanf(b, "SwapFree: %lu", &swapfree); +@@ -130,9 +137,6 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { + if (first) + snmp_log(LOG_ERR, "No SwapFree line in /proc/meminfo\n"); + } +- b = strstr(buff, "SReclaimable: "); +- if (b) +- sscanf(b, "SReclaimable: %lu", &sreclaimable); + first = 0; + + diff --git a/net-snmp-5.8-multilib.patch b/net-snmp-5.9-multilib.patch similarity index 62% rename from net-snmp-5.8-multilib.patch rename to net-snmp-5.9-multilib.patch index b8f3fea..ffd8da8 100644 --- a/net-snmp-5.8-multilib.patch +++ b/net-snmp-5.9-multilib.patch @@ -1,6 +1,7 @@ -diff -urNp a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def ---- a/man/netsnmp_config_api.3.def 2018-07-18 11:18:06.196792766 +0200 -+++ b/man/netsnmp_config_api.3.def 2018-07-18 11:20:04.631679886 +0200 +diff --git a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def +index 90b20d9..bd5abe1 100644 +--- a/man/netsnmp_config_api.3.def ++++ b/man/netsnmp_config_api.3.def @@ -295,7 +295,7 @@ for one particular machine. .PP The default list of directories to search is \fC SYSCONFDIR/snmp\fP, @@ -10,7 +11,7 @@ diff -urNp a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def followed by \fC $HOME/.snmp\fP. This list can be changed by setting the environmental variable .I SNMPCONFPATH -@@ -367,7 +367,7 @@ A colon separated list of directories to +@@ -367,7 +367,7 @@ A colon separated list of directories to search for configuration files in. Default: .br @@ -19,10 +20,11 @@ diff -urNp a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def .SH "SEE ALSO" netsnmp_mib_api(3), snmp_api(3) .\" Local Variables: -diff -urNp a/man/snmp_config.5.def b/man/snmp_config.5.def ---- a/man/snmp_config.5.def 2018-07-18 11:18:06.194792767 +0200 -+++ b/man/snmp_config.5.def 2018-07-18 11:20:56.423626117 +0200 -@@ -10,7 +10,7 @@ First off, there are numerous places tha +diff --git a/man/snmp_config.5.def b/man/snmp_config.5.def +index fd30873..c3437d6 100644 +--- a/man/snmp_config.5.def ++++ b/man/snmp_config.5.def +@@ -10,7 +10,7 @@ First off, there are numerous places that configuration files can be found and read from. By default, the applications look for configuration files in the following 4 directories, in order: SYSCONFDIR/snmp, @@ -31,10 +33,11 @@ diff -urNp a/man/snmp_config.5.def b/man/snmp_config.5.def directories, it looks for files snmp.conf, snmpd.conf and/or snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf and/or snmptrapd.local.conf. *.local.conf are always -diff -urNp a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def ---- a/man/snmpd.conf.5.def 2018-07-18 11:18:06.196792766 +0200 -+++ b/man/snmpd.conf.5.def 2018-07-18 11:21:44.263574388 +0200 -@@ -1559,7 +1559,7 @@ filename), and call the initialisation r +diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def +index 7ce8a46..a4000f9 100644 +--- a/man/snmpd.conf.5.def ++++ b/man/snmpd.conf.5.def +@@ -1593,7 +1593,7 @@ filename), and call the initialisation routine \fIinit_NAME\fR. .RS .IP "Note:" If the specified PATH is not a fully qualified filename, it will diff --git a/net-snmp-5.7.2-pie.patch b/net-snmp-5.9-pie.patch similarity index 56% rename from net-snmp-5.7.2-pie.patch rename to net-snmp-5.9-pie.patch index ee02001..cb2793d 100644 --- a/net-snmp-5.7.2-pie.patch +++ b/net-snmp-5.9-pie.patch @@ -1,7 +1,8 @@ -diff -up net-snmp-5.7.2/agent/Makefile.in.pie net-snmp-5.7.2/agent/Makefile.in ---- net-snmp-5.7.2/agent/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200 -+++ net-snmp-5.7.2/agent/Makefile.in 2012-10-18 09:45:13.298613099 +0200 -@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c +diff --git a/agent/Makefile.in b/agent/Makefile.in +index b5d692d..1a30209 100644 +--- a/agent/Makefile.in ++++ b/agent/Makefile.in +@@ -297,7 +297,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) @@ -9,11 +10,12 @@ diff -up net-snmp-5.7.2/agent/Makefile.in.pie net-snmp-5.7.2/agent/Makefile.in + $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS} libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS) - $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@ -diff -up net-snmp-5.7.2/apps/Makefile.in.pie net-snmp-5.7.2/apps/Makefile.in ---- net-snmp-5.7.2/apps/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200 -+++ net-snmp-5.7.2/apps/Makefile.in 2012-10-18 09:44:27.827774580 +0200 -@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX + $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) @AGENTLIBS@ +diff --git a/apps/Makefile.in b/apps/Makefile.in +index 43f3b9c..d4529d3 100644 +--- a/apps/Makefile.in ++++ b/apps/Makefile.in +@@ -190,7 +190,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS) $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS} snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) diff --git a/net-snmp-5.8-proxy-getnext.patch b/net-snmp-5.9-proxy-getnext.patch similarity index 60% rename from net-snmp-5.8-proxy-getnext.patch rename to net-snmp-5.9-proxy-getnext.patch index ff2294f..bfcbdbb 100644 --- a/net-snmp-5.8-proxy-getnext.patch +++ b/net-snmp-5.9-proxy-getnext.patch @@ -1,7 +1,8 @@ -diff -ruNp a/agent/mibgroup/ucd-snmp/proxy.c b/agent/mibgroup/ucd-snmp/proxy.c ---- a/agent/mibgroup/ucd-snmp/proxy.c 2020-06-10 09:24:24.933347483 +0200 -+++ b/agent/mibgroup/ucd-snmp/proxy.c 2020-06-10 09:25:49.007148474 +0200 -@@ -460,7 +460,7 @@ proxy_handler(netsnmp_mib_handler *handl +diff --git a/agent/mibgroup/ucd-snmp/proxy.c b/agent/mibgroup/ucd-snmp/proxy.c +index e0ee96b..8abe7a3 100644 +--- a/agent/mibgroup/ucd-snmp/proxy.c ++++ b/agent/mibgroup/ucd-snmp/proxy.c +@@ -463,7 +463,7 @@ proxy_handler(netsnmp_mib_handler *handler, if (sp->base_len && reqinfo->mode == MODE_GETNEXT && (snmp_oid_compare(ourname, ourlength, diff --git a/net-snmp-5.8-python-ld-flags.patch b/net-snmp-5.9-python-ld-flags.patch similarity index 80% rename from net-snmp-5.8-python-ld-flags.patch rename to net-snmp-5.9-python-ld-flags.patch index 2fe7778..78fab3d 100644 --- a/net-snmp-5.8-python-ld-flags.patch +++ b/net-snmp-5.9-python-ld-flags.patch @@ -1,7 +1,8 @@ -diff -urNp a/python/setup.py b/python/setup.py ---- a/python/setup.py 2018-11-29 16:39:33.959745228 +0100 -+++ b/python/setup.py 2018-11-29 16:40:19.125513424 +0100 -@@ -18,14 +18,14 @@ if intree: +diff --git a/python/setup.py b/python/setup.py +index 2547842..0c68cd8 100644 +--- a/python/setup.py ++++ b/python/setup.py +@@ -17,14 +17,14 @@ if intree: netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read() libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read() incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read() + " " + os.popen(basedir+'/net-snmp-config --base-cflags '+basedir).read() diff --git a/net-snmp-5.9-python3.patch b/net-snmp-5.9-python3.patch new file mode 100644 index 0000000..98de4ca --- /dev/null +++ b/net-snmp-5.9-python3.patch @@ -0,0 +1,38 @@ +diff --git a/Makefile.in b/Makefile.in +index 912f6b2..862fb5f 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -227,7 +227,7 @@ perlcleanfeatures: + + # python specific build rules + # +-PYMAKE=$(PYTHON) setup.py $(PYTHONARGS) ++PYMAKE=/usr/bin/python3 setup.py $(PYTHONARGS) + pythonmodules: subdirs + @(dir=`pwd`; cd python; $(PYMAKE) build --basedir=$$dir) ; \ + if test $$? != 0 ; then \ +diff --git a/python/netsnmp/client.py b/python/netsnmp/client.py +index daf11a4..3a30a64 100644 +--- a/python/netsnmp/client.py ++++ b/python/netsnmp/client.py +@@ -56,7 +56,7 @@ class Varbind(object): + def __init__(self, tag=None, iid=None, val=None, type_arg=None): + self.tag = STR(tag) + self.iid = STR(iid) +- self.val = STR(val) ++ self.val = val + self.type = STR(type_arg) + # parse iid out of tag if needed + if iid is None and tag is not None: +@@ -66,7 +66,10 @@ class Varbind(object): + (self.tag, self.iid) = match.group(1, 2) + + def __setattr__(self, name, val): +- self.__dict__[name] = STR(val) ++ if name == 'val': ++ self.__dict__[name] = val ++ else: ++ self.__dict__[name] = STR(val) + + def __str__(self): + return obj_to_str(self) diff --git a/net-snmp-5.9-test-debug.patch b/net-snmp-5.9-test-debug.patch new file mode 100644 index 0000000..85832a1 --- /dev/null +++ b/net-snmp-5.9-test-debug.patch @@ -0,0 +1,110 @@ +diff --git a/testing/fulltests/default/T070com2sec_simple b/testing/fulltests/default/T070com2sec_simple +index 6c07f74..7df0b51 100644 +--- a/testing/fulltests/default/T070com2sec_simple ++++ b/testing/fulltests/default/T070com2sec_simple +@@ -134,34 +134,30 @@ SAVECHECKAGENT '<"c406a", 255.255.255.255/255.255.255.255> => "t406a"' + SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies + SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies + +-if false; then +- # The two tests below have been disabled because these rely on resolving a +- # domain name into a local IP address. Such DNS replies are filtered out by +- # many security devices because to avoid DNS rebinding attacks. See also +- # https://en.wikipedia.org/wiki/DNS_rebinding. +- +- CHECKAGENT '<"c408a"' +- if [ "$snmp_last_test_result" -eq 0 ] ; then +- CHECKAGENT 'line 32: Error:' +- if [ "$snmp_last_test_result" -ne 1 ] ; then +- return_value=1 +- FINISHED +- fi +- elif [ "$snmp_last_test_result" -ne 1 ] ; then ++FINISHED ++ ++# don't test the rest, it depends on DNS, which is not available in Koji ++ ++CHECKAGENT '<"c408a"' ++if [ "$snmp_last_test_result" -eq 0 ] ; then ++ CHECKAGENT 'line 32: Error:' ++ if [ "$snmp_last_test_result" -ne 1 ] ; then + return_value=1 + FINISHED + fi ++elif [ "$snmp_last_test_result" -ne 1 ] ; then ++ return_value=1 ++ FINISHED ++fi + +- CHECKAGENT '<"c408b"' +- if [ "$snmp_last_test_result" -eq 0 ] ; then +- CHECKAGENT 'line 33: Error:' +- if [ "$snmp_last_test_result" -ne 1 ] ; then +- return_value=1 +- fi +- elif [ "$snmp_last_test_result" -ne 1 ] ; then ++CHECKAGENT '<"c408b"' ++if [ "$snmp_last_test_result" -eq 0 ] ; then ++ CHECKAGENT 'line 33: Error:' ++ if [ "$snmp_last_test_result" -ne 1 ] ; then + return_value=1 + fi +- ++elif [ "$snmp_last_test_result" -ne 1 ] ; then ++ return_value=1 + fi + + FINISHED +diff --git a/testing/fulltests/default/T071com2sec6_simple b/testing/fulltests/default/T071com2sec6_simple +index 76da70b..bc2d432 100644 +--- a/testing/fulltests/default/T071com2sec6_simple ++++ b/testing/fulltests/default/T071com2sec6_simple +@@ -132,30 +132,27 @@ SAVECHECKAGENT '<"c606a", ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/ffff:ffff:ffff + SAVECHECKAGENT 'line 27: Error:' + SAVECHECKAGENT 'line 28: Error:' + +-if false; then +- # The two tests below have been disabled because these rely on resolving a +- # domain name into a local IP address. Such DNS replies are filtered out by +- # many security devices because to avoid DNS rebinding attacks. See also +- # https://en.wikipedia.org/wiki/DNS_rebinding. +- +- # 608 +- CHECKAGENT '<"c608a"' +- if [ "$snmp_last_test_result" -eq 0 ] ; then +- CHECKAGENT 'line 29: Error:' +- errnum=`expr $errnum - 1` +- if [ "$snmp_last_test_result" -ne 1 ] ; then +- FINISHED +- fi +- elif [ "$snmp_last_test_result" -ne 1 ] ; then ++FINISHED ++ ++# don't test the rest, it depends on DNS, which is not available in Koji ++ ++# 608 ++CHECKAGENT '<"c608a"' ++if [ "$snmp_last_test_result" -eq 0 ] ; then ++ CHECKAGENT 'line 29: Error:' ++ errnum=`expr $errnum - 1` ++ if [ "$snmp_last_test_result" -ne 1 ] ; then + FINISHED + fi ++elif [ "$snmp_last_test_result" -ne 1 ] ; then ++ FINISHED ++fi + +- CHECKAGENTCOUNT atleastone '<"c608b"' +- if [ "$snmp_last_test_result" -eq 0 ] ; then +- CHECKAGENT 'line 30: Error:' +- if [ "$snmp_last_test_result" -eq 1 ] ; then +- errnum=`expr $errnum - 1` +- fi ++CHECKAGENTCOUNT atleastone '<"c608b"' ++if [ "$snmp_last_test_result" -eq 0 ] ; then ++ CHECKAGENT 'line 30: Error:' ++ if [ "$snmp_last_test_result" -eq 1 ] ; then ++ errnum=`expr $errnum - 1` + fi + fi + diff --git a/net-snmp-5.9-usage-exit.patch b/net-snmp-5.9-usage-exit.patch new file mode 100644 index 0000000..c43c846 --- /dev/null +++ b/net-snmp-5.9-usage-exit.patch @@ -0,0 +1,12 @@ +diff --git a/agent/snmpd.c b/agent/snmpd.c +index ae73eda..f01b890 100644 +--- a/agent/snmpd.c ++++ b/agent/snmpd.c +@@ -289,6 +289,7 @@ usage(char *prog) + " -S d|i|0-7\t\tuse -Ls instead\n" + "\n" + ); ++ exit(1); + } + + static void diff --git a/net-snmp.spec b/net-snmp.spec index 12e1151..0e20d62 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -5,12 +5,12 @@ %global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 aarch64 # actual soname version -%global soname 35 +%global soname 40 Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.8 -Release: 25%{?dist} +Version: 5.9 +Release: 1%{?dist} Epoch: 1 License: BSD @@ -27,57 +27,46 @@ Source8: snmpd.service Source9: snmptrapd.service Source10: IETF-MIB-LICENSE.txt -Patch1: net-snmp-5.7.2-pie.patch -Patch2: net-snmp-5.8-dir-fix.patch -Patch3: net-snmp-5.8-multilib.patch -Patch4: net-snmp-5.8-test-debug.patch -Patch5: net-snmp-5.7.2-autoreconf.patch -Patch6: net-snmp-5.8-agentx-disconnect-crash.patch -Patch7: net-snmp-5.7.2-cert-path.patch -Patch8: net-snmp-5.8-cflags.patch -Patch9: net-snmp-5.8-Remove-U64-typedef.patch -Patch10: net-snmp-5.8-libnetsnmptrapd-against-MYSQL_LIBS.patch -Patch11: net-snmp-5.7.3-iterator-fix.patch -Patch12: net-snmp-5.8-autofs-skip.patch -Patch13: net-snmp-5.8-key-leak-backport.patch -Patch14: net-snmp-5.8-python-ld-flags.patch -Patch15: net-snmp-5.8-ipv6-clientaddr.patch -Patch16: net-snmp-5.8-licensing.patch -Patch17: net-snmp-5.8-agent-of-death.patch -Patch18: net-snmp-5.8-trapsink.patch -Patch19: net-snmp-5.8-v3-forward.patch -Patch20: net-snmp-5.8-usage-exit.patch -Patch21: net-snmp-5.8-coverity.patch -Patch22: net-snmp-5.8-flood-messages.patch -Patch23: net-snmp-5.8-sec-counter.patch -Patch24: net-snmp-5.8-proxy-getnext.patch -Patch25: net-snmp-5.8-dskTable-dynamic.patch -Patch26: net-snmp-5.8-expand-SNMPCONFPATH.patch -Patch27: net-snmp-5.8-duplicate-ipAddress.patch -Patch28: net-snmp-5.8-memory-reporting.patch -Patch29: net-snmp-5.8-man-page.patch -Patch30: net-snmp-5.8-ipAddress-faster-load.patch -Patch31: net-snmp-5.8-rpm-memory-leak.patch -Patch32: net-snmp-5.8-sec-memory-leak.patch -Patch33: net-snmp-5.8-aes-config.patch +Patch1: net-snmp-5.9-pie.patch +Patch2: net-snmp-5.9-dir-fix.patch +Patch3: net-snmp-5.9-multilib.patch +Patch4: net-snmp-5.9-test-debug.patch +Patch5: net-snmp-5.7.2-cert-path.patch +Patch6: net-snmp-5.9-cflags.patch +Patch7: net-snmp-5.8-Remove-U64-typedef.patch +Patch8: net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch +Patch9: net-snmp-5.7.3-iterator-fix.patch +Patch10: net-snmp-5.9-autofs-skip.patch +Patch11: net-snmp-5.9-python-ld-flags.patch +Patch12: net-snmp-5.9-usage-exit.patch +Patch13: net-snmp-5.9-coverity.patch +Patch14: net-snmp-5.9-proxy-getnext.patch +Patch15: net-snmp-5.9-dskTable-dynamic.patch +Patch16: net-snmp-5.8-expand-SNMPCONFPATH.patch +Patch17: net-snmp-5.8-duplicate-ipAddress.patch +Patch18: net-snmp-5.9-memory-reporting.patch +Patch19: net-snmp-5.8-man-page.patch +Patch20: net-snmp-5.8-ipAddress-faster-load.patch +Patch21: net-snmp-5.8-rpm-memory-leak.patch +Patch22: net-snmp-5.9-aes-config.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch #disable this patch due compatibility issues -Patch102: net-snmp-5.8-python3.patch +Patch102: net-snmp-5.9-python3.patch Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # This is actually needed for the %%triggerun script but Requires(triggerun) -# is not valid. We can use %%post because this particular %triggerun script +# is not valid. We can use %%post because this particular %%triggerun script # should fire just after this package is installed. %{?systemd_requires} BuildRequires: systemd BuildRequires: gcc BuildRequires: openssl-devel, bzip2-devel, elfutils-devel BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel -BuildRequires: perl-devel, perl(ExtUtils::Embed), procps +BuildRequires: perl-devel, perl(ExtUtils::Embed), procps, pcre-devel BuildRequires: python3-devel, python3-setuptools BuildRequires: chrpath BuildRequires: mariadb-connector-c-devel @@ -189,21 +178,6 @@ Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} The net-snmp-agent-libs package contains the runtime agent libraries for shared binaries and applications. -#%package -n python2-net-snmp -#%%{?python_provide:%%python_provide python2-net-snmp} -#%%{?python_obsolete:%%python_obsolete python3-net-snmp} -# Remove before F30 -#Provides: %%{name}-python = %%{version}-%%{release} -#Provides: %%{name}-python%%{?_isa} = %%{version}-%%{release} -#Obsoletes: %%{name}-python < %%{version}-%%{release} -#Summary: The Python 'netsnmp' module for the Net-SNMP -#Requires: %%{name}-libs%%{?_isa} = %%{epoch}:%%{version}-%%{release} -# -#%%description -n python2-net-snmp -#The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3, -#SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the -#Net-SNMP toolkit library. - %package -n python3-net-snmp %{?python_provide:%python_provide python3-net-snmp} # Remove before F30 @@ -229,35 +203,24 @@ cp %{SOURCE10} . %patch2 -p1 -b .dir-fix %patch3 -p1 -b .multilib %patch4 -p1 -%patch5 -p1 -b .autoreconf -%patch6 -p1 -b .agentx-disconnect-crash -%patch7 -p1 -b .cert-path -%patch8 -p1 -b .cflags -%patch9 -p1 -b .u64-remove -%patch10 -p1 -b .perlfix -%patch11 -p1 -b .iterator-fix -%patch12 -p1 -b .autofs-skip -%patch13 -p1 -b .leak-backport -%patch14 -p1 -b .python-ld-flags -%patch15 -p1 -b .ipv6-clientaddr -%patch16 -p1 -%patch17 -p1 -b .agent-of-death -%patch18 -p1 -b .trapsink -%patch19 -p1 -b .v3-forward -%patch20 -p1 -b .usage-fix -%patch21 -p1 -b .coverity -%patch22 -p1 -b .flood-messages -%patch23 -p1 -b .sec-counter -%patch24 -p1 -b .proxy-getnext -%patch25 -p1 -b .dskTable-dynamic -%patch26 -p1 -b .expand-SNMPCONFPATH -%patch27 -p1 -b .duplicate-ipAddress -%patch28 -p1 -b .memory-reporting -%patch29 -p1 -b .man-page -%patch30 -p1 -b .ipAddress-faster-load -%patch31 -p1 -b .rpm-memory-leak -%patch32 -p1 -b .sec-memory-leak -%patch33 -p1 -b .aes-config +%patch5 -p1 -b .cert-path +%patch6 -p1 -b .cflags +%patch7 -p1 -b .u64-remove +%patch8 -p1 -b .perlfix +%patch9 -p1 -b .iterator-fix +%patch10 -p1 -b .autofs-skip +%patch11 -p1 -b .python-ld-flags +%patch12 -p1 -b .usage-fix +%patch13 -p1 -b .coverity +%patch14 -p1 -b .proxy-getnext +%patch15 -p1 -b .dskTable-dynamic +%patch16 -p1 -b .expand-SNMPCONFPATH +%patch17 -p1 -b .duplicate-ipAddress +%patch18 -p1 -b .memory-reporting +%patch19 -p1 -b .man-page +%patch20 -p1 -b .ipAddress-faster-load +%patch21 -p1 -b .rpm-memory-leak +%patch22 -p1 -b .aes-config %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -402,10 +365,6 @@ done # remove executable bit from documentation samples chmod 644 local/passtest local/ipf-mod.pl -# dirty hack for #603243, until it's fixed properly upstream -install -m 755 -d %{buildroot}/usr/include/net-snmp/agent/util_funcs -install -m 644 agent/mibgroup/util_funcs/*.h %{buildroot}/usr/include/net-snmp/agent/util_funcs - # systemd stuff install -m 755 -d %{buildroot}/%{_tmpfilesdir} install -m 644 %SOURCE7 %{buildroot}/%{_tmpfilesdir}/net-snmp.conf @@ -477,7 +436,8 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %files devel %{_libdir}/lib*.so -/usr/include/* +%{_libdir}/pkgconfig/* +%{_includedir}/* %attr(0644,root,root) %{_mandir}/man3/*.3.* %attr(0755,root,root) %{_bindir}/net-snmp-config* %attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* @@ -527,6 +487,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Aug 17 2020 Josef Řídký - 1:5.9-1 +- New upstream release 5.9 + * Tue Aug 04 2020 Josef Ridky - 1:5.8-25 - link math library to fix FTBFS for hplip (#1863855) diff --git a/sources b/sources index e71eafd..c6a5062 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.8.tar.gz) = 27895a583b23f3e14c48562bc32f3ba83513d81aa848e878be9a3650f0458d45950635c937ef627135f80b757b663e71fab9a3bde4fd91889153998ae3468fe7 +SHA512 (net-snmp-5.9.tar.gz) = 045a54be69a318ee8ed7ec8fd044bdb32821c189703cc7b1700b20f17a18af17a631588b3815f07ffa1f146f2e5be7f199a2929c6ab1f796d02fe6a2f3e8b3e5 From d9dc99b36b6e8ed580d037bff6d54eb808c9eb91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 2 Sep 2020 08:40:32 +0200 Subject: [PATCH 02/81] Remove dependency on pcre package --- net-snmp.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index 0e20d62..cbbe8cc 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: BSD @@ -66,7 +66,7 @@ BuildRequires: systemd BuildRequires: gcc BuildRequires: openssl-devel, bzip2-devel, elfutils-devel BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel -BuildRequires: perl-devel, perl(ExtUtils::Embed), procps, pcre-devel +BuildRequires: perl-devel, perl(ExtUtils::Embed), procps BuildRequires: python3-devel, python3-setuptools BuildRequires: chrpath BuildRequires: mariadb-connector-c-devel @@ -270,7 +270,8 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib" --with-systemd \ --with-temp-file-pattern=/run/net-snmp/snmp-tmp-XXXXXX \ --with-transports="DTLSUDP TLSTCP" \ - --with-sys-contact="root@localhost" < - 1:5.9-1 +* Tue Sep 01 2020 Josef Ridky - 1:5.9-2 +- Disable pcre binding + +* Mon Aug 17 2020 Josef Ridky - 1:5.9-1 - New upstream release 5.9 * Tue Aug 04 2020 Josef Ridky - 1:5.8-25 From be26e76db31e227dcc75fe872ad69f39629713ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 2 Sep 2020 08:46:25 +0200 Subject: [PATCH 03/81] Add support for available memory reporting --- net-snmp-5.9-available-memory.patch | 143 ++++++++++++++++++++++++++++ net-snmp.spec | 3 + 2 files changed, 146 insertions(+) create mode 100644 net-snmp-5.9-available-memory.patch diff --git a/net-snmp-5.9-available-memory.patch b/net-snmp-5.9-available-memory.patch new file mode 100644 index 0000000..7d7013e --- /dev/null +++ b/net-snmp-5.9-available-memory.patch @@ -0,0 +1,143 @@ +From 5b8bf5d4130761c3374f9ad618e8a76bb75eb634 Mon Sep 17 00:00:00 2001 +From: Yuwei Ba +Date: Fri, 21 Aug 2020 15:06:10 +0800 +Subject: [PATCH] snmpd: support MemAvailable on Linux + +See also https://github.com/net-snmp/net-snmp/pull/167 . + +[bvanassche: modified the behavior of this patch] +--- + agent/mibgroup/hardware/memory/memory_linux.c | 20 ++++++++++++++++++- + agent/mibgroup/ucd-snmp/memory.c | 12 ++++++++++- + agent/mibgroup/ucd-snmp/memory.h | 1 + + include/net-snmp/agent/hardware/memory.h | 1 + + mibs/UCD-SNMP-MIB.txt | 16 +++++++++++++++ + 5 files changed, 48 insertions(+), 2 deletions(-) + +diff --git a/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c +index 6d5e86cde..4ae235c2d 100644 +--- a/agent/mibgroup/hardware/memory/memory_linux.c ++++ b/agent/mibgroup/hardware/memory/memory_linux.c +@@ -24,7 +24,8 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { + static int first = 1; + ssize_t bytes_read; + char *b; +- unsigned long memtotal = 0, memfree = 0, memshared = 0, ++ int have_memavail = 0; ++ unsigned long memtotal = 0, memavail = 0, memfree = 0, memshared = 0, + buffers = 0, cached = 0, sreclaimable = 0, + swaptotal = 0, swapfree = 0; + +@@ -81,6 +82,11 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { + if (first) + snmp_log(LOG_ERR, "No MemTotal line in /proc/meminfo\n"); + } ++ b = strstr(buff, "MemAvailable: "); ++ if (b) { ++ have_memavail = 1; ++ sscanf(b, "MemAvailable: %lu", &memavail); ++ } + b = strstr(buff, "MemFree: "); + if (b) + sscanf(b, "MemFree: %lu", &memfree); +@@ -151,6 +157,18 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { + mem->other = -1; + } + ++ if (have_memavail) { ++ mem = netsnmp_memory_get_byIdx(NETSNMP_MEM_TYPE_AVAILMEM, 1); ++ if (mem) { ++ if (!mem->descr) ++ mem->descr = strdup("Available memory"); ++ mem->units = 1024; ++ mem->size = memavail; ++ mem->free = memavail; ++ mem->other = -1; ++ } ++ } ++ + mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 ); + if (!mem) { + snmp_log_perror("No Virtual Memory info entry"); +diff --git a/agent/mibgroup/ucd-snmp/memory.c b/agent/mibgroup/ucd-snmp/memory.c +index 371a77e9a..158b28e67 100644 +--- a/agent/mibgroup/ucd-snmp/memory.c ++++ b/agent/mibgroup/ucd-snmp/memory.c +@@ -26,7 +26,7 @@ init_memory(void) + netsnmp_create_handler_registration("memory", handle_memory, + memory_oid, OID_LENGTH(memory_oid), + HANDLER_CAN_RONLY), +- 1, 26); ++ 1, 27); + netsnmp_register_scalar( + netsnmp_create_handler_registration("memSwapError", handle_memory, + memSwapError_oid, OID_LENGTH(memSwapError_oid), +@@ -272,6 +272,16 @@ handle_memory(netsnmp_mib_handler *handler, + c64.low = val & 0xFFFFFFFF; + c64.high = val >>32; + break; ++ case MEMORY_SYS_AVAIL: ++ type = ASN_COUNTER64; ++ mem_info = netsnmp_memory_get_byIdx(NETSNMP_MEM_TYPE_AVAILMEM, 0); ++ if (!mem_info) ++ goto NOSUCH; ++ val = mem_info->size; /* memavail */ ++ val *= (mem_info->units/1024); ++ c64.low = val & 0xFFFFFFFF; ++ c64.high = val >> 32; ++ break; + case MEMORY_SWAP_ERROR: + mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 ); + if (!mem_info) +diff --git a/agent/mibgroup/ucd-snmp/memory.h b/agent/mibgroup/ucd-snmp/memory.h +index ded214022..54a56a2fd 100644 +--- a/agent/mibgroup/ucd-snmp/memory.h ++++ b/agent/mibgroup/ucd-snmp/memory.h +@@ -41,6 +41,7 @@ Netsnmp_Node_Handler handle_memory; + #define MEMORY_SHARED_X 24 + #define MEMORY_BUFFER_X 25 + #define MEMORY_CACHED_X 26 ++#define MEMORY_SYS_AVAIL 27 + #define MEMORY_SWAP_ERROR 100 + #define MEMORY_SWAP_ERRMSG 101 + #endif /* MEMORY_H */ +diff --git a/include/net-snmp/agent/hardware/memory.h b/include/net-snmp/agent/hardware/memory.h +index 54265cf22..aca3a4d00 100644 +--- a/include/net-snmp/agent/hardware/memory.h ++++ b/include/net-snmp/agent/hardware/memory.h +@@ -10,6 +10,7 @@ typedef struct netsnmp_memory_info_s netsnmp_memory_info; + #define NETSNMP_MEM_TYPE_SHARED 8 + #define NETSNMP_MEM_TYPE_SHARED2 9 + #define NETSNMP_MEM_TYPE_SWAP 10 ++#define NETSNMP_MEM_TYPE_AVAILMEM 11 + /* Leave space for individual swap devices */ + #define NETSNMP_MEM_TYPE_MAX 30 + +diff --git a/mibs/UCD-SNMP-MIB.txt b/mibs/UCD-SNMP-MIB.txt +index cde67feb5..d360bad02 100644 +--- a/mibs/UCD-SNMP-MIB.txt ++++ b/mibs/UCD-SNMP-MIB.txt +@@ -746,6 +746,22 @@ memCachedX OBJECT-TYPE + memory as specifically reserved for this purpose." + ::= { memory 26 } + ++memSysAvail OBJECT-TYPE ++ SYNTAX CounterBasedGauge64 ++ UNITS "kB" ++ MAX-ACCESS read-only ++ STATUS current ++ DESCRIPTION ++ "The total amount of available memory, which is an estimate ++ of how much memory is available for starting new applications, ++ without swapping. ++ ++ This object will not be implemented on hosts where the ++ underlying operating system does not explicitly identify ++ memory as specifically reserved for this purpose." ++ ::= { memory 27 } ++ ++ + memSwapError OBJECT-TYPE + SYNTAX UCDErrorFlag + MAX-ACCESS read-only + diff --git a/net-snmp.spec b/net-snmp.spec index cbbe8cc..aa5793f 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -49,6 +49,7 @@ Patch19: net-snmp-5.8-man-page.patch Patch20: net-snmp-5.8-ipAddress-faster-load.patch Patch21: net-snmp-5.8-rpm-memory-leak.patch Patch22: net-snmp-5.9-aes-config.patch +Patch23: net-snmp-5.9-available-memory.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -221,6 +222,7 @@ cp %{SOURCE10} . %patch20 -p1 -b .ipAddress-faster-load %patch21 -p1 -b .rpm-memory-leak %patch22 -p1 -b .aes-config +%patch23 -p1 -b .available-memory %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -490,6 +492,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Tue Sep 01 2020 Josef Ridky - 1:5.9-2 - Disable pcre binding +- Add support for available memory report * Mon Aug 17 2020 Josef Ridky - 1:5.9-1 - New upstream release 5.9 From 911fab38f41561dbc6729038ae0a36c0fb8bdacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 18 Nov 2020 08:02:02 +0100 Subject: [PATCH 04/81] Resolves: #1893471 - fix /var/run to /run for tmpfs --- net-snmp-tmpfs.conf | 2 +- net-snmp.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net-snmp-tmpfs.conf b/net-snmp-tmpfs.conf index 382f8eb..9f782d6 100644 --- a/net-snmp-tmpfs.conf +++ b/net-snmp-tmpfs.conf @@ -1 +1 @@ -d /var/run/net-snmp 0755 root root +d /run/net-snmp 0755 root root diff --git a/net-snmp.spec b/net-snmp.spec index aa5793f..85682a3 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: BSD @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Nov 18 2020 Josef Ridky - 1:5.9-3 +- update net-snmp-tmpfs.conf for /var/run to /run (#1893471) + * Tue Sep 01 2020 Josef Ridky - 1:5.9-2 - Disable pcre binding - Add support for available memory report From 5573ec507b2ff8bcf2d4f1213f1335c4ef81bd8a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 7 Jan 2021 05:42:44 +0000 Subject: [PATCH 05/81] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- net-snmp.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/net-snmp.spec b/net-snmp.spec index 85682a3..5e8369a 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -63,6 +63,7 @@ Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # is not valid. We can use %%post because this particular %%triggerun script # should fire just after this package is installed. %{?systemd_requires} +BuildRequires: make BuildRequires: systemd BuildRequires: gcc BuildRequires: openssl-devel, bzip2-devel, elfutils-devel From 4d7a6a14634fd61b493d83c13e6e199f07da6847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 18 Jan 2021 12:23:31 +0100 Subject: [PATCH 06/81] Fix issue with parsing long trap headers --- net-snmp-5.8-asn-parse-nlength.patch | 86 ++++++++++++++++++++++++++++ net-snmp.spec | 7 ++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.8-asn-parse-nlength.patch diff --git a/net-snmp-5.8-asn-parse-nlength.patch b/net-snmp-5.8-asn-parse-nlength.patch new file mode 100644 index 0000000..23823f5 --- /dev/null +++ b/net-snmp-5.8-asn-parse-nlength.patch @@ -0,0 +1,86 @@ +From 92f0fe9e0dc3cf7ab6e8cc94d7962df83d0ddbec Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Mon, 4 Jan 2021 12:21:59 -0800 +Subject: [PATCH] libsnmp: Fix asn_parse_nlength() + +Handle length zero correctly. + +Fixes: https://github.com/net-snmp/net-snmp/issues/253 +Fixes: a9850f4445cf ("asn parse: add NULL checks, check length lengths") +--- + snmplib/asn1.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/snmplib/asn1.c b/snmplib/asn1.c +index e983500e7..33c272768 100644 +--- a/snmplib/asn1.c ++++ b/snmplib/asn1.c +@@ -345,7 +345,7 @@ asn_parse_nlength(u_char *pkt, size_t pkt_len, u_long *data_len) + * long length; first byte is length of length (after masking high bit) + */ + len_len = (int) ((*pkt & ~0x80) + 1); +- if ((int) pkt_len <= len_len ) ++ if (pkt_len < len_len) + return NULL; /* still too short for length and data */ + + /* now we know we have enough data to parse length */ +From baef04f9c6fe0eb3ac74dd4d26a19264eeaf7fa1 Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Mon, 4 Jan 2021 10:00:33 -0800 +Subject: [PATCH] testing/fulltests/unit-tests/T105trap_parse_clib: Add this + test + +Add a reproducer for the bug fixed by the previous patch. +--- + .../unit-tests/T105trap_parse_clib.c | 41 +++++++++++++++++++ + 1 file changed, 41 insertions(+) + create mode 100644 testing/fulltests/unit-tests/T105trap_parse_clib.c + +diff --git a/testing/fulltests/unit-tests/T105trap_parse_clib.c b/testing/fulltests/unit-tests/T105trap_parse_clib.c +new file mode 100644 +index 000000000..5c21ccdc7 +--- /dev/null ++++ b/testing/fulltests/unit-tests/T105trap_parse_clib.c +@@ -0,0 +1,41 @@ ++/* HEADER Parsing of an SNMP trap with no varbinds */ ++netsnmp_pdu pdu; ++int rc; ++static u_char trap_pdu[] = { ++ /* Sequence with length of 0x2d = 45 bytes. */ ++ [ 0] = 0x30, [ 1] = 0x82, [ 2] = 0x00, [ 3] = 0x2d, ++ /* version = INTEGER 0 */ ++ [ 4] = 0x02, [ 5] = 0x01, [ 6] = 0x00, ++ /* community = public (OCTET STRING 0x70 0x75 0x62 0x6c 0x69 0x63) */ ++ [ 7] = 0x04, [ 8] = 0x06, [ 9] = 0x70, [10] = 0x75, ++ [11] = 0x62, [12] = 0x6c, [13] = 0x69, [14] = 0x63, ++ /* SNMP_MSG_TRAP; 32 bytes. */ ++ [15] = 0xa4, [16] = 0x20, ++ /* enterprise = OBJECT IDENTIFIER .1.3.6.1.6.3.1.1.5 = snmpTraps */ ++ [17] = 0x06, [18] = 0x08, ++ [19] = 0x2b, [20] = 0x06, [21] = 0x01, [22] = 0x06, ++ [23] = 0x03, [24] = 0x01, [25] = 0x01, [26] = 0x05, ++ /* agent-addr = ASN_IPADDRESS 192.168.1.34 */ ++ [27] = 0x40, [28] = 0x04, [29] = 0xc0, [30] = 0xa8, ++ [31] = 0x01, [32] = 0x22, ++ /* generic-trap = INTEGER 0 */ ++ [33] = 0x02, [34] = 0x01, [35] = 0x00, ++ /* specific-trap = INTEGER 0 */ ++ [36] = 0x02, [37] = 0x01, [38] = 0x00, ++ /* ASN_TIMETICKS 0x117f243a */ ++ [39] = 0x43, [40] = 0x04, [41] = 0x11, [42] = 0x7f, ++ [43] = 0x24, [44] = 0x3a, ++ /* varbind list */ ++ [45] = 0x30, [46] = 0x82, [47] = 0x00, [48] = 0x00, ++}; ++static size_t trap_pdu_length = sizeof(trap_pdu); ++netsnmp_session session; ++ ++snmp_set_do_debugging(TRUE); ++debug_register_tokens("dumpv_recv,dumpv_send,asn,recv"); ++memset(&session, 0, sizeof(session)); ++snmp_sess_init(&session); ++memset(&pdu, 0, sizeof(pdu)); ++rc = snmp_parse(NULL, &session, &pdu, trap_pdu, trap_pdu_length); ++ ++OKF((rc == 0), ("Parsing of a trap PDU")); + diff --git a/net-snmp.spec b/net-snmp.spec index 85682a3..b00e0e5 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: BSD @@ -50,6 +50,7 @@ Patch20: net-snmp-5.8-ipAddress-faster-load.patch Patch21: net-snmp-5.8-rpm-memory-leak.patch Patch22: net-snmp-5.9-aes-config.patch Patch23: net-snmp-5.9-available-memory.patch +Patch24: net-snmp-5.8-asn-parse-nlength.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -223,6 +224,7 @@ cp %{SOURCE10} . %patch21 -p1 -b .rpm-memory-leak %patch22 -p1 -b .aes-config %patch23 -p1 -b .available-memory +%patch24 -p1 -b .asn-parse-nlength %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -490,6 +492,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jan 18 2021 Josef Ridky - 1:5.9-4 +- fix issue with parsing long trap headers (#1912725) + * Wed Nov 18 2020 Josef Ridky - 1:5.9-3 - update net-snmp-tmpfs.conf for /var/run to /run (#1893471) From b6b01ca16fe6f28c3fc64302b0aabf3c313b0e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 18 Jan 2021 13:29:25 +0100 Subject: [PATCH 07/81] Fix error message when the address specified by clientaddr option is wrong or cannot be bound --- net-snmp-5.8-clientaddr-error-message.patch | 35 +++++++++++++++++++++ net-snmp.spec | 4 +++ 2 files changed, 39 insertions(+) create mode 100644 net-snmp-5.8-clientaddr-error-message.patch diff --git a/net-snmp-5.8-clientaddr-error-message.patch b/net-snmp-5.8-clientaddr-error-message.patch new file mode 100644 index 0000000..7ea9752 --- /dev/null +++ b/net-snmp-5.8-clientaddr-error-message.patch @@ -0,0 +1,35 @@ +diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c +--- a/snmplib/snmp_api.c 2020-11-26 11:05:51.084788775 +0100 ++++ b/snmplib/snmp_api.c 2020-11-26 11:08:27.850751397 +0100 +@@ -235,7 +235,7 @@ static const char *api_errors[-SNMPERR_M + "No error", /* SNMPERR_SUCCESS */ + "Generic error", /* SNMPERR_GENERR */ + "Invalid local port", /* SNMPERR_BAD_LOCPORT */ +- "Unknown host", /* SNMPERR_BAD_ADDRESS */ ++ "Invalid address", /* SNMPERR_BAD_ADDRESS */ + "Unknown session", /* SNMPERR_BAD_SESSION */ + "Too long", /* SNMPERR_TOO_LONG */ + "No socket", /* SNMPERR_NO_SOCKET */ +@@ -1662,7 +1662,9 @@ _sess_open(netsnmp_session * in_session) + DEBUGMSGTL(("_sess_open", "couldn't interpret peername\n")); + in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS; + in_session->s_errno = errno; +- snmp_set_detail(in_session->peername); ++ if (!netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_CLIENT_ADDR)) ++ snmp_set_detail(in_session->peername); + return NULL; + } + +diff -ruNp a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c +--- a/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 12:51:51.948106797 +0100 ++++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 14:17:31.029745744 +0100 +@@ -209,6 +209,8 @@ netsnmp_udpipv4base_transport_bind(netsn + DEBUGMSGTL(("netsnmp_udpbase", + "failed to bind for clientaddr: %d %s\n", + errno, strerror(errno))); ++ NETSNMP_LOGONCE((LOG_ERR, "Cannot bind for clientaddr: %s\n", ++ strerror(errno))); + goto err; + } + diff --git a/net-snmp.spec b/net-snmp.spec index b00e0e5..ea227ad 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -51,6 +51,7 @@ Patch21: net-snmp-5.8-rpm-memory-leak.patch Patch22: net-snmp-5.9-aes-config.patch Patch23: net-snmp-5.9-available-memory.patch Patch24: net-snmp-5.8-asn-parse-nlength.patch +Patch25: net-snmp-5.8-clientaddr-error-message.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -225,6 +226,7 @@ cp %{SOURCE10} . %patch22 -p1 -b .aes-config %patch23 -p1 -b .available-memory %patch24 -p1 -b .asn-parse-nlength +%patch25 -p1 -b .clientaddr-error-message %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -494,6 +496,8 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Mon Jan 18 2021 Josef Ridky - 1:5.9-4 - fix issue with parsing long trap headers (#1912725) +- fix error message when the address specified by clientaddr option + is wrong or cannot be bound * Wed Nov 18 2020 Josef Ridky - 1:5.9-3 - update net-snmp-tmpfs.conf for /var/run to /run (#1893471) From 91a48da872984a3e67fe6c7e8b09c62efbd5d263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 18 Jan 2021 14:27:41 +0100 Subject: [PATCH 08/81] Fix issue with quoting empty passphrase --- net-snmp.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net-snmp.spec b/net-snmp.spec index ea227ad..f2fcf80 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -52,6 +52,7 @@ Patch22: net-snmp-5.9-aes-config.patch Patch23: net-snmp-5.9-available-memory.patch Patch24: net-snmp-5.8-asn-parse-nlength.patch Patch25: net-snmp-5.8-clientaddr-error-message.patch +Patch26: net-snmp-5.8-empty-passphrase.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -227,6 +228,7 @@ cp %{SOURCE10} . %patch23 -p1 -b .available-memory %patch24 -p1 -b .asn-parse-nlength %patch25 -p1 -b .clientaddr-error-message +%patch26 -p1 -b .empty-passphrase %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -498,6 +500,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test - fix issue with parsing long trap headers (#1912725) - fix error message when the address specified by clientaddr option is wrong or cannot be bound +- fix issue with quoting empty passphrase * Wed Nov 18 2020 Josef Ridky - 1:5.9-3 - update net-snmp-tmpfs.conf for /var/run to /run (#1893471) From 07d64d3ffe53ed2fc4e7d192f07cf122268a10b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 18 Jan 2021 14:42:36 +0100 Subject: [PATCH 09/81] Add patch to empty passphrase issue --- net-snmp-5.8-empty-passphrase.patch | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 net-snmp-5.8-empty-passphrase.patch diff --git a/net-snmp-5.8-empty-passphrase.patch b/net-snmp-5.8-empty-passphrase.patch new file mode 100644 index 0000000..deb0388 --- /dev/null +++ b/net-snmp-5.8-empty-passphrase.patch @@ -0,0 +1,30 @@ +From 09a0c9005fb72102bf4f4499b28282f823e3e526 Mon Sep 17 00:00:00 2001 +From: Josef Ridky +Date: Wed, 18 Nov 2020 20:54:34 -0800 +Subject: [PATCH] net-snmp-create-v3-user: Handle empty passphrases correctly + +See also https://github.com/net-snmp/net-snmp/issues/86. + +Fixes: e5ad10de8e17 ("Quote provided encryption key in createUser line") +Reported-by: Chris Cheney +--- + net-snmp-create-v3-user.in | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in +index 452c2699d..31b4c58c1 100644 +--- a/net-snmp-create-v3-user.in ++++ b/net-snmp-create-v3-user.in +@@ -120,7 +120,11 @@ fi + fi + outdir="@PERSISTENT_DIRECTORY@" + outfile="$outdir/snmpd.conf" +-line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm \"$xpassphrase\"" ++if test "x$xpassphrase" = "x" ; then ++ line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm" ++else ++ line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm \"$xpassphrase\"" ++fi + echo "adding the following line to $outfile:" + echo " " $line + # in case it hasn't ever been started yet, start it. From f532a181bf1c62c48009b70883bdd4cad60627bc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 21:22:15 +0000 Subject: [PATCH 10/81] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index a88eca6..d81c527 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: BSD @@ -497,6 +497,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 1:5.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Jan 18 2021 Josef Ridky - 1:5.9-4 - fix issue with parsing long trap headers (#1912725) - fix error message when the address specified by clientaddr option From 9fa55abb4b79a8c773f23e558407fac52b679df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 28 Jan 2021 12:46:06 +0100 Subject: [PATCH 11/81] Add support for digests detected from ECC certificates --- net-snmp-5.9-ECC-cert.patch | 98 +++++++++++++++++++++++++++++++++++++ net-snmp.spec | 7 ++- 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9-ECC-cert.patch diff --git a/net-snmp-5.9-ECC-cert.patch b/net-snmp-5.9-ECC-cert.patch new file mode 100644 index 0000000..5d43d4d --- /dev/null +++ b/net-snmp-5.9-ECC-cert.patch @@ -0,0 +1,98 @@ +From a1968db524e087a36a19a351b89bf6f1633819aa Mon Sep 17 00:00:00 2001 +From: minfrin +Date: Tue, 5 Jan 2021 23:17:14 +0000 +Subject: [PATCH] Add support for digests detected from ECC certificates + +Previously, the digest could be detected on RSA certificates only. This +patch adds detection for ECC certificates. + +[ bvanassche: changed _htmap2 into a two-dimensional array and renamed _htmap2 + back to _htmap ] +--- + snmplib/snmp_openssl.c | 60 +++++++++++++++++++++++++++++++++++------- + 1 file changed, 50 insertions(+), 10 deletions(-) + +diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c +index c092a007a..432cb5c27 100644 +--- a/snmplib/snmp_openssl.c ++++ b/snmplib/snmp_openssl.c +@@ -521,18 +521,54 @@ netsnmp_openssl_cert_dump_extensions(X509 *ocert) + } + } + +-static int _htmap[NS_HASH_MAX + 1] = { +- 0, NID_md5WithRSAEncryption, NID_sha1WithRSAEncryption, +- NID_sha224WithRSAEncryption, NID_sha256WithRSAEncryption, +- NID_sha384WithRSAEncryption, NID_sha512WithRSAEncryption }; ++static const struct { ++ uint16_t nid; ++ uint16_t ht; ++} _htmap[] = { ++ { 0, NS_HASH_NONE }, ++#ifdef NID_md5WithRSAEncryption ++ { NID_md5WithRSAEncryption, NS_HASH_MD5 }, ++#endif ++#ifdef NID_sha1WithRSAEncryption ++ { NID_sha1WithRSAEncryption, NS_HASH_SHA1 }, ++#endif ++#ifdef NID_ecdsa_with_SHA1 ++ { NID_ecdsa_with_SHA1, NS_HASH_SHA1 }, ++#endif ++#ifdef NID_sha224WithRSAEncryption ++ { NID_sha224WithRSAEncryption, NS_HASH_SHA224 }, ++#endif ++#ifdef NID_ecdsa_with_SHA224 ++ { NID_ecdsa_with_SHA224, NS_HASH_SHA224 }, ++#endif ++#ifdef NID_sha256WithRSAEncryption ++ { NID_sha256WithRSAEncryption, NS_HASH_SHA256 }, ++#endif ++#ifdef NID_ecdsa_with_SHA256 ++ { NID_ecdsa_with_SHA256, NS_HASH_SHA256 }, ++#endif ++#ifdef NID_sha384WithRSAEncryption ++ { NID_sha384WithRSAEncryption, NS_HASH_SHA384 }, ++#endif ++#ifdef NID_ecdsa_with_SHA384 ++ { NID_ecdsa_with_SHA384, NS_HASH_SHA384 }, ++#endif ++#ifdef NID_sha512WithRSAEncryption ++ { NID_sha512WithRSAEncryption, NS_HASH_SHA512 }, ++#endif ++#ifdef NID_ecdsa_with_SHA512 ++ { NID_ecdsa_with_SHA512, NS_HASH_SHA512 }, ++#endif ++}; + + int + _nid2ht(int nid) + { + int i; +- for (i=1; i<= NS_HASH_MAX; ++i) { +- if (nid == _htmap[i]) +- return i; ++ ++ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) { ++ if (_htmap[i].nid == nid) ++ return _htmap[i].ht; + } + return 0; + } +@@ -541,9 +577,13 @@ _nid2ht(int nid) + int + _ht2nid(int ht) + { +- if ((ht < 0) || (ht > NS_HASH_MAX)) +- return 0; +- return _htmap[ht]; ++ int i; ++ ++ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) { ++ if (_htmap[i].ht == ht) ++ return _htmap[i].nid; ++ } ++ return 0; + } + #endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_HT2NID */ + + diff --git a/net-snmp.spec b/net-snmp.spec index d81c527..6cdada0 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 License: BSD @@ -53,6 +53,7 @@ Patch23: net-snmp-5.9-available-memory.patch Patch24: net-snmp-5.8-asn-parse-nlength.patch Patch25: net-snmp-5.8-clientaddr-error-message.patch Patch26: net-snmp-5.8-empty-passphrase.patch +Patch27: net-snmp-5.9-ECC-cert.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -230,6 +231,7 @@ cp %{SOURCE10} . %patch24 -p1 -b .asn-parse-nlength %patch25 -p1 -b .clientaddr-error-message %patch26 -p1 -b .empty-passphrase +%patch27 -p1 -b .ECC-cert %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -497,6 +499,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 28 2021 Josef Ridky - 1:5.9-6 +- add support for digests detected from ECC certificates + * Tue Jan 26 2021 Fedora Release Engineering - 1:5.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 4efbf707c21c6b3f192a985a40b1df73daac0b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 28 Jan 2021 13:24:12 +0100 Subject: [PATCH 12/81] Add support for intermediate certificates --- net-snmp-5.9-intermediate-certs.patch | 1079 +++++++++++++++++++++++++ net-snmp.spec | 3 + 2 files changed, 1082 insertions(+) create mode 100644 net-snmp-5.9-intermediate-certs.patch diff --git a/net-snmp-5.9-intermediate-certs.patch b/net-snmp-5.9-intermediate-certs.patch new file mode 100644 index 0000000..3a4ebcd --- /dev/null +++ b/net-snmp-5.9-intermediate-certs.patch @@ -0,0 +1,1079 @@ +diff -urNp a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h +--- a/include/net-snmp/library/cert_util.h 2021-01-28 12:55:48.969560884 +0100 ++++ b/include/net-snmp/library/cert_util.h 2021-01-28 13:10:25.616592870 +0100 +@@ -55,7 +55,8 @@ extern "C" { + char *common_name; + + u_char hash_type; +- u_char _pad[3]; /* for future use */ ++ u_char _pad[1]; /* for future use */ ++ u_short offset; + } netsnmp_cert; + + /** types */ +@@ -100,6 +101,7 @@ extern "C" { + + NETSNMP_IMPORT + netsnmp_cert *netsnmp_cert_find(int what, int where, void *hint); ++ netsnmp_void_array *netsnmp_certs_find(int what, int where, void *hint); + + int netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var); + +diff -urNp a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h +--- a/include/net-snmp/library/dir_utils.h 2021-01-28 12:55:48.969560884 +0100 ++++ b/include/net-snmp/library/dir_utils.h 2021-01-28 13:10:25.616592870 +0100 +@@ -53,6 +53,8 @@ extern "C" { + #define NETSNMP_DIR_NSFILE 0x0010 + /** load stats in netsnmp_file */ + #define NETSNMP_DIR_NSFILE_STATS 0x0020 ++/** allow files to be indexed more than once */ ++#define NETSNMP_DIR_ALLOW_DUPLICATES 0x0040 + + + +diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c +--- a/snmplib/cert_util.c 2021-01-28 12:55:48.909560222 +0100 ++++ b/snmplib/cert_util.c 2021-01-28 13:14:32.104988765 +0100 +@@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint + * bump this value whenever cert index format changes, so indexes + * will be regenerated with new format. + */ +-#define CERT_INDEX_FORMAT 1 ++#define CERT_INDEX_FORMAT 2 + + static netsnmp_container *_certs = NULL; + static netsnmp_container *_keys = NULL; +@@ -126,6 +126,8 @@ static int _cert_fn_ncompare(netsnmp_ce + netsnmp_cert_common *rhs); + static void _find_partner(netsnmp_cert *cert, netsnmp_key *key); + static netsnmp_cert *_find_issuer(netsnmp_cert *cert); ++static netsnmp_void_array *_cert_reduce_subset_first(netsnmp_void_array *matching); ++static netsnmp_void_array *_cert_reduce_subset_what(netsnmp_void_array *matching, int what); + static netsnmp_void_array *_cert_find_subset_fn(const char *filename, + const char *directory); + static netsnmp_void_array *_cert_find_subset_sn(const char *subject); +@@ -345,6 +347,8 @@ _get_cert_container(const char *use) + { + netsnmp_container *c; + ++ int rc; ++ + c = netsnmp_container_find("certs:binary_array"); + if (NULL == c) { + snmp_log(LOG_ERR, "could not create container for %s\n", use); +@@ -354,6 +358,8 @@ _get_cert_container(const char *use) + c->free_item = (netsnmp_container_obj_func*)_cert_free; + c->compare = (netsnmp_container_compare*)_cert_compare; + ++ CONTAINER_SET_OPTIONS(c, CONTAINER_KEY_ALLOW_DUPLICATES, rc); ++ + return c; + } + +@@ -362,6 +368,8 @@ _setup_containers(void) + { + netsnmp_container *additional_keys; + ++ int rc; ++ + _certs = _get_cert_container("netsnmp certificates"); + if (NULL == _certs) + return; +@@ -376,6 +384,7 @@ _setup_containers(void) + additional_keys->container_name = strdup("certs_cn"); + additional_keys->free_item = NULL; + additional_keys->compare = (netsnmp_container_compare*)_cert_cn_compare; ++ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + netsnmp_container_add_index(_certs, additional_keys); + + /** additional keys: subject name */ +@@ -389,6 +398,7 @@ _setup_containers(void) + additional_keys->free_item = NULL; + additional_keys->compare = (netsnmp_container_compare*)_cert_sn_compare; + additional_keys->ncompare = (netsnmp_container_compare*)_cert_sn_ncompare; ++ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + netsnmp_container_add_index(_certs, additional_keys); + + /** additional keys: file name */ +@@ -402,6 +412,7 @@ _setup_containers(void) + additional_keys->free_item = NULL; + additional_keys->compare = (netsnmp_container_compare*)_cert_fn_compare; + additional_keys->ncompare = (netsnmp_container_compare*)_cert_fn_ncompare; ++ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + netsnmp_container_add_index(_certs, additional_keys); + + _keys = netsnmp_container_find("cert_keys:binary_array"); +@@ -424,9 +435,9 @@ netsnmp_cert_map_container(void) + } + + static netsnmp_cert * +-_new_cert(const char *dirname, const char *filename, int certType, +- int hashType, const char *fingerprint, const char *common_name, +- const char *subject) ++_new_cert(const char *dirname, const char *filename, int certType, int offset, ++ int allowed_uses, int hashType, const char *fingerprint, ++ const char *common_name, const char *subject) + { + netsnmp_cert *cert; + +@@ -446,8 +457,10 @@ _new_cert(const char *dirname, const cha + + cert->info.dir = strdup(dirname); + cert->info.filename = strdup(filename); +- cert->info.allowed_uses = NS_CERT_REMOTE_PEER; ++ /* only the first certificate is allowed to be a remote peer */ ++ cert->info.allowed_uses = allowed_uses; + cert->info.type = certType; ++ cert->offset = offset; + if (fingerprint) { + cert->hash_type = hashType; + cert->fingerprint = strdup(fingerprint); +@@ -884,14 +897,86 @@ _certindex_new( const char *dirname ) + * certificate utility functions + * + */ ++static BIO * ++netsnmp_open_bio(const char *dir, const char *filename) ++{ ++ BIO *certbio; ++ char file[SNMP_MAXPATH]; ++ ++ DEBUGMSGT(("9:cert:read", "Checking file %s\n", filename)); ++ ++ certbio = BIO_new(BIO_s_file()); ++ if (NULL == certbio) { ++ snmp_log(LOG_ERR, "error creating BIO\n"); ++ return NULL; ++ } ++ ++ snprintf(file, sizeof(file),"%s/%s", dir, filename); ++ if (BIO_read_filename(certbio, file) <=0) { ++ snmp_log(LOG_ERR, "error reading certificate/key %s into BIO\n", file); ++ BIO_vfree(certbio); ++ return NULL; ++ } ++ ++ return certbio; ++} ++ ++static void ++netsnmp_ocert_parse(netsnmp_cert *cert, X509 *ocert) ++{ ++ int is_ca; ++ ++ cert->ocert = ocert; ++ ++ /* ++ * X509_check_ca return codes: ++ * 0 not a CA ++ * 1 is a CA ++ * 2 basicConstraints absent so "maybe" a CA ++ * 3 basicConstraints absent but self signed V1. ++ * 4 basicConstraints absent but keyUsage present and keyCertSign asserted. ++ * 5 outdated Netscape Certificate Type CA extension. ++ */ ++ is_ca = X509_check_ca(ocert); ++ if (1 == is_ca) ++ cert->info.allowed_uses |= NS_CERT_CA; ++ ++ if (NULL == cert->subject) { ++ cert->subject = X509_NAME_oneline(X509_get_subject_name(ocert), NULL, ++ 0); ++ DEBUGMSGT(("9:cert:add:subject", "subject name: %s\n", cert->subject)); ++ } ++ ++ if (NULL == cert->issuer) { ++ cert->issuer = X509_NAME_oneline(X509_get_issuer_name(ocert), NULL, 0); ++ if (strcmp(cert->subject, cert->issuer) == 0) { ++ free(cert->issuer); ++ cert->issuer = strdup("self-signed"); ++ } ++ DEBUGMSGT(("9:cert:add:issuer", "CA issuer: %s\n", cert->issuer)); ++ } ++ ++ if (NULL == cert->fingerprint) { ++ cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert); ++ cert->fingerprint = ++ netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type); ++ } ++ ++ if (NULL == cert->common_name) { ++ cert->common_name =netsnmp_openssl_cert_get_commonName(ocert, NULL, ++ NULL); ++ DEBUGMSGT(("9:cert:add:name","%s\n", cert->common_name)); ++ } ++ ++} ++ + static X509 * + netsnmp_ocert_get(netsnmp_cert *cert) + { + BIO *certbio; + X509 *ocert = NULL; ++ X509 *ncert = NULL; + EVP_PKEY *okey = NULL; +- char file[SNMP_MAXPATH]; +- int is_ca; + + if (NULL == cert) + return NULL; +@@ -908,51 +993,33 @@ netsnmp_ocert_get(netsnmp_cert *cert) + } + } + +- DEBUGMSGT(("9:cert:read", "Checking file %s\n", cert->info.filename)); +- +- certbio = BIO_new(BIO_s_file()); +- if (NULL == certbio) { +- snmp_log(LOG_ERR, "error creating BIO\n"); +- return NULL; +- } +- +- snprintf(file, sizeof(file),"%s/%s", cert->info.dir, cert->info.filename); +- if (BIO_read_filename(certbio, file) <=0) { +- snmp_log(LOG_ERR, "error reading certificate %s into BIO\n", file); +- BIO_vfree(certbio); ++ certbio = netsnmp_open_bio(cert->info.dir, cert->info.filename); ++ if (!certbio) { + return NULL; + } + +- if (NS_CERT_TYPE_UNKNOWN == cert->info.type) { +- char *pos = strrchr(cert->info.filename, '.'); +- if (NULL == pos) +- return NULL; +- cert->info.type = _cert_ext_type(++pos); +- netsnmp_assert(cert->info.type != NS_CERT_TYPE_UNKNOWN); +- } +- + switch (cert->info.type) { + + case NS_CERT_TYPE_DER: ++ (void)BIO_seek(certbio, cert->offset); + ocert = d2i_X509_bio(certbio,NULL); /* DER/ASN1 */ + if (NULL != ocert) + break; +- (void)BIO_reset(certbio); + /* Check for PEM if DER didn't work */ + /* FALLTHROUGH */ + + case NS_CERT_TYPE_PEM: +- ocert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); ++ (void)BIO_seek(certbio, cert->offset); ++ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); + if (NULL == ocert) + break; + if (NS_CERT_TYPE_DER == cert->info.type) { + DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n")); + cert->info.type = NS_CERT_TYPE_PEM; + } +- /** check for private key too */ +- if (NULL == cert->key) { +- (void)BIO_reset(certbio); +- okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); ++ /** check for private key too, but only if we're the first certificate */ ++ if (0 == cert->offset && NULL == cert->key) { ++ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); + if (NULL != okey) { + netsnmp_key *key; + DEBUGMSGT(("cert:read:key", "found key with cert in %s\n", +@@ -979,7 +1046,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) + break; + #ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER + case NS_CERT_TYPE_PKCS12: +- (void)BIO_reset(certbio); ++ (void)BIO_seek(certbio, cert->offset); + PKCS12 *p12 = d2i_PKCS12_bio(certbio, NULL); + if ( (NULL != p12) && (PKCS12_verify_mac(p12, "", 0) || + PKCS12_verify_mac(p12, NULL, 0))) +@@ -999,46 +1066,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) + return NULL; + } + +- cert->ocert = ocert; +- /* +- * X509_check_ca return codes: +- * 0 not a CA +- * 1 is a CA +- * 2 basicConstraints absent so "maybe" a CA +- * 3 basicConstraints absent but self signed V1. +- * 4 basicConstraints absent but keyUsage present and keyCertSign asserted. +- * 5 outdated Netscape Certificate Type CA extension. +- */ +- is_ca = X509_check_ca(ocert); +- if (1 == is_ca) +- cert->info.allowed_uses |= NS_CERT_CA; +- +- if (NULL == cert->subject) { +- cert->subject = X509_NAME_oneline(X509_get_subject_name(ocert), NULL, +- 0); +- DEBUGMSGT(("9:cert:add:subject", "subject name: %s\n", cert->subject)); +- } +- +- if (NULL == cert->issuer) { +- cert->issuer = X509_NAME_oneline(X509_get_issuer_name(ocert), NULL, 0); +- if (strcmp(cert->subject, cert->issuer) == 0) { +- free(cert->issuer); +- cert->issuer = strdup("self-signed"); +- } +- DEBUGMSGT(("9:cert:add:issuer", "CA issuer: %s\n", cert->issuer)); +- } +- +- if (NULL == cert->fingerprint) { +- cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert); +- cert->fingerprint = +- netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type); +- } +- +- if (NULL == cert->common_name) { +- cert->common_name =netsnmp_openssl_cert_get_commonName(ocert, NULL, +- NULL); +- DEBUGMSGT(("9:cert:add:name","%s\n", cert->common_name)); +- } ++ netsnmp_ocert_parse(cert, ocert); + + return ocert; + } +@@ -1048,7 +1076,6 @@ netsnmp_okey_get(netsnmp_key *key) + { + BIO *keybio; + EVP_PKEY *okey; +- char file[SNMP_MAXPATH]; + + if (NULL == key) + return NULL; +@@ -1056,19 +1083,8 @@ netsnmp_okey_get(netsnmp_key *key) + if (key->okey) + return key->okey; + +- snprintf(file, sizeof(file),"%s/%s", key->info.dir, key->info.filename); +- DEBUGMSGT(("cert:key:read", "Checking file %s\n", key->info.filename)); +- +- keybio = BIO_new(BIO_s_file()); +- if (NULL == keybio) { +- snmp_log(LOG_ERR, "error creating BIO\n"); +- return NULL; +- } +- +- if (BIO_read_filename(keybio, file) <=0) { +- snmp_log(LOG_ERR, "error reading certificate %s into BIO\n", +- key->info.filename); +- BIO_vfree(keybio); ++ keybio = netsnmp_open_bio(key->info.dir, key->info.filename); ++ if (!keybio) { + return NULL; + } + +@@ -1154,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cer + cert->issuer_cert = _find_issuer(cert); + if (NULL == cert->issuer_cert) { + DEBUGMSGT(("cert:load:warn", +- "couldn't load CA chain for cert %s\n", ++ "couldn't load full CA chain for cert %s\n", + cert->info.filename)); + rc = CERT_LOAD_PARTIAL; + break; +@@ -1163,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cer + /** get issuer ocert */ + if ((NULL == cert->issuer_cert->ocert) && + (netsnmp_ocert_get(cert->issuer_cert) == NULL)) { +- DEBUGMSGT(("cert:load:warn", "couldn't load cert chain for %s\n", ++ DEBUGMSGT(("cert:load:warn", "couldn't load full cert chain for %s\n", + cert->info.filename)); + rc = CERT_LOAD_PARTIAL; + break; +@@ -1184,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnm + return; + } + +- if(key) { ++ if (key) { + if (key->cert) { + DEBUGMSGT(("cert:partner", "key already has partner\n")); + return; +@@ -1197,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnm + return; + *pos = 0; + +- matching = _cert_find_subset_fn( filename, key->info.dir ); ++ matching = _cert_reduce_subset_first(_cert_find_subset_fn( filename, ++ key->info.dir )); + if (!matching) + return; + if (1 == matching->size) { +@@ -1217,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnm + DEBUGMSGT(("cert:partner", "%s matches multiple certs\n", + key->info.filename)); + } +- else if(cert) { ++ else if (cert) { + if (cert->key) { + DEBUGMSGT(("cert:partner", "cert already has partner\n")); + return; +@@ -1255,76 +1272,189 @@ _find_partner(netsnmp_cert *cert, netsnm + } + } + ++static netsnmp_key * ++_add_key(EVP_PKEY *okey, const char* dirname, const char* filename, FILE *index) ++{ ++ netsnmp_key *key; ++ ++ key = _new_key(dirname, filename); ++ if (NULL == key) { ++ return NULL; ++ } ++ ++ key->okey = okey; ++ ++ if (-1 == CONTAINER_INSERT(_keys, key)) { ++ DEBUGMSGT(("cert:key:file:add:err", ++ "error inserting key into container\n")); ++ netsnmp_key_free(key); ++ key = NULL; ++ } ++ if (index) { ++ fprintf(index, "k:%s\n", filename); ++ } ++ ++ return key; ++} ++ ++static netsnmp_cert * ++_add_cert(X509 *ocert, const char* dirname, const char* filename, int type, int offset, ++ int allowed_uses, FILE *index) ++{ ++ netsnmp_cert *cert; ++ ++ cert = _new_cert(dirname, filename, type, offset, ++ allowed_uses, -1, NULL, NULL, NULL); ++ if (NULL == cert) ++ return NULL; ++ ++ netsnmp_ocert_parse(cert, ocert); ++ ++ if (-1 == CONTAINER_INSERT(_certs, cert)) { ++ DEBUGMSGT(("cert:file:add:err", ++ "error inserting cert into container\n")); ++ netsnmp_cert_free(cert); ++ return NULL; ++ } ++ ++ if (index) { ++ /** filename = NAME_MAX = 255 */ ++ /** fingerprint max = 64*3=192 for sha512 */ ++ /** common name / CN = 64 */ ++ if (cert) ++ fprintf(index, "c:%s %d %d %d %d %s '%s' '%s'\n", filename, ++ cert->info.type, cert->offset, cert->info.allowed_uses, ++ cert->hash_type, cert->fingerprint, ++ cert->common_name, cert->subject); ++ } ++ ++ return cert; ++} ++ + static int + _add_certfile(const char* dirname, const char* filename, FILE *index) + { +- X509 *ocert; +- EVP_PKEY *okey; ++ BIO *certbio; ++ X509 *ocert = NULL; ++ X509 *ncert; ++ EVP_PKEY *okey = NULL; + netsnmp_cert *cert = NULL; + netsnmp_key *key = NULL; + char certfile[SNMP_MAXPATH]; + int type; ++ int offset = 0; + + if (((const void*)NULL == dirname) || (NULL == filename)) + return -1; + + type = _type_from_filename(filename); +- netsnmp_assert(type != NS_CERT_TYPE_UNKNOWN); ++ if (type == NS_CERT_TYPE_UNKNOWN) { ++ snmp_log(LOG_ERR, "certificate file '%s' type not recognised, ignoring\n", filename); ++ return -1; ++ } + +- snprintf(certfile, sizeof(certfile),"%s/%s", dirname, filename); ++ certbio = netsnmp_open_bio(dirname, filename); ++ if (!certbio) { ++ return -1; ++ } + +- DEBUGMSGT(("9:cert:file:add", "Checking file: %s (type %d)\n", filename, +- type)); ++ switch (type) { + +- if (NS_CERT_TYPE_KEY == type) { +- key = _new_key(dirname, filename); +- if (NULL == key) +- return -1; +- okey = netsnmp_okey_get(key); +- if (NULL == okey) { +- netsnmp_key_free(key); +- return -1; +- } +- key->okey = okey; +- if (-1 == CONTAINER_INSERT(_keys, key)) { +- DEBUGMSGT(("cert:key:file:add:err", +- "error inserting key into container\n")); +- netsnmp_key_free(key); +- key = NULL; +- } +- } +- else { +- cert = _new_cert(dirname, filename, type, -1, NULL, NULL, NULL); +- if (NULL == cert) +- return -1; +- ocert = netsnmp_ocert_get(cert); +- if (NULL == ocert) { +- netsnmp_cert_free(cert); +- return -1; +- } +- cert->ocert = ocert; +- if (-1 == CONTAINER_INSERT(_certs, cert)) { +- DEBUGMSGT(("cert:file:add:err", +- "error inserting cert into container\n")); +- netsnmp_cert_free(cert); +- cert = NULL; +- } +- } +- if ((NULL == cert) && (NULL == key)) { +- DEBUGMSGT(("cert:file:add:failure", "for %s\n", certfile)); +- return -1; ++ case NS_CERT_TYPE_KEY: ++ ++ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); ++ if (NULL == okey) ++ snmp_log(LOG_ERR, "error parsing key file %s\n", ++ key->info.filename); ++ else { ++ key = _add_key(okey, dirname, filename, index); ++ if (NULL == key) { ++ EVP_PKEY_free(okey); ++ okey = NULL; ++ } ++ } ++ break; ++ ++ case NS_CERT_TYPE_DER: ++ ++ ocert = d2i_X509_bio(certbio, NULL); /* DER/ASN1 */ ++ if (NULL != ocert) { ++ if (!_add_cert(ocert, dirname, filename, type, 0, ++ NS_CERT_REMOTE_PEER, index)) { ++ X509_free(ocert); ++ ocert = NULL; ++ } ++ break; ++ } ++ (void)BIO_reset(certbio); ++ /* Check for PEM if DER didn't work */ ++ /* FALLTHROUGH */ ++ ++ case NS_CERT_TYPE_PEM: ++ ++ if (NS_CERT_TYPE_DER == type) { ++ DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n")); ++ type = NS_CERT_TYPE_PEM; ++ } ++ ++ /* read the private key first so we can record this in the index */ ++ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); ++ ++ (void)BIO_reset(certbio); ++ ++ /* certs are read after the key */ ++ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); ++ if (NULL != ocert) { ++ cert = _add_cert(ncert, dirname, filename, type, 0, ++ okey ? NS_CERT_IDENTITY | NS_CERT_REMOTE_PEER : ++ NS_CERT_REMOTE_PEER, index); ++ if (NULL == cert) { ++ X509_free(ocert); ++ ocert = ncert = NULL; ++ } ++ } ++ while (NULL != ncert) { ++ offset = BIO_tell(certbio); ++ ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); ++ if (ncert) { ++ if (NULL == _add_cert(ncert, dirname, filename, type, offset, 0, index)) { ++ X509_free(ncert); ++ ncert = NULL; ++ } ++ } ++ } ++ ++ if (NULL != okey) { ++ DEBUGMSGT(("cert:read:key", "found key with cert in %s\n", ++ cert->info.filename)); ++ key = _add_key(okey, dirname, filename, NULL); ++ if (NULL != key) { ++ DEBUGMSGT(("cert:read:partner", "%s match found!\n", ++ cert->info.filename)); ++ key->cert = cert; ++ cert->key = key; ++ } ++ else { ++ EVP_PKEY_free(okey); ++ okey = NULL; ++ } ++ } ++ ++ break; ++ ++#ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER ++ case NS_CERT_TYPE_PKCS12: ++#endif ++ ++ default: ++ break; + } + +- if (index) { +- /** filename = NAME_MAX = 255 */ +- /** fingerprint max = 64*3=192 for sha512 */ +- /** common name / CN = 64 */ +- if (cert) +- fprintf(index, "c:%s %d %d %s '%s' '%s'\n", filename, +- cert->info.type, cert->hash_type, cert->fingerprint, +- cert->common_name, cert->subject); +- else if (key) +- fprintf(index, "k:%s\n", filename); ++ BIO_vfree(certbio); ++ ++ if ((NULL == ocert) && (NULL == okey)) { ++ snmp_log(LOG_ERR, "certificate file '%s' contained neither certificate nor key, ignoring\n", certfile); ++ return -1; + } + + return 0; +@@ -1338,8 +1468,10 @@ _cert_read_index(const char *dirname, st + struct stat idx_stat; + char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX]; + char fingerprint[EVP_MAX_MD_SIZE*3], common_name[64+1], type_str[15]; +- char subject[SNMP_MAXBUF_SMALL], hash_str[15]; +- int count = 0, type, hash, version; ++ char subject[SNMP_MAXBUF_SMALL], hash_str[15], offset_str[15]; ++ char allowed_uses_str[15]; ++ ssize_t offset; ++ int count = 0, type, allowed_uses, hash, version; + netsnmp_cert *cert; + netsnmp_key *key; + netsnmp_container *newer, *found; +@@ -1381,7 +1513,8 @@ _cert_read_index(const char *dirname, st + netsnmp_directory_container_read_some(NULL, dirname, + _time_filter, &idx_stat, + NETSNMP_DIR_NSFILE | +- NETSNMP_DIR_NSFILE_STATS); ++ NETSNMP_DIR_NSFILE_STATS | ++ NETSNMP_DIR_ALLOW_DUPLICATES); + if (newer) { + DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n")); + CONTAINER_FREE_ALL(newer, NULL); +@@ -1425,6 +1558,8 @@ _cert_read_index(const char *dirname, st + pos = &tmpstr[2]; + if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) || + (NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) || ++ (NULL == (pos=copy_nword(pos, offset_str, sizeof(offset_str)))) || ++ (NULL == (pos=copy_nword(pos, allowed_uses_str, sizeof(allowed_uses_str)))) || + (NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) || + (NULL == (pos=copy_nword(pos, fingerprint, + sizeof(fingerprint)))) || +@@ -1437,9 +1572,11 @@ _cert_read_index(const char *dirname, st + break; + } + type = atoi(type_str); ++ offset = atoi(offset_str); ++ allowed_uses = atoi(allowed_uses_str); + hash = atoi(hash_str); +- cert = _new_cert(dirname, filename, type, hash, fingerprint, +- common_name, subject); ++ cert = _new_cert(dirname, filename, type, offset, allowed_uses, hash, ++ fingerprint, common_name, subject); + if (cert && 0 == CONTAINER_INSERT(found, cert)) + ++count; + else { +@@ -1543,7 +1680,8 @@ _add_certdir(const char *dirname) + netsnmp_directory_container_read_some(NULL, dirname, + _cert_cert_filter, NULL, + NETSNMP_DIR_RELATIVE_PATH | +- NETSNMP_DIR_EMPTY_OK ); ++ NETSNMP_DIR_EMPTY_OK | ++ NETSNMP_DIR_ALLOW_DUPLICATES); + if (NULL == cert_container) { + DEBUGMSGT(("cert:index:dir", + "error creating container for cert files\n")); +@@ -1631,7 +1769,7 @@ _cert_print(netsnmp_cert *c, void *conte + if (NULL == c) + return; + +- DEBUGMSGT(("cert:dump", "cert %s in %s\n", c->info.filename, c->info.dir)); ++ DEBUGMSGT(("cert:dump", "cert %s in %s at offset %d\n", c->info.filename, c->info.dir, c->offset)); + DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n", + c->info.type, c->info.allowed_uses, + _mode_str(c->info.allowed_uses))); +@@ -1835,7 +1973,8 @@ netsnmp_cert_find(int what, int where, v + netsnmp_void_array *matching; + + DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); +- matching = _cert_find_subset_fn( filename, NULL ); ++ matching = _cert_reduce_subset_what(_cert_find_subset_fn( ++ filename, NULL ), what); + if (!matching) + return NULL; + if (1 == matching->size) +@@ -1881,6 +2020,32 @@ netsnmp_cert_find(int what, int where, v + return result; + } + ++netsnmp_void_array * ++netsnmp_certs_find(int what, int where, void *hint) ++{ ++ ++ DEBUGMSGT(("certs:find:params", "looking for %s(%d) in %s(0x%x), hint %p\n", ++ _mode_str(what), what, _where_str(where), where, hint)); ++ ++ if (NS_CERTKEY_FILE == where) { ++ /** hint == filename */ ++ char *filename = (char*)hint; ++ netsnmp_void_array *matching; ++ ++ DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); ++ matching = _cert_reduce_subset_what(_cert_find_subset_fn( ++ filename, NULL ), what); ++ ++ return matching; ++ } /* where = NS_CERTKEY_FILE */ ++ else { /* unknown location */ ++ ++ DEBUGMSGT(("certs:find:err", "unhandled location %d for %d\n", where, ++ what)); ++ return NULL; ++ } ++} ++ + #ifndef NETSNMP_FEATURE_REMOVE_CERT_FINGERPRINTS + int + netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var) +@@ -2278,6 +2443,124 @@ _reduce_subset_dir(netsnmp_void_array *m + } + } + ++/* ++ * reduce subset by eliminating any certificates that are not the ++ * first certficate in a file. This allows us to ignore certificate ++ * chains when testing for specific certificates, and to match keys ++ * to the first certificate only. ++ */ ++static netsnmp_void_array * ++_cert_reduce_subset_first(netsnmp_void_array *matching) ++{ ++ netsnmp_cert *cc; ++ int i = 0, j, newsize; ++ ++ if ((NULL == matching)) ++ return matching; ++ ++ newsize = matching->size; ++ ++ for( ; i < matching->size; ) { ++ /* ++ * if we've shifted matches down we'll hit a NULL entry before ++ * we hit the end of the array. ++ */ ++ if (NULL == matching->array[i]) ++ break; ++ /* ++ * skip over valid matches. The first entry has an offset of zero. ++ */ ++ cc = (netsnmp_cert*)matching->array[i]; ++ if (0 == cc->offset) { ++ ++i; ++ continue; ++ } ++ /* ++ * shrink array by shifting everything down a spot. Might not be ++ * the most efficient soloution, but this is just happening at ++ * startup and hopefully most certs won't have common prefixes. ++ */ ++ --newsize; ++ for ( j=i; j < newsize; ++j ) ++ matching->array[j] = matching->array[j+1]; ++ matching->array[j] = NULL; ++ /** no ++i; just shifted down, need to look at same position again */ ++ } ++ /* ++ * if we shifted, set the new size ++ */ ++ if (newsize != matching->size) { ++ DEBUGMSGT(("9:cert:subset:first", "shrank from %" NETSNMP_PRIz "d to %d\n", ++ matching->size, newsize)); ++ matching->size = newsize; ++ } ++ ++ if (0 == matching->size) { ++ free(matching->array); ++ SNMP_FREE(matching); ++ } ++ ++ return matching; ++} ++ ++/* ++ * reduce subset by eliminating any certificates that do not match ++ * purpose specified. ++ */ ++static netsnmp_void_array * ++_cert_reduce_subset_what(netsnmp_void_array *matching, int what) ++{ ++ netsnmp_cert_common *cc; ++ int i = 0, j, newsize; ++ ++ if ((NULL == matching)) ++ return matching; ++ ++ newsize = matching->size; ++ ++ for( ; i < matching->size; ) { ++ /* ++ * if we've shifted matches down we'll hit a NULL entry before ++ * we hit the end of the array. ++ */ ++ if (NULL == matching->array[i]) ++ break; ++ /* ++ * skip over valid matches. The first entry has an offset of zero. ++ */ ++ cc = (netsnmp_cert_common *)matching->array[i]; ++ if ((cc->allowed_uses & what)) { ++ ++i; ++ continue; ++ } ++ /* ++ * shrink array by shifting everything down a spot. Might not be ++ * the most efficient soloution, but this is just happening at ++ * startup and hopefully most certs won't have common prefixes. ++ */ ++ --newsize; ++ for ( j=i; j < newsize; ++j ) ++ matching->array[j] = matching->array[j+1]; ++ matching->array[j] = NULL; ++ /** no ++i; just shifted down, need to look at same position again */ ++ } ++ /* ++ * if we shifted, set the new size ++ */ ++ if (newsize != matching->size) { ++ DEBUGMSGT(("9:cert:subset:what", "shrank from %" NETSNMP_PRIz "d to %d\n", ++ matching->size, newsize)); ++ matching->size = newsize; ++ } ++ ++ if (0 == matching->size) { ++ free(matching->array); ++ SNMP_FREE(matching); ++ } ++ ++ return matching; ++} ++ + static netsnmp_void_array * + _cert_find_subset_common(const char *filename, netsnmp_container *container) + { +diff -urNp a/snmplib/dir_utils.c b/snmplib/dir_utils.c +--- a/snmplib/dir_utils.c 2021-01-28 12:55:48.911560244 +0100 ++++ b/snmplib/dir_utils.c 2021-01-28 13:10:25.618592889 +0100 +@@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(ne + /** default to unsorted */ + if (! (flags & NETSNMP_DIR_SORTED)) + CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_UNSORTED, rc); ++ /** default to duplicates not allowed */ ++ if (! (flags & NETSNMP_DIR_ALLOW_DUPLICATES)) ++ CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + } + + dir = opendir(dirname); +diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c +--- a/snmplib/transports/snmpTLSBaseDomain.c 2021-01-28 12:55:48.916560299 +0100 ++++ b/snmplib/transports/snmpTLSBaseDomain.c 2021-01-28 13:00:41.437047788 +0100 +@@ -68,7 +68,7 @@ static unsigned long ERR_get_error_all(c + /* this is called during negotiation */ + int verify_callback(int ok, X509_STORE_CTX *ctx) { + int err, depth; +- char buf[1024], *fingerprint; ++ char subject[SNMP_MAXBUF_MEDIUM], issuer[SNMP_MAXBUF_MEDIUM], *fingerprint; + X509 *thecert; + netsnmp_cert *cert; + _netsnmp_verify_info *verify_info; +@@ -80,10 +80,12 @@ int verify_callback(int ok, X509_STORE_C + + /* things to do: */ + +- X509_NAME_oneline(X509_get_subject_name(thecert), buf, sizeof(buf)); ++ X509_NAME_oneline(X509_get_subject_name(thecert), subject, sizeof(subject)); ++ X509_NAME_oneline(X509_get_issuer_name(thecert), issuer, sizeof(issuer)); + fingerprint = netsnmp_openssl_cert_get_fingerprint(thecert, -1); +- DEBUGMSGTL(("tls_x509:verify", "Cert: %s\n", buf)); +- DEBUGMSGTL(("tls_x509:verify", " fp: %s\n", fingerprint ? ++ DEBUGMSGTL(("tls_x509:verify", " subject: %s\n", subject)); ++ DEBUGMSGTL(("tls_x509:verify", " issuer: %s\n", issuer)); ++ DEBUGMSGTL(("tls_x509:verify", " fp: %s\n", fingerprint ? + fingerprint : "unknown")); + + ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); +@@ -118,7 +120,7 @@ int verify_callback(int ok, X509_STORE_C + } else { + DEBUGMSGTL(("tls_x509:verify", " no matching fp found\n")); + /* log where we are and why called */ +- snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err)); ++ snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d fp=%s subject='%s' issuer='%s' err=%i:%s\n", ok, ctx, depth, fingerprint, subject, issuer, err, X509_verify_cert_error_string(err)); + SNMP_FREE(fingerprint); + return 0; + } +@@ -434,23 +436,50 @@ netsnmp_tlsbase_extract_security_name(SS + int + _trust_this_cert(SSL_CTX *the_ctx, char *certspec) { + netsnmp_cert *trustcert; ++ netsnmp_cert *candidate; ++ netsnmp_void_array *matching = NULL; ++ ++ int i; + + DEBUGMSGTL(("sslctx_client", "Trying to load a trusted certificate: %s\n", + certspec)); + + /* load this identifier into the trust chain */ + trustcert = netsnmp_cert_find(NS_CERT_CA, +- NS_CERTKEY_MULTIPLE, ++ NS_CERTKEY_FINGERPRINT, + certspec); ++ ++ /* loop through all CA certs in the given files */ ++ if (!trustcert) { ++ matching = netsnmp_certs_find(NS_CERT_CA, ++ NS_CERTKEY_FILE, ++ certspec); ++ for (i = 0; (matching) && (i < matching->size); ++i) { ++ candidate = (netsnmp_cert*)matching->array[i]; ++ if (netsnmp_cert_trust(the_ctx, candidate) != SNMPERR_SUCCESS) { ++ free(matching->array); ++ free(matching); ++ LOGANDDIE("failed to load trust certificate"); ++ } ++ } /** matching loop */ ++ ++ if (matching) { ++ free(matching->array); ++ free(matching); ++ return 1; ++ } ++ } ++ ++ /* fall back to trusting the remote peer certificate */ + if (!trustcert) + trustcert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, + NS_CERTKEY_MULTIPLE, + certspec); + if (!trustcert) + LOGANDDIE("failed to find requested certificate to trust"); +- ++ + /* Add the certificate to the context */ +- if (netsnmp_cert_trust_ca(the_ctx, trustcert) != SNMPERR_SUCCESS) ++ if (netsnmp_cert_trust(the_ctx, trustcert) != SNMPERR_SUCCESS) + LOGANDDIE("failed to load trust certificate"); + + return 1; +@@ -490,7 +519,7 @@ _sslctx_common_setup(SSL_CTX *the_ctx, _ + NETSNMP_DS_LIB_X509_CRL_FILE); + if (NULL != crlFile) { + cert_store = SSL_CTX_get_cert_store(the_ctx); +- DEBUGMSGTL(("sslctx_client", "loading CRL: %s\n", crlFile)); ++ DEBUGMSGTL(("sslctx_common", "loading CRL: %s\n", crlFile)); + if (!cert_store) + LOGANDDIE("failed to find certificate store"); + if (!(lookup = X509_STORE_add_lookup(cert_store, X509_LOOKUP_file()))) +@@ -556,13 +585,19 @@ sslctx_client_setup(const SSL_METHOD *me + id_cert->key->info.filename)); + + if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0) +- LOGANDDIE("failed to set the certificate to use"); ++ LOGANDDIE("failed to set the client certificate to use"); + + if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0) +- LOGANDDIE("failed to set the private key to use"); ++ LOGANDDIE("failed to set the client private key to use"); + + if (!SSL_CTX_check_private_key(the_ctx)) +- LOGANDDIE("public and private keys incompatible"); ++ LOGANDDIE("client public and private keys incompatible"); ++ ++ while (id_cert->issuer_cert) { ++ id_cert = id_cert->issuer_cert; ++ if (!SSL_CTX_add_extra_chain_cert(the_ctx, id_cert->ocert)) ++ LOGANDDIE("failed to add intermediate client certificate"); ++ } + + if (tlsbase->their_identity) + peer_cert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, +@@ -576,11 +611,11 @@ sslctx_client_setup(const SSL_METHOD *me + peer_cert ? peer_cert->info.filename : "none")); + + /* Trust the expected certificate */ +- if (netsnmp_cert_trust_ca(the_ctx, peer_cert) != SNMPERR_SUCCESS) ++ if (netsnmp_cert_trust(the_ctx, peer_cert) != SNMPERR_SUCCESS) + LOGANDDIE ("failed to set verify paths"); + } + +- /* trust a certificate (possibly a CA) aspecifically passed in */ ++ /* trust a certificate (possibly a CA) specifically passed in */ + if (tlsbase->trust_cert) { + if (!_trust_this_cert(the_ctx, tlsbase->trust_cert)) + return 0; +@@ -599,7 +634,7 @@ sslctx_server_setup(const SSL_METHOD *me + /* setting up for ssl */ + SSL_CTX *the_ctx = SSL_CTX_new(NETSNMP_REMOVE_CONST(SSL_METHOD *, method)); + if (!the_ctx) { +- LOGANDDIE("can't create a new context"); ++ LOGANDDIE("can't create a new server context"); + } + MAKE_MEM_DEFINED(the_ctx, 256/*sizeof(*the_ctx)*/); + +@@ -608,7 +643,7 @@ sslctx_server_setup(const SSL_METHOD *me + LOGANDDIE ("error finding server identity keys"); + + if (!id_cert->key || !id_cert->key->okey) +- LOGANDDIE("failed to load private key"); ++ LOGANDDIE("failed to load server private key"); + + DEBUGMSGTL(("sslctx_server", "using public key: %s\n", + id_cert->info.filename)); +@@ -616,13 +651,19 @@ sslctx_server_setup(const SSL_METHOD *me + id_cert->key->info.filename)); + + if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0) +- LOGANDDIE("failed to set the certificate to use"); ++ LOGANDDIE("failed to set the server certificate to use"); + + if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0) +- LOGANDDIE("failed to set the private key to use"); ++ LOGANDDIE("failed to set the server private key to use"); + + if (!SSL_CTX_check_private_key(the_ctx)) +- LOGANDDIE("public and private keys incompatible"); ++ LOGANDDIE("server public and private keys incompatible"); ++ ++ while (id_cert->issuer_cert) { ++ id_cert = id_cert->issuer_cert; ++ if (!SSL_CTX_add_extra_chain_cert(the_ctx, id_cert->ocert)) ++ LOGANDDIE("failed to add intermediate server certificate"); ++ } + + SSL_CTX_set_read_ahead(the_ctx, 1); /* XXX: DTLS only? */ + diff --git a/net-snmp.spec b/net-snmp.spec index 6cdada0..ee12c05 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -54,6 +54,7 @@ Patch24: net-snmp-5.8-asn-parse-nlength.patch Patch25: net-snmp-5.8-clientaddr-error-message.patch Patch26: net-snmp-5.8-empty-passphrase.patch Patch27: net-snmp-5.9-ECC-cert.patch +Patch28: net-snmp-5.9-intermediate-certs.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -232,6 +233,7 @@ cp %{SOURCE10} . %patch25 -p1 -b .clientaddr-error-message %patch26 -p1 -b .empty-passphrase %patch27 -p1 -b .ECC-cert +%patch28 -p1 -b .intermediate-certs %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -501,6 +503,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Thu Jan 28 2021 Josef Ridky - 1:5.9-6 - add support for digests detected from ECC certificates +- add support for intermediate certificates * Tue Jan 26 2021 Fedora Release Engineering - 1:5.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 47adcde62f8cabd52c3ac438452b2d9e883d69f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 28 Jan 2021 14:19:56 +0100 Subject: [PATCH 13/81] Fix crash caused by small buffer size --- net-snmp-5.9-ssl-buffer-size.patch | 67 ++++++++++++++++++++++++++++++ net-snmp.spec | 3 ++ 2 files changed, 70 insertions(+) create mode 100644 net-snmp-5.9-ssl-buffer-size.patch diff --git a/net-snmp-5.9-ssl-buffer-size.patch b/net-snmp-5.9-ssl-buffer-size.patch new file mode 100644 index 0000000..d9875ac --- /dev/null +++ b/net-snmp-5.9-ssl-buffer-size.patch @@ -0,0 +1,67 @@ +diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c +--- a/snmplib/snmp_openssl.c 2021-01-28 14:10:05.993443671 +0100 ++++ b/snmplib/snmp_openssl.c 2021-01-28 14:17:52.531088559 +0100 +@@ -284,31 +284,29 @@ _cert_get_extension(X509_EXTENSION *oex + } + if (X509V3_EXT_print(bio, oext, 0, 0) != 1) { + snmp_log(LOG_ERR, "could not print extension!\n"); +- BIO_vfree(bio); +- return NULL; ++ goto out; + } + + space = BIO_get_mem_data(bio, &data); + if (buf && *buf) { +- if (*len < space) +- buf_ptr = NULL; +- else +- buf_ptr = *buf; ++ if (*len < space + 1) { ++ snmp_log(LOG_ERR, "not enough buffer space to print extension\n"); ++ goto out; ++ } ++ buf_ptr = *buf; ++ } else { ++ buf_ptr = calloc(1, space + 1); + } +- else +- buf_ptr = calloc(1,space + 1); + + if (!buf_ptr) { +- snmp_log(LOG_ERR, +- "not enough space or error in allocation for extenstion\n"); +- BIO_vfree(bio); +- return NULL; ++ snmp_log(LOG_ERR, "error in allocation for extenstion\n"); ++ goto out; + } + memcpy(buf_ptr, data, space); + buf_ptr[space] = 0; + if (len) + *len = space; +- ++out: + BIO_vfree(bio); + + return buf_ptr; +@@ -479,7 +477,7 @@ netsnmp_openssl_cert_dump_extensions(X50 + { + X509_EXTENSION *extension; + const char *extension_name; +- char buf[SNMP_MAXBUF_SMALL], *buf_ptr = buf, *str, *lf; ++ char buf[SNMP_MAXBUF], *buf_ptr = buf, *str, *lf; + int i, num_extensions, buf_len, nid; + + if (NULL == ocert) +@@ -499,6 +497,11 @@ netsnmp_openssl_cert_dump_extensions(X50 + extension_name = OBJ_nid2sn(nid); + buf_len = sizeof(buf); + str = _cert_get_extension_str_at(ocert, i, &buf_ptr, &buf_len, 0); ++ if (!str) { ++ DEBUGMSGT(("9:cert:dump", " %2d: %s\n", i, ++ extension_name)); ++ continue; ++ } + lf = strchr(str, '\n'); /* look for multiline strings */ + if (NULL != lf) + *lf = '\0'; /* only log first line of multiline here */ diff --git a/net-snmp.spec b/net-snmp.spec index ee12c05..b32e7fe 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -55,6 +55,7 @@ Patch25: net-snmp-5.8-clientaddr-error-message.patch Patch26: net-snmp-5.8-empty-passphrase.patch Patch27: net-snmp-5.9-ECC-cert.patch Patch28: net-snmp-5.9-intermediate-certs.patch +Patch29: net-snmp-5.9-ssl-buffer-size.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -234,6 +235,7 @@ cp %{SOURCE10} . %patch26 -p1 -b .empty-passphrase %patch27 -p1 -b .ECC-cert %patch28 -p1 -b .intermediate-certs +%patch29 -p1 -b .ssl-buffer-size %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -504,6 +506,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test * Thu Jan 28 2021 Josef Ridky - 1:5.9-6 - add support for digests detected from ECC certificates - add support for intermediate certificates +- fix crash caused by small buffer size * Tue Jan 26 2021 Fedora Release Engineering - 1:5.9-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild From 0dba34c092d286d8cfec9e5e6e81cfb21ee45c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 28 Jan 2021 14:23:51 +0100 Subject: [PATCH 14/81] Fix typo --- net-snmp-5.9-ssl-buffer-size.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-snmp-5.9-ssl-buffer-size.patch b/net-snmp-5.9-ssl-buffer-size.patch index d9875ac..5cb1ba6 100644 --- a/net-snmp-5.9-ssl-buffer-size.patch +++ b/net-snmp-5.9-ssl-buffer-size.patch @@ -32,7 +32,7 @@ diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c - "not enough space or error in allocation for extenstion\n"); - BIO_vfree(bio); - return NULL; -+ snmp_log(LOG_ERR, "error in allocation for extenstion\n"); ++ snmp_log(LOG_ERR, "error in allocation for extension\n"); + goto out; } memcpy(buf_ptr, data, space); From 14b4835cfba1143c13272aa2d64321bbf167401c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 4 Feb 2021 13:36:26 +0100 Subject: [PATCH 15/81] Remove file with unsupported license --- net-snmp.spec | 5 ++++- sources | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index b32e7fe..d15ed58 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: BSD @@ -503,6 +503,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Feb 04 2021 Josef Ridky - 1:5.9-7 +- remove file with unsupported license + * Thu Jan 28 2021 Josef Ridky - 1:5.9-6 - add support for digests detected from ECC certificates - add support for intermediate certificates diff --git a/sources b/sources index c6a5062..c46cae1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.tar.gz) = 045a54be69a318ee8ed7ec8fd044bdb32821c189703cc7b1700b20f17a18af17a631588b3815f07ffa1f146f2e5be7f199a2929c6ab1f796d02fe6a2f3e8b3e5 +SHA512 (net-snmp-5.9.tar.gz) = 21855ba5cee47ba41a82f88d2fa558c9a732690858af5523ae99c2b3939b133e3450d04c6446b3168eed6f08d6f0f5d4cbb5d784b713a8e14f68c424e514f91b From b47ab8773098783e41ea42caad342fd934366d2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 4 Feb 2021 13:38:21 +0100 Subject: [PATCH 16/81] Fix date --- net-snmp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index d15ed58..5d1c14a 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -503,7 +503,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog -* Wed Feb 04 2021 Josef Ridky - 1:5.9-7 +* Thu Feb 04 2021 Josef Ridky - 1:5.9-7 - remove file with unsupported license * Thu Jan 28 2021 Josef Ridky - 1:5.9-6 From e80342ac5a0a5f43b00ba0c5fcdf8f8b237f65cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 4 Feb 2021 14:00:36 +0100 Subject: [PATCH 17/81] Use make and make install macros --- net-snmp.spec | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index 5d1c14a..8bb3e15 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -296,7 +296,7 @@ sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool # the package is not %%_smp_mflags safe -make +%{__make} # remove rpath from compiled perl libs find perl/blib -type f -name "*.so" -print -exec chrpath --delete {} \; @@ -308,7 +308,7 @@ popd %install -make install DESTDIR=%{buildroot} +%{make_install} # Determine which arch net-snmp-config.h is going to try to #include. basearch=%{_arch} @@ -505,6 +505,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Thu Feb 04 2021 Josef Ridky - 1:5.9-7 - remove file with unsupported license +- use make and make install macros * Thu Jan 28 2021 Josef Ridky - 1:5.9-6 - add support for digests detected from ECC certificates From 46435165828aef0c862972b23ef88344a737b4f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 4 Feb 2021 19:06:20 +0100 Subject: [PATCH 18/81] Fix make install call --- net-snmp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 8bb3e15..a04ca01 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -308,7 +308,7 @@ popd %install -%{make_install} +make install DESTDIR=%{buildroot} # Determine which arch net-snmp-config.h is going to try to #include. basearch=%{_arch} From 1e1e50aae22f0920092ec988e6192c4a69745705 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 2 Mar 2021 16:13:20 +0100 Subject: [PATCH 19/81] Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. --- net-snmp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index a04ca01..d9f4533 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: BSD @@ -503,6 +503,10 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Mar 02 2021 Zbigniew JÄ™drzejewski-Szmek - 1:5.9-8 +- Rebuilt for updated systemd-rpm-macros + See https://pagure.io/fesco/issue/2583. + * Thu Feb 04 2021 Josef Ridky - 1:5.9-7 - remove file with unsupported license - use make and make install macros From 25af5a1169aa3f73f208df3d25e7db34af622c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 15 Mar 2021 11:29:51 +0100 Subject: [PATCH 20/81] Fix issue with parsing IPv4 address twice --- net-snmp-5.9-twice-IP-parsing.patch | 34 +++++++++++++++++++++++++++++ net-snmp.spec | 7 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9-twice-IP-parsing.patch diff --git a/net-snmp-5.9-twice-IP-parsing.patch b/net-snmp-5.9-twice-IP-parsing.patch new file mode 100644 index 0000000..2928e8f --- /dev/null +++ b/net-snmp-5.9-twice-IP-parsing.patch @@ -0,0 +1,34 @@ +diff --git a/snmplib/transports/snmpUDPDomain.c b/snmplib/transports/snmpUDPDomain.c +index b96497f3a..b594a389b 100644 +--- a/snmplib/transports/snmpUDPDomain.c ++++ b/snmplib/transports/snmpUDPDomain.c +@@ -387,7 +387,7 @@ netsnmp_udp_parse_security(const char *token, char *param) + /* Nope, wasn't a dotted quad. Must be a hostname. */ + int ret = netsnmp_gethostbyname_v4(sourcep, &network.s_addr); + if (ret < 0) { +- config_perror("cannot resolve source hostname"); ++ config_perror("cannot resolve IPv4 source hostname"); + return; + } + } +diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c +index 238c8a9d6..43c4eaee1 100644 +--- a/snmplib/transports/snmpUDPIPv6Domain.c ++++ b/snmplib/transports/snmpUDPIPv6Domain.c +@@ -736,7 +736,15 @@ netsnmp_udp6_parse_security(const char *token, char *param) + memset(&pton_addr.sin6_addr.s6_addr, '\0', + sizeof(struct in6_addr)); + } else if (inet_pton(AF_INET6, sourcep, &pton_addr.sin6_addr) != 1) { +- /* Nope, wasn't a numeric address. Must be a hostname. */ ++ /* Nope, wasn't a numeric IPv6 address. Must be IPv4 or a hostname. */ ++ ++ /* Try interpreting as dotted quad - IPv4 */ ++ struct in_addr network; ++ if (inet_pton(AF_INET, sourcep, &network) > 0){ ++ /* Yes, it's IPv4 - those it's already parsed and we can return. */ ++ DEBUGMSGTL(("com2sec6", "IPv4 detected for IPv6 parser. Skipping.\n")); ++ return; ++ } + #if HAVE_GETADDRINFO + int gai_error; + diff --git a/net-snmp.spec b/net-snmp.spec index d9f4533..d5e3365 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 License: BSD @@ -56,6 +56,7 @@ Patch26: net-snmp-5.8-empty-passphrase.patch Patch27: net-snmp-5.9-ECC-cert.patch Patch28: net-snmp-5.9-intermediate-certs.patch Patch29: net-snmp-5.9-ssl-buffer-size.patch +Patch30: net-snmp-5.9-twice-IP-parsing.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -236,6 +237,7 @@ cp %{SOURCE10} . %patch27 -p1 -b .ECC-cert %patch28 -p1 -b .intermediate-certs %patch29 -p1 -b .ssl-buffer-size +%patch30 -p1 -b .twice-IP-parsing %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -503,6 +505,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Mar 15 2021 Josef Ridky - 1:5.9-9 +- fix issue with parsing IPv4 address twice + * Tue Mar 02 2021 Zbigniew JÄ™drzejewski-Szmek - 1:5.9-8 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. From ea2a4871cc4c2c08b4a676434ee09c63a0add2a8 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Fri, 21 May 2021 12:40:07 +0200 Subject: [PATCH 21/81] Perl 5.34 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index d5e3365..0f75d6d 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 License: BSD @@ -505,6 +505,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri May 21 2021 Jitka Plesnikova - 1:5.9-10 +- Perl 5.34 rebuild + * Mon Mar 15 2021 Josef Ridky - 1:5.9-9 - fix issue with parsing IPv4 address twice From 5ca895838f1eabc53f44c25310221965505972e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 26 May 2021 12:22:04 +0200 Subject: [PATCH 22/81] Resolves: #1946399 - new upstream release 5.9.1 without DES support --- .gitignore | 1 + ...k-libnetsnmptrapd-against-MYSQL_LIBS.patch | 28 -- net-snmp-5.8-asn-parse-nlength.patch | 86 ----- net-snmp-5.8-clientaddr-error-message.patch | 2 +- net-snmp-5.8-empty-passphrase.patch | 30 -- net-snmp-5.9-aes-config.patch | 2 +- net-snmp-5.9-available-memory.patch | 143 -------- net-snmp-5.9-dir-fix.patch | 6 +- net-snmp-5.9-dskTable-dynamic.patch | 45 ++- net-snmp-5.9-intermediate-certs.patch | 310 +++--------------- net-snmp-5.9-proxy-getnext.patch | 13 - net-snmp-5.9-python-ld-flags.patch | 21 -- net-snmp-5.9-ssl-buffer-size.patch | 67 ---- net-snmp-5.9-twice-IP-parsing.patch | 34 -- net-snmp-5.9.1-remove-des.patch | 175 ++++++++++ net-snmp.spec | 77 ++--- sources | 2 +- 17 files changed, 279 insertions(+), 763 deletions(-) delete mode 100644 0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch delete mode 100644 net-snmp-5.8-asn-parse-nlength.patch delete mode 100644 net-snmp-5.8-empty-passphrase.patch delete mode 100644 net-snmp-5.9-available-memory.patch delete mode 100644 net-snmp-5.9-proxy-getnext.patch delete mode 100644 net-snmp-5.9-python-ld-flags.patch delete mode 100644 net-snmp-5.9-ssl-buffer-size.patch delete mode 100644 net-snmp-5.9-twice-IP-parsing.patch create mode 100644 net-snmp-5.9.1-remove-des.patch diff --git a/.gitignore b/.gitignore index eedf3ab..99fc27e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.7.3.tar.gz /net-snmp-5.8.tar.gz /net-snmp-5.9.tar.gz +/net-snmp-5.9.1.tar.gz diff --git a/0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch b/0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch deleted file mode 100644 index 96e9b10..0000000 --- a/0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 9432f629e66e4f9500f6335eab3ad427f84523b2 Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Thu, 20 Jul 2017 10:31:47 -0700 -Subject: [PATCH] Link libnetsnmptrapd against MYSQL_LIBS - -When building with MySQL (MariaDB) support, this library must -be linked against the MySQL client library, or else it will -have unresolved symbols. ---- - apps/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/apps/Makefile.in b/apps/Makefile.in -index 77404dd89..7da434522 100644 ---- a/apps/Makefile.in -+++ b/apps/Makefile.in -@@ -204,7 +204,7 @@ snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $(USELIBS) - $(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) ${LDFLAGS} ${LIBS} - - libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS) -- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) -+ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) $(MYSQL_LIBS) - $(RANLIB) $@ - - snmpinforminstall: --- -2.13.0 - diff --git a/net-snmp-5.8-asn-parse-nlength.patch b/net-snmp-5.8-asn-parse-nlength.patch deleted file mode 100644 index 23823f5..0000000 --- a/net-snmp-5.8-asn-parse-nlength.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 92f0fe9e0dc3cf7ab6e8cc94d7962df83d0ddbec Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Mon, 4 Jan 2021 12:21:59 -0800 -Subject: [PATCH] libsnmp: Fix asn_parse_nlength() - -Handle length zero correctly. - -Fixes: https://github.com/net-snmp/net-snmp/issues/253 -Fixes: a9850f4445cf ("asn parse: add NULL checks, check length lengths") ---- - snmplib/asn1.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/snmplib/asn1.c b/snmplib/asn1.c -index e983500e7..33c272768 100644 ---- a/snmplib/asn1.c -+++ b/snmplib/asn1.c -@@ -345,7 +345,7 @@ asn_parse_nlength(u_char *pkt, size_t pkt_len, u_long *data_len) - * long length; first byte is length of length (after masking high bit) - */ - len_len = (int) ((*pkt & ~0x80) + 1); -- if ((int) pkt_len <= len_len ) -+ if (pkt_len < len_len) - return NULL; /* still too short for length and data */ - - /* now we know we have enough data to parse length */ -From baef04f9c6fe0eb3ac74dd4d26a19264eeaf7fa1 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Mon, 4 Jan 2021 10:00:33 -0800 -Subject: [PATCH] testing/fulltests/unit-tests/T105trap_parse_clib: Add this - test - -Add a reproducer for the bug fixed by the previous patch. ---- - .../unit-tests/T105trap_parse_clib.c | 41 +++++++++++++++++++ - 1 file changed, 41 insertions(+) - create mode 100644 testing/fulltests/unit-tests/T105trap_parse_clib.c - -diff --git a/testing/fulltests/unit-tests/T105trap_parse_clib.c b/testing/fulltests/unit-tests/T105trap_parse_clib.c -new file mode 100644 -index 000000000..5c21ccdc7 ---- /dev/null -+++ b/testing/fulltests/unit-tests/T105trap_parse_clib.c -@@ -0,0 +1,41 @@ -+/* HEADER Parsing of an SNMP trap with no varbinds */ -+netsnmp_pdu pdu; -+int rc; -+static u_char trap_pdu[] = { -+ /* Sequence with length of 0x2d = 45 bytes. */ -+ [ 0] = 0x30, [ 1] = 0x82, [ 2] = 0x00, [ 3] = 0x2d, -+ /* version = INTEGER 0 */ -+ [ 4] = 0x02, [ 5] = 0x01, [ 6] = 0x00, -+ /* community = public (OCTET STRING 0x70 0x75 0x62 0x6c 0x69 0x63) */ -+ [ 7] = 0x04, [ 8] = 0x06, [ 9] = 0x70, [10] = 0x75, -+ [11] = 0x62, [12] = 0x6c, [13] = 0x69, [14] = 0x63, -+ /* SNMP_MSG_TRAP; 32 bytes. */ -+ [15] = 0xa4, [16] = 0x20, -+ /* enterprise = OBJECT IDENTIFIER .1.3.6.1.6.3.1.1.5 = snmpTraps */ -+ [17] = 0x06, [18] = 0x08, -+ [19] = 0x2b, [20] = 0x06, [21] = 0x01, [22] = 0x06, -+ [23] = 0x03, [24] = 0x01, [25] = 0x01, [26] = 0x05, -+ /* agent-addr = ASN_IPADDRESS 192.168.1.34 */ -+ [27] = 0x40, [28] = 0x04, [29] = 0xc0, [30] = 0xa8, -+ [31] = 0x01, [32] = 0x22, -+ /* generic-trap = INTEGER 0 */ -+ [33] = 0x02, [34] = 0x01, [35] = 0x00, -+ /* specific-trap = INTEGER 0 */ -+ [36] = 0x02, [37] = 0x01, [38] = 0x00, -+ /* ASN_TIMETICKS 0x117f243a */ -+ [39] = 0x43, [40] = 0x04, [41] = 0x11, [42] = 0x7f, -+ [43] = 0x24, [44] = 0x3a, -+ /* varbind list */ -+ [45] = 0x30, [46] = 0x82, [47] = 0x00, [48] = 0x00, -+}; -+static size_t trap_pdu_length = sizeof(trap_pdu); -+netsnmp_session session; -+ -+snmp_set_do_debugging(TRUE); -+debug_register_tokens("dumpv_recv,dumpv_send,asn,recv"); -+memset(&session, 0, sizeof(session)); -+snmp_sess_init(&session); -+memset(&pdu, 0, sizeof(pdu)); -+rc = snmp_parse(NULL, &session, &pdu, trap_pdu, trap_pdu_length); -+ -+OKF((rc == 0), ("Parsing of a trap PDU")); - diff --git a/net-snmp-5.8-clientaddr-error-message.patch b/net-snmp-5.8-clientaddr-error-message.patch index 7ea9752..ef851b1 100644 --- a/net-snmp-5.8-clientaddr-error-message.patch +++ b/net-snmp-5.8-clientaddr-error-message.patch @@ -32,4 +32,4 @@ diff -ruNp a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snm + strerror(errno))); goto err; } - + diff --git a/net-snmp-5.8-empty-passphrase.patch b/net-snmp-5.8-empty-passphrase.patch deleted file mode 100644 index deb0388..0000000 --- a/net-snmp-5.8-empty-passphrase.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 09a0c9005fb72102bf4f4499b28282f823e3e526 Mon Sep 17 00:00:00 2001 -From: Josef Ridky -Date: Wed, 18 Nov 2020 20:54:34 -0800 -Subject: [PATCH] net-snmp-create-v3-user: Handle empty passphrases correctly - -See also https://github.com/net-snmp/net-snmp/issues/86. - -Fixes: e5ad10de8e17 ("Quote provided encryption key in createUser line") -Reported-by: Chris Cheney ---- - net-snmp-create-v3-user.in | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in -index 452c2699d..31b4c58c1 100644 ---- a/net-snmp-create-v3-user.in -+++ b/net-snmp-create-v3-user.in -@@ -120,7 +120,11 @@ fi - fi - outdir="@PERSISTENT_DIRECTORY@" - outfile="$outdir/snmpd.conf" --line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm \"$xpassphrase\"" -+if test "x$xpassphrase" = "x" ; then -+ line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm" -+else -+ line="createUser $user $Aalgorithm \"$apassphrase\" $Xalgorithm \"$xpassphrase\"" -+fi - echo "adding the following line to $outfile:" - echo " " $line - # in case it hasn't ever been started yet, start it. diff --git a/net-snmp-5.9-aes-config.patch b/net-snmp-5.9-aes-config.patch index ac70142..ceac97c 100644 --- a/net-snmp-5.9-aes-config.patch +++ b/net-snmp-5.9-aes-config.patch @@ -13,6 +13,6 @@ index afd6fa4..07c26fe 100644 ;; - des|aes|aes128) + des|aes|aes128|aes192|aes256) - Xalgorithm=`echo $1 | tr a-z A-Z` + Xalgorithm=$(echo "$1" | tr a-z A-Z) shift ;; diff --git a/net-snmp-5.9-available-memory.patch b/net-snmp-5.9-available-memory.patch deleted file mode 100644 index 7d7013e..0000000 --- a/net-snmp-5.9-available-memory.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 5b8bf5d4130761c3374f9ad618e8a76bb75eb634 Mon Sep 17 00:00:00 2001 -From: Yuwei Ba -Date: Fri, 21 Aug 2020 15:06:10 +0800 -Subject: [PATCH] snmpd: support MemAvailable on Linux - -See also https://github.com/net-snmp/net-snmp/pull/167 . - -[bvanassche: modified the behavior of this patch] ---- - agent/mibgroup/hardware/memory/memory_linux.c | 20 ++++++++++++++++++- - agent/mibgroup/ucd-snmp/memory.c | 12 ++++++++++- - agent/mibgroup/ucd-snmp/memory.h | 1 + - include/net-snmp/agent/hardware/memory.h | 1 + - mibs/UCD-SNMP-MIB.txt | 16 +++++++++++++++ - 5 files changed, 48 insertions(+), 2 deletions(-) - -diff --git a/agent/mibgroup/hardware/memory/memory_linux.c b/agent/mibgroup/hardware/memory/memory_linux.c -index 6d5e86cde..4ae235c2d 100644 ---- a/agent/mibgroup/hardware/memory/memory_linux.c -+++ b/agent/mibgroup/hardware/memory/memory_linux.c -@@ -24,7 +24,8 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { - static int first = 1; - ssize_t bytes_read; - char *b; -- unsigned long memtotal = 0, memfree = 0, memshared = 0, -+ int have_memavail = 0; -+ unsigned long memtotal = 0, memavail = 0, memfree = 0, memshared = 0, - buffers = 0, cached = 0, sreclaimable = 0, - swaptotal = 0, swapfree = 0; - -@@ -81,6 +82,11 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { - if (first) - snmp_log(LOG_ERR, "No MemTotal line in /proc/meminfo\n"); - } -+ b = strstr(buff, "MemAvailable: "); -+ if (b) { -+ have_memavail = 1; -+ sscanf(b, "MemAvailable: %lu", &memavail); -+ } - b = strstr(buff, "MemFree: "); - if (b) - sscanf(b, "MemFree: %lu", &memfree); -@@ -151,6 +157,18 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void *magic ) { - mem->other = -1; - } - -+ if (have_memavail) { -+ mem = netsnmp_memory_get_byIdx(NETSNMP_MEM_TYPE_AVAILMEM, 1); -+ if (mem) { -+ if (!mem->descr) -+ mem->descr = strdup("Available memory"); -+ mem->units = 1024; -+ mem->size = memavail; -+ mem->free = memavail; -+ mem->other = -1; -+ } -+ } -+ - mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_VIRTMEM, 1 ); - if (!mem) { - snmp_log_perror("No Virtual Memory info entry"); -diff --git a/agent/mibgroup/ucd-snmp/memory.c b/agent/mibgroup/ucd-snmp/memory.c -index 371a77e9a..158b28e67 100644 ---- a/agent/mibgroup/ucd-snmp/memory.c -+++ b/agent/mibgroup/ucd-snmp/memory.c -@@ -26,7 +26,7 @@ init_memory(void) - netsnmp_create_handler_registration("memory", handle_memory, - memory_oid, OID_LENGTH(memory_oid), - HANDLER_CAN_RONLY), -- 1, 26); -+ 1, 27); - netsnmp_register_scalar( - netsnmp_create_handler_registration("memSwapError", handle_memory, - memSwapError_oid, OID_LENGTH(memSwapError_oid), -@@ -272,6 +272,16 @@ handle_memory(netsnmp_mib_handler *handler, - c64.low = val & 0xFFFFFFFF; - c64.high = val >>32; - break; -+ case MEMORY_SYS_AVAIL: -+ type = ASN_COUNTER64; -+ mem_info = netsnmp_memory_get_byIdx(NETSNMP_MEM_TYPE_AVAILMEM, 0); -+ if (!mem_info) -+ goto NOSUCH; -+ val = mem_info->size; /* memavail */ -+ val *= (mem_info->units/1024); -+ c64.low = val & 0xFFFFFFFF; -+ c64.high = val >> 32; -+ break; - case MEMORY_SWAP_ERROR: - mem_info = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 0 ); - if (!mem_info) -diff --git a/agent/mibgroup/ucd-snmp/memory.h b/agent/mibgroup/ucd-snmp/memory.h -index ded214022..54a56a2fd 100644 ---- a/agent/mibgroup/ucd-snmp/memory.h -+++ b/agent/mibgroup/ucd-snmp/memory.h -@@ -41,6 +41,7 @@ Netsnmp_Node_Handler handle_memory; - #define MEMORY_SHARED_X 24 - #define MEMORY_BUFFER_X 25 - #define MEMORY_CACHED_X 26 -+#define MEMORY_SYS_AVAIL 27 - #define MEMORY_SWAP_ERROR 100 - #define MEMORY_SWAP_ERRMSG 101 - #endif /* MEMORY_H */ -diff --git a/include/net-snmp/agent/hardware/memory.h b/include/net-snmp/agent/hardware/memory.h -index 54265cf22..aca3a4d00 100644 ---- a/include/net-snmp/agent/hardware/memory.h -+++ b/include/net-snmp/agent/hardware/memory.h -@@ -10,6 +10,7 @@ typedef struct netsnmp_memory_info_s netsnmp_memory_info; - #define NETSNMP_MEM_TYPE_SHARED 8 - #define NETSNMP_MEM_TYPE_SHARED2 9 - #define NETSNMP_MEM_TYPE_SWAP 10 -+#define NETSNMP_MEM_TYPE_AVAILMEM 11 - /* Leave space for individual swap devices */ - #define NETSNMP_MEM_TYPE_MAX 30 - -diff --git a/mibs/UCD-SNMP-MIB.txt b/mibs/UCD-SNMP-MIB.txt -index cde67feb5..d360bad02 100644 ---- a/mibs/UCD-SNMP-MIB.txt -+++ b/mibs/UCD-SNMP-MIB.txt -@@ -746,6 +746,22 @@ memCachedX OBJECT-TYPE - memory as specifically reserved for this purpose." - ::= { memory 26 } - -+memSysAvail OBJECT-TYPE -+ SYNTAX CounterBasedGauge64 -+ UNITS "kB" -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The total amount of available memory, which is an estimate -+ of how much memory is available for starting new applications, -+ without swapping. -+ -+ This object will not be implemented on hosts where the -+ underlying operating system does not explicitly identify -+ memory as specifically reserved for this purpose." -+ ::= { memory 27 } -+ -+ - memSwapError OBJECT-TYPE - SYNTAX UCDErrorFlag - MAX-ACCESS read-only - diff --git a/net-snmp-5.9-dir-fix.patch b/net-snmp-5.9-dir-fix.patch index 369626f..00d531f 100644 --- a/net-snmp-5.9-dir-fix.patch +++ b/net-snmp-5.9-dir-fix.patch @@ -13,12 +13,12 @@ index 452c269..afd6fa4 100644 unset shifted case $1 in -@@ -134,7 +138,7 @@ echo $line >> $outfile - prefix="@prefix@" +@@ -136,7 +140,7 @@ fi + echo "$line" >> "$outfile" # Avoid that configure complains that this script ignores @datarootdir@ echo "@datarootdir@" >/dev/null -outfile="@datadir@/snmp/snmpd.conf" +outfile="/etc/snmp/snmpd.conf" line="$token $user" echo "adding the following line to $outfile:" - echo " " $line + echo " $line" diff --git a/net-snmp-5.9-dskTable-dynamic.patch b/net-snmp-5.9-dskTable-dynamic.patch index 3822755..035bf55 100644 --- a/net-snmp-5.9-dskTable-dynamic.patch +++ b/net-snmp-5.9-dskTable-dynamic.patch @@ -1,8 +1,7 @@ -diff --git a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c -index 5206235..5e98476 100644 ---- a/agent/mibgroup/ucd-snmp/disk.c -+++ b/agent/mibgroup/ucd-snmp/disk.c -@@ -153,9 +153,10 @@ static void disk_free_config(void); +diff -urNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c +--- a/agent/mibgroup/ucd-snmp/disk.c 2021-05-26 08:56:39.678900275 +0200 ++++ b/agent/mibgroup/ucd-snmp/disk.c 2021-05-26 09:09:32.308731157 +0200 +@@ -153,9 +153,10 @@ static void disk_free_config(void) static void disk_parse_config(const char *, char *); static void disk_parse_config_all(const char *, char *); #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS @@ -11,7 +10,7 @@ index 5206235..5e98476 100644 static void add_device(char *path, char *device, - int minspace, int minpercent, int override); + int minspace, int minpercent, int addNewDisks, -+ int override); ++ int override); static void modify_disk_parameters(int index, int minspace, int minpercent); static int disk_exists(char *path); @@ -47,7 +46,7 @@ index 5206235..5e98476 100644 } static void -@@ -313,7 +318,7 @@ disk_parse_config(const char *token, char *cptr) +@@ -313,7 +318,7 @@ disk_parse_config(const char *token, cha * check if the disk already exists, if so then modify its * parameters. if it does not exist then add it */ @@ -56,7 +55,7 @@ index 5206235..5e98476 100644 #endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */ } -@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, char *cptr) +@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS static void @@ -65,7 +64,7 @@ index 5206235..5e98476 100644 { int index; -@@ -402,10 +407,16 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) +@@ -402,10 +407,16 @@ add_device(char *path, char *device, int } index = disk_exists(path); @@ -85,7 +84,7 @@ index 5206235..5e98476 100644 /* add if and only if the device was found */ if(device[0] != 0) { /* The following buffers are cleared above, no need to add '\0' */ -@@ -413,6 +424,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) +@@ -413,6 +424,7 @@ add_device(char *path, char *device, int strlcpy(disks[numdisks].device, device, sizeof(disks[numdisks].device)); disks[numdisks].minimumspace = minspace; disks[numdisks].minpercent = minpercent; @@ -93,7 +92,7 @@ index 5206235..5e98476 100644 numdisks++; } else { -@@ -420,6 +432,7 @@ add_device(char *path, char *device, int minspace, int minpercent, int override) +@@ -420,6 +432,7 @@ add_device(char *path, char *device, int disks[numdisks].minpercent = -1; disks[numdisks].path[0] = 0; disks[numdisks].device[0] = 0; @@ -128,7 +127,14 @@ index 5206235..5e98476 100644 dummy = 1; } fclose(mntfp); -@@ -510,7 +523,7 @@ find_and_add_allDisks(int minpercent) +@@ -514,13 +527,13 @@ find_and_add_allDisks(int minpercent) + mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntsize; i++) { + add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, +- minpercent, 0); ++ minpercent, addNewDisks, 0); + } + } #elif HAVE_FSTAB_H setfsent(); /* open /etc/fstab */ while((fstab1 = getfsent()) != NULL) { @@ -137,16 +143,7 @@ index 5206235..5e98476 100644 dummy = 1; } endfsent(); /* close /etc/fstab */ -@@ -521,7 +534,7 @@ find_and_add_allDisks(int minpercent) - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - if (strncmp(mntbuf[i].f_fstypename, "zfs", 3) == 0) { -- add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, minpercent, 0); -+ add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, minpercent, addNewDisks, 0); - } - } - } -@@ -537,7 +550,7 @@ find_and_add_allDisks(int minpercent) +@@ -535,7 +548,7 @@ find_and_add_allDisks(int minpercent) * statfs we default to the root partition "/" */ if (statfs("/", &statf) == 0) { @@ -155,7 +152,7 @@ index 5206235..5e98476 100644 } #endif else { -@@ -696,6 +709,10 @@ fill_dsk_entry(int disknum, struct dsk_entry *entry) +@@ -694,6 +707,10 @@ fill_dsk_entry(int disknum, struct dsk_e #endif #endif @@ -166,7 +163,7 @@ index 5206235..5e98476 100644 entry->dskPercentInode = -1; #if defined(HAVE_STATVFS) || defined(HAVE_STATFS) -@@ -827,6 +844,13 @@ var_extensible_disk(struct variable *vp, +@@ -825,6 +842,13 @@ var_extensible_disk(struct variable *vp, static char *errmsg; static char empty_str[1]; diff --git a/net-snmp-5.9-intermediate-certs.patch b/net-snmp-5.9-intermediate-certs.patch index 3a4ebcd..89815ef 100644 --- a/net-snmp-5.9-intermediate-certs.patch +++ b/net-snmp-5.9-intermediate-certs.patch @@ -1,6 +1,6 @@ diff -urNp a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h ---- a/include/net-snmp/library/cert_util.h 2021-01-28 12:55:48.969560884 +0100 -+++ b/include/net-snmp/library/cert_util.h 2021-01-28 13:10:25.616592870 +0100 +--- a/include/net-snmp/library/cert_util.h 2021-05-26 09:17:40.338156603 +0200 ++++ b/include/net-snmp/library/cert_util.h 2021-05-26 09:19:25.396109268 +0200 @@ -55,7 +55,8 @@ extern "C" { char *common_name; @@ -20,20 +20,21 @@ diff -urNp a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cer int netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var); diff -urNp a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h ---- a/include/net-snmp/library/dir_utils.h 2021-01-28 12:55:48.969560884 +0100 -+++ b/include/net-snmp/library/dir_utils.h 2021-01-28 13:10:25.616592870 +0100 -@@ -53,6 +53,8 @@ extern "C" { +--- a/include/net-snmp/library/dir_utils.h 2021-05-26 09:17:40.337156594 +0200 ++++ b/include/net-snmp/library/dir_utils.h 2021-05-26 09:19:59.236416127 +0200 +@@ -53,7 +53,8 @@ extern "C" { #define NETSNMP_DIR_NSFILE 0x0010 /** load stats in netsnmp_file */ #define NETSNMP_DIR_NSFILE_STATS 0x0020 +- +/** allow files to be indexed more than once */ +#define NETSNMP_DIR_ALLOW_DUPLICATES 0x0040 - + #ifdef __cplusplus diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c ---- a/snmplib/cert_util.c 2021-01-28 12:55:48.909560222 +0100 -+++ b/snmplib/cert_util.c 2021-01-28 13:14:32.104988765 +0100 +--- a/snmplib/cert_util.c 2021-05-26 09:17:40.182155189 +0200 ++++ b/snmplib/cert_util.c 2021-05-26 09:28:23.533539371 +0200 @@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint * bump this value whenever cert index format changes, so indexes * will be regenerated with new format. @@ -103,26 +104,22 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c netsnmp_container_add_index(_certs, additional_keys); _keys = netsnmp_container_find("cert_keys:binary_array"); -@@ -424,9 +435,9 @@ netsnmp_cert_map_container(void) +@@ -424,7 +435,7 @@ netsnmp_cert_map_container(void) } static netsnmp_cert * -_new_cert(const char *dirname, const char *filename, int certType, -- int hashType, const char *fingerprint, const char *common_name, -- const char *subject) +_new_cert(const char *dirname, const char *filename, int certType, int offset, -+ int allowed_uses, int hashType, const char *fingerprint, -+ const char *common_name, const char *subject) + int hashType, const char *fingerprint, const char *common_name, + const char *subject) { - netsnmp_cert *cert; - @@ -446,8 +457,10 @@ _new_cert(const char *dirname, const cha cert->info.dir = strdup(dirname); cert->info.filename = strdup(filename); - cert->info.allowed_uses = NS_CERT_REMOTE_PEER; + /* only the first certificate is allowed to be a remote peer */ -+ cert->info.allowed_uses = allowed_uses; ++ cert->info.allowed_uses = offset ? 0 : NS_CERT_REMOTE_PEER; cert->info.type = certType; + cert->offset = offset; if (fingerprint) { @@ -410,7 +407,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (cert->key) { DEBUGMSGT(("cert:partner", "cert already has partner\n")); return; -@@ -1255,76 +1272,189 @@ _find_partner(netsnmp_cert *cert, netsnm +@@ -1255,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnm } } @@ -440,13 +437,11 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c +} + +static netsnmp_cert * -+_add_cert(X509 *ocert, const char* dirname, const char* filename, int type, int offset, -+ int allowed_uses, FILE *index) ++_add_cert(X509 *ocert, const char* dirname, const char* filename, int type, int offset, FILE *index) +{ + netsnmp_cert *cert; + -+ cert = _new_cert(dirname, filename, type, offset, -+ allowed_uses, -1, NULL, NULL, NULL); ++ cert = _new_cert(dirname, filename, type, offset, -1, NULL, NULL, NULL); + if (NULL == cert) + return NULL; + @@ -464,9 +459,8 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c + /** fingerprint max = 64*3=192 for sha512 */ + /** common name / CN = 64 */ + if (cert) -+ fprintf(index, "c:%s %d %d %d %d %s '%s' '%s'\n", filename, -+ cert->info.type, cert->offset, cert->info.allowed_uses, -+ cert->hash_type, cert->fingerprint, ++ fprintf(index, "c:%s %d %d %d %s '%s' '%s'\n", filename, ++ cert->info.type, cert->offset, cert->hash_type, cert->fingerprint, + cert->common_name, cert->subject); + } + @@ -564,8 +558,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c + + ocert = d2i_X509_bio(certbio, NULL); /* DER/ASN1 */ + if (NULL != ocert) { -+ if (!_add_cert(ocert, dirname, filename, type, 0, -+ NS_CERT_REMOTE_PEER, index)) { ++ if (!_add_cert(ocert, dirname, filename, type, 0, index)) { + X509_free(ocert); + ocert = NULL; + } @@ -581,18 +574,9 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c + DEBUGMSGT(("9:cert:read", "Changing type from DER to PEM\n")); + type = NS_CERT_TYPE_PEM; + } -+ -+ /* read the private key first so we can record this in the index */ -+ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); -+ -+ (void)BIO_reset(certbio); -+ -+ /* certs are read after the key */ -+ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); ++ ocert = ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); + if (NULL != ocert) { -+ cert = _add_cert(ncert, dirname, filename, type, 0, -+ okey ? NS_CERT_IDENTITY | NS_CERT_REMOTE_PEER : -+ NS_CERT_REMOTE_PEER, index); ++ cert = _add_cert(ncert, dirname, filename, type, offset, index); + if (NULL == cert) { + X509_free(ocert); + ocert = ncert = NULL; @@ -602,13 +586,18 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c + offset = BIO_tell(certbio); + ncert = PEM_read_bio_X509_AUX(certbio, NULL, NULL, NULL); + if (ncert) { -+ if (NULL == _add_cert(ncert, dirname, filename, type, offset, 0, index)) { ++ if (NULL == _add_cert(ncert, dirname, filename, type, offset, index)) { + X509_free(ncert); + ncert = NULL; + } + } + } + ++ BIO_seek(certbio, offset); ++ ++ /** check for private key too */ ++ okey = PEM_read_bio_PrivateKey(certbio, NULL, NULL, NULL); ++ + if (NULL != okey) { + DEBUGMSGT(("cert:read:key", "found key with cert in %s\n", + cert->info.filename)); @@ -618,6 +607,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c + cert->info.filename)); + key->cert = cert; + cert->key = key; ++ cert->info.allowed_uses |= NS_CERT_IDENTITY; + } + else { + EVP_PKEY_free(okey); @@ -653,20 +643,17 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c } return 0; -@@ -1338,8 +1468,10 @@ _cert_read_index(const char *dirname, st +@@ -1338,7 +1461,8 @@ _cert_read_index(const char *dirname, st struct stat idx_stat; char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX]; char fingerprint[EVP_MAX_MD_SIZE*3], common_name[64+1], type_str[15]; - char subject[SNMP_MAXBUF_SMALL], hash_str[15]; -- int count = 0, type, hash, version; + char subject[SNMP_MAXBUF_SMALL], hash_str[15], offset_str[15]; -+ char allowed_uses_str[15]; + ssize_t offset; -+ int count = 0, type, allowed_uses, hash, version; + int count = 0, type, hash, version; netsnmp_cert *cert; netsnmp_key *key; - netsnmp_container *newer, *found; -@@ -1381,7 +1513,8 @@ _cert_read_index(const char *dirname, st +@@ -1381,7 +1505,8 @@ _cert_read_index(const char *dirname, st netsnmp_directory_container_read_some(NULL, dirname, _time_filter, &idx_stat, NETSNMP_DIR_NSFILE | @@ -676,30 +663,26 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (newer) { DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n")); CONTAINER_FREE_ALL(newer, NULL); -@@ -1425,6 +1558,8 @@ _cert_read_index(const char *dirname, st +@@ -1425,6 +1550,7 @@ _cert_read_index(const char *dirname, st pos = &tmpstr[2]; if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) || (NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) || + (NULL == (pos=copy_nword(pos, offset_str, sizeof(offset_str)))) || -+ (NULL == (pos=copy_nword(pos, allowed_uses_str, sizeof(allowed_uses_str)))) || (NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) || (NULL == (pos=copy_nword(pos, fingerprint, sizeof(fingerprint)))) || -@@ -1437,9 +1572,11 @@ _cert_read_index(const char *dirname, st +@@ -1437,8 +1563,9 @@ _cert_read_index(const char *dirname, st break; } type = atoi(type_str); + offset = atoi(offset_str); -+ allowed_uses = atoi(allowed_uses_str); hash = atoi(hash_str); - cert = _new_cert(dirname, filename, type, hash, fingerprint, -- common_name, subject); -+ cert = _new_cert(dirname, filename, type, offset, allowed_uses, hash, -+ fingerprint, common_name, subject); ++ cert = _new_cert(dirname, filename, type, offset, hash, fingerprint, + common_name, subject); if (cert && 0 == CONTAINER_INSERT(found, cert)) ++count; - else { -@@ -1543,7 +1680,8 @@ _add_certdir(const char *dirname) +@@ -1543,7 +1670,8 @@ _add_certdir(const char *dirname) netsnmp_directory_container_read_some(NULL, dirname, _cert_cert_filter, NULL, NETSNMP_DIR_RELATIVE_PATH | @@ -709,7 +692,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (NULL == cert_container) { DEBUGMSGT(("cert:index:dir", "error creating container for cert files\n")); -@@ -1631,7 +1769,7 @@ _cert_print(netsnmp_cert *c, void *conte +@@ -1631,7 +1759,7 @@ _cert_print(netsnmp_cert *c, void *conte if (NULL == c) return; @@ -718,7 +701,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n", c->info.type, c->info.allowed_uses, _mode_str(c->info.allowed_uses))); -@@ -1835,7 +1973,8 @@ netsnmp_cert_find(int what, int where, v +@@ -1835,7 +1963,8 @@ netsnmp_cert_find(int what, int where, v netsnmp_void_array *matching; DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); @@ -728,40 +711,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (!matching) return NULL; if (1 == matching->size) -@@ -1881,6 +2020,32 @@ netsnmp_cert_find(int what, int where, v - return result; - } - -+netsnmp_void_array * -+netsnmp_certs_find(int what, int where, void *hint) -+{ -+ -+ DEBUGMSGT(("certs:find:params", "looking for %s(%d) in %s(0x%x), hint %p\n", -+ _mode_str(what), what, _where_str(where), where, hint)); -+ -+ if (NS_CERTKEY_FILE == where) { -+ /** hint == filename */ -+ char *filename = (char*)hint; -+ netsnmp_void_array *matching; -+ -+ DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); -+ matching = _cert_reduce_subset_what(_cert_find_subset_fn( -+ filename, NULL ), what); -+ -+ return matching; -+ } /* where = NS_CERTKEY_FILE */ -+ else { /* unknown location */ -+ -+ DEBUGMSGT(("certs:find:err", "unhandled location %d for %d\n", where, -+ what)); -+ return NULL; -+ } -+} -+ - #ifndef NETSNMP_FEATURE_REMOVE_CERT_FINGERPRINTS - int - netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var) -@@ -2278,6 +2443,124 @@ _reduce_subset_dir(netsnmp_void_array *m +@@ -2278,6 +2407,124 @@ _reduce_subset_dir(netsnmp_void_array *m } } @@ -887,8 +837,8 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c _cert_find_subset_common(const char *filename, netsnmp_container *container) { diff -urNp a/snmplib/dir_utils.c b/snmplib/dir_utils.c ---- a/snmplib/dir_utils.c 2021-01-28 12:55:48.911560244 +0100 -+++ b/snmplib/dir_utils.c 2021-01-28 13:10:25.618592889 +0100 +--- a/snmplib/dir_utils.c 2021-05-26 09:17:40.203155379 +0200 ++++ b/snmplib/dir_utils.c 2021-05-26 09:27:39.721867913 +0200 @@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(ne /** default to unsorted */ if (! (flags & NETSNMP_DIR_SORTED)) @@ -899,181 +849,3 @@ diff -urNp a/snmplib/dir_utils.c b/snmplib/dir_utils.c } dir = opendir(dirname); -diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c ---- a/snmplib/transports/snmpTLSBaseDomain.c 2021-01-28 12:55:48.916560299 +0100 -+++ b/snmplib/transports/snmpTLSBaseDomain.c 2021-01-28 13:00:41.437047788 +0100 -@@ -68,7 +68,7 @@ static unsigned long ERR_get_error_all(c - /* this is called during negotiation */ - int verify_callback(int ok, X509_STORE_CTX *ctx) { - int err, depth; -- char buf[1024], *fingerprint; -+ char subject[SNMP_MAXBUF_MEDIUM], issuer[SNMP_MAXBUF_MEDIUM], *fingerprint; - X509 *thecert; - netsnmp_cert *cert; - _netsnmp_verify_info *verify_info; -@@ -80,10 +80,12 @@ int verify_callback(int ok, X509_STORE_C - - /* things to do: */ - -- X509_NAME_oneline(X509_get_subject_name(thecert), buf, sizeof(buf)); -+ X509_NAME_oneline(X509_get_subject_name(thecert), subject, sizeof(subject)); -+ X509_NAME_oneline(X509_get_issuer_name(thecert), issuer, sizeof(issuer)); - fingerprint = netsnmp_openssl_cert_get_fingerprint(thecert, -1); -- DEBUGMSGTL(("tls_x509:verify", "Cert: %s\n", buf)); -- DEBUGMSGTL(("tls_x509:verify", " fp: %s\n", fingerprint ? -+ DEBUGMSGTL(("tls_x509:verify", " subject: %s\n", subject)); -+ DEBUGMSGTL(("tls_x509:verify", " issuer: %s\n", issuer)); -+ DEBUGMSGTL(("tls_x509:verify", " fp: %s\n", fingerprint ? - fingerprint : "unknown")); - - ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); -@@ -118,7 +120,7 @@ int verify_callback(int ok, X509_STORE_C - } else { - DEBUGMSGTL(("tls_x509:verify", " no matching fp found\n")); - /* log where we are and why called */ -- snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d err=%i:%s\n", ok, ctx, depth, err, X509_verify_cert_error_string(err)); -+ snmp_log(LOG_ERR, "tls verification failure: ok=%d ctx=%p depth=%d fp=%s subject='%s' issuer='%s' err=%i:%s\n", ok, ctx, depth, fingerprint, subject, issuer, err, X509_verify_cert_error_string(err)); - SNMP_FREE(fingerprint); - return 0; - } -@@ -434,23 +436,50 @@ netsnmp_tlsbase_extract_security_name(SS - int - _trust_this_cert(SSL_CTX *the_ctx, char *certspec) { - netsnmp_cert *trustcert; -+ netsnmp_cert *candidate; -+ netsnmp_void_array *matching = NULL; -+ -+ int i; - - DEBUGMSGTL(("sslctx_client", "Trying to load a trusted certificate: %s\n", - certspec)); - - /* load this identifier into the trust chain */ - trustcert = netsnmp_cert_find(NS_CERT_CA, -- NS_CERTKEY_MULTIPLE, -+ NS_CERTKEY_FINGERPRINT, - certspec); -+ -+ /* loop through all CA certs in the given files */ -+ if (!trustcert) { -+ matching = netsnmp_certs_find(NS_CERT_CA, -+ NS_CERTKEY_FILE, -+ certspec); -+ for (i = 0; (matching) && (i < matching->size); ++i) { -+ candidate = (netsnmp_cert*)matching->array[i]; -+ if (netsnmp_cert_trust(the_ctx, candidate) != SNMPERR_SUCCESS) { -+ free(matching->array); -+ free(matching); -+ LOGANDDIE("failed to load trust certificate"); -+ } -+ } /** matching loop */ -+ -+ if (matching) { -+ free(matching->array); -+ free(matching); -+ return 1; -+ } -+ } -+ -+ /* fall back to trusting the remote peer certificate */ - if (!trustcert) - trustcert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, - NS_CERTKEY_MULTIPLE, - certspec); - if (!trustcert) - LOGANDDIE("failed to find requested certificate to trust"); -- -+ - /* Add the certificate to the context */ -- if (netsnmp_cert_trust_ca(the_ctx, trustcert) != SNMPERR_SUCCESS) -+ if (netsnmp_cert_trust(the_ctx, trustcert) != SNMPERR_SUCCESS) - LOGANDDIE("failed to load trust certificate"); - - return 1; -@@ -490,7 +519,7 @@ _sslctx_common_setup(SSL_CTX *the_ctx, _ - NETSNMP_DS_LIB_X509_CRL_FILE); - if (NULL != crlFile) { - cert_store = SSL_CTX_get_cert_store(the_ctx); -- DEBUGMSGTL(("sslctx_client", "loading CRL: %s\n", crlFile)); -+ DEBUGMSGTL(("sslctx_common", "loading CRL: %s\n", crlFile)); - if (!cert_store) - LOGANDDIE("failed to find certificate store"); - if (!(lookup = X509_STORE_add_lookup(cert_store, X509_LOOKUP_file()))) -@@ -556,13 +585,19 @@ sslctx_client_setup(const SSL_METHOD *me - id_cert->key->info.filename)); - - if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0) -- LOGANDDIE("failed to set the certificate to use"); -+ LOGANDDIE("failed to set the client certificate to use"); - - if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0) -- LOGANDDIE("failed to set the private key to use"); -+ LOGANDDIE("failed to set the client private key to use"); - - if (!SSL_CTX_check_private_key(the_ctx)) -- LOGANDDIE("public and private keys incompatible"); -+ LOGANDDIE("client public and private keys incompatible"); -+ -+ while (id_cert->issuer_cert) { -+ id_cert = id_cert->issuer_cert; -+ if (!SSL_CTX_add_extra_chain_cert(the_ctx, id_cert->ocert)) -+ LOGANDDIE("failed to add intermediate client certificate"); -+ } - - if (tlsbase->their_identity) - peer_cert = netsnmp_cert_find(NS_CERT_REMOTE_PEER, -@@ -576,11 +611,11 @@ sslctx_client_setup(const SSL_METHOD *me - peer_cert ? peer_cert->info.filename : "none")); - - /* Trust the expected certificate */ -- if (netsnmp_cert_trust_ca(the_ctx, peer_cert) != SNMPERR_SUCCESS) -+ if (netsnmp_cert_trust(the_ctx, peer_cert) != SNMPERR_SUCCESS) - LOGANDDIE ("failed to set verify paths"); - } - -- /* trust a certificate (possibly a CA) aspecifically passed in */ -+ /* trust a certificate (possibly a CA) specifically passed in */ - if (tlsbase->trust_cert) { - if (!_trust_this_cert(the_ctx, tlsbase->trust_cert)) - return 0; -@@ -599,7 +634,7 @@ sslctx_server_setup(const SSL_METHOD *me - /* setting up for ssl */ - SSL_CTX *the_ctx = SSL_CTX_new(NETSNMP_REMOVE_CONST(SSL_METHOD *, method)); - if (!the_ctx) { -- LOGANDDIE("can't create a new context"); -+ LOGANDDIE("can't create a new server context"); - } - MAKE_MEM_DEFINED(the_ctx, 256/*sizeof(*the_ctx)*/); - -@@ -608,7 +643,7 @@ sslctx_server_setup(const SSL_METHOD *me - LOGANDDIE ("error finding server identity keys"); - - if (!id_cert->key || !id_cert->key->okey) -- LOGANDDIE("failed to load private key"); -+ LOGANDDIE("failed to load server private key"); - - DEBUGMSGTL(("sslctx_server", "using public key: %s\n", - id_cert->info.filename)); -@@ -616,13 +651,19 @@ sslctx_server_setup(const SSL_METHOD *me - id_cert->key->info.filename)); - - if (SSL_CTX_use_certificate(the_ctx, id_cert->ocert) <= 0) -- LOGANDDIE("failed to set the certificate to use"); -+ LOGANDDIE("failed to set the server certificate to use"); - - if (SSL_CTX_use_PrivateKey(the_ctx, id_cert->key->okey) <= 0) -- LOGANDDIE("failed to set the private key to use"); -+ LOGANDDIE("failed to set the server private key to use"); - - if (!SSL_CTX_check_private_key(the_ctx)) -- LOGANDDIE("public and private keys incompatible"); -+ LOGANDDIE("server public and private keys incompatible"); -+ -+ while (id_cert->issuer_cert) { -+ id_cert = id_cert->issuer_cert; -+ if (!SSL_CTX_add_extra_chain_cert(the_ctx, id_cert->ocert)) -+ LOGANDDIE("failed to add intermediate server certificate"); -+ } - - SSL_CTX_set_read_ahead(the_ctx, 1); /* XXX: DTLS only? */ - diff --git a/net-snmp-5.9-proxy-getnext.patch b/net-snmp-5.9-proxy-getnext.patch deleted file mode 100644 index bfcbdbb..0000000 --- a/net-snmp-5.9-proxy-getnext.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/agent/mibgroup/ucd-snmp/proxy.c b/agent/mibgroup/ucd-snmp/proxy.c -index e0ee96b..8abe7a3 100644 ---- a/agent/mibgroup/ucd-snmp/proxy.c -+++ b/agent/mibgroup/ucd-snmp/proxy.c -@@ -463,7 +463,7 @@ proxy_handler(netsnmp_mib_handler *handler, - if (sp->base_len && - reqinfo->mode == MODE_GETNEXT && - (snmp_oid_compare(ourname, ourlength, -- sp->base, sp->base_len) < 0)) { -+ sp->name, sp->name_len) < 0)) { - DEBUGMSGTL(( "proxy", "request is out of registered range\n")); - /* - * Create GETNEXT request with an OID so the diff --git a/net-snmp-5.9-python-ld-flags.patch b/net-snmp-5.9-python-ld-flags.patch deleted file mode 100644 index 78fab3d..0000000 --- a/net-snmp-5.9-python-ld-flags.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/python/setup.py b/python/setup.py -index 2547842..0c68cd8 100644 ---- a/python/setup.py -+++ b/python/setup.py -@@ -17,14 +17,14 @@ if intree: - netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read() - libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read() - incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read() + " " + os.popen(basedir+'/net-snmp-config --base-cflags '+basedir).read() -- libs = re.findall(r"-l(\S+)", netsnmp_libs) -+ libs = re.findall(r"\s-l(\S+)", netsnmp_libs) - libdirs = re.findall(r"-L(\S+)", libdir) - incdirs = re.findall(r"-I(\S+)", incdir) - else: - netsnmp_libs = os.popen('net-snmp-config --libs').read() - libdirs = re.findall(r"-L(\S+)", netsnmp_libs) - incdirs = [] -- libs = re.findall(r"-l(\S+)", netsnmp_libs) -+ libs = re.findall(r"\s-l(\S+)", netsnmp_libs) - - setup( - name="netsnmp-python", version="1.0a1", diff --git a/net-snmp-5.9-ssl-buffer-size.patch b/net-snmp-5.9-ssl-buffer-size.patch deleted file mode 100644 index 5cb1ba6..0000000 --- a/net-snmp-5.9-ssl-buffer-size.patch +++ /dev/null @@ -1,67 +0,0 @@ -diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c ---- a/snmplib/snmp_openssl.c 2021-01-28 14:10:05.993443671 +0100 -+++ b/snmplib/snmp_openssl.c 2021-01-28 14:17:52.531088559 +0100 -@@ -284,31 +284,29 @@ _cert_get_extension(X509_EXTENSION *oex - } - if (X509V3_EXT_print(bio, oext, 0, 0) != 1) { - snmp_log(LOG_ERR, "could not print extension!\n"); -- BIO_vfree(bio); -- return NULL; -+ goto out; - } - - space = BIO_get_mem_data(bio, &data); - if (buf && *buf) { -- if (*len < space) -- buf_ptr = NULL; -- else -- buf_ptr = *buf; -+ if (*len < space + 1) { -+ snmp_log(LOG_ERR, "not enough buffer space to print extension\n"); -+ goto out; -+ } -+ buf_ptr = *buf; -+ } else { -+ buf_ptr = calloc(1, space + 1); - } -- else -- buf_ptr = calloc(1,space + 1); - - if (!buf_ptr) { -- snmp_log(LOG_ERR, -- "not enough space or error in allocation for extenstion\n"); -- BIO_vfree(bio); -- return NULL; -+ snmp_log(LOG_ERR, "error in allocation for extension\n"); -+ goto out; - } - memcpy(buf_ptr, data, space); - buf_ptr[space] = 0; - if (len) - *len = space; -- -+out: - BIO_vfree(bio); - - return buf_ptr; -@@ -479,7 +477,7 @@ netsnmp_openssl_cert_dump_extensions(X50 - { - X509_EXTENSION *extension; - const char *extension_name; -- char buf[SNMP_MAXBUF_SMALL], *buf_ptr = buf, *str, *lf; -+ char buf[SNMP_MAXBUF], *buf_ptr = buf, *str, *lf; - int i, num_extensions, buf_len, nid; - - if (NULL == ocert) -@@ -499,6 +497,11 @@ netsnmp_openssl_cert_dump_extensions(X50 - extension_name = OBJ_nid2sn(nid); - buf_len = sizeof(buf); - str = _cert_get_extension_str_at(ocert, i, &buf_ptr, &buf_len, 0); -+ if (!str) { -+ DEBUGMSGT(("9:cert:dump", " %2d: %s\n", i, -+ extension_name)); -+ continue; -+ } - lf = strchr(str, '\n'); /* look for multiline strings */ - if (NULL != lf) - *lf = '\0'; /* only log first line of multiline here */ diff --git a/net-snmp-5.9-twice-IP-parsing.patch b/net-snmp-5.9-twice-IP-parsing.patch deleted file mode 100644 index 2928e8f..0000000 --- a/net-snmp-5.9-twice-IP-parsing.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/snmplib/transports/snmpUDPDomain.c b/snmplib/transports/snmpUDPDomain.c -index b96497f3a..b594a389b 100644 ---- a/snmplib/transports/snmpUDPDomain.c -+++ b/snmplib/transports/snmpUDPDomain.c -@@ -387,7 +387,7 @@ netsnmp_udp_parse_security(const char *token, char *param) - /* Nope, wasn't a dotted quad. Must be a hostname. */ - int ret = netsnmp_gethostbyname_v4(sourcep, &network.s_addr); - if (ret < 0) { -- config_perror("cannot resolve source hostname"); -+ config_perror("cannot resolve IPv4 source hostname"); - return; - } - } -diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c -index 238c8a9d6..43c4eaee1 100644 ---- a/snmplib/transports/snmpUDPIPv6Domain.c -+++ b/snmplib/transports/snmpUDPIPv6Domain.c -@@ -736,7 +736,15 @@ netsnmp_udp6_parse_security(const char *token, char *param) - memset(&pton_addr.sin6_addr.s6_addr, '\0', - sizeof(struct in6_addr)); - } else if (inet_pton(AF_INET6, sourcep, &pton_addr.sin6_addr) != 1) { -- /* Nope, wasn't a numeric address. Must be a hostname. */ -+ /* Nope, wasn't a numeric IPv6 address. Must be IPv4 or a hostname. */ -+ -+ /* Try interpreting as dotted quad - IPv4 */ -+ struct in_addr network; -+ if (inet_pton(AF_INET, sourcep, &network) > 0){ -+ /* Yes, it's IPv4 - those it's already parsed and we can return. */ -+ DEBUGMSGTL(("com2sec6", "IPv4 detected for IPv6 parser. Skipping.\n")); -+ return; -+ } - #if HAVE_GETADDRINFO - int gai_error; - diff --git a/net-snmp-5.9.1-remove-des.patch b/net-snmp-5.9.1-remove-des.patch new file mode 100644 index 0000000..60fd30f --- /dev/null +++ b/net-snmp-5.9.1-remove-des.patch @@ -0,0 +1,175 @@ +diff -urNp a/man/net-snmp-config.1.def b/man/net-snmp-config.1.def +--- a/man/net-snmp-config.1.def 2021-05-26 09:30:07.430790003 +0200 ++++ b/man/net-snmp-config.1.def 2021-05-26 09:35:36.703673542 +0200 +@@ -30,7 +30,7 @@ code for a list of available debug token + SNMP Setup commands: + .TP + \fB\-\-create\-snmpv3\-user\fR [\-ro] [\-a authpass] [\-x privpass] +-[\-X DES|AES] [\-A MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [username] ++[\-X AES] [\-A MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [username] + .PP + These options produce the various compilation flags needed when + building external SNMP applications: +diff -urNp a/man/net-snmp-create-v3-user.1.def b/man/net-snmp-create-v3-user.1.def +--- a/man/net-snmp-create-v3-user.1.def 2021-05-26 09:30:07.430790003 +0200 ++++ b/man/net-snmp-create-v3-user.1.def 2021-05-26 09:34:23.702034230 +0200 +@@ -3,7 +3,7 @@ + net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file + .SH SYNOPSIS + .PP +-.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES] ++.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x AES] + .B [username] + .SH DESCRIPTION + .PP +@@ -27,5 +27,5 @@ specifies the authentication password ha + \fB\-X privpass\fR + specifies the encryption password + .TP +-\fB\-x DES|AES\fR ++\fB\-x AES\fR + specifies the encryption algorithm +diff -urNp a/man/snmpcmd.1.def b/man/snmpcmd.1.def +--- a/man/snmpcmd.1.def 2021-05-26 09:30:07.429789994 +0200 ++++ b/man/snmpcmd.1.def 2021-05-26 09:37:51.104850500 +0200 +@@ -311,7 +311,7 @@ Overrides the \fIdefSecurityName\fR toke + file. + .TP + .BI \-x " privProtocol" +-Set the privacy protocol (DES or AES) used for encrypted SNMPv3 messages. ++Set the privacy protocol (AES) used for encrypted SNMPv3 messages. + Overrides the \fIdefPrivType\fR token in the + .I snmp.conf + file. This option is only valid if the Net-SNMP software was build +diff -urNp a/man/snmp.conf.5.def b/man/snmp.conf.5.def +--- a/man/snmp.conf.5.def 2021-05-26 09:30:07.429789994 +0200 ++++ b/man/snmp.conf.5.def 2021-05-26 09:40:03.730011937 +0200 +@@ -221,13 +221,13 @@ The + value will be used for the authentication and/or privacy pass phrases + if either of the other directives are not specified. + .IP "defAuthType MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224" +-.IP "defPrivType DES|AES" ++.IP "defPrivType AES" + define the default authentication and privacy protocols to use for + SNMPv3 requests. + These can be overridden using the \fB\-a\fR and \fB\-x\fR options respectively. + .IP + If not specified, SNMPv3 requests will default to MD5 authentication +-and DES encryption. ++and AES encryption. + .RS + .IP "Note: + If the software has not been compiled to use the OpenSSL libraries, +@@ -262,8 +262,7 @@ master keys which have been converted to + suitable for on particular SNMP engine (agent). The length of the key + needs to be appropriate for the authentication or encryption type + being used (auth keys: MD5=16 bytes, SHA1=20 bytes; +-priv keys: DES=16 bytes (8 +-bytes of which is used as an IV and not a key), and AES=16 bytes). ++priv keys: AES=16 bytes). + .IP "sshtosnmpsocket PATH" + Sets the path of the \fBsshtosnmp\fR socket created by an application + (e.g. snmpd) listening for incoming ssh connections through the +diff -urNp a/man/snmpd.examples.5.def b/man/snmpd.examples.5.def +--- a/man/snmpd.examples.5.def 2021-05-26 09:30:07.429789994 +0200 ++++ b/man/snmpd.examples.5.def 2021-05-26 09:41:29.170761436 +0200 +@@ -87,8 +87,8 @@ the same authentication and encryption s + .RS + .nf + createUser me MD5 "single pass phrase" +-createUser myself MD5 "single pass phrase" DES +-createUser andI MD5 "single pass phrase" DES "single pass phrase" ++createUser myself MD5 "single pass phrase" AES ++createUser andI MD5 "single pass phrase" AES "single pass phrase" + .fi + .RE + Note that this defines three \fIdistinct\fR users, who could be granted +diff -urNp a/man/snmptrapd.conf.5.def b/man/snmptrapd.conf.5.def +--- a/man/snmptrapd.conf.5.def 2021-05-26 09:30:07.428789985 +0200 ++++ b/man/snmptrapd.conf.5.def 2021-05-26 09:42:02.963064029 +0200 +@@ -117,7 +117,7 @@ to trigger the types of processing liste + See + .IR snmpd.conf (5) + for more details. +-.IP "createUser [-e ENGINEID] username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [DES|AES]" ++.IP "createUser [-e ENGINEID] username (MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224) authpassphrase [AES]" + See the + .IR snmpd.conf (5) + manual page for a description of how to create SNMPv3 users. This +diff -urNp a/man/snmpusm.1.def b/man/snmpusm.1.def +--- a/man/snmpusm.1.def 2021-05-26 09:30:07.430790003 +0200 ++++ b/man/snmpusm.1.def 2021-05-26 09:42:24.178253990 +0200 +@@ -216,7 +216,7 @@ rwuser initial + # lets add the new user we'll create too: + rwuser wes + # USM configuration entries +-createUser initial MD5 setup_passphrase DES ++createUser initial MD5 setup_passphrase AES + .fi + .RE + .PP +diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in +--- a/net-snmp-create-v3-user.in 2021-05-26 09:30:07.369789468 +0200 ++++ b/net-snmp-create-v3-user.in 2021-05-26 09:33:23.966511123 +0200 +@@ -10,7 +10,7 @@ if @PSCMD@ | egrep ' snmpd *$' > /dev/nu + fi + + Aalgorithm="MD5" +-Xalgorithm="DES" ++Xalgorithm="AES" + token=rwuser + + while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do +@@ -57,11 +57,11 @@ case $1 in + exit 1 + fi + case $1 in +- DES|AES|AES128|AES192|AES256) ++ AES|AES128|AES192|AES256) + Xalgorithm=$1 + shift + ;; +- des|aes|aes128|aes192|aes256) ++ aes|aes128|aes192|aes256) + Xalgorithm=$(echo "$1" | tr a-z A-Z) + shift + ;; +@@ -90,7 +90,7 @@ if test "x$usage" = "xyes"; then + echo "" + echo "Usage:" + echo " net-snmp-create-v3-user [-ro] [-A authpass] [-X privpass]" +- echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x DES|AES] [username]" ++ echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x AES] [username]" + echo "" + exit + fi +diff -urNp a/README.snmpv3 b/README.snmpv3 +--- a/README.snmpv3 2021-05-26 09:30:07.352789320 +0200 ++++ b/README.snmpv3 2021-05-26 09:44:49.109551728 +0200 +@@ -4,7 +4,7 @@ How to setup SNMPv3, a very brief docume + do a better job on since I suck at writing documentation and he + doesn't ;-) --Wes: + +-Note: SHA authentication and DES/AES encryption support is only available ++Note: SHA authentication and AES encryption support is only available + if you have OpenSSL installed or if you've compiled using + --with-openssl=internal. If you use --with-openssl=internal please + read the documentation in snmplib/openssl/README for important details. +@@ -27,7 +27,7 @@ CREATING THE FIRST USER: + WARNING: SNMPv3 pass phrases must be at least 8 characters long! + + The above line creates the user "myuser" with a password of +- "my_password" (and uses MD5 and DES for protection). (Note that ++ "my_password" (and uses MD5 and AES for protection). (Note that + encryption support isn't enabled in the binary releases downloadable + from the net-snmp web site.) net-snmp-config will also add a line + to your snmpd.conf file to let that user have read/write access to +@@ -44,7 +44,7 @@ CREATING THE FIRST USER: + [ this should return information about how long your agent has been up] + + snmpget -v 3 -u myuser -l authPriv -a MD5 -A my_password +- -x DES -X my_password localhost sysUpTime.0 ++ -x AES -X my_password localhost sysUpTime.0 + [ this should return similar information, but encrypts the transmission ] + + CREATING A SECOND USER: diff --git a/net-snmp.spec b/net-snmp.spec index 0f75d6d..b894763 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -9,8 +9,8 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.9 -Release: 10%{?dist} +Version: 5.9.1 +Release: 1%{?dist} Epoch: 1 License: BSD @@ -37,26 +37,20 @@ Patch7: net-snmp-5.8-Remove-U64-typedef.patch Patch8: net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch Patch9: net-snmp-5.7.3-iterator-fix.patch Patch10: net-snmp-5.9-autofs-skip.patch -Patch11: net-snmp-5.9-python-ld-flags.patch -Patch12: net-snmp-5.9-usage-exit.patch -Patch13: net-snmp-5.9-coverity.patch -Patch14: net-snmp-5.9-proxy-getnext.patch -Patch15: net-snmp-5.9-dskTable-dynamic.patch -Patch16: net-snmp-5.8-expand-SNMPCONFPATH.patch -Patch17: net-snmp-5.8-duplicate-ipAddress.patch -Patch18: net-snmp-5.9-memory-reporting.patch -Patch19: net-snmp-5.8-man-page.patch -Patch20: net-snmp-5.8-ipAddress-faster-load.patch -Patch21: net-snmp-5.8-rpm-memory-leak.patch -Patch22: net-snmp-5.9-aes-config.patch -Patch23: net-snmp-5.9-available-memory.patch -Patch24: net-snmp-5.8-asn-parse-nlength.patch -Patch25: net-snmp-5.8-clientaddr-error-message.patch -Patch26: net-snmp-5.8-empty-passphrase.patch -Patch27: net-snmp-5.9-ECC-cert.patch -Patch28: net-snmp-5.9-intermediate-certs.patch -Patch29: net-snmp-5.9-ssl-buffer-size.patch -Patch30: net-snmp-5.9-twice-IP-parsing.patch +Patch11: net-snmp-5.9-usage-exit.patch +Patch12: net-snmp-5.9-coverity.patch +Patch13: net-snmp-5.9-dskTable-dynamic.patch +Patch14: net-snmp-5.8-expand-SNMPCONFPATH.patch +Patch15: net-snmp-5.8-duplicate-ipAddress.patch +Patch16: net-snmp-5.9-memory-reporting.patch +Patch17: net-snmp-5.8-man-page.patch +Patch18: net-snmp-5.8-ipAddress-faster-load.patch +Patch19: net-snmp-5.8-rpm-memory-leak.patch +Patch20: net-snmp-5.9-aes-config.patch +Patch21: net-snmp-5.8-clientaddr-error-message.patch +Patch22: net-snmp-5.9-ECC-cert.patch +Patch23: net-snmp-5.9-intermediate-certs.patch +Patch24: net-snmp-5.9.1-remove-des.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -218,26 +212,20 @@ cp %{SOURCE10} . %patch8 -p1 -b .perlfix %patch9 -p1 -b .iterator-fix %patch10 -p1 -b .autofs-skip -%patch11 -p1 -b .python-ld-flags -%patch12 -p1 -b .usage-fix -%patch13 -p1 -b .coverity -%patch14 -p1 -b .proxy-getnext -%patch15 -p1 -b .dskTable-dynamic -%patch16 -p1 -b .expand-SNMPCONFPATH -%patch17 -p1 -b .duplicate-ipAddress -%patch18 -p1 -b .memory-reporting -%patch19 -p1 -b .man-page -%patch20 -p1 -b .ipAddress-faster-load -%patch21 -p1 -b .rpm-memory-leak -%patch22 -p1 -b .aes-config -%patch23 -p1 -b .available-memory -%patch24 -p1 -b .asn-parse-nlength -%patch25 -p1 -b .clientaddr-error-message -%patch26 -p1 -b .empty-passphrase -%patch27 -p1 -b .ECC-cert -%patch28 -p1 -b .intermediate-certs -%patch29 -p1 -b .ssl-buffer-size -%patch30 -p1 -b .twice-IP-parsing +%patch11 -p1 -b .usage-fix +%patch12 -p1 -b .coverity +%patch13 -p1 -b .dskTable-dynamic +%patch14 -p1 -b .expand-SNMPCONFPATH +%patch15 -p1 -b .duplicate-ipAddress +%patch16 -p1 -b .memory-reporting +%patch17 -p1 -b .man-page +%patch18 -p1 -b .ipAddress-faster-load +%patch19 -p1 -b .rpm-memory-leak +%patch20 -p1 -b .aes-config +%patch21 -p1 -b .clientaddr-error-message +%patch22 -p1 -b .ECC-cert +%patch23 -p1 -b .intermediate-certs +%patch24 -p1 -b .remove-des %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -272,6 +260,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib" --enable-local-smux \ --enable-mfd-rewrites \ --enable-ucd-snmp-compatibility \ + --disable-des \ --sysconfdir=%{_sysconfdir} \ --with-cflags="$RPM_OPT_FLAGS -fPIE" \ --with-ldflags="$RPM_LD_FLAGS -lm" \ @@ -505,6 +494,10 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed May 26 2021 Josef Ridky - 1:5.9.1-1 +- New upstream release 5.9.1 (#1946399) +- remove DES support + * Fri May 21 2021 Jitka Plesnikova - 1:5.9-10 - Perl 5.34 rebuild diff --git a/sources b/sources index c46cae1..30f421d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.tar.gz) = 21855ba5cee47ba41a82f88d2fa558c9a732690858af5523ae99c2b3939b133e3450d04c6446b3168eed6f08d6f0f5d4cbb5d784b713a8e14f68c424e514f91b +SHA512 (net-snmp-5.9.1.tar.gz) = 7d73b2085863b1c063d7eaee488d806cc07da79c070f702068846e43d8e5c67673b86357600f2c1f774c30c24b0561cb566c64ea4588b073bf6906a9c6949ab7 From 2f2718771d7044222502cf22362b5c351572a72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 1 Jun 2021 08:52:32 +0200 Subject: [PATCH 23/81] Enable DES for F33 and F34 --- net-snmp.spec | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index b894763..649e7f2 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: BSD @@ -50,7 +50,7 @@ Patch20: net-snmp-5.9-aes-config.patch Patch21: net-snmp-5.8-clientaddr-error-message.patch Patch22: net-snmp-5.9-ECC-cert.patch Patch23: net-snmp-5.9-intermediate-certs.patch -Patch24: net-snmp-5.9.1-remove-des.patch +#Patch24: net-snmp-5.9.1-remove-des.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -225,7 +225,7 @@ cp %{SOURCE10} . %patch21 -p1 -b .clientaddr-error-message %patch22 -p1 -b .ECC-cert %patch23 -p1 -b .intermediate-certs -%patch24 -p1 -b .remove-des +#%patch24 -p1 -b .remove-des %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -260,7 +260,6 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib" --enable-local-smux \ --enable-mfd-rewrites \ --enable-ucd-snmp-compatibility \ - --disable-des \ --sysconfdir=%{_sysconfdir} \ --with-cflags="$RPM_OPT_FLAGS -fPIE" \ --with-ldflags="$RPM_LD_FLAGS -lm" \ @@ -494,6 +493,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jun 01 2021 Josef Ridky - 1:5.9.1-2 +- restore DES for F34 and F33 + * Wed May 26 2021 Josef Ridky - 1:5.9.1-1 - New upstream release 5.9.1 (#1946399) - remove DES support From 3b0b966b01015fa76f592d1eeb9d58a2e1939a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 1 Jun 2021 09:09:57 +0200 Subject: [PATCH 24/81] Disable DES for F35+ --- net-snmp.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index 649e7f2..0bff3c0 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: BSD @@ -50,7 +50,7 @@ Patch20: net-snmp-5.9-aes-config.patch Patch21: net-snmp-5.8-clientaddr-error-message.patch Patch22: net-snmp-5.9-ECC-cert.patch Patch23: net-snmp-5.9-intermediate-certs.patch -#Patch24: net-snmp-5.9.1-remove-des.patch +Patch24: net-snmp-5.9.1-remove-des.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -225,7 +225,7 @@ cp %{SOURCE10} . %patch21 -p1 -b .clientaddr-error-message %patch22 -p1 -b .ECC-cert %patch23 -p1 -b .intermediate-certs -#%patch24 -p1 -b .remove-des +%patch24 -p1 -b .remove-des %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -260,6 +260,7 @@ MIBS="$MIBS ucd-snmp/lmsensorsMib" --enable-local-smux \ --enable-mfd-rewrites \ --enable-ucd-snmp-compatibility \ + --disable-des \ --sysconfdir=%{_sysconfdir} \ --with-cflags="$RPM_OPT_FLAGS -fPIE" \ --with-ldflags="$RPM_LD_FLAGS -lm" \ @@ -493,6 +494,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jun 01 2021 Josef Ridky - 1:5.9.1-3 +- disable DES for F35+ + * Tue Jun 01 2021 Josef Ridky - 1:5.9.1-2 - restore DES for F34 and F33 From 0e8b4706feb95c9a080c977a87d86ec2d91f9326 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 4 Jun 2021 20:12:44 +0200 Subject: [PATCH 25/81] Rebuilt for Python 3.10 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 0bff3c0..92f7cd4 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: BSD @@ -494,6 +494,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jun 04 2021 Python Maint - 1:5.9.1-4 +- Rebuilt for Python 3.10 + * Tue Jun 01 2021 Josef Ridky - 1:5.9.1-3 - disable DES for F35+ From 31a7f8be0fa2dc07435b4ff6768fd1a50e2b884c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 19 Jul 2021 12:30:47 +0200 Subject: [PATCH 26/81] Resolves: #1970937 - fix UseNumeric in Python library --- net-snmp-5.9.1-python-usenumeric.patch | 60 ++++++++++++++++++++++++++ net-snmp.spec | 8 +++- 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 net-snmp-5.9.1-python-usenumeric.patch diff --git a/net-snmp-5.9.1-python-usenumeric.patch b/net-snmp-5.9.1-python-usenumeric.patch new file mode 100644 index 0000000..2f1d1ae --- /dev/null +++ b/net-snmp-5.9.1-python-usenumeric.patch @@ -0,0 +1,60 @@ +From 8c1dad23301692799749d75a3c039b8ae7c07f8e Mon Sep 17 00:00:00 2001 +From: Bart Van Assche +Date: Wed, 9 Jun 2021 14:19:46 -0700 +Subject: [PATCH] Python: Fix snmpwalk with UseNumeric=1 + +Fixes: c744be5ffed6 ("Python: Introduce build_python_varbind()") +Fixes: https://github.com/net-snmp/net-snmp/issues/303 +--- + python/netsnmp/client_intf.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/python/netsnmp/client_intf.c b/python/netsnmp/client_intf.c +index e5e7372303..94da39fe34 100644 +--- a/python/netsnmp/client_intf.c ++++ b/python/netsnmp/client_intf.c +@@ -1316,7 +1316,7 @@ netsnmp_delete_session(PyObject *self, PyObject *args) + + static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars, + int varlist_ind, int sprintval_flag, int *len, +- char **str_buf) ++ char **str_buf, int getlabel_flag) + { + struct tree *tp; + int type; +@@ -1326,7 +1326,6 @@ static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars, + int buf_over = 0; + const char *tag; + const char *iid; +- int getlabel_flag = NO_FLAGS; + + if (!PyObject_HasAttrString(varbind, "tag")) + return TYPE_OTHER; +@@ -1523,7 +1522,7 @@ netsnmp_get_or_getnext(PyObject *self, PyObject *args, int pdu_type, + + varbind = PySequence_GetItem(varlist, varlist_ind); + type = build_python_varbind(varbind, vars, varlist_ind, sprintval_flag, +- &len, &str_buf); ++ &len, &str_buf, getlabel_flag); + if (type != TYPE_OTHER) { + /* save in return tuple as well */ + if ((type == SNMP_ENDOFMIBVIEW) || +@@ -1832,7 +1831,7 @@ netsnmp_walk(PyObject *self, PyObject *args) + + varbind = py_netsnmp_construct_varbind(); + if (varbind && build_python_varbind(varbind, vars, varlist_ind, +- sprintval_flag, &len, &str_buf) != ++ sprintval_flag, &len, &str_buf, getlabel_flag) != + TYPE_OTHER) { + const int hex = is_hex(str_buf, len); + +@@ -2055,7 +2054,7 @@ netsnmp_getbulk(PyObject *self, PyObject *args) + + varbind = py_netsnmp_construct_varbind(); + if (varbind && build_python_varbind(varbind, vars, varbind_ind, +- sprintval_flag, &len, &str_buf) != TYPE_OTHER) { ++ sprintval_flag, &len, &str_buf, getlabel_flag) != TYPE_OTHER) { + const int hex = is_hex(str_buf, len); + + /* push varbind onto varbinds */ + diff --git a/net-snmp.spec b/net-snmp.spec index 0bff3c0..f8e20ce 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: BSD @@ -51,12 +51,12 @@ Patch21: net-snmp-5.8-clientaddr-error-message.patch Patch22: net-snmp-5.9-ECC-cert.patch Patch23: net-snmp-5.9-intermediate-certs.patch Patch24: net-snmp-5.9.1-remove-des.patch - # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch #disable this patch due compatibility issues Patch102: net-snmp-5.9-python3.patch +Patch103: net-snmp-5.9.1-python-usenumeric.patch Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -229,6 +229,7 @@ cp %{SOURCE10} . %patch101 -p1 -b .modern-rpm-api %patch102 -p1 +%patch103 -p1 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* @@ -494,6 +495,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jun 01 2021 Josef Ridky - 1:5.9.1-4 +- fix UseNumeric in Python library (#1970937) + * Tue Jun 01 2021 Josef Ridky - 1:5.9.1-3 - disable DES for F35+ From 0da701e0985dd0fba03ecdd73c1a77b601c7342c Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 15:58:22 +0000 Subject: [PATCH 27/81] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 39a8db4..dc8b370 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 License: BSD @@ -495,6 +495,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 1:5.9.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Mon Jul 19 2021 Josef Ridky - 1:5.9.1-5 - fix UseNumeric in Python library (#1970937) From 94800d9ce0e58f4eb12f27e8461883f49c17921b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 29 Jul 2021 15:26:49 +0200 Subject: [PATCH 28/81] Resolves: #1544527 - fix cflag compile error --- net-snmp-5.9-cflags.patch | 18 +----------------- net-snmp.spec | 7 ++++++- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/net-snmp-5.9-cflags.patch b/net-snmp-5.9-cflags.patch index 5099cde..8e22133 100644 --- a/net-snmp-5.9-cflags.patch +++ b/net-snmp-5.9-cflags.patch @@ -1,19 +1,3 @@ -diff -urNp a/net-snmp-config.in b/net-snmp-config.in ---- a/net-snmp-config.in 2018-07-18 13:43:12.264426052 +0200 -+++ b/net-snmp-config.in 2018-07-18 13:52:06.917089518 +0200 -@@ -140,10 +140,10 @@ else - ;; - #################################################### compile - --base-cflags) -- echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR} -+ echo -I${NSC_INCLUDEDIR} - ;; - --cflags|--cf*) -- echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} -+ echo @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR} - ;; - --srcdir) - echo $NSC_SRCDIR diff -urNp a/perl/Makefile.PL b/perl/Makefile.PL --- a/perl/Makefile.PL 2020-08-26 08:32:52.498909823 +0200 +++ b/perl/Makefile.PL 2020-08-26 09:30:45.584951552 +0200 @@ -33,4 +17,4 @@ diff -urNp a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm + $Params->{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; append($Params->{'CCFLAGS'}, '-Wformat'); } - } + }":: diff --git a/net-snmp.spec b/net-snmp.spec index dc8b370..1a55f78 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: BSD @@ -121,6 +121,7 @@ Summary: The development environment for the NET-SNMP project Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel +Requires: redhat-rpm-config %ifnarch s390 s390x ppc64le Requires: lm_sensors-devel %endif @@ -495,6 +496,10 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 29 2021 Josef Ridky - 1:5.9.1-7 +- revert cflags modification in net-snmp-config as was reverted in upstream + and add proper dependency to net-snmp-devel sub-package (#1544527) + * Thu Jul 22 2021 Fedora Release Engineering - 1:5.9.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 888f62f4d4ffce3c52e35fd8ac1d16c75fd17129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 29 Jul 2021 15:33:26 +0200 Subject: [PATCH 29/81] Fix typo in patch --- net-snmp-5.9-cflags.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-snmp-5.9-cflags.patch b/net-snmp-5.9-cflags.patch index 8e22133..ef8604f 100644 --- a/net-snmp-5.9-cflags.patch +++ b/net-snmp-5.9-cflags.patch @@ -17,4 +17,4 @@ diff -urNp a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm + $Params->{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; append($Params->{'CCFLAGS'}, '-Wformat'); } - }":: + } From c7a2182909582969739c51a0af8edb25c588a096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 1 Sep 2021 11:47:36 +0200 Subject: [PATCH 30/81] Resolves: #1999475 - FTBFS due of autoconf update --- net-snmp-5.9.1-autoconf.patch | 6 ++++++ net-snmp.spec | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9.1-autoconf.patch diff --git a/net-snmp-5.9.1-autoconf.patch b/net-snmp-5.9.1-autoconf.patch new file mode 100644 index 0000000..5c6b2a9 --- /dev/null +++ b/net-snmp-5.9.1-autoconf.patch @@ -0,0 +1,6 @@ +diff -urNp a/dist/autoconf-version b/dist/autoconf-version +--- a/dist/autoconf-version 2021-09-01 11:18:14.582110773 +0200 ++++ b/dist/autoconf-version 2021-09-01 11:20:16.804369533 +0200 +@@ -1 +1 @@ +-2.69 ++2.71 diff --git a/net-snmp.spec b/net-snmp.spec index 1a55f78..e97c61b 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: BSD @@ -51,6 +51,8 @@ Patch21: net-snmp-5.8-clientaddr-error-message.patch Patch22: net-snmp-5.9-ECC-cert.patch Patch23: net-snmp-5.9-intermediate-certs.patch Patch24: net-snmp-5.9.1-remove-des.patch +Patch25: net-snmp-5.9.1-autoconf.patch + # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -227,6 +229,7 @@ cp %{SOURCE10} . %patch22 -p1 -b .ECC-cert %patch23 -p1 -b .intermediate-certs %patch24 -p1 -b .remove-des +%patch25 -p1 -b .autoconf %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -496,6 +499,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Sep 01 2021 Josef Ridky - 1:5.9.1-8 +- fix FTBFS (#1999475) + * Thu Jul 29 2021 Josef Ridky - 1:5.9.1-7 - revert cflags modification in net-snmp-config as was reverted in upstream and add proper dependency to net-snmp-devel sub-package (#1544527) From 8c84e94b7d799d4e20097c01a7bd2c9761241ae6 Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:08:56 +0200 Subject: [PATCH 31/81] Rebuilt with OpenSSL 3.0.0 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index e97c61b..941d261 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 License: BSD @@ -499,6 +499,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Sep 14 2021 Sahana Prasad - 1:5.9.1-9 +- Rebuilt with OpenSSL 3.0.0 + * Wed Sep 01 2021 Josef Ridky - 1:5.9.1-8 - fix FTBFS (#1999475) From fc25bbe4da751b59f55389e21c50632cabbd1fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 15 Sep 2021 08:01:33 +0200 Subject: [PATCH 32/81] Resolves: #2004351 - remove ERR_GET_FUNC from code --- net-snmp-5.9.1-remove-err-log.patch | 35 +++++++++++++++++++++++++++++ net-snmp.spec | 7 +++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9.1-remove-err-log.patch diff --git a/net-snmp-5.9.1-remove-err-log.patch b/net-snmp-5.9.1-remove-err-log.patch new file mode 100644 index 0000000..a56188b --- /dev/null +++ b/net-snmp-5.9.1-remove-err-log.patch @@ -0,0 +1,35 @@ +diff -urNp a/include/net-snmp/library/snmp_openssl.h b/include/net-snmp/library/snmp_openssl.h +--- a/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:55:39.829901038 +0200 ++++ b/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:56:18.656412998 +0200 +@@ -44,7 +44,6 @@ extern "C" { + /* + * misc + */ +- void netsnmp_openssl_err_log(const char *prefix); + void netsnmp_openssl_null_checks(SSL *ssl, int *nullAuth, int *nullCipher); + + /* +diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c +--- a/snmplib/snmp_openssl.c 2021-09-15 07:55:39.785900458 +0200 ++++ b/snmplib/snmp_openssl.c 2021-09-15 07:57:30.914417600 +0200 +@@ -937,20 +937,6 @@ netsnmp_openssl_cert_issued_by(X509 *iss + return (X509_check_issued(issuer, cert) == X509_V_OK); + } + +- +-#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG +-void +-netsnmp_openssl_err_log(const char *prefix) +-{ +- unsigned long err; +- for (err = ERR_get_error(); err; err = ERR_get_error()) { +- snmp_log(LOG_ERR,"%s: %ld\n", prefix ? prefix: "openssl error", err); +- snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n", +- ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err)); +- } +-} +-#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG */ +- + void + netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher) + { diff --git a/net-snmp.spec b/net-snmp.spec index 941d261..e8d3a29 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 License: BSD @@ -52,6 +52,7 @@ Patch22: net-snmp-5.9-ECC-cert.patch Patch23: net-snmp-5.9-intermediate-certs.patch Patch24: net-snmp-5.9.1-remove-des.patch Patch25: net-snmp-5.9.1-autoconf.patch +Patch26: net-snmp-5.9.1-remove-err-log.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -230,6 +231,7 @@ cp %{SOURCE10} . %patch23 -p1 -b .intermediate-certs %patch24 -p1 -b .remove-des %patch25 -p1 -b .autoconf +%patch26 -p1 -b .remove-err-log %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -499,6 +501,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Sep 15 2021 Josef Ridky - 1:5.9.1-10 +- Remove ERR_GET_FUNC from code (#2004351) + * Tue Sep 14 2021 Sahana Prasad - 1:5.9.1-9 - Rebuilt with OpenSSL 3.0.0 From 309b687c1e4b323f71d8ba3051cf2f2119474337 Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Wed, 15 Sep 2021 11:50:07 +0200 Subject: [PATCH 33/81] Rebuilt with OpenSSL 3.0.0 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index e8d3a29..e7d0282 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 10%{?dist} +Release: 11%{?dist} Epoch: 1 License: BSD @@ -501,6 +501,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Sep 15 2021 Sahana Prasad - 1:5.9.1-11 +- Rebuilt with OpenSSL 3.0.0 + * Wed Sep 15 2021 Josef Ridky - 1:5.9.1-10 - Remove ERR_GET_FUNC from code (#2004351) From d622fc4df5379bedfad1d8bbda0c4539d2a85e0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Mon, 4 Oct 2021 15:51:07 +0200 Subject: [PATCH 34/81] Resolves: #2008781 - fix FTBFS for F36 --- net-snmp-5.9.1-remove-err-log.patch | 49 +++++++++++++++++++++++++++++ net-snmp.spec | 5 ++- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/net-snmp-5.9.1-remove-err-log.patch b/net-snmp-5.9.1-remove-err-log.patch index a56188b..42b17b2 100644 --- a/net-snmp-5.9.1-remove-err-log.patch +++ b/net-snmp-5.9.1-remove-err-log.patch @@ -33,3 +33,52 @@ diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c void netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher) { +diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c +--- a/snmplib/transports/snmpTLSBaseDomain.c 2021-09-15 07:55:39.784900445 +0200 ++++ b/snmplib/transports/snmpTLSBaseDomain.c 2021-10-04 15:35:48.157385970 +0200 +@@ -54,17 +54,6 @@ netsnmp_feature_require(cert_util); + + int openssl_local_index; + +-#ifndef HAVE_ERR_GET_ERROR_ALL +-/* A backport of the OpenSSL 1.1.1e ERR_get_error_all() function. */ +-static unsigned long ERR_get_error_all(const char **file, int *line, +- const char **func, +- const char **data, int *flags) +-{ +- *func = NULL; +- return ERR_get_error_line_data(file, line, data, flags); +-} +-#endif +- + /* this is called during negotiation */ + int verify_callback(int ok, X509_STORE_CTX *ctx) { + int err, depth; +@@ -1187,27 +1176,6 @@ void _openssl_log_error(int rc, SSL *con + ERR_reason_error_string(ERR_get_error())); + + } +- +- /* other errors */ +- while ((numerical_reason = +- ERR_get_error_all(&file, &line, &func, &data, &flags)) != 0) { +- snmp_log(LOG_ERR, "%s (file %s, func %s, line %d)\n", +- ERR_error_string(numerical_reason, NULL), file, func, line); +- +- /* if we have a text translation: */ +- if (data && (flags & ERR_TXT_STRING)) { +- snmp_log(LOG_ERR, " Textual Error: %s\n", data); +- /* +- * per openssl man page: If it has been allocated by +- * OPENSSL_malloc(), *flags&ERR_TXT_MALLOCED is true. +- * +- * arggh... stupid openssl prototype for ERR_get_error_line_data +- * wants a const char **, but returns something that we might +- * need to free?? +- */ +- if (flags & ERR_TXT_MALLOCED) +- OPENSSL_free(NETSNMP_REMOVE_CONST(void *, data)); } +- } + + snmp_log(LOG_ERR, "---- End of OpenSSL Errors ----\n"); + } diff --git a/net-snmp.spec b/net-snmp.spec index e7d0282..3d634b5 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 11%{?dist} +Release: 12%{?dist} Epoch: 1 License: BSD @@ -501,6 +501,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Oct 04 2021 Josef Ridky - 1:5.9.1-12 +- fix FTBFS of ERR_get_error (#2008781) + * Wed Sep 15 2021 Sahana Prasad - 1:5.9.1-11 - Rebuilt with OpenSSL 3.0.0 From 71fd62d403cd384917f270a6cb7c73add5db26fe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 21:02:00 +0000 Subject: [PATCH 35/81] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 3d634b5..d9baaa4 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 12%{?dist} +Release: 13%{?dist} Epoch: 1 License: BSD @@ -501,6 +501,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 1:5.9.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Mon Oct 04 2021 Josef Ridky - 1:5.9.1-12 - fix FTBFS of ERR_get_error (#2008781) From a55907366ff0e7d7af4896d76e375819eb0f7e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 29 Jan 2022 09:30:35 +0100 Subject: [PATCH 36/81] Remove linker flags from Libs.private --- net-snmp-libs-misunderstanding.patch | 59 ++++++++++++++++++++++++++++ net-snmp.spec | 7 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 net-snmp-libs-misunderstanding.patch diff --git a/net-snmp-libs-misunderstanding.patch b/net-snmp-libs-misunderstanding.patch new file mode 100644 index 0000000..5e09b4b --- /dev/null +++ b/net-snmp-libs-misunderstanding.patch @@ -0,0 +1,59 @@ +Libs.private should contain a list of libraries the library that the package +exposes is linked too. So let's filter out unrelated link flags. + +diff --git net-snmp-5.9.1/netsnmp.pc.in~ net-snmp-5.9.1/netsnmp.pc.in +index 0a1f5785a4..524ca91d82 100644 +--- net-snmp-5.9.1/netsnmp.pc.in~ ++++ net-snmp-5.9.1/netsnmp.pc.in +@@ -9,4 +9,4 @@ URL: http://www.net-snmp.org + Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} + Libs: -L${libdir} -lnetsnmp +-Libs.private: @LDFLAGS@ @LNETSNMPLIBS@ @LIBS@ @PERLLDOPTS_FOR_APPS@ ++Libs.private: @LNETSNMPLIBS@ @LIBS@ +diff --git net-snmp-5.9.1/netsnmp-agent.pc.in~ net-snmp-5.9.1/netsnmp-agent.pc.in +index 3a1c77bbf8..3d3b308d21 100644 +--- net-snmp-5.9.1/netsnmp-agent.pc.in~ ++++ net-snmp-5.9.1/netsnmp-agent.pc.in +@@ -9,4 +9,4 @@ URL: http://www.net-snmp.org + Version: @PACKAGE_VERSION@ + Cflags: -I${includedir} + Libs: -L${libdir} -lnetsnmpmibs -lnetsnmpagent -lnetsnmp +-Libs.private: @LDFLAGS@ @LMIBLIBS@ @LAGENTLIBS@ @PERLLDOPTS_FOR_APPS@ @LNETSNMPLIBS@ @LIBS@ ++Libs.private: @LMIBLIBS@ @LAGENTLIBS@ @LNETSNMPLIBS@ @LIBS@ +diff --git net-snmp-5.9.1/net-snmp-config.in~ net-snmp-5.9.1/net-snmp-config.in +index 6b5abf8f83..ee81ce98fa 100644 +--- net-snmp-5.9.1/net-snmp-config.in~ ++++ net-snmp-5.9.1/net-snmp-config.in +@@ -193,13 +193,13 @@ else + #################################################### client lib + --libs) + # use this one == --netsnmp-libs + --external-libs +- echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS ++ echo $NSC_LIBDIR $NSC_SNMPLIBS $NSC_LIBS + ;; + --netsnmp-libs) + echo $NSC_LIBDIR $NSC_BASE_SNMP_LIBS + ;; + --external-libs) +- echo $NSC_LDFLAGS $NSC_LNETSNMPLIBS $NSC_LIBS @PERLLDOPTS_FOR_APPS@ ++ echo $NSC_LNETSNMPLIBS $NSC_LIBS + ;; + #################################################### agent lib + --base-agent-libs) +@@ -210,13 +210,13 @@ else + ;; + --agent-libs) + # use this one == --netsnmp-agent-libs + --external-libs +- echo $NSC_LDFLAGS $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS ++ echo $NSC_LIBDIR $NSC_AGENTLIBS $NSC_LIBS + ;; + --netsnmp-agent-libs) + echo $NSC_LIBDIR $NSC_BASE_AGENT_LIBS + ;; + --external-agent-libs) +- echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS ++ echo $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS + ;; + #################################################### + --version|--ver*) diff --git a/net-snmp.spec b/net-snmp.spec index d9baaa4..4d57136 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 13%{?dist} +Release: 14%{?dist} Epoch: 1 License: BSD @@ -53,6 +53,7 @@ Patch23: net-snmp-5.9-intermediate-certs.patch Patch24: net-snmp-5.9.1-remove-des.patch Patch25: net-snmp-5.9.1-autoconf.patch Patch26: net-snmp-5.9.1-remove-err-log.patch +Patch27: net-snmp-libs-misunderstanding.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -232,6 +233,7 @@ cp %{SOURCE10} . %patch24 -p1 -b .remove-des %patch25 -p1 -b .autoconf %patch26 -p1 -b .remove-err-log +%patch27 -p1 %patch101 -p1 -b .modern-rpm-api %patch102 -p1 @@ -501,6 +503,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Sat Jan 29 2022 Zbigniew JÄ™drzejewski-Szmek - 1:5.9.1-14 +- Remove linker flags from Libs.private (#2043092) + * Thu Jan 20 2022 Fedora Release Engineering - 1:5.9.1-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild From 8718f62cb288e6f1192cedc09488a2cb7f544e5f Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 30 May 2022 20:11:35 +0200 Subject: [PATCH 37/81] Perl 5.36 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 4d57136..34077b7 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 14%{?dist} +Release: 15%{?dist} Epoch: 1 License: BSD @@ -503,6 +503,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon May 30 2022 Jitka Plesnikova - 1:5.9.1-15 +- Perl 5.36 rebuild + * Sat Jan 29 2022 Zbigniew JÄ™drzejewski-Szmek - 1:5.9.1-14 - Remove linker flags from Libs.private (#2043092) From 689c725c3458fe459324981324cddd9c79a69dc8 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 13 Jun 2022 15:11:28 +0200 Subject: [PATCH 38/81] Rebuilt for Python 3.11 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 34077b7..4ceb973 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 15%{?dist} +Release: 16%{?dist} Epoch: 1 License: BSD @@ -503,6 +503,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jun 13 2022 Python Maint - 1:5.9.1-16 +- Rebuilt for Python 3.11 + * Mon May 30 2022 Jitka Plesnikova - 1:5.9.1-15 - Perl 5.36 rebuild From 5567bd7e3e3dfa51b8ea70b712fae5eb91155c07 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 22 Jul 2022 00:23:29 +0000 Subject: [PATCH 39/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 4ceb973..b8aba36 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.1 -Release: 16%{?dist} +Release: 17%{?dist} Epoch: 1 License: BSD @@ -503,6 +503,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jul 22 2022 Fedora Release Engineering - 1:5.9.1-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Mon Jun 13 2022 Python Maint - 1:5.9.1-16 - Rebuilt for Python 3.11 From f9c2f2517932582b91a99a248c1a8a38a6fb015f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Thu, 4 Aug 2022 15:03:38 +0200 Subject: [PATCH 40/81] Resolves: #2072230 - New upstream release 5.9.3 --- .gitignore | 1 + net-snmp-5.8-rpm-memory-leak.patch | 16 +- net-snmp-5.9-ECC-cert.patch | 98 ---------- net-snmp-5.9-autofs-skip.patch | 36 +--- net-snmp-5.9-dir-fix.patch | 16 +- net-snmp-5.9-dskTable-dynamic.patch | 179 ------------------ net-snmp-5.9-intermediate-certs.patch | 64 ++++--- ...9-libnetsnmptrapd-against-MYSQL_LIBS.patch | 13 -- net-snmp-5.9-pie.patch | 8 +- net-snmp-5.9-usage-exit.patch | 12 -- net-snmp-5.9.1-python-usenumeric.patch | 60 ------ net-snmp-5.9.1-remove-err-log.patch | 84 -------- net-snmp.spec | 79 ++++---- sources | 2 +- 14 files changed, 96 insertions(+), 572 deletions(-) delete mode 100644 net-snmp-5.9-ECC-cert.patch delete mode 100644 net-snmp-5.9-dskTable-dynamic.patch delete mode 100644 net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch delete mode 100644 net-snmp-5.9-usage-exit.patch delete mode 100644 net-snmp-5.9.1-python-usenumeric.patch delete mode 100644 net-snmp-5.9.1-remove-err-log.patch diff --git a/.gitignore b/.gitignore index 99fc27e..2467898 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.8.tar.gz /net-snmp-5.9.tar.gz /net-snmp-5.9.1.tar.gz +/net-snmp-5.9.3.tar.gz diff --git a/net-snmp-5.8-rpm-memory-leak.patch b/net-snmp-5.8-rpm-memory-leak.patch index 33b8d29..d337008 100644 --- a/net-snmp-5.8-rpm-memory-leak.patch +++ b/net-snmp-5.8-rpm-memory-leak.patch @@ -1,6 +1,7 @@ -diff -urNp a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c ---- a/agent/mibgroup/host/data_access/swinst_rpm.c 2020-06-10 14:32:43.330486233 +0200 -+++ b/agent/mibgroup/host/data_access/swinst_rpm.c 2020-06-10 14:35:46.672298741 +0200 +diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c +index 695c469..dd0e487 100644 +--- a/agent/mibgroup/host/data_access/swinst_rpm.c ++++ b/agent/mibgroup/host/data_access/swinst_rpm.c @@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void) snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); SNMP_FREE(rpmdbpath); @@ -9,11 +10,12 @@ diff -urNp a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/ + rpmFreeRpmrc(); +#endif if (-1 == stat( pkg_directory, &stat_buf )) { - snmp_log(LOG_ERR, "Can't find directory of RPM packages"); + snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); pkg_directory[0] = '\0'; -diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c ---- a/agent/mibgroup/host/hr_swinst.c 2020-06-10 14:32:43.325486184 +0200 -+++ b/agent/mibgroup/host/hr_swinst.c 2020-06-10 14:36:44.423872418 +0200 +diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c +index 1f52733..ccf1cab 100644 +--- a/agent/mibgroup/host/hr_swinst.c ++++ b/agent/mibgroup/host/hr_swinst.c @@ -231,6 +231,9 @@ init_hr_swinst(void) snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath); path[ sizeof(path)-1 ] = 0; diff --git a/net-snmp-5.9-ECC-cert.patch b/net-snmp-5.9-ECC-cert.patch deleted file mode 100644 index 5d43d4d..0000000 --- a/net-snmp-5.9-ECC-cert.patch +++ /dev/null @@ -1,98 +0,0 @@ -From a1968db524e087a36a19a351b89bf6f1633819aa Mon Sep 17 00:00:00 2001 -From: minfrin -Date: Tue, 5 Jan 2021 23:17:14 +0000 -Subject: [PATCH] Add support for digests detected from ECC certificates - -Previously, the digest could be detected on RSA certificates only. This -patch adds detection for ECC certificates. - -[ bvanassche: changed _htmap2 into a two-dimensional array and renamed _htmap2 - back to _htmap ] ---- - snmplib/snmp_openssl.c | 60 +++++++++++++++++++++++++++++++++++------- - 1 file changed, 50 insertions(+), 10 deletions(-) - -diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c -index c092a007a..432cb5c27 100644 ---- a/snmplib/snmp_openssl.c -+++ b/snmplib/snmp_openssl.c -@@ -521,18 +521,54 @@ netsnmp_openssl_cert_dump_extensions(X509 *ocert) - } - } - --static int _htmap[NS_HASH_MAX + 1] = { -- 0, NID_md5WithRSAEncryption, NID_sha1WithRSAEncryption, -- NID_sha224WithRSAEncryption, NID_sha256WithRSAEncryption, -- NID_sha384WithRSAEncryption, NID_sha512WithRSAEncryption }; -+static const struct { -+ uint16_t nid; -+ uint16_t ht; -+} _htmap[] = { -+ { 0, NS_HASH_NONE }, -+#ifdef NID_md5WithRSAEncryption -+ { NID_md5WithRSAEncryption, NS_HASH_MD5 }, -+#endif -+#ifdef NID_sha1WithRSAEncryption -+ { NID_sha1WithRSAEncryption, NS_HASH_SHA1 }, -+#endif -+#ifdef NID_ecdsa_with_SHA1 -+ { NID_ecdsa_with_SHA1, NS_HASH_SHA1 }, -+#endif -+#ifdef NID_sha224WithRSAEncryption -+ { NID_sha224WithRSAEncryption, NS_HASH_SHA224 }, -+#endif -+#ifdef NID_ecdsa_with_SHA224 -+ { NID_ecdsa_with_SHA224, NS_HASH_SHA224 }, -+#endif -+#ifdef NID_sha256WithRSAEncryption -+ { NID_sha256WithRSAEncryption, NS_HASH_SHA256 }, -+#endif -+#ifdef NID_ecdsa_with_SHA256 -+ { NID_ecdsa_with_SHA256, NS_HASH_SHA256 }, -+#endif -+#ifdef NID_sha384WithRSAEncryption -+ { NID_sha384WithRSAEncryption, NS_HASH_SHA384 }, -+#endif -+#ifdef NID_ecdsa_with_SHA384 -+ { NID_ecdsa_with_SHA384, NS_HASH_SHA384 }, -+#endif -+#ifdef NID_sha512WithRSAEncryption -+ { NID_sha512WithRSAEncryption, NS_HASH_SHA512 }, -+#endif -+#ifdef NID_ecdsa_with_SHA512 -+ { NID_ecdsa_with_SHA512, NS_HASH_SHA512 }, -+#endif -+}; - - int - _nid2ht(int nid) - { - int i; -- for (i=1; i<= NS_HASH_MAX; ++i) { -- if (nid == _htmap[i]) -- return i; -+ -+ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) { -+ if (_htmap[i].nid == nid) -+ return _htmap[i].ht; - } - return 0; - } -@@ -541,9 +577,13 @@ _nid2ht(int nid) - int - _ht2nid(int ht) - { -- if ((ht < 0) || (ht > NS_HASH_MAX)) -- return 0; -- return _htmap[ht]; -+ int i; -+ -+ for (i = 0; i < sizeof(_htmap) / sizeof(_htmap[0]); i++) { -+ if (_htmap[i].ht == ht) -+ return _htmap[i].nid; -+ } -+ return 0; - } - #endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_HT2NID */ - - diff --git a/net-snmp-5.9-autofs-skip.patch b/net-snmp-5.9-autofs-skip.patch index 0d054b2..bd5c560 100644 --- a/net-snmp-5.9-autofs-skip.patch +++ b/net-snmp-5.9-autofs-skip.patch @@ -1,5 +1,5 @@ diff --git a/agent/mibgroup/host/hr_filesys.c b/agent/mibgroup/host/hr_filesys.c -index 4f78df3..fd25b3f 100644 +index e7ca92f..80b3e0d 100644 --- a/agent/mibgroup/host/hr_filesys.c +++ b/agent/mibgroup/host/hr_filesys.c @@ -704,6 +704,7 @@ static const char *HRFS_ignores[] = { @@ -10,37 +10,3 @@ index 4f78df3..fd25b3f 100644 "usbdevfs", "usbfs", #endif -diff --git a/agent/mibgroup/host/hr_storage.c b/agent/mibgroup/host/hr_storage.c -index 6b459ec..f7a376b 100644 ---- a/agent/mibgroup/host/hr_storage.c -+++ b/agent/mibgroup/host/hr_storage.c -@@ -540,9 +540,10 @@ really_try_next: - - store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; - if (store_idx > NETSNMP_MEM_TYPE_MAX ) { -- if ( netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, -+ if ( (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS()) -+ Check_HR_FileSys_NFS()) || -+ Check_HR_FileSys_AutoFs()) - return NULL; /* or goto try_next; */ - if (Check_HR_FileSys_AutoFs()) - return NULL; -diff --git a/agent/mibgroup/host/hrh_storage.c b/agent/mibgroup/host/hrh_storage.c -index 8967d35..9bf2659 100644 ---- a/agent/mibgroup/host/hrh_storage.c -+++ b/agent/mibgroup/host/hrh_storage.c -@@ -366,9 +366,10 @@ really_try_next: - store_idx = name[ HRSTORE_ENTRY_NAME_LENGTH ]; - if (HRFS_entry && - store_idx > NETSNMP_MEM_TYPE_MAX && -- netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, -+ ((netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_SKIPNFSINHOSTRESOURCES) && -- Check_HR_FileSys_NFS()) -+ Check_HR_FileSys_NFS()) || -+ Check_HR_FileSys_AutoFs())) - return NULL; - if (HRFS_entry && Check_HR_FileSys_AutoFs()) - return NULL; diff --git a/net-snmp-5.9-dir-fix.patch b/net-snmp-5.9-dir-fix.patch index 00d531f..f7311ca 100644 --- a/net-snmp-5.9-dir-fix.patch +++ b/net-snmp-5.9-dir-fix.patch @@ -1,8 +1,8 @@ diff --git a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in -index 452c269..afd6fa4 100644 +index 19895a1..ac3c60f 100644 --- a/net-snmp-create-v3-user.in +++ b/net-snmp-create-v3-user.in -@@ -16,6 +16,10 @@ Xalgorithm="DES" +@@ -14,6 +14,10 @@ Xalgorithm="DES" token=rwuser while test "x$done" = "x" -a "x$1" != "x" -a "x$usage" != "xyes"; do @@ -13,11 +13,17 @@ index 452c269..afd6fa4 100644 unset shifted case $1 in -@@ -136,7 +140,7 @@ fi +@@ -134,11 +138,9 @@ if test ! -d "$outfile"; then + touch "$outfile" + fi echo "$line" >> "$outfile" - # Avoid that configure complains that this script ignores @datarootdir@ - echo "@datarootdir@" >/dev/null +-prefix=@prefix@ +-datarootdir=@datarootdir@ +-# To suppress shellcheck complaints about $prefix and $datarootdir. +-: "$prefix" "$datarootdir" -outfile="@datadir@/snmp/snmpd.conf" ++# Avoid that configure complains that this script ignores @datarootdir@ ++echo "@datarootdir@" >/dev/null +outfile="/etc/snmp/snmpd.conf" line="$token $user" echo "adding the following line to $outfile:" diff --git a/net-snmp-5.9-dskTable-dynamic.patch b/net-snmp-5.9-dskTable-dynamic.patch deleted file mode 100644 index 035bf55..0000000 --- a/net-snmp-5.9-dskTable-dynamic.patch +++ /dev/null @@ -1,179 +0,0 @@ -diff -urNp a/agent/mibgroup/ucd-snmp/disk.c b/agent/mibgroup/ucd-snmp/disk.c ---- a/agent/mibgroup/ucd-snmp/disk.c 2021-05-26 08:56:39.678900275 +0200 -+++ b/agent/mibgroup/ucd-snmp/disk.c 2021-05-26 09:09:32.308731157 +0200 -@@ -153,9 +153,10 @@ static void disk_free_config(void) - static void disk_parse_config(const char *, char *); - static void disk_parse_config_all(const char *, char *); - #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS --static void find_and_add_allDisks(int minpercent); -+static void refresh_disk_table(int addNewDisks, int minpercent); - static void add_device(char *path, char *device, -- int minspace, int minpercent, int override); -+ int minspace, int minpercent, int addNewDisks, -+ int override); - static void modify_disk_parameters(int index, int minspace, - int minpercent); - static int disk_exists(char *path); -@@ -167,6 +168,7 @@ struct diskpart { - char path[STRMAX]; - int minimumspace; - int minpercent; -+ int alive; - }; - - #define MAX_INT_32 0x7fffffff -@@ -174,6 +176,7 @@ struct diskpart { - - unsigned int numdisks; - int allDisksIncluded = 0; -+int allDisksMinPercent = 0; - unsigned int maxdisks = 0; - struct diskpart *disks; - -@@ -238,6 +241,7 @@ init_disk(void) - disk_free_config, - "minpercent%"); - allDisksIncluded = 0; -+ allDisksMinPercent = 0; - } - - static void -@@ -253,6 +257,7 @@ disk_free_config(void) - disks[i].minpercent = -1; - } - allDisksIncluded = 0; -+ allDisksMinPercent = 0; - } - - static void -@@ -313,7 +318,7 @@ disk_parse_config(const char *token, cha - * check if the disk already exists, if so then modify its - * parameters. if it does not exist then add it - */ -- add_device(path, find_device(path), minspace, minpercent, 1); -+ add_device(path, find_device(path), minspace, minpercent, 1, 1); - #endif /* HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS */ - } - -@@ -372,7 +377,7 @@ disk_parse_config_all(const char *token, - - #if HAVE_FSTAB_H || HAVE_GETMNTENT || HAVE_STATFS - static void --add_device(char *path, char *device, int minspace, int minpercent, int override) -+add_device(char *path, char *device, int minspace, int minpercent, int addNewDisks, int override) - { - int index; - -@@ -402,10 +407,16 @@ add_device(char *path, char *device, int - } - - index = disk_exists(path); -- if((index != -1) && (index < maxdisks) && (override==1)) { -- modify_disk_parameters(index, minspace, minpercent); -+ if((index != -1) && (index < maxdisks)) { -+ /* the path is already in the table */ -+ disks[index].alive = 1; -+ /* -> update its device */ -+ strlcpy(disks[index].device, device, sizeof(disks[index].device)); -+ if (override == 1) { -+ modify_disk_parameters(index, minspace, minpercent); -+ } - } -- else if(index == -1){ -+ else if(index == -1 && addNewDisks){ - /* add if and only if the device was found */ - if(device[0] != 0) { - /* The following buffers are cleared above, no need to add '\0' */ -@@ -413,6 +424,7 @@ add_device(char *path, char *device, int - strlcpy(disks[numdisks].device, device, sizeof(disks[numdisks].device)); - disks[numdisks].minimumspace = minspace; - disks[numdisks].minpercent = minpercent; -+ disks[numdisks].alive = 1; - numdisks++; - } - else { -@@ -420,6 +432,7 @@ add_device(char *path, char *device, int - disks[numdisks].minpercent = -1; - disks[numdisks].path[0] = 0; - disks[numdisks].device[0] = 0; -+ disks[numdisks].alive = 0; - } - } - } -@@ -444,7 +457,7 @@ int disk_exists(char *path) - } - - static void --find_and_add_allDisks(int minpercent) -+refresh_disk_table(int addNewDisks, int minpercent) - { - #if HAVE_GETMNTENT - #if HAVE_SYS_MNTTAB_H -@@ -480,7 +493,7 @@ find_and_add_allDisks(int minpercent) - return; - } - while (mntfp && NULL != (mntent = getmntent(mntfp))) { -- add_device(mntent->mnt_dir, mntent->mnt_fsname, -1, minpercent, 0); -+ add_device(mntent->mnt_dir, mntent->mnt_fsname, -1, minpercent, addNewDisks, 0); - dummy = 1; - } - if (mntfp) -@@ -497,7 +510,7 @@ find_and_add_allDisks(int minpercent) - return; - } - while ((i = getmntent(mntfp, &mnttab)) == 0) { -- add_device(mnttab.mnt_mountp, mnttab.mnt_special, -1, minpercent, 0); -+ add_device(mnttab.mnt_mountp, mnttab.mnt_special, -1, minpercent, addNewDisks, 0); - dummy = 1; - } - fclose(mntfp); -@@ -514,13 +527,13 @@ find_and_add_allDisks(int minpercent) - mntsize = getmntinfo(&mntbuf, MNT_NOWAIT); - for (i = 0; i < mntsize; i++) { - add_device(mntbuf[i].f_mntonname, mntbuf[i].f_mntfromname, -1, -- minpercent, 0); -+ minpercent, addNewDisks, 0); - } - } - #elif HAVE_FSTAB_H - setfsent(); /* open /etc/fstab */ - while((fstab1 = getfsent()) != NULL) { -- add_device(fstab1->fs_file, fstab1->fs_spec, -1, minpercent, 0); -+ add_device(fstab1->fs_file, fstab1->fs_spec, -1, minpercent, addNewDisks, 0); - dummy = 1; - } - endfsent(); /* close /etc/fstab */ -@@ -535,7 +548,7 @@ find_and_add_allDisks(int minpercent) - * statfs we default to the root partition "/" - */ - if (statfs("/", &statf) == 0) { -- add_device("/", statf.f_mntfromname, -1, minpercent, 0); -+ add_device("/", statf.f_mntfromname, -1, minpercent, addNewDisks, 0); - } - #endif - else { -@@ -694,6 +707,10 @@ fill_dsk_entry(int disknum, struct dsk_e - #endif - #endif - -+ if (disks[disknum].alive == 0){ -+ return -1; -+ } -+ - entry->dskPercentInode = -1; - - #if defined(HAVE_STATVFS) || defined(HAVE_STATFS) -@@ -825,6 +842,13 @@ var_extensible_disk(struct variable *vp, - static char *errmsg; - static char empty_str[1]; - -+ int i; -+ for (i = 0; i < numdisks; i++){ -+ disks[i].alive = 0; -+ } -+ /* dynamically add new disks + update alive flag */ -+ refresh_disk_table(allDisksIncluded, allDisksMinPercent); -+ - tryAgain: - if (header_simple_table - (vp, name, length, exact, var_len, write_method, numdisks)) diff --git a/net-snmp-5.9-intermediate-certs.patch b/net-snmp-5.9-intermediate-certs.patch index 89815ef..6b5daf7 100644 --- a/net-snmp-5.9-intermediate-certs.patch +++ b/net-snmp-5.9-intermediate-certs.patch @@ -1,6 +1,7 @@ -diff -urNp a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h ---- a/include/net-snmp/library/cert_util.h 2021-05-26 09:17:40.338156603 +0200 -+++ b/include/net-snmp/library/cert_util.h 2021-05-26 09:19:25.396109268 +0200 +diff --git a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h +index 80e2a19..143adbb 100644 +--- a/include/net-snmp/library/cert_util.h ++++ b/include/net-snmp/library/cert_util.h @@ -55,7 +55,8 @@ extern "C" { char *common_name; @@ -19,9 +20,10 @@ diff -urNp a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cer int netsnmp_cert_check_vb_fingerprint(const netsnmp_variable_list *var); -diff -urNp a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h ---- a/include/net-snmp/library/dir_utils.h 2021-05-26 09:17:40.337156594 +0200 -+++ b/include/net-snmp/library/dir_utils.h 2021-05-26 09:19:59.236416127 +0200 +diff --git a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir_utils.h +index 471bb0b..ac7f69a 100644 +--- a/include/net-snmp/library/dir_utils.h ++++ b/include/net-snmp/library/dir_utils.h @@ -53,7 +53,8 @@ extern "C" { #define NETSNMP_DIR_NSFILE 0x0010 /** load stats in netsnmp_file */ @@ -32,10 +34,11 @@ diff -urNp a/include/net-snmp/library/dir_utils.h b/include/net-snmp/library/dir #ifdef __cplusplus -diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c ---- a/snmplib/cert_util.c 2021-05-26 09:17:40.182155189 +0200 -+++ b/snmplib/cert_util.c 2021-05-26 09:28:23.533539371 +0200 -@@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint +diff --git a/snmplib/cert_util.c b/snmplib/cert_util.c +index 210ad8b..b1f8144 100644 +--- a/snmplib/cert_util.c ++++ b/snmplib/cert_util.c +@@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all); * bump this value whenever cert index format changes, so indexes * will be regenerated with new format. */ @@ -44,7 +47,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c static netsnmp_container *_certs = NULL; static netsnmp_container *_keys = NULL; -@@ -126,6 +126,8 @@ static int _cert_fn_ncompare(netsnmp_ce +@@ -126,6 +126,8 @@ static int _cert_fn_ncompare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs); static void _find_partner(netsnmp_cert *cert, netsnmp_key *key); static netsnmp_cert *_find_issuer(netsnmp_cert *cert); @@ -113,7 +116,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c int hashType, const char *fingerprint, const char *common_name, const char *subject) { -@@ -446,8 +457,10 @@ _new_cert(const char *dirname, const cha +@@ -446,8 +457,10 @@ _new_cert(const char *dirname, const char *filename, int certType, cert->info.dir = strdup(dirname); cert->info.filename = strdup(filename); @@ -361,7 +364,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c return NULL; } -@@ -1154,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cer +@@ -1154,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) cert->issuer_cert = _find_issuer(cert); if (NULL == cert->issuer_cert) { DEBUGMSGT(("cert:load:warn", @@ -370,7 +373,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c cert->info.filename)); rc = CERT_LOAD_PARTIAL; break; -@@ -1163,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cer +@@ -1163,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) /** get issuer ocert */ if ((NULL == cert->issuer_cert->ocert) && (netsnmp_ocert_get(cert->issuer_cert) == NULL)) { @@ -379,7 +382,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c cert->info.filename)); rc = CERT_LOAD_PARTIAL; break; -@@ -1184,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnm +@@ -1184,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) return; } @@ -388,7 +391,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (key->cert) { DEBUGMSGT(("cert:partner", "key already has partner\n")); return; -@@ -1197,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnm +@@ -1197,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) return; *pos = 0; @@ -398,7 +401,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (!matching) return; if (1 == matching->size) { -@@ -1217,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnm +@@ -1217,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) DEBUGMSGT(("cert:partner", "%s matches multiple certs\n", key->info.filename)); } @@ -407,7 +410,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (cert->key) { DEBUGMSGT(("cert:partner", "cert already has partner\n")); return; -@@ -1255,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnm +@@ -1255,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) } } @@ -643,7 +646,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c } return 0; -@@ -1338,7 +1461,8 @@ _cert_read_index(const char *dirname, st +@@ -1338,7 +1461,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) struct stat idx_stat; char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX]; char fingerprint[EVP_MAX_MD_SIZE*3], common_name[64+1], type_str[15]; @@ -653,7 +656,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c int count = 0, type, hash, version; netsnmp_cert *cert; netsnmp_key *key; -@@ -1381,7 +1505,8 @@ _cert_read_index(const char *dirname, st +@@ -1381,7 +1505,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) netsnmp_directory_container_read_some(NULL, dirname, _time_filter, &idx_stat, NETSNMP_DIR_NSFILE | @@ -663,7 +666,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (newer) { DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n")); CONTAINER_FREE_ALL(newer, NULL); -@@ -1425,6 +1550,7 @@ _cert_read_index(const char *dirname, st +@@ -1426,6 +1551,7 @@ _cert_read_index(const char *dirname, struct stat *dirstat) pos = &tmpstr[2]; if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) || (NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) || @@ -671,7 +674,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c (NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) || (NULL == (pos=copy_nword(pos, fingerprint, sizeof(fingerprint)))) || -@@ -1437,8 +1563,9 @@ _cert_read_index(const char *dirname, st +@@ -1438,8 +1564,9 @@ _cert_read_index(const char *dirname, struct stat *dirstat) break; } type = atoi(type_str); @@ -682,7 +685,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c common_name, subject); if (cert && 0 == CONTAINER_INSERT(found, cert)) ++count; -@@ -1543,7 +1670,8 @@ _add_certdir(const char *dirname) +@@ -1546,7 +1673,8 @@ _add_certdir(const char *dirname) netsnmp_directory_container_read_some(NULL, dirname, _cert_cert_filter, NULL, NETSNMP_DIR_RELATIVE_PATH | @@ -692,7 +695,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (NULL == cert_container) { DEBUGMSGT(("cert:index:dir", "error creating container for cert files\n")); -@@ -1631,7 +1759,7 @@ _cert_print(netsnmp_cert *c, void *conte +@@ -1634,7 +1762,7 @@ _cert_print(netsnmp_cert *c, void *context) if (NULL == c) return; @@ -701,7 +704,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n", c->info.type, c->info.allowed_uses, _mode_str(c->info.allowed_uses))); -@@ -1835,7 +1963,8 @@ netsnmp_cert_find(int what, int where, v +@@ -1838,7 +1966,8 @@ netsnmp_cert_find(int what, int where, void *hint) netsnmp_void_array *matching; DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); @@ -711,7 +714,7 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c if (!matching) return NULL; if (1 == matching->size) -@@ -2278,6 +2407,124 @@ _reduce_subset_dir(netsnmp_void_array *m +@@ -2281,6 +2410,124 @@ _reduce_subset_dir(netsnmp_void_array *matching, const char *directory) } } @@ -836,10 +839,11 @@ diff -urNp a/snmplib/cert_util.c b/snmplib/cert_util.c static netsnmp_void_array * _cert_find_subset_common(const char *filename, netsnmp_container *container) { -diff -urNp a/snmplib/dir_utils.c b/snmplib/dir_utils.c ---- a/snmplib/dir_utils.c 2021-05-26 09:17:40.203155379 +0200 -+++ b/snmplib/dir_utils.c 2021-05-26 09:27:39.721867913 +0200 -@@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(ne +diff --git a/snmplib/dir_utils.c b/snmplib/dir_utils.c +index c2dd989..e7145e4 100644 +--- a/snmplib/dir_utils.c ++++ b/snmplib/dir_utils.c +@@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(netsnmp_container *user_container, /** default to unsorted */ if (! (flags & NETSNMP_DIR_SORTED)) CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_UNSORTED, rc); diff --git a/net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch b/net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch deleted file mode 100644 index 8f1f2ed..0000000 --- a/net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/apps/Makefile.in b/apps/Makefile.in -index d4529d3..175242b 100644 ---- a/apps/Makefile.in -+++ b/apps/Makefile.in -@@ -237,7 +237,7 @@ snmppcap$(EXEEXT): snmppcap.$(OSUFFIX) $(USELIBS) - $(LINK) ${CFLAGS} -o $@ snmppcap.$(OSUFFIX) ${LDFLAGS} ${LIBS} -lpcap - - libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS) -- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LDFLAGS) -+ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) $(MYSQL_LIBS) - $(RANLIB) $@ - - snmpinforminstall: diff --git a/net-snmp-5.9-pie.patch b/net-snmp-5.9-pie.patch index cb2793d..a792904 100644 --- a/net-snmp-5.9-pie.patch +++ b/net-snmp-5.9-pie.patch @@ -1,8 +1,8 @@ diff --git a/agent/Makefile.in b/agent/Makefile.in -index b5d692d..1a30209 100644 +index 047d880..38d40aa 100644 --- a/agent/Makefile.in +++ b/agent/Makefile.in -@@ -297,7 +297,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c +@@ -300,7 +300,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) @@ -10,9 +10,9 @@ index b5d692d..1a30209 100644 + $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS} libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS) - $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) @AGENTLIBS@ + $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) @AGENTLIBS@ diff --git a/apps/Makefile.in b/apps/Makefile.in -index 43f3b9c..d4529d3 100644 +index 3dbb1d1..48ed23a 100644 --- a/apps/Makefile.in +++ b/apps/Makefile.in @@ -190,7 +190,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS) diff --git a/net-snmp-5.9-usage-exit.patch b/net-snmp-5.9-usage-exit.patch deleted file mode 100644 index c43c846..0000000 --- a/net-snmp-5.9-usage-exit.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/agent/snmpd.c b/agent/snmpd.c -index ae73eda..f01b890 100644 ---- a/agent/snmpd.c -+++ b/agent/snmpd.c -@@ -289,6 +289,7 @@ usage(char *prog) - " -S d|i|0-7\t\tuse -Ls instead\n" - "\n" - ); -+ exit(1); - } - - static void diff --git a/net-snmp-5.9.1-python-usenumeric.patch b/net-snmp-5.9.1-python-usenumeric.patch deleted file mode 100644 index 2f1d1ae..0000000 --- a/net-snmp-5.9.1-python-usenumeric.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 8c1dad23301692799749d75a3c039b8ae7c07f8e Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Wed, 9 Jun 2021 14:19:46 -0700 -Subject: [PATCH] Python: Fix snmpwalk with UseNumeric=1 - -Fixes: c744be5ffed6 ("Python: Introduce build_python_varbind()") -Fixes: https://github.com/net-snmp/net-snmp/issues/303 ---- - python/netsnmp/client_intf.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/python/netsnmp/client_intf.c b/python/netsnmp/client_intf.c -index e5e7372303..94da39fe34 100644 ---- a/python/netsnmp/client_intf.c -+++ b/python/netsnmp/client_intf.c -@@ -1316,7 +1316,7 @@ netsnmp_delete_session(PyObject *self, PyObject *args) - - static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars, - int varlist_ind, int sprintval_flag, int *len, -- char **str_buf) -+ char **str_buf, int getlabel_flag) - { - struct tree *tp; - int type; -@@ -1326,7 +1326,6 @@ static int build_python_varbind(PyObject *varbind, netsnmp_variable_list *vars, - int buf_over = 0; - const char *tag; - const char *iid; -- int getlabel_flag = NO_FLAGS; - - if (!PyObject_HasAttrString(varbind, "tag")) - return TYPE_OTHER; -@@ -1523,7 +1522,7 @@ netsnmp_get_or_getnext(PyObject *self, PyObject *args, int pdu_type, - - varbind = PySequence_GetItem(varlist, varlist_ind); - type = build_python_varbind(varbind, vars, varlist_ind, sprintval_flag, -- &len, &str_buf); -+ &len, &str_buf, getlabel_flag); - if (type != TYPE_OTHER) { - /* save in return tuple as well */ - if ((type == SNMP_ENDOFMIBVIEW) || -@@ -1832,7 +1831,7 @@ netsnmp_walk(PyObject *self, PyObject *args) - - varbind = py_netsnmp_construct_varbind(); - if (varbind && build_python_varbind(varbind, vars, varlist_ind, -- sprintval_flag, &len, &str_buf) != -+ sprintval_flag, &len, &str_buf, getlabel_flag) != - TYPE_OTHER) { - const int hex = is_hex(str_buf, len); - -@@ -2055,7 +2054,7 @@ netsnmp_getbulk(PyObject *self, PyObject *args) - - varbind = py_netsnmp_construct_varbind(); - if (varbind && build_python_varbind(varbind, vars, varbind_ind, -- sprintval_flag, &len, &str_buf) != TYPE_OTHER) { -+ sprintval_flag, &len, &str_buf, getlabel_flag) != TYPE_OTHER) { - const int hex = is_hex(str_buf, len); - - /* push varbind onto varbinds */ - diff --git a/net-snmp-5.9.1-remove-err-log.patch b/net-snmp-5.9.1-remove-err-log.patch deleted file mode 100644 index 42b17b2..0000000 --- a/net-snmp-5.9.1-remove-err-log.patch +++ /dev/null @@ -1,84 +0,0 @@ -diff -urNp a/include/net-snmp/library/snmp_openssl.h b/include/net-snmp/library/snmp_openssl.h ---- a/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:55:39.829901038 +0200 -+++ b/include/net-snmp/library/snmp_openssl.h 2021-09-15 07:56:18.656412998 +0200 -@@ -44,7 +44,6 @@ extern "C" { - /* - * misc - */ -- void netsnmp_openssl_err_log(const char *prefix); - void netsnmp_openssl_null_checks(SSL *ssl, int *nullAuth, int *nullCipher); - - /* -diff -urNp a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c ---- a/snmplib/snmp_openssl.c 2021-09-15 07:55:39.785900458 +0200 -+++ b/snmplib/snmp_openssl.c 2021-09-15 07:57:30.914417600 +0200 -@@ -937,20 +937,6 @@ netsnmp_openssl_cert_issued_by(X509 *iss - return (X509_check_issued(issuer, cert) == X509_V_OK); - } - -- --#ifndef NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG --void --netsnmp_openssl_err_log(const char *prefix) --{ -- unsigned long err; -- for (err = ERR_get_error(); err; err = ERR_get_error()) { -- snmp_log(LOG_ERR,"%s: %ld\n", prefix ? prefix: "openssl error", err); -- snmp_log(LOG_ERR, "library=%d, function=%d, reason=%d\n", -- ERR_GET_LIB(err), ERR_GET_FUNC(err), ERR_GET_REASON(err)); -- } --} --#endif /* NETSNMP_FEATURE_REMOVE_OPENSSL_ERR_LOG */ -- - void - netsnmp_openssl_null_checks(SSL *ssl, int *null_auth, int *null_cipher) - { -diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c ---- a/snmplib/transports/snmpTLSBaseDomain.c 2021-09-15 07:55:39.784900445 +0200 -+++ b/snmplib/transports/snmpTLSBaseDomain.c 2021-10-04 15:35:48.157385970 +0200 -@@ -54,17 +54,6 @@ netsnmp_feature_require(cert_util); - - int openssl_local_index; - --#ifndef HAVE_ERR_GET_ERROR_ALL --/* A backport of the OpenSSL 1.1.1e ERR_get_error_all() function. */ --static unsigned long ERR_get_error_all(const char **file, int *line, -- const char **func, -- const char **data, int *flags) --{ -- *func = NULL; -- return ERR_get_error_line_data(file, line, data, flags); --} --#endif -- - /* this is called during negotiation */ - int verify_callback(int ok, X509_STORE_CTX *ctx) { - int err, depth; -@@ -1187,27 +1176,6 @@ void _openssl_log_error(int rc, SSL *con - ERR_reason_error_string(ERR_get_error())); - - } -- -- /* other errors */ -- while ((numerical_reason = -- ERR_get_error_all(&file, &line, &func, &data, &flags)) != 0) { -- snmp_log(LOG_ERR, "%s (file %s, func %s, line %d)\n", -- ERR_error_string(numerical_reason, NULL), file, func, line); -- -- /* if we have a text translation: */ -- if (data && (flags & ERR_TXT_STRING)) { -- snmp_log(LOG_ERR, " Textual Error: %s\n", data); -- /* -- * per openssl man page: If it has been allocated by -- * OPENSSL_malloc(), *flags&ERR_TXT_MALLOCED is true. -- * -- * arggh... stupid openssl prototype for ERR_get_error_line_data -- * wants a const char **, but returns something that we might -- * need to free?? -- */ -- if (flags & ERR_TXT_MALLOCED) -- OPENSSL_free(NETSNMP_REMOVE_CONST(void *, data)); } -- } - - snmp_log(LOG_ERR, "---- End of OpenSSL Errors ----\n"); - } diff --git a/net-snmp.spec b/net-snmp.spec index b8aba36..5998a4b 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -9,8 +9,8 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.9.1 -Release: 17%{?dist} +Version: 5.9.3 +Release: 1%{?dist} Epoch: 1 License: BSD @@ -34,33 +34,27 @@ Patch4: net-snmp-5.9-test-debug.patch Patch5: net-snmp-5.7.2-cert-path.patch Patch6: net-snmp-5.9-cflags.patch Patch7: net-snmp-5.8-Remove-U64-typedef.patch -Patch8: net-snmp-5.9-libnetsnmptrapd-against-MYSQL_LIBS.patch -Patch9: net-snmp-5.7.3-iterator-fix.patch -Patch10: net-snmp-5.9-autofs-skip.patch -Patch11: net-snmp-5.9-usage-exit.patch -Patch12: net-snmp-5.9-coverity.patch -Patch13: net-snmp-5.9-dskTable-dynamic.patch -Patch14: net-snmp-5.8-expand-SNMPCONFPATH.patch -Patch15: net-snmp-5.8-duplicate-ipAddress.patch -Patch16: net-snmp-5.9-memory-reporting.patch -Patch17: net-snmp-5.8-man-page.patch -Patch18: net-snmp-5.8-ipAddress-faster-load.patch -Patch19: net-snmp-5.8-rpm-memory-leak.patch -Patch20: net-snmp-5.9-aes-config.patch -Patch21: net-snmp-5.8-clientaddr-error-message.patch -Patch22: net-snmp-5.9-ECC-cert.patch -Patch23: net-snmp-5.9-intermediate-certs.patch -Patch24: net-snmp-5.9.1-remove-des.patch -Patch25: net-snmp-5.9.1-autoconf.patch -Patch26: net-snmp-5.9.1-remove-err-log.patch -Patch27: net-snmp-libs-misunderstanding.patch +Patch8: net-snmp-5.7.3-iterator-fix.patch +Patch9: net-snmp-5.9-autofs-skip.patch +Patch10: net-snmp-5.9-coverity.patch +Patch11: net-snmp-5.8-expand-SNMPCONFPATH.patch +Patch12: net-snmp-5.8-duplicate-ipAddress.patch +Patch13: net-snmp-5.9-memory-reporting.patch +Patch14: net-snmp-5.8-man-page.patch +Patch15: net-snmp-5.8-ipAddress-faster-load.patch +Patch16: net-snmp-5.8-rpm-memory-leak.patch +Patch17: net-snmp-5.9-aes-config.patch +Patch18: net-snmp-5.8-clientaddr-error-message.patch +Patch19: net-snmp-5.9-intermediate-certs.patch +Patch20: net-snmp-5.9.1-remove-des.patch +Patch21: net-snmp-5.9.1-autoconf.patch +Patch22: net-snmp-libs-misunderstanding.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch #disable this patch due compatibility issues Patch102: net-snmp-5.9-python3.patch -Patch103: net-snmp-5.9.1-python-usenumeric.patch Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -214,30 +208,24 @@ cp %{SOURCE10} . %patch5 -p1 -b .cert-path %patch6 -p1 -b .cflags %patch7 -p1 -b .u64-remove -%patch8 -p1 -b .perlfix -%patch9 -p1 -b .iterator-fix -%patch10 -p1 -b .autofs-skip -%patch11 -p1 -b .usage-fix -%patch12 -p1 -b .coverity -%patch13 -p1 -b .dskTable-dynamic -%patch14 -p1 -b .expand-SNMPCONFPATH -%patch15 -p1 -b .duplicate-ipAddress -%patch16 -p1 -b .memory-reporting -%patch17 -p1 -b .man-page -%patch18 -p1 -b .ipAddress-faster-load -%patch19 -p1 -b .rpm-memory-leak -%patch20 -p1 -b .aes-config -%patch21 -p1 -b .clientaddr-error-message -%patch22 -p1 -b .ECC-cert -%patch23 -p1 -b .intermediate-certs -%patch24 -p1 -b .remove-des -%patch25 -p1 -b .autoconf -%patch26 -p1 -b .remove-err-log -%patch27 -p1 +%patch8 -p1 -b .iterator-fix +%patch9 -p1 -b .autofs-skip +%patch10 -p1 -b .coverity +%patch11 -p1 -b .expand-SNMPCONFPATH +%patch12 -p1 -b .duplicate-ipAddress +%patch13 -p1 -b .memory-reporting +%patch14 -p1 -b .man-page +%patch15 -p1 -b .ipAddress-faster-load +%patch16 -p1 -b .rpm-memory-leak +%patch17 -p1 -b .aes-config +%patch18 -p1 -b .clientaddr-error-message +%patch19 -p1 -b .intermediate-certs +%patch20 -p1 -b .remove-des +%patch21 -p1 -b .autoconf +%patch22 -p1 %patch101 -p1 -b .modern-rpm-api %patch102 -p1 -%patch103 -p1 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* @@ -503,6 +491,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Aug 04 2022 Josef Ridky - 1:5.9.3-1 +- New upstream release 5.9.3 (#2072230) + * Fri Jul 22 2022 Fedora Release Engineering - 1:5.9.1-17 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild diff --git a/sources b/sources index 30f421d..6889744 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.1.tar.gz) = 7d73b2085863b1c063d7eaee488d806cc07da79c070f702068846e43d8e5c67673b86357600f2c1f774c30c24b0561cb566c64ea4588b073bf6906a9c6949ab7 +SHA512 (net-snmp-5.9.3.tar.gz) = a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc From 18351a39049ad210c6818427cad44b72b8b18e8a Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Fri, 13 Jan 2023 09:50:52 +0100 Subject: [PATCH 41/81] Remove perl(MODULE_COMPAT), it will be replaced by generators --- net-snmp.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 5998a4b..dd94fa2 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -173,7 +173,6 @@ binaries and applications. %package agent-libs Summary: The NET-SNMP runtime agent libraries # the libs link against libperl.so: -Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} %description agent-libs From 96bb8ca49d5e8db01cdba8c50ba73a8a51a1cecd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 21:24:13 +0000 Subject: [PATCH 42/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index dd94fa2..d012906 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: BSD @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 1:5.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Thu Aug 04 2022 Josef Ridky - 1:5.9.3-1 - New upstream release 5.9.3 (#2072230) From 47260a4a3ac50217073cee82033c7eac4e20c24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 19 May 2023 15:46:00 +0200 Subject: [PATCH 43/81] Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index d012906..cf4fa17 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: BSD @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri May 19 2023 Petr Pisar - 1:5.9.3-3 +- Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) + * Thu Jan 19 2023 Fedora Release Engineering - 1:5.9.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From f12e2cf5d737f0a0cf5b999e07aec4348a2eb270 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Tue, 13 Jun 2023 20:45:42 +0200 Subject: [PATCH 44/81] Rebuilt for Python 3.12 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index cf4fa17..be45df0 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: BSD @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jun 13 2023 Python Maint - 1:5.9.3-4 +- Rebuilt for Python 3.12 + * Fri May 19 2023 Petr Pisar - 1:5.9.3-3 - Rebuild against rpm-4.19 (https://fedoraproject.org/wiki/Changes/RPM-4.19) From 88d41bd5db4f86c07a45d3b1a7119d0e94996b6d Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Tue, 11 Jul 2023 15:11:20 +0200 Subject: [PATCH 45/81] Perl 5.38 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index be45df0..ed91932 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: BSD @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Jul 11 2023 Jitka Plesnikova - 1:5.9.3-5 +- Perl 5.38 rebuild + * Tue Jun 13 2023 Python Maint - 1:5.9.3-4 - Rebuilt for Python 3.12 From e4b67c5f99019b18e0f153b782e4517b6cbd86b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 19 Jul 2023 14:59:36 +0200 Subject: [PATCH 46/81] Migrate to SPDX license format --- net-snmp.spec | 57 +++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index ed91932..b3a3717 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,10 +10,10 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 -License: BSD +License: Net-SNMP and OpenSSL URL: http://net-snmp.sourceforge.net/ Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz Source1: net-snmp.redhat.conf @@ -35,7 +35,7 @@ Patch5: net-snmp-5.7.2-cert-path.patch Patch6: net-snmp-5.9-cflags.patch Patch7: net-snmp-5.8-Remove-U64-typedef.patch Patch8: net-snmp-5.7.3-iterator-fix.patch -Patch9: net-snmp-5.9-autofs-skip.patch +Patch9: net-snmp-5.9-autofs-skip.patch Patch10: net-snmp-5.9-coverity.patch Patch11: net-snmp-5.8-expand-SNMPCONFPATH.patch Patch12: net-snmp-5.8-duplicate-ipAddress.patch @@ -198,33 +198,33 @@ Net-SNMP toolkit library. cp %{SOURCE10} . %ifnarch ia64 -%patch1 -p1 -b .pie +%patch 1 -p1 -b .pie %endif -%patch2 -p1 -b .dir-fix -%patch3 -p1 -b .multilib -%patch4 -p1 -%patch5 -p1 -b .cert-path -%patch6 -p1 -b .cflags -%patch7 -p1 -b .u64-remove -%patch8 -p1 -b .iterator-fix -%patch9 -p1 -b .autofs-skip -%patch10 -p1 -b .coverity -%patch11 -p1 -b .expand-SNMPCONFPATH -%patch12 -p1 -b .duplicate-ipAddress -%patch13 -p1 -b .memory-reporting -%patch14 -p1 -b .man-page -%patch15 -p1 -b .ipAddress-faster-load -%patch16 -p1 -b .rpm-memory-leak -%patch17 -p1 -b .aes-config -%patch18 -p1 -b .clientaddr-error-message -%patch19 -p1 -b .intermediate-certs -%patch20 -p1 -b .remove-des -%patch21 -p1 -b .autoconf -%patch22 -p1 +%patch 2 -p1 -b .dir-fix +%patch 3 -p1 -b .multilib +%patch 4 -p1 +%patch 5 -p1 -b .cert-path +%patch 6 -p1 -b .cflags +%patch 7 -p1 -b .u64-remove +%patch 8 -p1 -b .iterator-fix +%patch 9 -p1 -b .autofs-skip +%patch 10 -p1 -b .coverity +%patch 11 -p1 -b .expand-SNMPCONFPATH +%patch 12 -p1 -b .duplicate-ipAddress +%patch 13 -p1 -b .memory-reporting +%patch 14 -p1 -b .man-page +%patch 15 -p1 -b .ipAddress-faster-load +%patch 16 -p1 -b .rpm-memory-leak +%patch 17 -p1 -b .aes-config +%patch 18 -p1 -b .clientaddr-error-message +%patch 19 -p1 -b .intermediate-certs +%patch 20 -p1 -b .remove-des +%patch 21 -p1 -b .autoconf +%patch 22 -p1 -%patch101 -p1 -b .modern-rpm-api -%patch102 -p1 +%patch 101 -p1 -b .modern-rpm-api +%patch 102 -p1 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* @@ -490,6 +490,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Jul 19 2023 Josef Ridky - 1:5.9.3-6 +- Migrate to SPDX license format + * Tue Jul 11 2023 Jitka Plesnikova - 1:5.9.3-5 - Perl 5.38 rebuild From 491853f2e5a57afcfe0863c82c99d0a2f210892a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 1 Aug 2023 08:10:58 +0200 Subject: [PATCH 47/81] Sync fixes with RHEL --- net-snmp-5.9-CVE-2022-44792-44793.patch | 129 ++++++++++++++++++++++++ net-snmp-5.9-ipv6-disable-leak.patch | 12 +++ net-snmp.spec | 9 +- 3 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9-CVE-2022-44792-44793.patch create mode 100644 net-snmp-5.9-ipv6-disable-leak.patch diff --git a/net-snmp-5.9-CVE-2022-44792-44793.patch b/net-snmp-5.9-CVE-2022-44792-44793.patch new file mode 100644 index 0000000..4b48b14 --- /dev/null +++ b/net-snmp-5.9-CVE-2022-44792-44793.patch @@ -0,0 +1,129 @@ +From 4589352dac3ae111c7621298cf231742209efd9b Mon Sep 17 00:00:00 2001 +From: Bill Fenner +Date: Fri, 25 Nov 2022 08:41:24 -0800 +Subject: [PATCH 1/3] snmp_agent: disallow SET with NULL varbind + +--- + agent/snmp_agent.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c +index 867d0c166f..3f678fe2df 100644 +--- a/agent/snmp_agent.c ++++ b/agent/snmp_agent.c +@@ -3719,12 +3719,44 @@ netsnmp_handle_request(netsnmp_agent_session *asp, int status) + return 1; + } + ++static int ++check_set_pdu_for_null_varbind(netsnmp_agent_session *asp) ++{ ++ int i; ++ netsnmp_variable_list *v = NULL; ++ ++ for (i = 1, v = asp->pdu->variables; v != NULL; i++, v = v->next_variable) { ++ if (v->type == ASN_NULL) { ++ /* ++ * Protect SET implementations that do not protect themselves ++ * against wrong type. ++ */ ++ DEBUGMSGTL(("snmp_agent", "disallowing SET with NULL var for varbind %d\n", i)); ++ asp->index = i; ++ return SNMP_ERR_WRONGTYPE; ++ } ++ } ++ return SNMP_ERR_NOERROR; ++} ++ + int + handle_pdu(netsnmp_agent_session *asp) + { + int status, inclusives = 0; + netsnmp_variable_list *v = NULL; + ++#ifndef NETSNMP_NO_WRITE_SUPPORT ++ /* ++ * Check for ASN_NULL in SET request ++ */ ++ if (asp->pdu->command == SNMP_MSG_SET) { ++ status = check_set_pdu_for_null_varbind(asp); ++ if (status != SNMP_ERR_NOERROR) { ++ return status; ++ } ++ } ++#endif /* NETSNMP_NO_WRITE_SUPPORT */ ++ + /* + * for illegal requests, mark all nodes as ASN_NULL + */ + +From 7f4ac4051cc7fec6a5944661923acb95cec359c7 Mon Sep 17 00:00:00 2001 +From: Bill Fenner +Date: Fri, 25 Nov 2022 08:41:46 -0800 +Subject: [PATCH 2/3] apps: snmpset: allow SET with NULL varbind for testing + +--- + apps/snmpset.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/apps/snmpset.c b/apps/snmpset.c +index 48e14bd513..d542713e1b 100644 +--- a/apps/snmpset.c ++++ b/apps/snmpset.c +@@ -182,6 +182,7 @@ main(int argc, char *argv[]) + case 'x': + case 'd': + case 'b': ++ case 'n': /* undocumented */ + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES + case 'I': + case 'U': + +From 15f9d7f7e5b90c9b419832ed8e6413feb6570d83 Mon Sep 17 00:00:00 2001 +From: Bill Fenner +Date: Fri, 25 Nov 2022 10:23:32 -0800 +Subject: [PATCH 3/3] Add test for NULL varbind set + +--- + .../default/T0142snmpv2csetnull_simple | 31 +++++++++++++++++++ + 1 file changed, 31 insertions(+) + create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple + +diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple +new file mode 100644 +index 0000000000..0f1b8f386b +--- /dev/null ++++ b/testing/fulltests/default/T0142snmpv2csetnull_simple +@@ -0,0 +1,31 @@ ++#!/bin/sh ++ ++. ../support/simple_eval_tools.sh ++ ++HEADER SNMPv2c set of system.sysContact.0 with NULL varbind ++ ++SKIPIF NETSNMP_DISABLE_SET_SUPPORT ++SKIPIF NETSNMP_NO_WRITE_SUPPORT ++SKIPIF NETSNMP_DISABLE_SNMPV2C ++SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE ++ ++# ++# Begin test ++# ++ ++# standard V2C configuration: testcomunnity ++snmp_write_access='all' ++. ./Sv2cconfig ++STARTAGENT ++ ++CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0" ++ ++CHECK ".1.3.6.1.2.1.1.4.0 = STRING:" ++ ++CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 n x" ++ ++CHECK "Reason: wrongType" ++ ++STOPAGENT ++ ++FINISHED + diff --git a/net-snmp-5.9-ipv6-disable-leak.patch b/net-snmp-5.9-ipv6-disable-leak.patch new file mode 100644 index 0000000..f8c20fd --- /dev/null +++ b/net-snmp-5.9-ipv6-disable-leak.patch @@ -0,0 +1,12 @@ +diff -urNp a/snmplib/snmp_logging.c b/snmplib/snmp_logging.c +--- a/snmplib/snmp_logging.c 2023-02-15 10:19:15.691827254 +0100 ++++ b/snmplib/snmp_logging.c 2023-02-15 10:24:41.006642974 +0100 +@@ -490,7 +490,7 @@ snmp_log_options(char *optarg, int argc, + char * + snmp_log_syslogname(const char *pstr) + { +- if (pstr) ++ if (pstr && (pstr != syslogname)) + strlcpy (syslogname, pstr, sizeof(syslogname)); + + return syslogname; diff --git a/net-snmp.spec b/net-snmp.spec index b3a3717..4a67f14 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -49,6 +49,8 @@ Patch19: net-snmp-5.9-intermediate-certs.patch Patch20: net-snmp-5.9.1-remove-des.patch Patch21: net-snmp-5.9.1-autoconf.patch Patch22: net-snmp-libs-misunderstanding.patch +Patch23: net-snmp-5.9-CVE-2022-44792-44793.patch +Patch24: net-snmp-5.9-ipv6-disable-leak.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -222,6 +224,8 @@ cp %{SOURCE10} . %patch 20 -p1 -b .remove-des %patch 21 -p1 -b .autoconf %patch 22 -p1 +%patch 23 -p1 +%patch 24 -p1 -b .ipv6-disable-leak %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -490,6 +494,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Aug 01 2023 Josef Ridky - 1:5.9.3-7 +- Sync fixes with RHEL + * Wed Jul 19 2023 Josef Ridky - 1:5.9.3-6 - Migrate to SPDX license format From 0867787a38c8b596e7e1630d9dfb1e9e985cead9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 1 Aug 2023 08:14:07 +0200 Subject: [PATCH 48/81] Fix sendmsg error code change for new kernel --- net-snmp-5.9-sendmsg-error-code.patch | 31 +++++++++++++++++++++++++++ net-snmp.spec | 3 +++ 2 files changed, 34 insertions(+) create mode 100644 net-snmp-5.9-sendmsg-error-code.patch diff --git a/net-snmp-5.9-sendmsg-error-code.patch b/net-snmp-5.9-sendmsg-error-code.patch new file mode 100644 index 0000000..6709cef --- /dev/null +++ b/net-snmp-5.9-sendmsg-error-code.patch @@ -0,0 +1,31 @@ +From 298c8103db80b292791616af4fd497342a71867f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= +Date: Wed, 24 May 2023 10:49:41 +0200 +Subject: [PATCH] libsnmp, UDP transport: Fix sendmsg() error code handling + +This change has been made because of Linux kernel commit "ipv4: Return +-ENETUNREACH if we can't create route but saddr is valid" +(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=595e0651d029) + +Fixes: https://github.com/net-snmp/net-snmp/issues/564 +Fixes: https://github.com/net-snmp/net-snmp/pull/576 + +[ bvanassche: edited commit message ] +--- + snmplib/transports/snmpUDPBaseDomain.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c +index ca8f9a5554..cd6b15e2ad 100644 +--- a/snmplib/transports/snmpUDPBaseDomain.c ++++ b/snmplib/transports/snmpUDPBaseDomain.c +@@ -315,7 +315,7 @@ int netsnmp_udpbase_sendto_unix(int fd, const struct in_addr *srcip, + sizeof(struct sockaddr)); + else + rc = sendmsg(fd, &m, MSG_DONTWAIT); +- if (rc >= 0 || errno != EINVAL) ++ if (rc >= 0 || (errno != EINVAL && errno != ENETUNREACH)) + return rc; + + /* + diff --git a/net-snmp.spec b/net-snmp.spec index 4a67f14..da99d50 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -51,6 +51,7 @@ Patch21: net-snmp-5.9.1-autoconf.patch Patch22: net-snmp-libs-misunderstanding.patch Patch23: net-snmp-5.9-CVE-2022-44792-44793.patch Patch24: net-snmp-5.9-ipv6-disable-leak.patch +Patch25: net-snmp-5.9-sendmsg-error-code.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -226,6 +227,7 @@ cp %{SOURCE10} . %patch 22 -p1 %patch 23 -p1 %patch 24 -p1 -b .ipv6-disable-leak +%patch 25 -p1 -b .sendmsg-error-code %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -496,6 +498,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Tue Aug 01 2023 Josef Ridky - 1:5.9.3-7 - Sync fixes with RHEL +- Fix sendmesg error code change for new kernel * Wed Jul 19 2023 Josef Ridky - 1:5.9.3-6 - Migrate to SPDX license format From 0f69787599ad3fd30073aad31d52b67929c1489a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 15 Aug 2023 09:43:05 +0200 Subject: [PATCH 49/81] Fix SQLight RPM transition warning and split perl package --- net-snmp-5.9-rpmdb.patch | 65 ++++++++++++++++++++++++++++++++++++++++ net-snmp.spec | 50 +++++++++++++++++++++++-------- 2 files changed, 103 insertions(+), 12 deletions(-) create mode 100644 net-snmp-5.9-rpmdb.patch diff --git a/net-snmp-5.9-rpmdb.patch b/net-snmp-5.9-rpmdb.patch new file mode 100644 index 0000000..d20d728 --- /dev/null +++ b/net-snmp-5.9-rpmdb.patch @@ -0,0 +1,65 @@ +From ed4ee14af5b83fa4a86dfaa783f841d3e8545ce4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= +Date: Wed, 9 Aug 2023 16:51:28 +0200 +Subject: [PATCH] Add support for RPM SQLite DB background. + +From RPM 4.16 the SQLite support is available for RPM DB. +After https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb, rpm changed +it's background DB from Berkeley to SQLite in Fedora. +Net-SNMP is using hard coded paths to determine where RPM DB files are. + +This update is adding check for rpmdb.sqlite file in order to be able +invalidate internal cache after system package change. + +Closes #596 +--- + agent/mibgroup/host/data_access/swinst_rpm.c | 18 +++++++++++++----- + agent/mibgroup/host/hr_swinst.c | 3 +++ + 2 files changed, 16 insertions(+), 5 deletions(-) + +diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c +index 050edff307..7ad91a3194 100644 +--- a/agent/mibgroup/host/data_access/swinst_rpm.c ++++ b/agent/mibgroup/host/data_access/swinst_rpm.c +@@ -73,15 +73,23 @@ netsnmp_swinst_arch_init(void) + #endif + + snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); ++ ++ if (-1 == stat( pkg_directory, &stat_buf )) { ++ ++ /* check for SQLite DB backend */ ++ snprintf( pkg_directory, SNMP_MAXPATH, "%s/rpmdb.sqlite", dbpath ); ++ ++ if (-1 == stat( pkg_directory, &stat_buf )) { ++ snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); ++ pkg_directory[0] = '\0'; ++ } ++ } ++ + SNMP_FREE(rpmdbpath); + dbpath = NULL; + #ifdef HAVE_RPMGETPATH + rpmFreeRpmrc(); +-#endif +- if (-1 == stat( pkg_directory, &stat_buf )) { +- snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); +- pkg_directory[0] = '\0'; +- } ++#endif + } + + void +diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c +--- a/agent/mibgroup/host/hr_swinst.c 2023-07-31 11:37:44.855071535 +0200 ++++ b/agent/mibgroup/host/hr_swinst.c 2023-08-14 12:45:14.846357019 +0200 +@@ -229,6 +229,9 @@ init_hr_swinst(void) + snprintf(path, sizeof(path), "%s/Packages", swi->swi_dbpath); + if (stat(path, &stat_buf) == -1) + snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath); ++ /* check for SQLite DB backend */ ++ if (stat(path, &stat_buf) == -1) ++ snprintf(path, sizeof(path), "%s/rpmdb.sqlite", swi->swi_dbpath); + path[ sizeof(path)-1 ] = 0; + swi->swi_directory = strdup(path); + #ifdef HAVE_RPMGETPATH diff --git a/net-snmp.spec b/net-snmp.spec index da99d50..7dcaa55 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.3 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -52,6 +52,7 @@ Patch22: net-snmp-libs-misunderstanding.patch Patch23: net-snmp-5.9-CVE-2022-44792-44793.patch Patch24: net-snmp-5.9-ipv6-disable-leak.patch Patch25: net-snmp-5.9-sendmsg-error-code.patch +Patch26: net-snmp-5.9-rpmdb.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -139,8 +140,21 @@ applications for use with the NET-SNMP project's network management tools. You'll also need to have the net-snmp and net-snmp-utils packages installed. +%package perl-module +Summary: The perl NET-SNMP module +Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter +BuildRequires: perl-interpreter +BuildRequires: perl-generators + +%description perl-module +The net-snmp-perl package contains the perl files to use SNMP from within +Perl. + +Install the net-snmp-perl package, if you want to use SNMP with perl. + + %package perl -Summary: The perl NET-SNMP module and the mib2c tool +Summary: The perl-based utilities and the mib2c tool Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}, perl-interpreter Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-devel%{?_isa} = %{epoch}:%{version}-%{release} @@ -148,15 +162,17 @@ BuildRequires: perl-interpreter BuildRequires: perl-generators %description perl -The net-snmp-perl package contains the perl files to use SNMP from within -Perl. +The net-snmp-perl package contains the utilities written in perl. -Install the net-snmp-perl package, if you want to use mib2c or SNMP -with perl. +Install the net-snmp-perl package, if you want to use mib2c or other +perl utilities. Use the net-snmp-perl-module package instead to get the +SNMP perl module. %package gui Summary: An interactive graphical MIB browser for SNMP -Requires: perl-Tk, net-snmp-perl%{?_isa} = %{epoch}:%{version}-%{release} +Requires: perl-Tk, %{name}-perl-module%{?_isa} = %{epoch}:%{version}-%{release} +BuildRequires: perl-interpreter +BuildRequires: perl-generators %description gui The net-snmp-gui package contains tkmib utility, which is a graphical user @@ -228,6 +244,7 @@ cp %{SOURCE10} . %patch 23 -p1 %patch 24 -p1 -b .ipv6-disable-leak %patch 25 -p1 -b .sendmsg-error-code +%patch 26 -p1 -b .rpmdbpatch %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -342,6 +359,7 @@ rm -f %{buildroot}/%{_mandir}/man1/fixproc* rm -f %{buildroot}/%{_bindir}/ipf-mod.pl rm -f %{buildroot}/%{_libdir}/*.la rm -f %{buildroot}/%{_libdir}/libsnmp* +rm -f %{buildroot}/%{_libdir}/perl5/vendor_perl/Bundle/MakefileSubs.pm # remove special perl files find %{buildroot} -name perllocal.pod \ @@ -451,6 +469,12 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %attr(0755,root,root) %{_bindir}/net-snmp-config* %attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* +%files perl-module +%attr(0644,root,root) %{_mandir}/man3/*.3pm.* +%{perl_vendorarch}/*SNMP* +%{perl_vendorarch}/auto/*SNMP* +%{perl_vendorarch}/auto/Bundle/*SNMP* + %files perl %{_bindir}/mib2c-update %{_bindir}/mib2c @@ -462,13 +486,8 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_datadir}/snmp/*.pl %{_bindir}/traptoemail %attr(0644,root,root) %{_mandir}/man[15]/mib2c* -%attr(0644,root,root) %{_mandir}/man3/*.3pm.* %attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* %attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1* -%{perl_vendorarch}/*SNMP* -%{perl_vendorarch}/auto/*SNMP* -%{perl_vendorarch}/auto/Bundle/*SNMP* -%{perl_vendorarch}/Bundle/MakefileSubs.pm %files -n python3-net-snmp %doc README @@ -496,6 +515,13 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Aug 14 2023 Josef Ridky - 1:5.9.3-8 +- Fix warning for RPM DB +- split perl module into separate package that doesn't pull in gcc and + other build dependencies (thanks Chris Adams) +- don't install MakefileSubs.pm - it's just needed at module build time + (thanks Chris Adams) + * Tue Aug 01 2023 Josef Ridky - 1:5.9.3-7 - Sync fixes with RHEL - Fix sendmesg error code change for new kernel From a1af22f2061d9dff4c1c667c51f6aecd6fec0450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Wed, 16 Aug 2023 11:55:04 +0200 Subject: [PATCH 50/81] New upstream release 5.9.4 (#2184202) --- .gitignore | 1 + net-snmp-5.9-CVE-2022-44792-44793.patch | 129 ------------------------ net-snmp-5.9-sendmsg-error-code.patch | 31 ------ net-snmp-5.9.1-autoconf.patch | 6 -- net-snmp.spec | 25 ++--- sources | 2 +- 6 files changed, 13 insertions(+), 181 deletions(-) delete mode 100644 net-snmp-5.9-CVE-2022-44792-44793.patch delete mode 100644 net-snmp-5.9-sendmsg-error-code.patch delete mode 100644 net-snmp-5.9.1-autoconf.patch diff --git a/.gitignore b/.gitignore index 2467898..c94eb56 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.9.tar.gz /net-snmp-5.9.1.tar.gz /net-snmp-5.9.3.tar.gz +/net-snmp-5.9.4.tar.gz diff --git a/net-snmp-5.9-CVE-2022-44792-44793.patch b/net-snmp-5.9-CVE-2022-44792-44793.patch deleted file mode 100644 index 4b48b14..0000000 --- a/net-snmp-5.9-CVE-2022-44792-44793.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 4589352dac3ae111c7621298cf231742209efd9b Mon Sep 17 00:00:00 2001 -From: Bill Fenner -Date: Fri, 25 Nov 2022 08:41:24 -0800 -Subject: [PATCH 1/3] snmp_agent: disallow SET with NULL varbind - ---- - agent/snmp_agent.c | 32 ++++++++++++++++++++++++++++++++ - 1 file changed, 32 insertions(+) - -diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c -index 867d0c166f..3f678fe2df 100644 ---- a/agent/snmp_agent.c -+++ b/agent/snmp_agent.c -@@ -3719,12 +3719,44 @@ netsnmp_handle_request(netsnmp_agent_session *asp, int status) - return 1; - } - -+static int -+check_set_pdu_for_null_varbind(netsnmp_agent_session *asp) -+{ -+ int i; -+ netsnmp_variable_list *v = NULL; -+ -+ for (i = 1, v = asp->pdu->variables; v != NULL; i++, v = v->next_variable) { -+ if (v->type == ASN_NULL) { -+ /* -+ * Protect SET implementations that do not protect themselves -+ * against wrong type. -+ */ -+ DEBUGMSGTL(("snmp_agent", "disallowing SET with NULL var for varbind %d\n", i)); -+ asp->index = i; -+ return SNMP_ERR_WRONGTYPE; -+ } -+ } -+ return SNMP_ERR_NOERROR; -+} -+ - int - handle_pdu(netsnmp_agent_session *asp) - { - int status, inclusives = 0; - netsnmp_variable_list *v = NULL; - -+#ifndef NETSNMP_NO_WRITE_SUPPORT -+ /* -+ * Check for ASN_NULL in SET request -+ */ -+ if (asp->pdu->command == SNMP_MSG_SET) { -+ status = check_set_pdu_for_null_varbind(asp); -+ if (status != SNMP_ERR_NOERROR) { -+ return status; -+ } -+ } -+#endif /* NETSNMP_NO_WRITE_SUPPORT */ -+ - /* - * for illegal requests, mark all nodes as ASN_NULL - */ - -From 7f4ac4051cc7fec6a5944661923acb95cec359c7 Mon Sep 17 00:00:00 2001 -From: Bill Fenner -Date: Fri, 25 Nov 2022 08:41:46 -0800 -Subject: [PATCH 2/3] apps: snmpset: allow SET with NULL varbind for testing - ---- - apps/snmpset.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/apps/snmpset.c b/apps/snmpset.c -index 48e14bd513..d542713e1b 100644 ---- a/apps/snmpset.c -+++ b/apps/snmpset.c -@@ -182,6 +182,7 @@ main(int argc, char *argv[]) - case 'x': - case 'd': - case 'b': -+ case 'n': /* undocumented */ - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES - case 'I': - case 'U': - -From 15f9d7f7e5b90c9b419832ed8e6413feb6570d83 Mon Sep 17 00:00:00 2001 -From: Bill Fenner -Date: Fri, 25 Nov 2022 10:23:32 -0800 -Subject: [PATCH 3/3] Add test for NULL varbind set - ---- - .../default/T0142snmpv2csetnull_simple | 31 +++++++++++++++++++ - 1 file changed, 31 insertions(+) - create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple - -diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple -new file mode 100644 -index 0000000000..0f1b8f386b ---- /dev/null -+++ b/testing/fulltests/default/T0142snmpv2csetnull_simple -@@ -0,0 +1,31 @@ -+#!/bin/sh -+ -+. ../support/simple_eval_tools.sh -+ -+HEADER SNMPv2c set of system.sysContact.0 with NULL varbind -+ -+SKIPIF NETSNMP_DISABLE_SET_SUPPORT -+SKIPIF NETSNMP_NO_WRITE_SUPPORT -+SKIPIF NETSNMP_DISABLE_SNMPV2C -+SKIPIFNOT USING_MIBII_SYSTEM_MIB_MODULE -+ -+# -+# Begin test -+# -+ -+# standard V2C configuration: testcomunnity -+snmp_write_access='all' -+. ./Sv2cconfig -+STARTAGENT -+ -+CAPTURE "snmpget -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0" -+ -+CHECK ".1.3.6.1.2.1.1.4.0 = STRING:" -+ -+CAPTURE "snmpset -On $SNMP_FLAGS -c testcommunity -v 2c $SNMP_TRANSPORT_SPEC:$SNMP_TEST_DEST$SNMP_SNMPD_PORT .1.3.6.1.2.1.1.4.0 n x" -+ -+CHECK "Reason: wrongType" -+ -+STOPAGENT -+ -+FINISHED - diff --git a/net-snmp-5.9-sendmsg-error-code.patch b/net-snmp-5.9-sendmsg-error-code.patch deleted file mode 100644 index 6709cef..0000000 --- a/net-snmp-5.9-sendmsg-error-code.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 298c8103db80b292791616af4fd497342a71867f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= -Date: Wed, 24 May 2023 10:49:41 +0200 -Subject: [PATCH] libsnmp, UDP transport: Fix sendmsg() error code handling - -This change has been made because of Linux kernel commit "ipv4: Return --ENETUNREACH if we can't create route but saddr is valid" -(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=595e0651d029) - -Fixes: https://github.com/net-snmp/net-snmp/issues/564 -Fixes: https://github.com/net-snmp/net-snmp/pull/576 - -[ bvanassche: edited commit message ] ---- - snmplib/transports/snmpUDPBaseDomain.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c -index ca8f9a5554..cd6b15e2ad 100644 ---- a/snmplib/transports/snmpUDPBaseDomain.c -+++ b/snmplib/transports/snmpUDPBaseDomain.c -@@ -315,7 +315,7 @@ int netsnmp_udpbase_sendto_unix(int fd, const struct in_addr *srcip, - sizeof(struct sockaddr)); - else - rc = sendmsg(fd, &m, MSG_DONTWAIT); -- if (rc >= 0 || errno != EINVAL) -+ if (rc >= 0 || (errno != EINVAL && errno != ENETUNREACH)) - return rc; - - /* - diff --git a/net-snmp-5.9.1-autoconf.patch b/net-snmp-5.9.1-autoconf.patch deleted file mode 100644 index 5c6b2a9..0000000 --- a/net-snmp-5.9.1-autoconf.patch +++ /dev/null @@ -1,6 +0,0 @@ -diff -urNp a/dist/autoconf-version b/dist/autoconf-version ---- a/dist/autoconf-version 2021-09-01 11:18:14.582110773 +0200 -+++ b/dist/autoconf-version 2021-09-01 11:20:16.804369533 +0200 -@@ -1 +1 @@ --2.69 -+2.71 diff --git a/net-snmp.spec b/net-snmp.spec index 7dcaa55..6103067 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -9,8 +9,8 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.9.3 -Release: 8%{?dist} +Version: 5.9.4 +Release: 1%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -47,12 +47,9 @@ Patch17: net-snmp-5.9-aes-config.patch Patch18: net-snmp-5.8-clientaddr-error-message.patch Patch19: net-snmp-5.9-intermediate-certs.patch Patch20: net-snmp-5.9.1-remove-des.patch -Patch21: net-snmp-5.9.1-autoconf.patch -Patch22: net-snmp-libs-misunderstanding.patch -Patch23: net-snmp-5.9-CVE-2022-44792-44793.patch -Patch24: net-snmp-5.9-ipv6-disable-leak.patch -Patch25: net-snmp-5.9-sendmsg-error-code.patch -Patch26: net-snmp-5.9-rpmdb.patch +Patch21: net-snmp-libs-misunderstanding.patch +Patch22: net-snmp-5.9-ipv6-disable-leak.patch +Patch23: net-snmp-5.9-rpmdb.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -239,12 +236,9 @@ cp %{SOURCE10} . %patch 18 -p1 -b .clientaddr-error-message %patch 19 -p1 -b .intermediate-certs %patch 20 -p1 -b .remove-des -%patch 21 -p1 -b .autoconf -%patch 22 -p1 -%patch 23 -p1 -%patch 24 -p1 -b .ipv6-disable-leak -%patch 25 -p1 -b .sendmsg-error-code -%patch 26 -p1 -b .rpmdbpatch +%patch 21 -p1 +%patch 22 -p1 -b .ipv6-disable-leak +%patch 23 -p1 -b .rpmdbpatch %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -515,6 +509,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Aug 16 2023 Josef Ridky - 1:5.9.4-1 +- New upstream release 5.9.4 (#2184202) + * Mon Aug 14 2023 Josef Ridky - 1:5.9.3-8 - Fix warning for RPM DB - split perl module into separate package that doesn't pull in gcc and diff --git a/sources b/sources index 6889744..0d272db 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.3.tar.gz) = a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc +SHA512 (net-snmp-5.9.4.tar.gz) = a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423 From 0a09d4c2dbe96745422070eadd733b7de1323f80 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 09:29:00 +0000 Subject: [PATCH 51/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 6103067..951408d 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -509,6 +509,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 1:5.9.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Aug 16 2023 Josef Ridky - 1:5.9.4-1 - New upstream release 5.9.4 (#2184202) From 1f70924d0af18a6e989c0c8227168d73b0bd8716 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 08:47:22 +0000 Subject: [PATCH 52/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 951408d..888a078 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -509,6 +509,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 1:5.9.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 1:5.9.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From e50eb6982b7bec7cc6ae419468a348825c8dd6f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Fri, 16 Feb 2024 08:46:30 +0100 Subject: [PATCH 53/81] Resolves: #2256768 - autoconf version update --- net-snmp-5.9.4-autoconf.patch | 6 ++++++ net-snmp.spec | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9.4-autoconf.patch diff --git a/net-snmp-5.9.4-autoconf.patch b/net-snmp-5.9.4-autoconf.patch new file mode 100644 index 0000000..f2b23a9 --- /dev/null +++ b/net-snmp-5.9.4-autoconf.patch @@ -0,0 +1,6 @@ +diff -urNp a/dist/autoconf-version b/dist/autoconf-version +--- a/dist/autoconf-version 2024-02-16 08:21:36.551729028 +0100 ++++ b/dist/autoconf-version 2024-02-16 08:24:39.035608191 +0100 +@@ -1 +1 @@ +-2.71 ++2.72 diff --git a/net-snmp.spec b/net-snmp.spec index 6103067..f9d5197 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -50,6 +50,7 @@ Patch20: net-snmp-5.9.1-remove-des.patch Patch21: net-snmp-libs-misunderstanding.patch Patch22: net-snmp-5.9-ipv6-disable-leak.patch Patch23: net-snmp-5.9-rpmdb.patch +Patch24: net-snmp-5.9.4-autoconf.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -239,6 +240,7 @@ cp %{SOURCE10} . %patch 21 -p1 %patch 22 -p1 -b .ipv6-disable-leak %patch 23 -p1 -b .rpmdbpatch +%patch 24 -p1 %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -509,6 +511,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Feb 16 2024 Josef Ridky - 1:5.9.4-2 +- Autoconf upgrade (#2256768) + * Wed Aug 16 2023 Josef Ridky - 1:5.9.4-1 - New upstream release 5.9.4 (#2184202) From 8ca1417603bca94ab2a8a0a070c108bb0d1c3a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= Date: Tue, 12 Mar 2024 12:10:07 +0100 Subject: [PATCH 54/81] Resolve: #2266893 - Fix parsing issue for kernel 6.7+ --- net-snmp-5.9.4-kernel-6.7.patch | 120 ++++++++++++++++++++++++++++++++ net-snmp.spec | 7 +- 2 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9.4-kernel-6.7.patch diff --git a/net-snmp-5.9.4-kernel-6.7.patch b/net-snmp-5.9.4-kernel-6.7.patch new file mode 100644 index 0000000..089f23b --- /dev/null +++ b/net-snmp-5.9.4-kernel-6.7.patch @@ -0,0 +1,120 @@ +From f5ae6baf0018abda9dedc368fe6d52c0d7a8ab8f Mon Sep 17 00:00:00 2001 +From: Philippe Troin +Date: Sat, 3 Feb 2024 10:30:30 -0800 +Subject: [PATCH] Add Linux 6.7 compatibility parsing /proc/net/snmp + +Linux 6.7 adds a new OutTransmits field to Ip in /proc/net/snmp. +This breaks the hard-coded assumptions about the Ip line length. +Add compatibility to parse Linux 6.7 Ip header while keep support +for previous versions. +--- + .../ip-mib/data_access/systemstats_linux.c | 46 +++++++++++++++---- + 1 file changed, 37 insertions(+), 9 deletions(-) + +diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c +index 49e0a34d5c..f04e828a94 100644 +--- a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c ++++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c +@@ -36,7 +36,7 @@ netsnmp_access_systemstats_arch_init(void) + } + + /* +- /proc/net/snmp ++ /proc/net/snmp - Linux 6.6 and lower + + Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates + Ip: 2 64 7083534 0 0 0 0 0 6860233 6548963 0 0 1 286623 63322 1 259920 0 0 +@@ -49,6 +49,26 @@ netsnmp_access_systemstats_arch_init(void) + + Udp: InDatagrams NoPorts InErrors OutDatagrams + Udp: 1491094 122 0 1466178 ++* ++ /proc/net/snmp - Linux 6.7 and higher ++ ++ Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates OutTransmits ++ Ip: 1 64 50859058 496 0 37470604 0 0 20472980 7515791 1756 0 0 7264 3632 0 3548 0 7096 44961424 ++ ++ Icmp: InMsgs InErrors InCsumErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutRateLimitGlobal OutRateLimitHost OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps ++ Icmp: 114447 2655 0 17589 0 0 0 0 66905 29953 0 0 0 0 143956 0 0 572 16610 484 0 0 0 59957 66905 0 0 0 0 ++ ++ IcmpMsg: InType0 InType3 InType8 OutType0 OutType3 OutType8 OutType11 ++ IcmpMsg: 29953 17589 66905 66905 16610 59957 484 ++ ++ Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors ++ Tcp: 1 200 120000 -1 17744 13525 307 3783 6 18093137 9277788 3499 8 7442 0 ++ ++ Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors ++ Udp: 2257832 1422 0 2252835 0 0 0 84 0 ++ ++ UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors ++ UdpLite: 0 0 0 0 0 0 0 0 0 + */ + + +@@ -101,10 +121,10 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) + FILE *devin; + char line[1024]; + netsnmp_systemstats_entry *entry = NULL; +- int scan_count; ++ int scan_count, expected_scan_count; + char *stats, *start = line; + int len; +- unsigned long long scan_vals[19]; ++ unsigned long long scan_vals[20]; + + DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %x)\n", + load_flags)); +@@ -126,10 +146,17 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) + */ + NETSNMP_IGNORE_RESULT(fgets(line, sizeof(line), devin)); + len = strlen(line); +- if (224 != len) { ++ switch (len) { ++ case 224: ++ expected_scan_count = 19; ++ break; ++ case 237: ++ expected_scan_count = 20; ++ break; ++ default: + fclose(devin); + snmp_log(LOG_ERR, "systemstats_linux: unexpected header length in /proc/net/snmp." +- " %d != 224\n", len); ++ " %d not in { 224, 237 } \n", len); + return -4; + } + +@@ -178,20 +205,20 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) + memset(scan_vals, 0x0, sizeof(scan_vals)); + scan_count = sscanf(stats, + "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" +- "%llu %llu %llu %llu %llu %llu %llu %llu %llu", ++ "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu", + &scan_vals[0],&scan_vals[1],&scan_vals[2], + &scan_vals[3],&scan_vals[4],&scan_vals[5], + &scan_vals[6],&scan_vals[7],&scan_vals[8], + &scan_vals[9],&scan_vals[10],&scan_vals[11], + &scan_vals[12],&scan_vals[13],&scan_vals[14], + &scan_vals[15],&scan_vals[16],&scan_vals[17], +- &scan_vals[18]); ++ &scan_vals[18],&scan_vals[19]); + DEBUGMSGTL(("access:systemstats", " read %d values\n", scan_count)); + +- if(scan_count != 19) { ++ if(scan_count != expected_scan_count) { + snmp_log(LOG_ERR, + "error scanning systemstats data (expected %d, got %d)\n", +- 19, scan_count); ++ expected_scan_count, scan_count); + netsnmp_access_systemstats_entry_free(entry); + return -4; + } +@@ -223,6 +250,7 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) + entry->stats.HCOutFragFails.high = scan_vals[17] >> 32; + entry->stats.HCOutFragCreates.low = scan_vals[18] & 0xffffffff; + entry->stats.HCOutFragCreates.high = scan_vals[18] >> 32; ++ /* entry->stats. = scan_vals[19]; / * OutTransmits */ + + entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1; + entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1; + diff --git a/net-snmp.spec b/net-snmp.spec index 87e457d..585f87d 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -51,6 +51,7 @@ Patch21: net-snmp-libs-misunderstanding.patch Patch22: net-snmp-5.9-ipv6-disable-leak.patch Patch23: net-snmp-5.9-rpmdb.patch Patch24: net-snmp-5.9.4-autoconf.patch +Patch25: net-snmp-5.9.4-kernel-6.7.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -241,6 +242,7 @@ cp %{SOURCE10} . %patch 22 -p1 -b .ipv6-disable-leak %patch 23 -p1 -b .rpmdbpatch %patch 24 -p1 +%patch 25 -p1 -b .kernel-6.7 %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -511,6 +513,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Tue Mar 12 2024 Josef Ridky - 1:5.9.4-5 +- Fix parsing issue for kernel 6.7+ (#2266893) + * Fri Feb 16 2024 Josef Ridky - 1:5.9.4-4 - Autoconf upgrade (#2256768) From ae7481e93f19b0138ddc1ad56fe6a12a1e109744 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:54:33 +0200 Subject: [PATCH 55/81] Rebuilt for Python 3.13 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 585f87d..1c63987 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -513,6 +513,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jun 07 2024 Python Maint - 1:5.9.4-6 +- Rebuilt for Python 3.13 + * Tue Mar 12 2024 Josef Ridky - 1:5.9.4-5 - Fix parsing issue for kernel 6.7+ (#2266893) From ad9d539156bcc06d55345e67822944ce09b52cbe Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Wed, 12 Jun 2024 10:38:32 +0200 Subject: [PATCH 56/81] Perl 5.40 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 1c63987..53bf97f 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -513,6 +513,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Jun 12 2024 Jitka Plesnikova - 1:5.9.4-7 +- Perl 5.40 rebuild + * Fri Jun 07 2024 Python Maint - 1:5.9.4-6 - Rebuilt for Python 3.13 From e1ae9a2b12c70db75e9114dd845dfd475f3c30dd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 19:19:29 +0000 Subject: [PATCH 57/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 53bf97f..1c773e0 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: Net-SNMP and OpenSSL @@ -513,6 +513,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 1:5.9.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jun 12 2024 Jitka Plesnikova - 1:5.9.4-7 - Perl 5.40 rebuild From 9c65dec8e98d826aa6dea47f329d3846e8062a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 30 Oct 2024 19:27:54 +0000 Subject: [PATCH 58/81] Migrate to SPDX license Based on https://gitlab.com/fedora/legal/fedora-license-data/-/issues/533 This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- net-snmp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 1c773e0..89a9ff4 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -13,7 +13,7 @@ Version: 5.9.4 Release: 8%{?dist} Epoch: 1 -License: Net-SNMP and OpenSSL +License: MIT-CMU AND BSD-3-Clause AND MIT URL: http://net-snmp.sourceforge.net/ Source0: https://downloads.sourceforge.net/project/net-snmp/net-snmp/%{version}/net-snmp-%{version}.tar.gz Source1: net-snmp.redhat.conf From a1c4087963210e056133737352dd01fa970d5fa3 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 19:54:05 +0000 Subject: [PATCH 59/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 89a9ff4..e103457 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -513,6 +513,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 1:5.9.4-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Thu Jul 18 2024 Fedora Release Engineering - 1:5.9.4-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From d33a16352962d8dc485a7b39a227c2bb2c4ca5d0 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 22 Jan 2025 19:03:37 -0500 Subject: [PATCH 60/81] Fix file listings for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin After the bin-sbin merge, %_bindir and %_sbindir are the same; this glob was picking up the components that are supposed to be separated into net-snmp-perl (and hence its dependencies). --- net-snmp.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index e103457..0edca99 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -435,7 +435,8 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %config(noreplace) %attr(0600,root,root) %{_sysconfdir}/snmp/snmptrapd.conf %{_bindir}/snmpconf %{_bindir}/net-snmp-create-v3-user -%{_sbindir}/* +%{_sbindir}/snmpd +%{_sbindir}/snmptrapd %attr(0644,root,root) %{_mandir}/man[58]/snmp*d* %attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz %attr(0644,root,root) %{_mandir}/man5/variables* @@ -513,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 23 2025 Yaakov Selkowitz - 1:5.9.4-10 +- Fix file listings for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin + * Fri Jan 17 2025 Fedora Release Engineering - 1:5.9.4-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 74f2032ae1d4024cc07c22b294d7714323563c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 1 Feb 2025 19:56:00 +0100 Subject: [PATCH 61/81] Add explicit BR: libxcrypt-devel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Esser --- net-snmp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 0edca99..7d0b20e 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 10%{?dist} +Release: 11%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -66,6 +66,7 @@ Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # should fire just after this package is installed. %{?systemd_requires} BuildRequires: make +BuildRequires: libxcrypt-devel BuildRequires: systemd BuildRequires: gcc BuildRequires: openssl-devel, bzip2-devel, elfutils-devel @@ -514,6 +515,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Sat Feb 01 2025 Björn Esser - 1:5.9.4-11 +- Add explicit BR: libxcrypt-devel + * Thu Jan 23 2025 Yaakov Selkowitz - 1:5.9.4-10 - Fix file listings for https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin From 4b676c579c102558560b6eaf391604c3ef3e7df7 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 20 Mar 2025 16:58:31 -0400 Subject: [PATCH 62/81] Avoid Mail::Sender dependency on RHEL perl-Mail-Sender is not available in RHEL. This allows it to still be used if installed from elsewhere (e.g. CPAN or EPEL). https://gitlab.com/redhat/centos-stream/rpms/net-snmp/-/commit/4a199d0e37ad12c70bca2b534e14de181f02854e --- net-snmp-5.9-mail-sender.patch | 24 ++++++++++++++++++++++++ net-snmp.spec | 11 ++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9-mail-sender.patch diff --git a/net-snmp-5.9-mail-sender.patch b/net-snmp-5.9-mail-sender.patch new file mode 100644 index 0000000..2f6e28b --- /dev/null +++ b/net-snmp-5.9-mail-sender.patch @@ -0,0 +1,24 @@ +diff -up ./local/checkbandwidth.orig ./local/checkbandwidth +--- ./local/checkbandwidth.orig 2023-08-15 16:32:01.000000000 -0400 ++++ ./local/checkbandwidth 2025-03-20 16:31:14.062432316 -0400 +@@ -326,7 +326,6 @@ See the Net-SNMP COPYING file for licens + + use JSON; + use Data::Dumper; +-use Mail::Sender; + use SNMP; + use Fcntl ':flock'; + +@@ -744,6 +743,12 @@ sub send_rate_message($$$$$$) { + sub send_message($$$) { + my ($to, $subject, $text) = @_; + ++ if (! eval {require Mail::Sender;}) { ++ Log("Failed to send mail with error code -1: Mail::Sender is not available"); ++ return(); ++ } ++ ++ import Mail::Sender; + my $sender = new Mail::Sender { smtp => $opts{'S'} , + port => $opts{'P'}, + from => $opts{'F'}, diff --git a/net-snmp.spec b/net-snmp.spec index 7d0b20e..53bbb20 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 11%{?dist} +Release: 12%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -59,6 +59,9 @@ Patch101: net-snmp-5.8-modern-rpm-api.patch #disable this patch due compatibility issues Patch102: net-snmp-5.9-python3.patch +# make Mail::Sender optional +Patch103: net-snmp-5.9-mail-sender.patch + Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # This is actually needed for the %%triggerun script but Requires(triggerun) @@ -247,6 +250,9 @@ cp %{SOURCE10} . %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 +%if 0%{?rhel} +%patch 103 -p1 +%endif # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* @@ -515,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Mar 20 2025 Yaakov Selkowitz - 1:5.9.4-12 +- Avoid Mail::Sender dependency on RHEL + * Sat Feb 01 2025 Björn Esser - 1:5.9.4-11 - Add explicit BR: libxcrypt-devel From 7c1240fe6b6f26c4d4eb14463baa796c48e9f451 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 20:30:22 +0200 Subject: [PATCH 63/81] Rebuilt for Python 3.14 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 53bbb20..0d7c531 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 12%{?dist} +Release: 13%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -521,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jun 02 2025 Python Maint - 1:5.9.4-13 +- Rebuilt for Python 3.14 + * Thu Mar 20 2025 Yaakov Selkowitz - 1:5.9.4-12 - Avoid Mail::Sender dependency on RHEL From edd9638ab3ae641754e95e5919d0971b2d691144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Mon, 7 Jul 2025 14:03:33 +0200 Subject: [PATCH 64/81] tests: migrate from STI to TMT Related: https://fedoraproject.org/wiki/Changes/DisableSTI --- .fmf/version | 1 + plans/ci.fmf | 5 +++++ tests/integration-tests/Makefile | 2 +- tests/integration-tests/main.fmf | 16 ++++++++++++++++ tests/integration-tests/net-snmp-tests.py | 8 +------- tests/tests.yml | 14 -------------- 6 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf create mode 100644 tests/integration-tests/main.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/integration-tests/Makefile b/tests/integration-tests/Makefile index 2f27fbf..9e49696 100644 --- a/tests/integration-tests/Makefile +++ b/tests/integration-tests/Makefile @@ -27,7 +27,7 @@ $(METADATA): Makefile @echo "Type: Sanity" >> $(METADATA) @echo "TestTime: 5m" >> $(METADATA) @echo "RunFor: net-snmp" >> $(METADATA) - @echo "Requires: net=snmp" >> $(METADATA) + @echo "Requires: net-snmp net-snmp-utils iproute python3 python3-pyroute2" >> $(METADATA) @echo "Priority: Normal" >> $(METADATA) @echo "License: GPLv2" >> $(METADATA) @echo "Confidential: no" >> $(METADATA) diff --git a/tests/integration-tests/main.fmf b/tests/integration-tests/main.fmf new file mode 100644 index 0000000..64426d7 --- /dev/null +++ b/tests/integration-tests/main.fmf @@ -0,0 +1,16 @@ +summary: Test snmpd +description: '' +contact: Susant Sahani +component: + - net-snmp +test: ./runtest.sh +framework: beakerlib +recommend: + - net-snmp + - net-snmp-utils + - iproute + - python3 + - python3-pyroute2 +duration: 5m +extra-summary: /CoreOS/net-snmp +extra-task: /CoreOS/net-snmp diff --git a/tests/integration-tests/net-snmp-tests.py b/tests/integration-tests/net-snmp-tests.py index 4cb19eb..746c9d8 100755 --- a/tests/integration-tests/net-snmp-tests.py +++ b/tests/integration-tests/net-snmp-tests.py @@ -15,12 +15,10 @@ import unittest import subprocess import signal import shutil -import psutil import socket import platform import re from pyroute2 import IPRoute -from psutil import virtual_memory from collections import OrderedDict HOST='192.168.111.50' @@ -140,11 +138,7 @@ class SnmpdTests(unittest.TestCase, GenericUtilities): # 1.3.6.1.2.1.1.1 - sysDescr output=subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.1']).rstrip().decode('utf-8') - self.assertRegex(output, platform.machine()) - self.assertRegex(output, platform.node()) - self.assertRegex(output, platform.processor()) - self.assertRegex(output, platform.release()) - self.assertRegex(output, platform.version()) + self.assertRegex(output, " ".join(platform.uname()).strip()) # 1.3.6.1.2.1.1.2 - sysObjectID subprocess.check_output(['snmpwalk', '-v2c', '-c', 'public', HOST, '1.3.6.1.2.1.1.2']) diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index f600628..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,14 +0,0 @@ -- hosts: localhost - roles: - - role: standard-test-beakerlib - tags: - - classic - tests: - - integration-tests - required_packages: - - python3 - - systemd - - iproute - - python3-pyroute2 - - net-snmp - - net-snmp-utils From 603f908db11d3bfece44c21322230ccfd5d4985b Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 7 Jul 2025 16:26:23 +0200 Subject: [PATCH 65/81] Perl 5.42 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 0d7c531..18a914d 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 13%{?dist} +Release: 14%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -521,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jul 07 2025 Jitka Plesnikova - 1:5.9.4-14 +- Perl 5.42 rebuild + * Mon Jun 02 2025 Python Maint - 1:5.9.4-13 - Rebuilt for Python 3.14 From 45a2bb2eea1dfc24d7c7f4bd7c1268eabdcd2ed9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 22:43:37 +0000 Subject: [PATCH 66/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 18a914d..87a43fb 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 14%{?dist} +Release: 15%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -521,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 1:5.9.4-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Jul 07 2025 Jitka Plesnikova - 1:5.9.4-14 - Perl 5.42 rebuild From a63df165470f4385227f740834aef4bd6a6ab55b Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 13:01:50 +0200 Subject: [PATCH 67/81] Rebuilt for Python 3.14.0rc2 bytecode --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 87a43fb..848bfbe 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 15%{?dist} +Release: 16%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -521,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Aug 15 2025 Python Maint - 1:5.9.4-16 +- Rebuilt for Python 3.14.0rc2 bytecode + * Thu Jul 24 2025 Fedora Release Engineering - 1:5.9.4-15 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 0e6b0aaa6a16a47adc5af65f06f56e95534fcbd8 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 12:32:38 +0200 Subject: [PATCH 68/81] Rebuilt for Python 3.14.0rc3 bytecode --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 848bfbe..3e868b5 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 16%{?dist} +Release: 17%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -521,6 +521,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Sep 19 2025 Python Maint - 1:5.9.4-17 +- Rebuilt for Python 3.14.0rc3 bytecode + * Fri Aug 15 2025 Python Maint - 1:5.9.4-16 - Rebuilt for Python 3.14.0rc2 bytecode From 6410ad3116a23c1bc5175937b7f47599838e8cdd Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Mon, 13 Oct 2025 10:05:09 +0200 Subject: [PATCH 69/81] Enable PQC in net-snmp Signed-off-by: Josef Ridky --- net-snmp-5.9.4-tls.patch | 146 +++++++++++++++++++++++++++++++++++++++ net-snmp.spec | 7 +- 2 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.9.4-tls.patch diff --git a/net-snmp-5.9.4-tls.patch b/net-snmp-5.9.4-tls.patch new file mode 100644 index 0000000..2f7d16c --- /dev/null +++ b/net-snmp-5.9.4-tls.patch @@ -0,0 +1,146 @@ +diff -urNp a/include/net-snmp/library/default_store.h b/include/net-snmp/library/default_store.h +--- a/include/net-snmp/library/default_store.h 2025-09-01 10:02:06.355543487 +0200 ++++ b/include/net-snmp/library/default_store.h 2025-09-01 10:06:35.524663762 +0200 +@@ -183,6 +183,8 @@ extern "C" { + #define NETSNMP_DS_LIB_SSH_PUBKEY 33 + #define NETSNMP_DS_LIB_SSH_PRIVKEY 34 + #define NETSNMP_DS_LIB_OUTPUT_PRECISION 35 ++#define NETSNMP_DS_LIB_TLS_MIN_VERSION 36 ++#define NETSNMP_DS_LIB_TLS_MAX_VERSION 37 + #define NETSNMP_DS_LIB_MAX_STR_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */ + + /* +diff -urNp a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def +--- a/man/snmpd.conf.5.def 2025-09-01 10:02:06.417543463 +0200 ++++ b/man/snmpd.conf.5.def 2025-09-01 10:07:03.717037472 +0200 +@@ -203,6 +203,12 @@ HIGH:!AES128\-SHA + .RE + .IP + The default value is whatever openssl itself was configured with. ++.IP "tlsMinVersion STRING" ++The function sets the minimum supported TLS protocol version. ++OPTION can be one of < tls1 | tls1_1| tls1_2 | tls1_3 >. ++.IP "tlsMaxVersion STRING" ++The function sets the maximum supported TLS protocol version. ++OPTION can be one of < tls1 | tls1_1| tls1_2 | tls1_3 >. + .IP "[snmp] x509CRLFile" + If you are using a Certificate Authority (CA) that publishes a + Certificate Revocation List (CRL) then this token can be used to +diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c +--- a/snmplib/transports/snmpTLSBaseDomain.c 2025-09-01 10:02:06.457543447 +0200 ++++ b/snmplib/transports/snmpTLSBaseDomain.c 2025-09-01 10:10:02.796751304 +0200 +@@ -479,6 +479,9 @@ SSL_CTX * + _sslctx_common_setup(SSL_CTX *the_ctx, _netsnmpTLSBaseData *tlsbase) { + char *crlFile; + char *cipherList; ++ char *tlsMinVersion; ++ char *tlsMaxVersion; ++ int tlsVersion; + X509_LOOKUP *lookup; + X509_STORE *cert_store = NULL; + +@@ -502,6 +505,63 @@ _sslctx_common_setup(SSL_CTX *the_ctx, _ + X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); + } + ++#ifdef SSL_CTX_set_min_proto_version ++ tlsVersion = TLS1_2_VERSION; ++ tlsMinVersion = "tls1_2"; ++ tlsMinVersion = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_TLS_MIN_VERSION); ++ if (NULL != tlsMinVersion) { ++ if (strcmp("tls1",tlsMinVersion) == 0) { ++ tlsVersion = TLS1_VERSION; ++ } ++ else if (strcmp("tls1_1",tlsMinVersion) == 0) { ++ tlsVersion = TLS1_1_VERSION; ++ } ++ else if (strcmp("tls1_2",tlsMinVersion) == 0) { ++ tlsVersion = TLS1_2_VERSION; ++ } ++ else if (strcmp("tls1_3",tlsMinVersion) == 0) { ++ tlsVersion = TLS1_3_VERSION; ++ } ++ else { ++ LOGANDDIE("Invalid tlsMinVersion value"); ++ } ++ } ++ if (1 == SSL_CTX_set_min_proto_version(the_ctx, tlsVersion)) { ++ snmp_log(LOG_INFO,"Set tlsMinVersion to '%s'\n", tlsMinVersion); ++ } ++ else { ++ LOGANDDIE("Set tlsMinVersion failed"); ++ } ++ tlsVersion = TLS1_3_VERSION; ++ tlsMaxVersion = "tls1_3"; ++ tlsMaxVersion = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_TLS_MAX_VERSION); ++ if (NULL != tlsMaxVersion) { ++ if (strcmp("tls1",tlsMaxVersion) == 0) { ++ tlsVersion = TLS1_VERSION; ++ } ++ else if (strcmp("tls1_1",tlsMaxVersion) == 0) { ++ tlsVersion = TLS1_1_VERSION; ++ } ++ else if (strcmp("tls1_2",tlsMaxVersion) == 0) { ++ tlsVersion = TLS1_2_VERSION; ++ } ++ else if (strcmp("tls1_3",tlsMaxVersion) == 0) { ++ tlsVersion = TLS1_3_VERSION; ++ } ++ else { ++ LOGANDDIE("Invalid tlsMaxVersion value"); ++ } ++ } ++ if (1 == SSL_CTX_set_max_proto_version(the_ctx, tlsVersion)) { ++ snmp_log(LOG_INFO,"Set tlsMaxVersion to '%s'\n", tlsMaxVersion); ++ } ++ else { ++ LOGANDDIE("Set tlsMaxVersion failed"); ++ } ++#endif ++ + cipherList = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, + NETSNMP_DS_LIB_TLS_ALGORITMS); + if (NULL != cipherList) { +@@ -803,6 +863,15 @@ netsnmp_tlsbase_ctor(void) { + NETSNMP_DS_LIBRARY_ID, + NETSNMP_DS_LIB_TLS_ALGORITMS); + ++ /* What TLS version should be used at least */ ++ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "tlsMinVersion", ++ NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_TLS_MIN_VERSION); ++ /* What TLS version should be used at max */ ++ netsnmp_ds_register_config(ASN_OCTET_STR, "snmp", "tlsMaxVersion", ++ NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_TLS_MAX_VERSION); ++ + /* + * for the client + */ +diff -urNp a/snmplib/transports/snmpTLSTCPDomain.c b/snmplib/transports/snmpTLSTCPDomain.c +--- a/snmplib/transports/snmpTLSTCPDomain.c 2025-09-01 10:02:06.460543446 +0200 ++++ b/snmplib/transports/snmpTLSTCPDomain.c 2025-09-01 10:10:46.100597968 +0200 +@@ -718,10 +718,6 @@ netsnmp_tlstcp_open_client(netsnmp_trans + return NULL; + } + +-#ifdef SSL_CTX_set_max_proto_version +- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, TLS1_VERSION); +-#endif +- + /* RFC5953 Section 5.3.1: Establishing a Session as a Client + 3) Using the destTransportDomain and destTransportAddress values, + the client will initiate the (D)TLS handshake protocol to +@@ -917,10 +913,6 @@ netsnmp_tlstcp_open_server(netsnmp_trans + + /* create the OpenSSL TLS context */ + tlsdata->ssl_context = sslctx_server_setup(TLS_method()); +-#ifdef SSL_CTX_set_max_proto_version +- if (tlsdata->ssl_context) +- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, TLS1_VERSION); +-#endif + + t->sock = BIO_get_fd(tlsdata->accept_bio, NULL); + t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; diff --git a/net-snmp.spec b/net-snmp.spec index 3e868b5..bf0380f 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.4 -Release: 17%{?dist} +Release: 18%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -52,6 +52,7 @@ Patch22: net-snmp-5.9-ipv6-disable-leak.patch Patch23: net-snmp-5.9-rpmdb.patch Patch24: net-snmp-5.9.4-autoconf.patch Patch25: net-snmp-5.9.4-kernel-6.7.patch +Patch26: net-snmp-5.9.4-tls.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -247,6 +248,7 @@ cp %{SOURCE10} . %patch 23 -p1 -b .rpmdbpatch %patch 24 -p1 %patch 25 -p1 -b .kernel-6.7 +%patch 26 -p1 -b .tls %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -521,6 +523,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Oct 13 2025 Josef Ridky - 1:5.9.4-18 +- Enable PQC in net-snmp + * Fri Sep 19 2025 Python Maint - 1:5.9.4-17 - Rebuilt for Python 3.14.0rc3 bytecode From 656ebdb2459bb3c28c37d84e4cfa52301cfb3855 Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Mon, 13 Oct 2025 10:08:37 +0200 Subject: [PATCH 70/81] Fix inverted use of -n in snmptrapd_log.c Signed-off-by: Josef Ridky --- net-snmp-5.9.4-revert-n-snmptrapd-log.patch | 12 ++++++++++++ net-snmp.spec | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 net-snmp-5.9.4-revert-n-snmptrapd-log.patch diff --git a/net-snmp-5.9.4-revert-n-snmptrapd-log.patch b/net-snmp-5.9.4-revert-n-snmptrapd-log.patch new file mode 100644 index 0000000..e49d571 --- /dev/null +++ b/net-snmp-5.9.4-revert-n-snmptrapd-log.patch @@ -0,0 +1,12 @@ +diff -urNp a/apps/snmptrapd_log.c b/apps/snmptrapd_log.c +--- a/apps/snmptrapd_log.c 2025-09-03 15:15:12.510914175 +0200 ++++ b/apps/snmptrapd_log.c 2025-09-03 15:15:40.804731480 +0200 +@@ -590,7 +590,7 @@ realloc_handle_time_fmt(u_char ** buf, s + static + void convert_agent_addr(struct in_addr agent_addr, char *name, size_t size) + { +- const int numeric = !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, ++ const int numeric = netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID, + NETSNMP_DS_APP_NUMERIC_IP); + struct sockaddr_in sin; + diff --git a/net-snmp.spec b/net-snmp.spec index bf0380f..0a2d162 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -53,6 +53,7 @@ Patch23: net-snmp-5.9-rpmdb.patch Patch24: net-snmp-5.9.4-autoconf.patch Patch25: net-snmp-5.9.4-kernel-6.7.patch Patch26: net-snmp-5.9.4-tls.patch +Patch27: net-snmp-5.9.4-revert-n-snmptrapd-log.patch # Modern RPM API means at least EL6 Patch101: net-snmp-5.8-modern-rpm-api.patch @@ -249,6 +250,7 @@ cp %{SOURCE10} . %patch 24 -p1 %patch 25 -p1 -b .kernel-6.7 %patch 26 -p1 -b .tls +%patch 27 -p1 -b .revert-n-snmptrapd-log %patch 101 -p1 -b .modern-rpm-api %patch 102 -p1 @@ -525,6 +527,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Mon Oct 13 2025 Josef Ridky - 1:5.9.4-18 - Enable PQC in net-snmp +- Fix inverted use of -n in snmptrapd_log.c * Fri Sep 19 2025 Python Maint - 1:5.9.4-17 - Rebuilt for Python 3.14.0rc3 bytecode From 15cedc2c45936e053ca2d66b89922baf86707280 Mon Sep 17 00:00:00 2001 From: Josef Ridky Date: Mon, 12 Jan 2026 17:58:31 +0100 Subject: [PATCH 71/81] Resolves: #2424126 - rebase to 5.9.5.2 Signed-off-by: Josef Ridky --- .gitignore | 1 + net-snmp-5.7.3-iterator-fix.patch | 9 +- net-snmp-5.8-clientaddr-error-message.patch | 20 +- net-snmp-5.8-duplicate-ipAddress.patch | 9 +- net-snmp-5.8-expand-SNMPCONFPATH.patch | 9 +- net-snmp-5.8-ipAddress-faster-load.patch | 11 +- net-snmp-5.8-man-page.patch | 36 -- net-snmp-5.8-rpm-memory-leak.patch | 28 -- net-snmp-5.9-cflags.patch | 20 +- net-snmp-5.9-coverity.patch | 22 -- net-snmp-5.9-intermediate-certs.patch | 414 +++++++++++++++++--- net-snmp-5.9-multilib.patch | 8 +- net-snmp-5.9-python3.patch | 2 +- net-snmp-5.9-rpmdb.patch | 65 --- net-snmp-5.9.1-remove-des.patch | 56 +-- net-snmp-5.9.4-autoconf.patch | 6 - net-snmp-5.9.4-kernel-6.7.patch | 120 ------ net-snmp-5.9.4-revert-n-snmptrapd-log.patch | 9 +- net-snmp-5.9.4-tls.patch | 42 +- net-snmp.spec | 22 +- sources | 2 +- 21 files changed, 465 insertions(+), 446 deletions(-) delete mode 100644 net-snmp-5.8-man-page.patch delete mode 100644 net-snmp-5.8-rpm-memory-leak.patch delete mode 100644 net-snmp-5.9-coverity.patch delete mode 100644 net-snmp-5.9-rpmdb.patch delete mode 100644 net-snmp-5.9.4-autoconf.patch delete mode 100644 net-snmp-5.9.4-kernel-6.7.patch diff --git a/.gitignore b/.gitignore index c94eb56..d358878 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ net-snmp-5.5.tar.gz /net-snmp-5.9.1.tar.gz /net-snmp-5.9.3.tar.gz /net-snmp-5.9.4.tar.gz +/net-snmp-5.9.5.2.tar.gz diff --git a/net-snmp-5.7.3-iterator-fix.patch b/net-snmp-5.7.3-iterator-fix.patch index fb34caf..0afd8bc 100644 --- a/net-snmp-5.7.3-iterator-fix.patch +++ b/net-snmp-5.7.3-iterator-fix.patch @@ -1,7 +1,8 @@ -diff -urNp old/agent/mibgroup/host/data_access/swrun.c new/agent/mibgroup/host/data_access/swrun.c ---- old/agent/mibgroup/host/data_access/swrun.c 2017-07-18 09:44:00.626109526 +0200 -+++ new/agent/mibgroup/host/data_access/swrun.c 2017-07-19 15:27:50.452255836 +0200 -@@ -102,6 +102,10 @@ swrun_count_processes_by_name( char *nam +diff --git a/agent/mibgroup/host/data_access/swrun.c b/agent/mibgroup/host/data_access/swrun.c +index 7b278eb..5f10ade 100644 +--- a/agent/mibgroup/host/data_access/swrun.c ++++ b/agent/mibgroup/host/data_access/swrun.c +@@ -143,6 +143,10 @@ swrun_count_processes_by_name( char *name ) return 0; /* or -1 */ it = CONTAINER_ITERATOR( swrun_container ); diff --git a/net-snmp-5.8-clientaddr-error-message.patch b/net-snmp-5.8-clientaddr-error-message.patch index ef851b1..8de6386 100644 --- a/net-snmp-5.8-clientaddr-error-message.patch +++ b/net-snmp-5.8-clientaddr-error-message.patch @@ -1,7 +1,8 @@ -diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c ---- a/snmplib/snmp_api.c 2020-11-26 11:05:51.084788775 +0100 -+++ b/snmplib/snmp_api.c 2020-11-26 11:08:27.850751397 +0100 -@@ -235,7 +235,7 @@ static const char *api_errors[-SNMPERR_M +diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c +index ad30397..307253a 100644 +--- a/snmplib/snmp_api.c ++++ b/snmplib/snmp_api.c +@@ -231,7 +231,7 @@ static const char *api_errors[-SNMPERR_MAX + 1] = { "No error", /* SNMPERR_SUCCESS */ "Generic error", /* SNMPERR_GENERR */ "Invalid local port", /* SNMPERR_BAD_LOCPORT */ @@ -10,7 +11,7 @@ diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c "Unknown session", /* SNMPERR_BAD_SESSION */ "Too long", /* SNMPERR_TOO_LONG */ "No socket", /* SNMPERR_NO_SOCKET */ -@@ -1662,7 +1662,9 @@ _sess_open(netsnmp_session * in_session) +@@ -1718,7 +1718,9 @@ _sess_open(netsnmp_session * in_session) DEBUGMSGTL(("_sess_open", "couldn't interpret peername\n")); in_session->s_snmp_errno = SNMPERR_BAD_ADDRESS; in_session->s_errno = errno; @@ -21,10 +22,11 @@ diff -urNp a/snmplib/snmp_api.c b/snmplib/snmp_api.c return NULL; } -diff -ruNp a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c ---- a/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 12:51:51.948106797 +0100 -+++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c 2021-01-06 14:17:31.029745744 +0100 -@@ -209,6 +209,8 @@ netsnmp_udpipv4base_transport_bind(netsn +diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c +index 1e15a2f..47ac42e 100644 +--- a/snmplib/transports/snmpUDPIPv4BaseDomain.c ++++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c +@@ -224,6 +224,8 @@ netsnmp_udpipv4base_transport_bind(netsnmp_transport *t, DEBUGMSGTL(("netsnmp_udpbase", "failed to bind for clientaddr: %d %s\n", errno, strerror(errno))); diff --git a/net-snmp-5.8-duplicate-ipAddress.patch b/net-snmp-5.8-duplicate-ipAddress.patch index 075976a..8c833a7 100644 --- a/net-snmp-5.8-duplicate-ipAddress.patch +++ b/net-snmp-5.8-duplicate-ipAddress.patch @@ -1,7 +1,8 @@ -diff -urNp a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c ---- a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2020-06-10 13:27:03.213904398 +0200 -+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c 2020-06-10 13:28:41.025863050 +0200 -@@ -121,6 +121,7 @@ _remove_duplicates(netsnmp_container *co +diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c +index 675d4ea..8d3708d 100644 +--- a/agent/mibgroup/ip-mib/data_access/ipaddress_common.c ++++ b/agent/mibgroup/ip-mib/data_access/ipaddress_common.c +@@ -120,6 +120,7 @@ _remove_duplicates(netsnmp_container *container, u_int container_flags) for (entry = ITERATOR_FIRST(it); entry; entry = ITERATOR_NEXT(it)) { if (prev_entry && _access_ipaddress_entry_compare_addr(prev_entry, entry) == 0) { /* 'entry' is duplicate of the previous one -> delete it */ diff --git a/net-snmp-5.8-expand-SNMPCONFPATH.patch b/net-snmp-5.8-expand-SNMPCONFPATH.patch index a812cf4..f9132fe 100644 --- a/net-snmp-5.8-expand-SNMPCONFPATH.patch +++ b/net-snmp-5.8-expand-SNMPCONFPATH.patch @@ -1,7 +1,8 @@ -diff -ruNp a/snmplib/read_config.c b/snmplib/read_config.c ---- a/snmplib/read_config.c 2020-06-10 09:51:57.184786510 +0200 -+++ b/snmplib/read_config.c 2020-06-10 09:53:13.257507112 +0200 -@@ -1642,7 +1642,7 @@ snmp_save_persistent(const char *type) +diff --git a/snmplib/read_config.c b/snmplib/read_config.c +index 159f4be..fa8fcba 100644 +--- a/snmplib/read_config.c ++++ b/snmplib/read_config.c +@@ -1688,7 +1688,7 @@ snmp_save_persistent(const char *type) * save a warning header to the top of the new file */ snprintf(fileold, sizeof(fileold), diff --git a/net-snmp-5.8-ipAddress-faster-load.patch b/net-snmp-5.8-ipAddress-faster-load.patch index db95998..32f9b60 100644 --- a/net-snmp-5.8-ipAddress-faster-load.patch +++ b/net-snmp-5.8-ipAddress-faster-load.patch @@ -1,7 +1,8 @@ -diff -urNp a/agent/mibgroup/mibII/ipAddr.c b/agent/mibgroup/mibII/ipAddr.c ---- a/agent/mibgroup/mibII/ipAddr.c 2020-06-10 14:14:30.113696471 +0200 -+++ b/agent/mibgroup/mibII/ipAddr.c 2020-06-10 14:27:15.345354018 +0200 -@@ -495,14 +495,16 @@ Address_Scan_Next(Index, Retin_ifaddr) +diff --git a/agent/mibgroup/mibII/ipAddr.c b/agent/mibgroup/mibII/ipAddr.c +index a89255f..ef67f5f 100644 +--- a/agent/mibgroup/mibII/ipAddr.c ++++ b/agent/mibgroup/mibII/ipAddr.c +@@ -498,14 +498,16 @@ Address_Scan_Next(Index, Retin_ifaddr) } #elif defined(linux) @@ -19,7 +20,7 @@ diff -urNp a/agent/mibgroup/mibII/ipAddr.c b/agent/mibgroup/mibII/ipAddr.c /* get info about all interfaces */ -@@ -510,28 +512,45 @@ Address_Scan_Init(void) +@@ -513,28 +515,45 @@ Address_Scan_Init(void) SNMP_FREE(ifc.ifc_buf); ifr_counter = 0; diff --git a/net-snmp-5.8-man-page.patch b/net-snmp-5.8-man-page.patch deleted file mode 100644 index dc78e14..0000000 --- a/net-snmp-5.8-man-page.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff -urNp a/man/net-snmp-create-v3-user.1.def b/man/net-snmp-create-v3-user.1.def ---- a/man/net-snmp-create-v3-user.1.def 2020-06-10 13:43:18.443070961 +0200 -+++ b/man/net-snmp-create-v3-user.1.def 2020-06-10 13:49:25.975363441 +0200 -@@ -3,7 +3,7 @@ - net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file - .SH SYNOPSIS - .PP --.B net-snmp-create-v3-user [-ro] [-a authpass] [-x privpass] [-X DES|AES] -+.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES] - .B [username] - .SH DESCRIPTION - .PP -@@ -16,13 +16,16 @@ new user in net-snmp configuration file - displays the net-snmp version number - .TP - \fB\-ro\fR --create an user with read-only permissions -+creates a user with read-only permissions - .TP --\fB\-a authpass\fR --specify authentication password -+\fB\-A authpass\fR -+specifies the authentication password - .TP --\fB\-x privpass\fR --specify encryption password -+\fB\-a MD5|SHA\fR -+specifies the authentication password hashing algorithm - .TP --\fB\-X DES|AES\fR --specify encryption algorithm -+\fB\-X privpass\fR -+specifies the encryption password -+.TP -+\fB\-x DES|AES\fR -+specifies the encryption algorithm diff --git a/net-snmp-5.8-rpm-memory-leak.patch b/net-snmp-5.8-rpm-memory-leak.patch deleted file mode 100644 index d337008..0000000 --- a/net-snmp-5.8-rpm-memory-leak.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c -index 695c469..dd0e487 100644 ---- a/agent/mibgroup/host/data_access/swinst_rpm.c -+++ b/agent/mibgroup/host/data_access/swinst_rpm.c -@@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void) - snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); - SNMP_FREE(rpmdbpath); - dbpath = NULL; -+#ifdef HAVE_RPMGETPATH -+ rpmFreeRpmrc(); -+#endif - if (-1 == stat( pkg_directory, &stat_buf )) { - snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); - pkg_directory[0] = '\0'; -diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c -index 1f52733..ccf1cab 100644 ---- a/agent/mibgroup/host/hr_swinst.c -+++ b/agent/mibgroup/host/hr_swinst.c -@@ -231,6 +231,9 @@ init_hr_swinst(void) - snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath); - path[ sizeof(path)-1 ] = 0; - swi->swi_directory = strdup(path); -+#ifdef HAVE_RPMGETPATH -+ rpmFreeRpmrc(); -+#endif - } - #else - # ifdef _PATH_HRSW_directory diff --git a/net-snmp-5.9-cflags.patch b/net-snmp-5.9-cflags.patch index ef8604f..a48e9ca 100644 --- a/net-snmp-5.9-cflags.patch +++ b/net-snmp-5.9-cflags.patch @@ -1,17 +1,19 @@ -diff -urNp a/perl/Makefile.PL b/perl/Makefile.PL ---- a/perl/Makefile.PL 2020-08-26 08:32:52.498909823 +0200 -+++ b/perl/Makefile.PL 2020-08-26 09:30:45.584951552 +0200 +diff --git a/perl/Makefile.PL b/perl/Makefile.PL +index 63e6333..82cedca 100644 +--- a/perl/Makefile.PL ++++ b/perl/Makefile.PL @@ -1,3 +1,4 @@ +use lib '.'; use strict; use warnings; use ExtUtils::MakeMaker; -diff -urNp a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm ---- a/perl/MakefileSubs.pm 2020-08-26 08:32:52.498909823 +0200 -+++ b/perl/MakefileSubs.pm 2020-08-26 08:36:44.097218448 +0200 -@@ -116,7 +116,7 @@ sub AddCommonParams { - append($Params->{'CCFLAGS'}, $cflags); - append($Params->{'CCFLAGS'}, $Config{'ccflags'}); +diff --git a/perl/MakefileSubs.pm b/perl/MakefileSubs.pm +index 804b20e..25c5d67 100644 +--- a/perl/MakefileSubs.pm ++++ b/perl/MakefileSubs.pm +@@ -126,7 +126,7 @@ sub AddCommonParams { + # Suppress warnings about old-style function definitions. + append($Params->{'CCFLAGS'}, '-Wno-old-style-definition'); # Suppress known Perl header shortcomings. - $Params->{'CCFLAGS'} =~ s/ -W(cast-qual|write-strings)//g; + $Params->{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; diff --git a/net-snmp-5.9-coverity.patch b/net-snmp-5.9-coverity.patch deleted file mode 100644 index fa3e043..0000000 --- a/net-snmp-5.9-coverity.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/agent/mibgroup/disman/event/mteTrigger.c b/agent/mibgroup/disman/event/mteTrigger.c -index e9a8831..5a1d8e7 100644 ---- a/agent/mibgroup/disman/event/mteTrigger.c -+++ b/agent/mibgroup/disman/event/mteTrigger.c -@@ -1012,7 +1012,7 @@ mteTrigger_run( unsigned int reg, void *clientarg) - * Similarly, if no fallEvent is configured, - * there's no point in trying to fire it either. - */ -- if (entry->mteTThRiseEvent[0] != '\0' ) { -+ if (entry->mteTThFallEvent[0] != '\0' ) { - entry->mteTriggerXOwner = entry->mteTThObjOwner; - entry->mteTriggerXObjects = entry->mteTThObjects; - entry->mteTriggerFired = vp1; -@@ -1105,7 +1105,7 @@ mteTrigger_run( unsigned int reg, void *clientarg) - * Similarly, if no fallEvent is configured, - * there's no point in trying to fire it either. - */ -- if (entry->mteTThDRiseEvent[0] != '\0' ) { -+ if (entry->mteTThDFallEvent[0] != '\0' ) { - entry->mteTriggerXOwner = entry->mteTThObjOwner; - entry->mteTriggerXObjects = entry->mteTThObjects; - entry->mteTriggerFired = vp1; diff --git a/net-snmp-5.9-intermediate-certs.patch b/net-snmp-5.9-intermediate-certs.patch index 6b5daf7..ab5b7a0 100644 --- a/net-snmp-5.9-intermediate-certs.patch +++ b/net-snmp-5.9-intermediate-certs.patch @@ -1,8 +1,8 @@ diff --git a/include/net-snmp/library/cert_util.h b/include/net-snmp/library/cert_util.h -index 80e2a19..143adbb 100644 +index 305e367..6117b9a 100644 --- a/include/net-snmp/library/cert_util.h +++ b/include/net-snmp/library/cert_util.h -@@ -55,7 +55,8 @@ extern "C" { +@@ -48,7 +48,8 @@ extern "C" { char *common_name; u_char hash_type; @@ -12,7 +12,7 @@ index 80e2a19..143adbb 100644 } netsnmp_cert; /** types */ -@@ -100,6 +101,7 @@ extern "C" { +@@ -93,6 +94,7 @@ extern "C" { NETSNMP_IMPORT netsnmp_cert *netsnmp_cert_find(int what, int where, void *hint); @@ -35,10 +35,21 @@ index 471bb0b..ac7f69a 100644 #ifdef __cplusplus diff --git a/snmplib/cert_util.c b/snmplib/cert_util.c -index 210ad8b..b1f8144 100644 +index 5b5aaaa..7c07048 100644 --- a/snmplib/cert_util.c +++ b/snmplib/cert_util.c -@@ -100,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all); +@@ -42,9 +42,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all); + + #include + +-#include +- +-#if HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H + #include + #endif + +@@ -102,7 +100,7 @@ netsnmp_feature_child_of(tls_fingerprint_build, cert_util_all); * bump this value whenever cert index format changes, so indexes * will be regenerated with new format. */ @@ -47,8 +58,28 @@ index 210ad8b..b1f8144 100644 static netsnmp_container *_certs = NULL; static netsnmp_container *_keys = NULL; -@@ -126,6 +126,8 @@ static int _cert_fn_ncompare(netsnmp_cert_common *lhs, - netsnmp_cert_common *rhs); +@@ -116,16 +114,20 @@ static netsnmp_container *_trusted_certs = NULL; + static void _setup_containers(void); + + static void _cert_indexes_load(void); +-static void _cert_free(void *cert, void *context); +-static void _key_free(void *key, void *context); +-static int _cert_compare(const void *p, const void *q); +-static int _cert_sn_compare(const void *p, const void *q); +-static int _cert_sn_ncompare(const void *p, const void *q); +-static int _cert_cn_compare(const void *p, const void *q); +-static int _cert_fn_compare(const void *p, const void *q); +-static int _cert_fn_ncompare(const void *p, const void *q); ++static void _cert_free(netsnmp_cert *cert, void *context); ++static void _key_free(netsnmp_key *key, void *context); ++static int _cert_compare(netsnmp_cert *lhs, netsnmp_cert *rhs); ++static int _cert_sn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs); ++static int _cert_sn_ncompare(netsnmp_cert *lhs, netsnmp_cert *rhs); ++static int _cert_cn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs); ++static int _cert_fn_compare(netsnmp_cert_common *lhs, ++ netsnmp_cert_common *rhs); ++static int _cert_fn_ncompare(netsnmp_cert_common *lhs, ++ netsnmp_cert_common *rhs); static void _find_partner(netsnmp_cert *cert, netsnmp_key *key); static netsnmp_cert *_find_issuer(netsnmp_cert *cert); +static netsnmp_void_array *_cert_reduce_subset_first(netsnmp_void_array *matching); @@ -56,7 +87,16 @@ index 210ad8b..b1f8144 100644 static netsnmp_void_array *_cert_find_subset_fn(const char *filename, const char *directory); static netsnmp_void_array *_cert_find_subset_sn(const char *subject); -@@ -345,6 +347,8 @@ _get_cert_container(const char *use) +@@ -200,7 +202,7 @@ _setup_trusted_certs(void) + return; + } + _trusted_certs->container_name = strdup("trusted certificates"); +- _trusted_certs->compare = netsnmp_str_compare; ++ _trusted_certs->compare = (netsnmp_container_compare*) strcmp; + } + + /* +@@ -345,14 +347,18 @@ _get_cert_container(const char *use) { netsnmp_container *c; @@ -65,49 +105,61 @@ index 210ad8b..b1f8144 100644 c = netsnmp_container_find("certs:binary_array"); if (NULL == c) { snmp_log(LOG_ERR, "could not create container for %s\n", use); -@@ -354,6 +358,8 @@ _get_cert_container(const char *use) - c->free_item = (netsnmp_container_obj_func*)_cert_free; - c->compare = (netsnmp_container_compare*)_cert_compare; - -+ CONTAINER_SET_OPTIONS(c, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + return NULL; + } + c->container_name = strdup(use); +- c->free_item = _cert_free; +- c->compare = _cert_compare; ++ c->free_item = (netsnmp_container_obj_func*)_cert_free; ++ c->compare = (netsnmp_container_compare*)_cert_compare; + ++ CONTAINER_SET_OPTIONS(c, CONTAINER_KEY_ALLOW_DUPLICATES, rc); + return c; } - -@@ -362,6 +368,8 @@ _setup_containers(void) - { - netsnmp_container *additional_keys; - -+ int rc; -+ - _certs = _get_cert_container("netsnmp certificates"); - if (NULL == _certs) - return; -@@ -376,6 +384,7 @@ _setup_containers(void) +@@ -377,7 +383,7 @@ _setup_containers(void) + } additional_keys->container_name = strdup("certs_cn"); additional_keys->free_item = NULL; - additional_keys->compare = (netsnmp_container_compare*)_cert_cn_compare; -+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); +- additional_keys->compare = _cert_cn_compare; ++ additional_keys->compare = (netsnmp_container_compare*)_cert_cn_compare; + CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); netsnmp_container_add_index(_certs, additional_keys); - /** additional keys: subject name */ -@@ -389,6 +398,7 @@ _setup_containers(void) +@@ -390,8 +396,8 @@ _setup_containers(void) + } + additional_keys->container_name = strdup("certs_sn"); additional_keys->free_item = NULL; - additional_keys->compare = (netsnmp_container_compare*)_cert_sn_compare; - additional_keys->ncompare = (netsnmp_container_compare*)_cert_sn_ncompare; -+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); +- additional_keys->compare = _cert_sn_compare; +- additional_keys->ncompare = _cert_sn_ncompare; ++ additional_keys->compare = (netsnmp_container_compare*)_cert_sn_compare; ++ additional_keys->ncompare = (netsnmp_container_compare*)_cert_sn_ncompare; + CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); netsnmp_container_add_index(_certs, additional_keys); - /** additional keys: file name */ -@@ -402,6 +412,7 @@ _setup_containers(void) +@@ -404,8 +410,8 @@ _setup_containers(void) + } + additional_keys->container_name = strdup("certs_fn"); additional_keys->free_item = NULL; - additional_keys->compare = (netsnmp_container_compare*)_cert_fn_compare; - additional_keys->ncompare = (netsnmp_container_compare*)_cert_fn_ncompare; -+ CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); +- additional_keys->compare = _cert_fn_compare; +- additional_keys->ncompare = _cert_fn_ncompare; ++ additional_keys->compare = (netsnmp_container_compare*)_cert_fn_compare; ++ additional_keys->ncompare = (netsnmp_container_compare*)_cert_fn_ncompare; + CONTAINER_SET_OPTIONS(additional_keys, CONTAINER_KEY_ALLOW_DUPLICATES, rc); netsnmp_container_add_index(_certs, additional_keys); - _keys = netsnmp_container_find("cert_keys:binary_array"); -@@ -424,7 +435,7 @@ netsnmp_cert_map_container(void) +@@ -416,8 +422,8 @@ _setup_containers(void) + return; + } + _keys->container_name = strdup("netsnmp certificate keys"); +- _keys->free_item = _key_free; +- _keys->compare = _cert_fn_compare; ++ _keys->free_item = (netsnmp_container_obj_func*)_key_free; ++ _keys->compare = (netsnmp_container_compare*)_cert_fn_compare; + + _setup_trusted_certs(); + } +@@ -429,7 +435,7 @@ netsnmp_cert_map_container(void) } static netsnmp_cert * @@ -116,7 +168,7 @@ index 210ad8b..b1f8144 100644 int hashType, const char *fingerprint, const char *common_name, const char *subject) { -@@ -446,8 +457,10 @@ _new_cert(const char *dirname, const char *filename, int certType, +@@ -451,8 +457,10 @@ _new_cert(const char *dirname, const char *filename, int certType, cert->info.dir = strdup(dirname); cert->info.filename = strdup(filename); @@ -128,7 +180,112 @@ index 210ad8b..b1f8144 100644 if (fingerprint) { cert->hash_type = hashType; cert->fingerprint = strdup(fingerprint); -@@ -884,14 +897,86 @@ _certindex_new( const char *dirname ) +@@ -553,22 +561,20 @@ netsnmp_key_free(netsnmp_key *key) + } + + static void +-_cert_free(void *cert, void *context) ++_cert_free(netsnmp_cert *cert, void *context) + { + netsnmp_cert_free(cert); + } + + static void +-_key_free(void *key, void *context) ++_key_free(netsnmp_key *key, void *context) + { + netsnmp_key_free(key); + } + + static int +-_cert_compare(const void *p, const void *q) ++_cert_compare(netsnmp_cert *lhs, netsnmp_cert *rhs) + { +- const netsnmp_cert *lhs = p, *rhs = q; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + netsnmp_assert((lhs->fingerprint != NULL) && + (rhs->fingerprint != NULL)); +@@ -578,8 +584,7 @@ _cert_compare(const void *p, const void *q) + } + + static int +-_cert_path_compare(const netsnmp_cert_common *lhs, +- const netsnmp_cert_common *rhs) ++_cert_path_compare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs) + { + int rc; + +@@ -595,9 +600,8 @@ _cert_path_compare(const netsnmp_cert_common *lhs, + } + + static int +-_cert_cn_compare(const void *p, const void *q) ++_cert_cn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs) + { +- const netsnmp_cert *lhs = p, *rhs = q; + int rc; + const char *lhcn, *rhcn; + +@@ -617,13 +621,13 @@ _cert_cn_compare(const void *p, const void *q) + return rc; + + /** in case of equal common names, sub-sort by path */ +- return _cert_path_compare(&lhs->info, &rhs->info); ++ return _cert_path_compare((netsnmp_cert_common*)lhs, ++ (netsnmp_cert_common*)rhs); + } + + static int +-_cert_sn_compare(const void *p, const void *q) ++_cert_sn_compare(netsnmp_cert *lhs, netsnmp_cert *rhs) + { +- const netsnmp_cert *lhs = p, *rhs = q; + int rc; + const char *lhsn, *rhsn; + +@@ -643,13 +647,13 @@ _cert_sn_compare(const void *p, const void *q) + return rc; + + /** in case of equal common names, sub-sort by path */ +- return _cert_path_compare(&lhs->info, &rhs->info); ++ return _cert_path_compare((netsnmp_cert_common*)lhs, ++ (netsnmp_cert_common*)rhs); + } + + static int +-_cert_fn_compare(const void *p, const void *q) ++_cert_fn_compare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs) + { +- const netsnmp_cert_common *lhs = p, *rhs = q; + int rc; + + netsnmp_assert((lhs != NULL) && (rhs != NULL)); +@@ -663,10 +667,8 @@ _cert_fn_compare(const void *p, const void *q) + } + + static int +-_cert_fn_ncompare(const void *p, const void *q) ++_cert_fn_ncompare(netsnmp_cert_common *lhs, netsnmp_cert_common *rhs) + { +- const netsnmp_cert_common *lhs = p, *rhs = q; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + netsnmp_assert((lhs->filename != NULL) && (rhs->filename != NULL)); + +@@ -674,10 +676,8 @@ _cert_fn_ncompare(const void *p, const void *q) + } + + static int +-_cert_sn_ncompare(const void *p, const void *q) ++_cert_sn_ncompare(netsnmp_cert *lhs, netsnmp_cert *rhs) + { +- const netsnmp_cert *lhs = p, *rhs = q; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + netsnmp_assert((lhs->subject != NULL) && (rhs->subject != NULL)); + +@@ -897,14 +897,86 @@ _certindex_new( const char *dirname ) * certificate utility functions * */ @@ -217,7 +374,7 @@ index 210ad8b..b1f8144 100644 if (NULL == cert) return NULL; -@@ -908,51 +993,33 @@ netsnmp_ocert_get(netsnmp_cert *cert) +@@ -921,51 +993,33 @@ netsnmp_ocert_get(netsnmp_cert *cert) } } @@ -277,7 +434,7 @@ index 210ad8b..b1f8144 100644 if (NULL != okey) { netsnmp_key *key; DEBUGMSGT(("cert:read:key", "found key with cert in %s\n", -@@ -979,7 +1046,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) +@@ -992,7 +1046,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) break; #ifdef CERT_PKCS12_SUPPORT_MAYBE_LATER case NS_CERT_TYPE_PKCS12: @@ -286,7 +443,7 @@ index 210ad8b..b1f8144 100644 PKCS12 *p12 = d2i_PKCS12_bio(certbio, NULL); if ( (NULL != p12) && (PKCS12_verify_mac(p12, "", 0) || PKCS12_verify_mac(p12, NULL, 0))) -@@ -999,46 +1066,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) +@@ -1012,46 +1066,7 @@ netsnmp_ocert_get(netsnmp_cert *cert) return NULL; } @@ -320,7 +477,7 @@ index 210ad8b..b1f8144 100644 - } - - if (NULL == cert->fingerprint) { -- cert->hash_type = netsnmp_openssl_cert_get_hash_type(ocert); +- cert->hash_type = NS_HASH_SHA1; - cert->fingerprint = - netsnmp_openssl_cert_get_fingerprint(ocert, cert->hash_type); - } @@ -334,7 +491,7 @@ index 210ad8b..b1f8144 100644 return ocert; } -@@ -1048,7 +1076,6 @@ netsnmp_okey_get(netsnmp_key *key) +@@ -1061,7 +1076,6 @@ netsnmp_okey_get(netsnmp_key *key) { BIO *keybio; EVP_PKEY *okey; @@ -342,7 +499,7 @@ index 210ad8b..b1f8144 100644 if (NULL == key) return NULL; -@@ -1056,19 +1083,8 @@ netsnmp_okey_get(netsnmp_key *key) +@@ -1069,19 +1083,8 @@ netsnmp_okey_get(netsnmp_key *key) if (key->okey) return key->okey; @@ -364,7 +521,7 @@ index 210ad8b..b1f8144 100644 return NULL; } -@@ -1154,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) +@@ -1167,7 +1170,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) cert->issuer_cert = _find_issuer(cert); if (NULL == cert->issuer_cert) { DEBUGMSGT(("cert:load:warn", @@ -373,7 +530,7 @@ index 210ad8b..b1f8144 100644 cert->info.filename)); rc = CERT_LOAD_PARTIAL; break; -@@ -1163,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) +@@ -1176,7 +1179,7 @@ netsnmp_cert_load_x509(netsnmp_cert *cert) /** get issuer ocert */ if ((NULL == cert->issuer_cert->ocert) && (netsnmp_ocert_get(cert->issuer_cert) == NULL)) { @@ -382,7 +539,7 @@ index 210ad8b..b1f8144 100644 cert->info.filename)); rc = CERT_LOAD_PARTIAL; break; -@@ -1184,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) +@@ -1197,7 +1200,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) return; } @@ -391,7 +548,7 @@ index 210ad8b..b1f8144 100644 if (key->cert) { DEBUGMSGT(("cert:partner", "key already has partner\n")); return; -@@ -1197,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) +@@ -1210,7 +1213,8 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) return; *pos = 0; @@ -401,7 +558,7 @@ index 210ad8b..b1f8144 100644 if (!matching) return; if (1 == matching->size) { -@@ -1217,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) +@@ -1230,7 +1234,7 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) DEBUGMSGT(("cert:partner", "%s matches multiple certs\n", key->info.filename)); } @@ -410,7 +567,7 @@ index 210ad8b..b1f8144 100644 if (cert->key) { DEBUGMSGT(("cert:partner", "cert already has partner\n")); return; -@@ -1255,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) +@@ -1268,76 +1272,182 @@ _find_partner(netsnmp_cert *cert, netsnmp_key *key) } } @@ -646,7 +803,7 @@ index 210ad8b..b1f8144 100644 } return 0; -@@ -1338,7 +1461,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) +@@ -1351,7 +1461,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) struct stat idx_stat; char tmpstr[SNMP_MAXPATH + 5], filename[NAME_MAX]; char fingerprint[EVP_MAX_MD_SIZE*3], common_name[64+1], type_str[15]; @@ -656,7 +813,7 @@ index 210ad8b..b1f8144 100644 int count = 0, type, hash, version; netsnmp_cert *cert; netsnmp_key *key; -@@ -1381,7 +1505,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) +@@ -1394,7 +1505,8 @@ _cert_read_index(const char *dirname, struct stat *dirstat) netsnmp_directory_container_read_some(NULL, dirname, _time_filter, &idx_stat, NETSNMP_DIR_NSFILE | @@ -666,7 +823,7 @@ index 210ad8b..b1f8144 100644 if (newer) { DEBUGMSGT(("cert:index:parse", "Index outdated; files modified\n")); CONTAINER_FREE_ALL(newer, NULL); -@@ -1426,6 +1551,7 @@ _cert_read_index(const char *dirname, struct stat *dirstat) +@@ -1439,6 +1551,7 @@ _cert_read_index(const char *dirname, struct stat *dirstat) pos = &tmpstr[2]; if ((NULL == (pos=copy_nword(pos, filename, sizeof(filename)))) || (NULL == (pos=copy_nword(pos, type_str, sizeof(type_str)))) || @@ -674,7 +831,7 @@ index 210ad8b..b1f8144 100644 (NULL == (pos=copy_nword(pos, hash_str, sizeof(hash_str)))) || (NULL == (pos=copy_nword(pos, fingerprint, sizeof(fingerprint)))) || -@@ -1438,8 +1564,9 @@ _cert_read_index(const char *dirname, struct stat *dirstat) +@@ -1451,8 +1564,9 @@ _cert_read_index(const char *dirname, struct stat *dirstat) break; } type = atoi(type_str); @@ -685,7 +842,7 @@ index 210ad8b..b1f8144 100644 common_name, subject); if (cert && 0 == CONTAINER_INSERT(found, cert)) ++count; -@@ -1546,7 +1673,8 @@ _add_certdir(const char *dirname) +@@ -1559,7 +1673,8 @@ _add_certdir(const char *dirname) netsnmp_directory_container_read_some(NULL, dirname, _cert_cert_filter, NULL, NETSNMP_DIR_RELATIVE_PATH | @@ -695,7 +852,15 @@ index 210ad8b..b1f8144 100644 if (NULL == cert_container) { DEBUGMSGT(("cert:index:dir", "error creating container for cert files\n")); -@@ -1634,7 +1762,7 @@ _cert_print(netsnmp_cert *c, void *context) +@@ -1642,14 +1757,12 @@ _cert_indexes_load(void) + } + + static void +-_cert_print(void *p, void *context) ++_cert_print(netsnmp_cert *c, void *context) + { +- netsnmp_cert *c = p; +- if (NULL == c) return; @@ -704,7 +869,39 @@ index 210ad8b..b1f8144 100644 DEBUGMSGT(("cert:dump", " type %d flags 0x%x (%s)\n", c->info.type, c->info.allowed_uses, _mode_str(c->info.allowed_uses))); -@@ -1838,7 +1966,8 @@ netsnmp_cert_find(int what, int where, void *hint) +@@ -1676,10 +1789,8 @@ _cert_print(void *p, void *context) + } + + static void +-_key_print(void *p, void *context) ++_key_print(netsnmp_key *k, void *context) + { +- netsnmp_key *k = p; +- + if (NULL == k) + return; + +@@ -1691,8 +1802,8 @@ _key_print(void *p, void *context) + void + netsnmp_cert_dump_all(void) + { +- CONTAINER_FOR_EACH(_certs, _cert_print, NULL); +- CONTAINER_FOR_EACH(_keys, _key_print, NULL); ++ CONTAINER_FOR_EACH(_certs, (netsnmp_container_obj_func*)_cert_print, NULL); ++ CONTAINER_FOR_EACH(_keys, (netsnmp_container_obj_func*)_key_print, NULL); + } + + #ifdef CERT_MAIN +@@ -1726,6 +1837,8 @@ main(int argc, char** argv) + + #endif /* CERT_MAIN */ + ++static netsnmp_cert *_cert_find_fp(const char *fingerprint); ++ + void + netsnmp_fp_lowercase_and_strip_colon(char *fp) + { +@@ -1853,7 +1966,8 @@ netsnmp_cert_find(int what, int where, void *hint) netsnmp_void_array *matching; DEBUGMSGT(("cert:find:params", " hint = %s\n", (char *)hint)); @@ -714,7 +911,16 @@ index 210ad8b..b1f8144 100644 if (!matching) return NULL; if (1 == matching->size) -@@ -2281,6 +2410,124 @@ _reduce_subset_dir(netsnmp_void_array *matching, const char *directory) +@@ -2061,7 +2175,7 @@ netsnmp_cert_trust(SSL_CTX *ctx, netsnmp_cert *thiscert) + SNMPERR_GENERR); + + /* Put the certificate into the store */ +- fingerprint = netsnmp_openssl_cert_get_fingerprint(cert, NS_HASH_SHA1); ++ fingerprint = netsnmp_openssl_cert_get_fingerprint(cert, -1); + DEBUGMSGTL(("cert:trust", + "putting trusted cert %p = %s in certstore %p\n", cert, + fingerprint, certstore)); +@@ -2296,6 +2410,124 @@ _reduce_subset_dir(netsnmp_void_array *matching, const char *directory) } } @@ -839,11 +1045,95 @@ index 210ad8b..b1f8144 100644 static netsnmp_void_array * _cert_find_subset_common(const char *filename, netsnmp_container *container) { +@@ -2433,7 +2665,7 @@ _time_filter(const void *text, void *ctx) + * ***************************************************************************/ + #define MAP_CONFIG_TOKEN "certSecName" + static void _parse_map(const char *token, char *line); +-static void _map_free(void *map, void *ctx); ++static void _map_free(netsnmp_cert_map* entry, void *ctx); + static void _purge_config_entries(void); + + static void +@@ -2538,16 +2770,14 @@ netsnmp_cert_map_find(netsnmp_cert_map *map) + #endif /* NETSNMP_FEATURE_REMOVE_CERT_MAP_FIND */ + + static void +-_map_free(void *map, void *context) ++_map_free(netsnmp_cert_map *map, void *context) + { + netsnmp_cert_map_free(map); + } + + static int +-_map_compare(const void *p, const void *q) ++_map_compare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs) + { +- const netsnmp_cert_map *lhs = p, *rhs = q; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + + if (lhs->priority < rhs->priority) +@@ -2559,11 +2789,9 @@ _map_compare(const void *p, const void *q) + } + + static int +-_map_fp_compare(const void *p, const void *q) ++_map_fp_compare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs) + { +- const netsnmp_cert_map *lhs = p, *rhs = q; + int rc; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + + if ((rc = strcmp(lhs->fingerprint, rhs->fingerprint)) != 0) +@@ -2578,10 +2806,8 @@ _map_fp_compare(const void *p, const void *q) + } + + static int +-_map_fp_ncompare(const void *p, const void *q) ++_map_fp_ncompare(netsnmp_cert_map *lhs, netsnmp_cert_map *rhs) + { +- const netsnmp_cert_map *lhs = p, *rhs = q; +- + netsnmp_assert((lhs != NULL) && (rhs != NULL)); + + return strncmp(lhs->fingerprint, rhs->fingerprint, +@@ -2600,8 +2826,8 @@ netsnmp_cert_map_container_create(int with_fp) + } + + chain_map->container_name = strdup("cert_map"); +- chain_map->free_item = _map_free; +- chain_map->compare = _map_compare; ++ chain_map->free_item = (netsnmp_container_obj_func*)_map_free; ++ chain_map->compare = (netsnmp_container_compare*)_map_compare; + + if (!with_fp) + return chain_map; +@@ -2617,8 +2843,8 @@ netsnmp_cert_map_container_create(int with_fp) + return NULL; + } + fp->container_name = strdup("cert2sn_fp"); +- fp->compare = _map_fp_compare; +- fp->ncompare = _map_fp_ncompare; ++ fp->compare = (netsnmp_container_compare*)_map_fp_compare; ++ fp->ncompare = (netsnmp_container_compare*)_map_fp_ncompare; + netsnmp_container_add_index(chain_map, fp); + + return chain_map; +@@ -2769,7 +2995,7 @@ netsnmp_certToTSN_parse_common(char **line) + map->fingerprint = strdup(buf); + } else { + map->fingerprint = +- netsnmp_openssl_cert_get_fingerprint(tmpcert->ocert, NS_HASH_SHA1); ++ netsnmp_openssl_cert_get_fingerprint(tmpcert->ocert, -1); + } + + if (NULL == *line) { diff --git a/snmplib/dir_utils.c b/snmplib/dir_utils.c -index c2dd989..e7145e4 100644 +index 48c1a0f..32426f8 100644 --- a/snmplib/dir_utils.c +++ b/snmplib/dir_utils.c -@@ -107,6 +107,9 @@ netsnmp_directory_container_read_some(netsnmp_container *user_container, +@@ -105,6 +105,9 @@ netsnmp_directory_container_read_some(netsnmp_container *user_container, /** default to unsorted */ if (! (flags & NETSNMP_DIR_SORTED)) CONTAINER_SET_OPTIONS(container, CONTAINER_KEY_UNSORTED, rc); diff --git a/net-snmp-5.9-multilib.patch b/net-snmp-5.9-multilib.patch index ffd8da8..2dfd9a6 100644 --- a/net-snmp-5.9-multilib.patch +++ b/net-snmp-5.9-multilib.patch @@ -1,5 +1,5 @@ diff --git a/man/netsnmp_config_api.3.def b/man/netsnmp_config_api.3.def -index 90b20d9..bd5abe1 100644 +index d4e0c1a..9e3a166 100644 --- a/man/netsnmp_config_api.3.def +++ b/man/netsnmp_config_api.3.def @@ -295,7 +295,7 @@ for one particular machine. @@ -11,7 +11,7 @@ index 90b20d9..bd5abe1 100644 followed by \fC $HOME/.snmp\fP. This list can be changed by setting the environmental variable .I SNMPCONFPATH -@@ -367,7 +367,7 @@ A colon separated list of directories to search for configuration +@@ -367,7 +367,7 @@ A colon-separated list of directories to search for configuration files in. Default: .br @@ -34,10 +34,10 @@ index fd30873..c3437d6 100644 snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf and/or snmptrapd.local.conf. *.local.conf are always diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def -index 7ce8a46..a4000f9 100644 +index 6acd8c7..0a8b9fa 100644 --- a/man/snmpd.conf.5.def +++ b/man/snmpd.conf.5.def -@@ -1593,7 +1593,7 @@ filename), and call the initialisation routine \fIinit_NAME\fR. +@@ -1609,7 +1609,7 @@ filename), and call the initialisation routine \fIinit_NAME\fR. .RS .IP "Note:" If the specified PATH is not a fully qualified filename, it will diff --git a/net-snmp-5.9-python3.patch b/net-snmp-5.9-python3.patch index 98de4ca..c7eda61 100644 --- a/net-snmp-5.9-python3.patch +++ b/net-snmp-5.9-python3.patch @@ -1,5 +1,5 @@ diff --git a/Makefile.in b/Makefile.in -index 912f6b2..862fb5f 100644 +index bb4ada9..69ce4f0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -227,7 +227,7 @@ perlcleanfeatures: diff --git a/net-snmp-5.9-rpmdb.patch b/net-snmp-5.9-rpmdb.patch deleted file mode 100644 index d20d728..0000000 --- a/net-snmp-5.9-rpmdb.patch +++ /dev/null @@ -1,65 +0,0 @@ -From ed4ee14af5b83fa4a86dfaa783f841d3e8545ce4 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Josef=20=C5=98=C3=ADdk=C3=BD?= -Date: Wed, 9 Aug 2023 16:51:28 +0200 -Subject: [PATCH] Add support for RPM SQLite DB background. - -From RPM 4.16 the SQLite support is available for RPM DB. -After https://fedoraproject.org/wiki/Changes/Sqlite_Rpmdb, rpm changed -it's background DB from Berkeley to SQLite in Fedora. -Net-SNMP is using hard coded paths to determine where RPM DB files are. - -This update is adding check for rpmdb.sqlite file in order to be able -invalidate internal cache after system package change. - -Closes #596 ---- - agent/mibgroup/host/data_access/swinst_rpm.c | 18 +++++++++++++----- - agent/mibgroup/host/hr_swinst.c | 3 +++ - 2 files changed, 16 insertions(+), 5 deletions(-) - -diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c -index 050edff307..7ad91a3194 100644 ---- a/agent/mibgroup/host/data_access/swinst_rpm.c -+++ b/agent/mibgroup/host/data_access/swinst_rpm.c -@@ -73,15 +73,23 @@ netsnmp_swinst_arch_init(void) - #endif - - snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); -+ -+ if (-1 == stat( pkg_directory, &stat_buf )) { -+ -+ /* check for SQLite DB backend */ -+ snprintf( pkg_directory, SNMP_MAXPATH, "%s/rpmdb.sqlite", dbpath ); -+ -+ if (-1 == stat( pkg_directory, &stat_buf )) { -+ snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); -+ pkg_directory[0] = '\0'; -+ } -+ } -+ - SNMP_FREE(rpmdbpath); - dbpath = NULL; - #ifdef HAVE_RPMGETPATH - rpmFreeRpmrc(); --#endif -- if (-1 == stat( pkg_directory, &stat_buf )) { -- snmp_log(LOG_ERR, "Can't find directory of RPM packages\n"); -- pkg_directory[0] = '\0'; -- } -+#endif - } - - void -diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c ---- a/agent/mibgroup/host/hr_swinst.c 2023-07-31 11:37:44.855071535 +0200 -+++ b/agent/mibgroup/host/hr_swinst.c 2023-08-14 12:45:14.846357019 +0200 -@@ -229,6 +229,9 @@ init_hr_swinst(void) - snprintf(path, sizeof(path), "%s/Packages", swi->swi_dbpath); - if (stat(path, &stat_buf) == -1) - snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath); -+ /* check for SQLite DB backend */ -+ if (stat(path, &stat_buf) == -1) -+ snprintf(path, sizeof(path), "%s/rpmdb.sqlite", swi->swi_dbpath); - path[ sizeof(path)-1 ] = 0; - swi->swi_directory = strdup(path); - #ifdef HAVE_RPMGETPATH diff --git a/net-snmp-5.9.1-remove-des.patch b/net-snmp-5.9.1-remove-des.patch index 60fd30f..4618655 100644 --- a/net-snmp-5.9.1-remove-des.patch +++ b/net-snmp-5.9.1-remove-des.patch @@ -1,6 +1,6 @@ diff -urNp a/man/net-snmp-config.1.def b/man/net-snmp-config.1.def ---- a/man/net-snmp-config.1.def 2021-05-26 09:30:07.430790003 +0200 -+++ b/man/net-snmp-config.1.def 2021-05-26 09:35:36.703673542 +0200 +--- a/man/net-snmp-config.1.def 2026-01-12 12:42:08.018134877 +0100 ++++ b/man/net-snmp-config.1.def 2026-01-12 12:43:26.749846227 +0100 @@ -30,7 +30,7 @@ code for a list of available debug token SNMP Setup commands: .TP @@ -11,27 +11,27 @@ diff -urNp a/man/net-snmp-config.1.def b/man/net-snmp-config.1.def These options produce the various compilation flags needed when building external SNMP applications: diff -urNp a/man/net-snmp-create-v3-user.1.def b/man/net-snmp-create-v3-user.1.def ---- a/man/net-snmp-create-v3-user.1.def 2021-05-26 09:30:07.430790003 +0200 -+++ b/man/net-snmp-create-v3-user.1.def 2021-05-26 09:34:23.702034230 +0200 +--- a/man/net-snmp-create-v3-user.1.def 2026-01-12 12:42:08.017134868 +0100 ++++ b/man/net-snmp-create-v3-user.1.def 2026-01-12 12:44:16.263005034 +0100 @@ -3,7 +3,7 @@ net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file .SH SYNOPSIS .PP --.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES] -+.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x AES] +-.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-X privpass] [-x DES|AES|AES128] ++.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-X privpass] [-x AES|AES128] .B [username] .SH DESCRIPTION .PP -@@ -27,5 +27,5 @@ specifies the authentication password ha +@@ -27,5 +27,5 @@ specify authentication algorithm \fB\-X privpass\fR - specifies the encryption password + specify encryption password .TP --\fB\-x DES|AES\fR -+\fB\-x AES\fR - specifies the encryption algorithm +-\fB\-x DES|AES|AES128\fR ++\fB\-x AES|AES128\fR + specify encryption algorithm diff -urNp a/man/snmpcmd.1.def b/man/snmpcmd.1.def ---- a/man/snmpcmd.1.def 2021-05-26 09:30:07.429789994 +0200 -+++ b/man/snmpcmd.1.def 2021-05-26 09:37:51.104850500 +0200 +--- a/man/snmpcmd.1.def 2026-01-12 12:42:08.016788741 +0100 ++++ b/man/snmpcmd.1.def 2026-01-12 12:45:15.040041004 +0100 @@ -311,7 +311,7 @@ Overrides the \fIdefSecurityName\fR toke file. .TP @@ -42,8 +42,8 @@ diff -urNp a/man/snmpcmd.1.def b/man/snmpcmd.1.def .I snmp.conf file. This option is only valid if the Net-SNMP software was build diff -urNp a/man/snmp.conf.5.def b/man/snmp.conf.5.def ---- a/man/snmp.conf.5.def 2021-05-26 09:30:07.429789994 +0200 -+++ b/man/snmp.conf.5.def 2021-05-26 09:40:03.730011937 +0200 +--- a/man/snmp.conf.5.def 2026-01-12 12:42:08.018134877 +0100 ++++ b/man/snmp.conf.5.def 2026-01-12 12:47:26.967780683 +0100 @@ -221,13 +221,13 @@ The value will be used for the authentication and/or privacy pass phrases if either of the other directives are not specified. @@ -71,8 +71,8 @@ diff -urNp a/man/snmp.conf.5.def b/man/snmp.conf.5.def Sets the path of the \fBsshtosnmp\fR socket created by an application (e.g. snmpd) listening for incoming ssh connections through the diff -urNp a/man/snmpd.examples.5.def b/man/snmpd.examples.5.def ---- a/man/snmpd.examples.5.def 2021-05-26 09:30:07.429789994 +0200 -+++ b/man/snmpd.examples.5.def 2021-05-26 09:41:29.170761436 +0200 +--- a/man/snmpd.examples.5.def 2026-01-12 12:42:08.016788741 +0100 ++++ b/man/snmpd.examples.5.def 2026-01-12 12:48:02.264211991 +0100 @@ -87,8 +87,8 @@ the same authentication and encryption s .RS .nf @@ -85,8 +85,8 @@ diff -urNp a/man/snmpd.examples.5.def b/man/snmpd.examples.5.def .RE Note that this defines three \fIdistinct\fR users, who could be granted diff -urNp a/man/snmptrapd.conf.5.def b/man/snmptrapd.conf.5.def ---- a/man/snmptrapd.conf.5.def 2021-05-26 09:30:07.428789985 +0200 -+++ b/man/snmptrapd.conf.5.def 2021-05-26 09:42:02.963064029 +0200 +--- a/man/snmptrapd.conf.5.def 2026-01-12 12:42:08.018134877 +0100 ++++ b/man/snmptrapd.conf.5.def 2026-01-12 12:48:43.264773008 +0100 @@ -117,7 +117,7 @@ to trigger the types of processing liste See .IR snmpd.conf (5) @@ -97,8 +97,8 @@ diff -urNp a/man/snmptrapd.conf.5.def b/man/snmptrapd.conf.5.def .IR snmpd.conf (5) manual page for a description of how to create SNMPv3 users. This diff -urNp a/man/snmpusm.1.def b/man/snmpusm.1.def ---- a/man/snmpusm.1.def 2021-05-26 09:30:07.430790003 +0200 -+++ b/man/snmpusm.1.def 2021-05-26 09:42:24.178253990 +0200 +--- a/man/snmpusm.1.def 2026-01-12 12:42:08.018134877 +0100 ++++ b/man/snmpusm.1.def 2026-01-12 12:49:26.488017367 +0100 @@ -216,7 +216,7 @@ rwuser initial # lets add the new user we'll create too: rwuser wes @@ -109,9 +109,9 @@ diff -urNp a/man/snmpusm.1.def b/man/snmpusm.1.def .RE .PP diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in ---- a/net-snmp-create-v3-user.in 2021-05-26 09:30:07.369789468 +0200 -+++ b/net-snmp-create-v3-user.in 2021-05-26 09:33:23.966511123 +0200 -@@ -10,7 +10,7 @@ if @PSCMD@ | egrep ' snmpd *$' > /dev/nu +--- a/net-snmp-create-v3-user.in 2026-01-12 12:42:08.102135636 +0100 ++++ b/net-snmp-create-v3-user.in 2026-01-12 12:50:35.760787628 +0100 +@@ -10,7 +10,7 @@ if @PSCMD@ | @EGREP@ ' snmpd *$' > /dev/ fi Aalgorithm="MD5" @@ -138,14 +138,14 @@ diff -urNp a/net-snmp-create-v3-user.in b/net-snmp-create-v3-user.in echo "" echo "Usage:" echo " net-snmp-create-v3-user [-ro] [-A authpass] [-X privpass]" -- echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x DES|AES] [username]" -+ echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x AES] [username]" +- echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x DES|AES|AES128] [username]" ++ echo " [-a MD5|SHA|SHA-512|SHA-384|SHA-256|SHA-224] [-x AES|AES128] [username]" echo "" exit fi diff -urNp a/README.snmpv3 b/README.snmpv3 ---- a/README.snmpv3 2021-05-26 09:30:07.352789320 +0200 -+++ b/README.snmpv3 2021-05-26 09:44:49.109551728 +0200 +--- a/README.snmpv3 2026-01-12 12:42:08.021134904 +0100 ++++ b/README.snmpv3 2026-01-12 12:51:58.767903013 +0100 @@ -4,7 +4,7 @@ How to setup SNMPv3, a very brief docume do a better job on since I suck at writing documentation and he doesn't ;-) --Wes: diff --git a/net-snmp-5.9.4-autoconf.patch b/net-snmp-5.9.4-autoconf.patch deleted file mode 100644 index f2b23a9..0000000 --- a/net-snmp-5.9.4-autoconf.patch +++ /dev/null @@ -1,6 +0,0 @@ -diff -urNp a/dist/autoconf-version b/dist/autoconf-version ---- a/dist/autoconf-version 2024-02-16 08:21:36.551729028 +0100 -+++ b/dist/autoconf-version 2024-02-16 08:24:39.035608191 +0100 -@@ -1 +1 @@ --2.71 -+2.72 diff --git a/net-snmp-5.9.4-kernel-6.7.patch b/net-snmp-5.9.4-kernel-6.7.patch deleted file mode 100644 index 089f23b..0000000 --- a/net-snmp-5.9.4-kernel-6.7.patch +++ /dev/null @@ -1,120 +0,0 @@ -From f5ae6baf0018abda9dedc368fe6d52c0d7a8ab8f Mon Sep 17 00:00:00 2001 -From: Philippe Troin -Date: Sat, 3 Feb 2024 10:30:30 -0800 -Subject: [PATCH] Add Linux 6.7 compatibility parsing /proc/net/snmp - -Linux 6.7 adds a new OutTransmits field to Ip in /proc/net/snmp. -This breaks the hard-coded assumptions about the Ip line length. -Add compatibility to parse Linux 6.7 Ip header while keep support -for previous versions. ---- - .../ip-mib/data_access/systemstats_linux.c | 46 +++++++++++++++---- - 1 file changed, 37 insertions(+), 9 deletions(-) - -diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -index 49e0a34d5c..f04e828a94 100644 ---- a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -+++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c -@@ -36,7 +36,7 @@ netsnmp_access_systemstats_arch_init(void) - } - - /* -- /proc/net/snmp -+ /proc/net/snmp - Linux 6.6 and lower - - Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates - Ip: 2 64 7083534 0 0 0 0 0 6860233 6548963 0 0 1 286623 63322 1 259920 0 0 -@@ -49,6 +49,26 @@ netsnmp_access_systemstats_arch_init(void) - - Udp: InDatagrams NoPorts InErrors OutDatagrams - Udp: 1491094 122 0 1466178 -+* -+ /proc/net/snmp - Linux 6.7 and higher -+ -+ Ip: Forwarding DefaultTTL InReceives InHdrErrors InAddrErrors ForwDatagrams InUnknownProtos InDiscards InDelivers OutRequests OutDiscards OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs ReasmFails FragOKs FragFails FragCreates OutTransmits -+ Ip: 1 64 50859058 496 0 37470604 0 0 20472980 7515791 1756 0 0 7264 3632 0 3548 0 7096 44961424 -+ -+ Icmp: InMsgs InErrors InCsumErrors InDestUnreachs InTimeExcds InParmProbs InSrcQuenchs InRedirects InEchos InEchoReps InTimestamps InTimestampReps InAddrMasks InAddrMaskReps OutMsgs OutErrors OutRateLimitGlobal OutRateLimitHost OutDestUnreachs OutTimeExcds OutParmProbs OutSrcQuenchs OutRedirects OutEchos OutEchoReps OutTimestamps OutTimestampReps OutAddrMasks OutAddrMaskReps -+ Icmp: 114447 2655 0 17589 0 0 0 0 66905 29953 0 0 0 0 143956 0 0 572 16610 484 0 0 0 59957 66905 0 0 0 0 -+ -+ IcmpMsg: InType0 InType3 InType8 OutType0 OutType3 OutType8 OutType11 -+ IcmpMsg: 29953 17589 66905 66905 16610 59957 484 -+ -+ Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts InCsumErrors -+ Tcp: 1 200 120000 -1 17744 13525 307 3783 6 18093137 9277788 3499 8 7442 0 -+ -+ Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors -+ Udp: 2257832 1422 0 2252835 0 0 0 84 0 -+ -+ UdpLite: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors IgnoredMulti MemErrors -+ UdpLite: 0 0 0 0 0 0 0 0 0 - */ - - -@@ -101,10 +121,10 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - FILE *devin; - char line[1024]; - netsnmp_systemstats_entry *entry = NULL; -- int scan_count; -+ int scan_count, expected_scan_count; - char *stats, *start = line; - int len; -- unsigned long long scan_vals[19]; -+ unsigned long long scan_vals[20]; - - DEBUGMSGTL(("access:systemstats:container:arch", "load v4 (flags %x)\n", - load_flags)); -@@ -126,10 +146,17 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - */ - NETSNMP_IGNORE_RESULT(fgets(line, sizeof(line), devin)); - len = strlen(line); -- if (224 != len) { -+ switch (len) { -+ case 224: -+ expected_scan_count = 19; -+ break; -+ case 237: -+ expected_scan_count = 20; -+ break; -+ default: - fclose(devin); - snmp_log(LOG_ERR, "systemstats_linux: unexpected header length in /proc/net/snmp." -- " %d != 224\n", len); -+ " %d not in { 224, 237 } \n", len); - return -4; - } - -@@ -178,20 +205,20 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - memset(scan_vals, 0x0, sizeof(scan_vals)); - scan_count = sscanf(stats, - "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu" -- "%llu %llu %llu %llu %llu %llu %llu %llu %llu", -+ "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu", - &scan_vals[0],&scan_vals[1],&scan_vals[2], - &scan_vals[3],&scan_vals[4],&scan_vals[5], - &scan_vals[6],&scan_vals[7],&scan_vals[8], - &scan_vals[9],&scan_vals[10],&scan_vals[11], - &scan_vals[12],&scan_vals[13],&scan_vals[14], - &scan_vals[15],&scan_vals[16],&scan_vals[17], -- &scan_vals[18]); -+ &scan_vals[18],&scan_vals[19]); - DEBUGMSGTL(("access:systemstats", " read %d values\n", scan_count)); - -- if(scan_count != 19) { -+ if(scan_count != expected_scan_count) { - snmp_log(LOG_ERR, - "error scanning systemstats data (expected %d, got %d)\n", -- 19, scan_count); -+ expected_scan_count, scan_count); - netsnmp_access_systemstats_entry_free(entry); - return -4; - } -@@ -223,6 +250,7 @@ _systemstats_v4(netsnmp_container* container, u_int load_flags) - entry->stats.HCOutFragFails.high = scan_vals[17] >> 32; - entry->stats.HCOutFragCreates.low = scan_vals[18] & 0xffffffff; - entry->stats.HCOutFragCreates.high = scan_vals[18] >> 32; -+ /* entry->stats. = scan_vals[19]; / * OutTransmits */ - - entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINRECEIVES] = 1; - entry->stats.columnAvail[IPSYSTEMSTATSTABLE_INHDRERRORS] = 1; - diff --git a/net-snmp-5.9.4-revert-n-snmptrapd-log.patch b/net-snmp-5.9.4-revert-n-snmptrapd-log.patch index e49d571..981097b 100644 --- a/net-snmp-5.9.4-revert-n-snmptrapd-log.patch +++ b/net-snmp-5.9.4-revert-n-snmptrapd-log.patch @@ -1,7 +1,8 @@ -diff -urNp a/apps/snmptrapd_log.c b/apps/snmptrapd_log.c ---- a/apps/snmptrapd_log.c 2025-09-03 15:15:12.510914175 +0200 -+++ b/apps/snmptrapd_log.c 2025-09-03 15:15:40.804731480 +0200 -@@ -590,7 +590,7 @@ realloc_handle_time_fmt(u_char ** buf, s +diff --git a/apps/snmptrapd_log.c b/apps/snmptrapd_log.c +index 067c7f6..e6f0f1e 100644 +--- a/apps/snmptrapd_log.c ++++ b/apps/snmptrapd_log.c +@@ -596,7 +596,7 @@ realloc_handle_time_fmt(u_char ** buf, size_t * buf_len, size_t * out_len, static void convert_agent_addr(struct in_addr agent_addr, char *name, size_t size) { diff --git a/net-snmp-5.9.4-tls.patch b/net-snmp-5.9.4-tls.patch index 2f7d16c..1f46abb 100644 --- a/net-snmp-5.9.4-tls.patch +++ b/net-snmp-5.9.4-tls.patch @@ -1,6 +1,7 @@ -diff -urNp a/include/net-snmp/library/default_store.h b/include/net-snmp/library/default_store.h ---- a/include/net-snmp/library/default_store.h 2025-09-01 10:02:06.355543487 +0200 -+++ b/include/net-snmp/library/default_store.h 2025-09-01 10:06:35.524663762 +0200 +diff --git a/include/net-snmp/library/default_store.h b/include/net-snmp/library/default_store.h +index 1b1978e..dd590be 100644 +--- a/include/net-snmp/library/default_store.h ++++ b/include/net-snmp/library/default_store.h @@ -183,6 +183,8 @@ extern "C" { #define NETSNMP_DS_LIB_SSH_PUBKEY 33 #define NETSNMP_DS_LIB_SSH_PRIVKEY 34 @@ -10,9 +11,10 @@ diff -urNp a/include/net-snmp/library/default_store.h b/include/net-snmp/library #define NETSNMP_DS_LIB_MAX_STR_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */ /* -diff -urNp a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def ---- a/man/snmpd.conf.5.def 2025-09-01 10:02:06.417543463 +0200 -+++ b/man/snmpd.conf.5.def 2025-09-01 10:07:03.717037472 +0200 +diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def +index 0a8b9fa..d9641cc 100644 +--- a/man/snmpd.conf.5.def ++++ b/man/snmpd.conf.5.def @@ -203,6 +203,12 @@ HIGH:!AES128\-SHA .RE .IP @@ -26,10 +28,11 @@ diff -urNp a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def .IP "[snmp] x509CRLFile" If you are using a Certificate Authority (CA) that publishes a Certificate Revocation List (CRL) then this token can be used to -diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c ---- a/snmplib/transports/snmpTLSBaseDomain.c 2025-09-01 10:02:06.457543447 +0200 -+++ b/snmplib/transports/snmpTLSBaseDomain.c 2025-09-01 10:10:02.796751304 +0200 -@@ -479,6 +479,9 @@ SSL_CTX * +diff --git a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLSBaseDomain.c +index e301de4..7ae2db7 100644 +--- a/snmplib/transports/snmpTLSBaseDomain.c ++++ b/snmplib/transports/snmpTLSBaseDomain.c +@@ -490,6 +490,9 @@ SSL_CTX * _sslctx_common_setup(SSL_CTX *the_ctx, _netsnmpTLSBaseData *tlsbase) { char *crlFile; char *cipherList; @@ -39,7 +42,7 @@ diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLS X509_LOOKUP *lookup; X509_STORE *cert_store = NULL; -@@ -502,6 +505,63 @@ _sslctx_common_setup(SSL_CTX *the_ctx, _ +@@ -513,6 +516,63 @@ _sslctx_common_setup(SSL_CTX *the_ctx, _netsnmpTLSBaseData *tlsbase) { X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); } @@ -103,7 +106,7 @@ diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLS cipherList = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_TLS_ALGORITMS); if (NULL != cipherList) { -@@ -803,6 +863,15 @@ netsnmp_tlsbase_ctor(void) { +@@ -858,6 +918,15 @@ netsnmp_tlsbase_ctor(void) { NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_TLS_ALGORITMS); @@ -119,27 +122,28 @@ diff -urNp a/snmplib/transports/snmpTLSBaseDomain.c b/snmplib/transports/snmpTLS /* * for the client */ -diff -urNp a/snmplib/transports/snmpTLSTCPDomain.c b/snmplib/transports/snmpTLSTCPDomain.c ---- a/snmplib/transports/snmpTLSTCPDomain.c 2025-09-01 10:02:06.460543446 +0200 -+++ b/snmplib/transports/snmpTLSTCPDomain.c 2025-09-01 10:10:46.100597968 +0200 -@@ -718,10 +718,6 @@ netsnmp_tlstcp_open_client(netsnmp_trans +diff --git a/snmplib/transports/snmpTLSTCPDomain.c b/snmplib/transports/snmpTLSTCPDomain.c +index 0ddf023..e0133f9 100644 +--- a/snmplib/transports/snmpTLSTCPDomain.c ++++ b/snmplib/transports/snmpTLSTCPDomain.c +@@ -718,10 +718,6 @@ netsnmp_tlstcp_open_client(netsnmp_transport *t) return NULL; } -#ifdef SSL_CTX_set_max_proto_version -- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, TLS1_VERSION); +- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, 0); -#endif - /* RFC5953 Section 5.3.1: Establishing a Session as a Client 3) Using the destTransportDomain and destTransportAddress values, the client will initiate the (D)TLS handshake protocol to -@@ -917,10 +913,6 @@ netsnmp_tlstcp_open_server(netsnmp_trans +@@ -917,10 +913,6 @@ netsnmp_tlstcp_open_server(netsnmp_transport *t) /* create the OpenSSL TLS context */ tlsdata->ssl_context = sslctx_server_setup(TLS_method()); -#ifdef SSL_CTX_set_max_proto_version - if (tlsdata->ssl_context) -- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, TLS1_VERSION); +- SSL_CTX_set_max_proto_version(tlsdata->ssl_context, 0); -#endif t->sock = BIO_get_fd(tlsdata->accept_bio, NULL); diff --git a/net-snmp.spec b/net-snmp.spec index 0a2d162..8819570 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -5,12 +5,12 @@ %global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 aarch64 # actual soname version -%global soname 40 +%global soname 45 Summary: A collection of SNMP protocol tools and libraries Name: net-snmp -Version: 5.9.4 -Release: 18%{?dist} +Version: 5.9.5.2 +Release: 1%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -36,22 +36,16 @@ Patch6: net-snmp-5.9-cflags.patch Patch7: net-snmp-5.8-Remove-U64-typedef.patch Patch8: net-snmp-5.7.3-iterator-fix.patch Patch9: net-snmp-5.9-autofs-skip.patch -Patch10: net-snmp-5.9-coverity.patch Patch11: net-snmp-5.8-expand-SNMPCONFPATH.patch Patch12: net-snmp-5.8-duplicate-ipAddress.patch Patch13: net-snmp-5.9-memory-reporting.patch -Patch14: net-snmp-5.8-man-page.patch Patch15: net-snmp-5.8-ipAddress-faster-load.patch -Patch16: net-snmp-5.8-rpm-memory-leak.patch Patch17: net-snmp-5.9-aes-config.patch Patch18: net-snmp-5.8-clientaddr-error-message.patch Patch19: net-snmp-5.9-intermediate-certs.patch Patch20: net-snmp-5.9.1-remove-des.patch Patch21: net-snmp-libs-misunderstanding.patch Patch22: net-snmp-5.9-ipv6-disable-leak.patch -Patch23: net-snmp-5.9-rpmdb.patch -Patch24: net-snmp-5.9.4-autoconf.patch -Patch25: net-snmp-5.9.4-kernel-6.7.patch Patch26: net-snmp-5.9.4-tls.patch Patch27: net-snmp-5.9.4-revert-n-snmptrapd-log.patch @@ -80,6 +74,7 @@ BuildRequires: perl-devel, perl(ExtUtils::Embed), procps BuildRequires: python3-devel, python3-setuptools BuildRequires: chrpath BuildRequires: mariadb-connector-c-devel +BuildRequires: libnl3-devel # for netstat, needed by 'make test' BuildRequires: net-tools # for make test @@ -233,22 +228,16 @@ cp %{SOURCE10} . %patch 7 -p1 -b .u64-remove %patch 8 -p1 -b .iterator-fix %patch 9 -p1 -b .autofs-skip -%patch 10 -p1 -b .coverity %patch 11 -p1 -b .expand-SNMPCONFPATH %patch 12 -p1 -b .duplicate-ipAddress %patch 13 -p1 -b .memory-reporting -%patch 14 -p1 -b .man-page %patch 15 -p1 -b .ipAddress-faster-load -%patch 16 -p1 -b .rpm-memory-leak %patch 17 -p1 -b .aes-config %patch 18 -p1 -b .clientaddr-error-message %patch 19 -p1 -b .intermediate-certs %patch 20 -p1 -b .remove-des %patch 21 -p1 %patch 22 -p1 -b .ipv6-disable-leak -%patch 23 -p1 -b .rpmdbpatch -%patch 24 -p1 -%patch 25 -p1 -b .kernel-6.7 %patch 26 -p1 -b .tls %patch 27 -p1 -b .revert-n-snmptrapd-log @@ -525,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jan 12 2026 Josef Ridky - 1:5.9.5.2-1 +- New upstream release 5.9.5.2 + * Mon Oct 13 2025 Josef Ridky - 1:5.9.4-18 - Enable PQC in net-snmp - Fix inverted use of -n in snmptrapd_log.c diff --git a/sources b/sources index 0d272db..fb75aae 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (net-snmp-5.9.4.tar.gz) = a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423 +SHA512 (net-snmp-5.9.5.2.tar.gz) = c320c90e01377651fdff3aa9c373b9013f142fab23810d821174e546716ef2fa6499a805728710c67ca7fe238679111df392754c24ea4e01768faa5535ac7db2 From f3f833915418b59f46de3074c841188c5cb61875 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Sun, 16 Nov 2025 18:32:41 -0500 Subject: [PATCH 72/81] Enable lm_sensors on all arches Once upon a time lm_sensors was only only supported on some arches, but nowadays all are enabled, so do the same here. --- net-snmp.spec | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index 8819570..59fb339 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -89,9 +89,7 @@ BuildRequires: perl(strict) BuildRequires: perl(TAP::Harness) BuildRequires: perl(vars) BuildRequires: perl(warnings) -%ifnarch s390 s390x ppc64le BuildRequires: lm_sensors-devel >= 3 -%endif BuildRequires: autoconf, automake %description @@ -124,9 +122,7 @@ Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel Requires: redhat-rpm-config -%ifnarch s390 s390x ppc64le Requires: lm_sensors-devel -%endif # pull perl development libraries, net-snmp agent libraries may link to them Requires: perl-devel%{?_isa} @@ -261,12 +257,7 @@ MIBS="host agentx smux \ ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \ ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \ ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ - sctp-mib rmon-mib etherlike-mib" - -%ifnarch s390 s390x ppc64le -# there are no lm_sensors on s390 -MIBS="$MIBS ucd-snmp/lmsensorsMib" -%endif + sctp-mib rmon-mib etherlike-mib ucd-snmp/lmsensorsMib" %configure \ --disable-static --enable-shared \ @@ -514,6 +505,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Mon Jan 12 2026 Yaakov Selkowitz - 1:5.9.5.2-2 +- Enable lm_sensors on all arches + * Mon Jan 12 2026 Josef Ridky - 1:5.9.5.2-1 - New upstream release 5.9.5.2 From 7f7d58eaf7cec3ce8e2a91e9b71fa2a933b4420e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 16 Jan 2026 22:01:09 +0000 Subject: [PATCH 73/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 59fb339..880cb40 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -505,6 +505,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jan 16 2026 Fedora Release Engineering - 1:5.9.5.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Mon Jan 12 2026 Yaakov Selkowitz - 1:5.9.5.2-2 - Enable lm_sensors on all arches From 40d9093621bf82fe66cb386f612ffbbef43f42fd Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Thu, 29 Jan 2026 12:43:41 -0500 Subject: [PATCH 74/81] Add net-snmp-devel dependency on libnl3-devel With the addition of the libnl3 build dependency in 5.9.5.2, its link flags also show up in net-snmp-config --agent-libs. --- net-snmp.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 880cb40..e5e32ac 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -122,6 +122,7 @@ Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel Requires: redhat-rpm-config +Requires: libnl3-devel Requires: lm_sensors-devel # pull perl development libraries, net-snmp agent libraries may link to them Requires: perl-devel%{?_isa} @@ -505,6 +506,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jan 29 2026 Yaakov Selkowitz - 1:5.9.5.2-4 +- Add net-snmp-devel dependency on libnl3-devel + * Fri Jan 16 2026 Fedora Release Engineering - 1:5.9.5.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From 0d287ccdd2dc7051949e2ebf775f67a937723fb6 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 3 Jun 2026 17:44:08 +0200 Subject: [PATCH 75/81] Rebuilt for Python 3.15 --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index e5e32ac..2291398 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -506,6 +506,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Jun 03 2026 Python Maint - 1:5.9.5.2-5 +- Rebuilt for Python 3.15 + * Thu Jan 29 2026 Yaakov Selkowitz - 1:5.9.5.2-4 - Add net-snmp-devel dependency on libnl3-devel From f11e93ce096c2be03cb441869235cabd74fdcaeb Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 8 Jun 2026 12:39:06 -0400 Subject: [PATCH 76/81] Fix "Checking the Net-SNMP configure script validity" test Autoreconf is run during build, which may be a different version than upstream used, resulting in a mismatch that causes this test to fail. --- net-snmp.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net-snmp.spec b/net-snmp.spec index 2291398..f65b878 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -90,7 +90,7 @@ BuildRequires: perl(TAP::Harness) BuildRequires: perl(vars) BuildRequires: perl(warnings) BuildRequires: lm_sensors-devel >= 3 -BuildRequires: autoconf, automake +BuildRequires: autoconf, automake, libtool %description SNMP (Simple Network Management Protocol) is a protocol used for @@ -247,10 +247,14 @@ cp %{SOURCE10} . # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* +# Autoreconf is run during build, which may be a different version than upstream used, +# resulting in a mismatch during "Checking the Net-SNMP configure script validity" test +autoconf --version | awk 'NR==1 {print $4}' > dist/autoconf-version + %build # Autoreconf to get autoconf 2.69 for ARM (#926223) -autoreconf +autoreconf -fiv MIBS="host agentx smux \ ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ From 7043b422273f27ce2c43719ddcf09d6c8191d75c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 12 Jun 2026 11:10:49 -0400 Subject: [PATCH 77/81] Openssl 4 build fixes Signed-off-by: Simo Sorce --- ...OpenSSL-accessors-for-opaque-structs.patch | 177 ++++++++++++++++++ net-snmp.spec | 9 +- 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 0001-Use-OpenSSL-accessors-for-opaque-structs.patch diff --git a/0001-Use-OpenSSL-accessors-for-opaque-structs.patch b/0001-Use-OpenSSL-accessors-for-opaque-structs.patch new file mode 100644 index 0000000..fa1b973 --- /dev/null +++ b/0001-Use-OpenSSL-accessors-for-opaque-structs.patch @@ -0,0 +1,177 @@ +From 338d289f1e14650edf0bd7e960272871029131e1 Mon Sep 17 00:00:00 2001 +From: Simo Sorce +Date: Fri, 17 Apr 2026 12:47:18 -0400 +Subject: [PATCH] Use OpenSSL accessors for opaque structs + +Replaced direct access to `ASN1_STRING` fields with OpenSSL accessor functions +(e.g., `ASN1_STRING_type`, `ASN1_STRING_length`, `ASN1_STRING_get0_data`) and +updated `X509_NAME` and `X509_EXTENSION` pointers to `const`. This is required +to maintain compatibility with newer OpenSSL versions (4.0+) where these +structures were made opaque. + +Co-authored-by: Gemini +Signed-off-by: Simo Sorce +--- + snmplib/snmp_openssl.c | 74 ++++++++++++++++++++++-------------------- + 1 file changed, 39 insertions(+), 35 deletions(-) + +diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c +index 4471a7a..658841a 100644 +--- a/snmplib/snmp_openssl.c ++++ b/snmplib/snmp_openssl.c +@@ -147,7 +147,7 @@ void netsnmp_init_openssl(void) { + static char * + _cert_get_name(X509 *ocert, int which, char **buf, int *len, int flags) + { +- X509_NAME *osubj_name; ++ const X509_NAME *osubj_name; + int space; + char *buf_ptr; + +@@ -187,7 +187,7 @@ _cert_get_name(X509 *ocert, int which, char **buf, int *len, int flags) + char * + netsnmp_openssl_cert_get_subjectName(X509 *ocert, char **buf, int *len) + { +- X509_NAME *osubj_name; ++ const X509_NAME *osubj_name; + int space; + char *buf_ptr; + +@@ -233,11 +233,11 @@ netsnmp_openssl_cert_get_commonName(X509 *ocert, char **buf, int *len) + void + netsnmp_openssl_cert_dump_names(X509 *ocert) + { +- int i, onid; +- X509_NAME_ENTRY *oname_entry; +- ASN1_STRING *oname_value; +- X509_NAME *osubj_name; +- const char *prefix_short, *prefix_long; ++ int i, onid; ++ const X509_NAME_ENTRY *oname_entry; ++ const ASN1_STRING *oname_value; ++ const X509_NAME *osubj_name; ++ const char *prefix_short, *prefix_long; + + if (NULL == ocert) + return; +@@ -253,7 +253,7 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) + netsnmp_assert(NULL != oname_entry); + oname_value = X509_NAME_ENTRY_get_data(oname_entry); + +- if (oname_value->type != V_ASN1_PRINTABLESTRING) ++ if (ASN1_STRING_type(oname_value) != V_ASN1_PRINTABLESTRING) + continue; + + /** get NID */ +@@ -268,7 +268,7 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) + + DEBUGMSGT(("9:cert:dump:names", + "[%02d] NID type %d, ASN type %d\n", i, onid, +- oname_value->type)); ++ ASN1_STRING_type(oname_value))); + DEBUGMSGT(("9:cert:dump:names", "%s/%s: '%s'\n", prefix_long, + prefix_short, ASN1_STRING_get0_data(oname_value))); + } +@@ -276,7 +276,7 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) + #endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */ + + static char * +-_cert_get_extension(X509_EXTENSION *oext, char **buf, int *len, int flags) ++_cert_get_extension(const X509_EXTENSION *oext, char **buf, int *len, int flags) + { + int space; + char *buf_ptr = NULL; +@@ -327,10 +327,10 @@ out: + */ + /** instead of exposing this function, make helper functions for each + * field, like netsnmp_openssl_cert_get_subjectAltName, below */ +-X509_EXTENSION * ++const X509_EXTENSION * + _cert_get_extension_at(X509 *ocert, int pos, char **buf, int *len, int flags) + { +- X509_EXTENSION *oext; ++ const X509_EXTENSION *oext; + + if ((NULL == ocert) || ((buf && !len) || (len && !buf))) + return NULL; +@@ -354,7 +354,7 @@ static char * + _cert_get_extension_str_at(X509 *ocert, int pos, char **buf, int *len, + int flags) + { +- X509_EXTENSION *oext; ++ const X509_EXTENSION *oext; + + if ((NULL == ocert) || ((buf && !len) || (len && !buf))) + return NULL; +@@ -374,7 +374,7 @@ _cert_get_extension_str_at(X509 *ocert, int pos, char **buf, int *len, + */ + /** instead of exposing this function, make helper functions for each + * field, like netsnmp_openssl_cert_get_subjectAltName, below */ +-X509_EXTENSION * ++const X509_EXTENSION * + _cert_get_extension_id(X509 *ocert, int which, char **buf, int *len, int flags) + { + int pos; +@@ -434,27 +434,31 @@ _extract_oname(const GENERAL_NAME *oname) + break; + + case GEN_IPADD: +- if (oname->d.iPAddress->length == 4) { +- sprintf(ipbuf, "%d.%d.%d.%d", oname->d.iPAddress->data[0], +- oname->d.iPAddress->data[1], +- oname->d.iPAddress->data[2], +- oname->d.iPAddress->data[3]); +- rtn = strdup(ipbuf); +- } +- else if ((oname->d.iPAddress->length == 16) || +- (oname->d.iPAddress->length == 20)) { +- char *pos = ipbuf; +- int j; +- for(j = 0; j < oname->d.iPAddress->length; ++j) { +- *pos++ = VAL2HEX(oname->d.iPAddress->data[j]); +- *pos++ = ':'; ++ { ++ int ipaddr_len = ASN1_STRING_length(oname->d.iPAddress); ++ const unsigned char *ipaddr_data = ASN1_STRING_get0_data(oname->d.iPAddress); ++ if (ipaddr_len == 4) { ++ sprintf(ipbuf, "%d.%d.%d.%d", ipaddr_data[0], ++ ipaddr_data[1], ++ ipaddr_data[2], ++ ipaddr_data[3]); ++ rtn = strdup(ipbuf); ++ } ++ else if ((ipaddr_len == 16) || ++ (ipaddr_len == 20)) { ++ char *pos = ipbuf; ++ int j; ++ for(j = 0; j < ipaddr_len; ++j) { ++ *pos++ = VAL2HEX(ipaddr_data[j]); ++ *pos++ = ':'; ++ } ++ *pos = '\0'; ++ rtn = strdup(ipbuf); + } +- *pos = '\0'; +- rtn = strdup(ipbuf); ++ else ++ NETSNMP_LOGONCE((LOG_WARNING, "unexpected ip addr length %d\n", ++ ipaddr_len)); + } +- else +- NETSNMP_LOGONCE((LOG_WARNING, "unexpected ip addr length %d\n", +- oname->d.iPAddress->length)); + + break; + default: +@@ -485,7 +489,7 @@ netsnmp_openssl_cert_get_subjectAltNames(X509 *ocert, char **buf, int *len) + void + netsnmp_openssl_cert_dump_extensions(X509 *ocert) + { +- X509_EXTENSION *extension; ++ const X509_EXTENSION *extension; + const char *extension_name; + char buf[SNMP_MAXBUF], *buf_ptr = buf, *str, *lf; + int i, num_extensions, buf_len, nid; +-- +2.53.0 + diff --git a/net-snmp.spec b/net-snmp.spec index f65b878..adfab89 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -58,6 +58,9 @@ Patch102: net-snmp-5.9-python3.patch # make Mail::Sender optional Patch103: net-snmp-5.9-mail-sender.patch +# Openssl 4 build fixes +Patch104: 0001-Use-OpenSSL-accessors-for-opaque-structs.patch + Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: %{name}-agent-libs%{?_isa} = %{epoch}:%{version}-%{release} # This is actually needed for the %%triggerun script but Requires(triggerun) @@ -243,6 +246,7 @@ cp %{SOURCE10} . %if 0%{?rhel} %patch 103 -p1 %endif +%patch 104 -p1 # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 rm testing/fulltests/default/T200* @@ -510,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jun 12 2026 Simo Sorce - 1:5.9.5.2-6 +- Openssl 4 and autoconf build fixes + * Wed Jun 03 2026 Python Maint - 1:5.9.5.2-5 - Rebuilt for Python 3.15 From 7f44925712cf462a418b73be15c79e833c1349a7 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 16 Jul 2026 09:28:09 +0000 Subject: [PATCH 78/81] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index adfab89..492fd44 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -514,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 16 2026 Fedora Release Engineering - 1:5.9.5.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Fri Jun 12 2026 Simo Sorce - 1:5.9.5.2-6 - Openssl 4 and autoconf build fixes From baccc928a0a934cedc2e898fd071d1bb8fc0cf71 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 22 Jul 2026 10:56:03 +0200 Subject: [PATCH 79/81] Rebuilt for Python 3.15.0b4 ABI change --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 492fd44..42b41f1 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -514,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Wed Jul 22 2026 Python Maint - 1:5.9.5.2-8 +- Rebuilt for Python 3.15.0b4 ABI change + * Thu Jul 16 2026 Fedora Release Engineering - 1:5.9.5.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From 649594e0a8fdae546da4cb53e2893d1bc4c3a34c Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Thu, 23 Jul 2026 17:39:50 +0200 Subject: [PATCH 80/81] Perl 5.44 rebuild --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 42b41f1..4b86b72 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -514,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Thu Jul 23 2026 Jitka Plesnikova - 1:5.9.5.2-9 +- Perl 5.44 rebuild + * Wed Jul 22 2026 Python Maint - 1:5.9.5.2-8 - Rebuilt for Python 3.15.0b4 ABI change From 28e611c95877f50f1bd9adc9bc5513f544261966 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 24 Jul 2026 12:56:28 +0200 Subject: [PATCH 81/81] Rebuilt for Python 3.15.0b4 ABI change --- net-snmp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net-snmp.spec b/net-snmp.spec index 4b86b72..c762558 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -10,7 +10,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.9.5.2 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 License: MIT-CMU AND BSD-3-Clause AND MIT @@ -514,6 +514,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %{_libdir}/libnetsnmptrapd*.so.%{soname}* %changelog +* Fri Jul 24 2026 Python Maint - 1:5.9.5.2-10 +- Rebuilt for Python 3.15.0b4 ABI change + * Thu Jul 23 2026 Jitka Plesnikova - 1:5.9.5.2-9 - Perl 5.44 rebuild