diff --git a/net-snmp-5.7.3-iterator-fix.patch b/net-snmp-5.7.3-iterator-fix.patch new file mode 100644 index 0000000..fb34caf --- /dev/null +++ b/net-snmp-5.7.3-iterator-fix.patch @@ -0,0 +1,14 @@ +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 + return 0; /* or -1 */ + + it = CONTAINER_ITERATOR( swrun_container ); ++ if((entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it )) != NULL) { ++ if (0 == strcmp( entry->hrSWRunName, name )) ++ i++; ++ } + while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) { + if (0 == strcmp( entry->hrSWRunName, name )) + i++; diff --git a/net-snmp.spec b/net-snmp.spec index dbfbe77..b333784 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -60,6 +60,7 @@ Patch18: 0001-Link-libnetsnmptrapd-against-MYSQL_LIBS.patch Patch19: net-snmp-5.7.3-mariadb-connector-c.patch Patch20: net-snmp-5.7.3-strstr.patch +Patch21: net-snmp-5.7.3-iterator-fix.patch # This patch fix issue with new OpenSLL library in rawhide (f26+) # !!!WARNING!!! DO NOT USE IT FOR OLDER FEDORA RELEASES (>f26) @@ -219,6 +220,8 @@ cp %{SOURCE10} . %patch17 -p1 -b .mariadb102 %patch18 -p1 -b .perlfix %patch19 -p1 -b .mariadb-connector-c +%patch20 -p1 -b .strstr +%patch21 -p1 -b .iterator-fix %patch100 -p1 -b .openssl %patch101 -p1 -b .modern-rpm-api @@ -488,6 +491,7 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} make test %changelog * Thu Feb 08 2018 Josef Ridky - 1:5.7.3-33 - Fix strstr() crash when looking for RPM Group tag +- Fix wrong usage of structure iterator * Thu Feb 08 2018 Fedora Release Engineering - 1:5.7.3-32 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild