From cd6759e4f3a2c6dd8d2dd0d8884f20d02f662164 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 19 Jul 2017 11:03:20 -0700 Subject: [PATCH] Fix build with MariaDB 10.2 (#1470642) --- net-snmp-5.7.3-mariadb102.patch | 38 +++++++++++++++++++++++++++++++++ net-snmp.spec | 11 +++++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.7.3-mariadb102.patch diff --git a/net-snmp-5.7.3-mariadb102.patch b/net-snmp-5.7.3-mariadb102.patch new file mode 100644 index 0000000..8867cad --- /dev/null +++ b/net-snmp-5.7.3-mariadb102.patch @@ -0,0 +1,38 @@ +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.spec b/net-snmp.spec index 9a27396..564536b 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -11,7 +11,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.7.3 -Release: 17%{?dist} +Release: 18%{?dist} Epoch: 1 License: BSD @@ -51,6 +51,11 @@ Patch14: net-snmp-5.7.3-Remove-U64-typedef.patch Patch15: net-snmp-5.7.3-Fix-Makefile-PL.patch # Use strtok_r for strtok to avoid a race condition Patch16: net-snmp-5.7.3-strtok-r.patch +# Fix build with MariaDB 10.2 +# https://sourceforge.net/p/net-snmp/bugs/2782/ +# Josef's patch from https://sourceforge.net/p/net-snmp/bugs/2782/#cbed +# but with the config_os_libs2 portion removed +Patch17: net-snmp-5.7.3-mariadb102.patch # This patch fix issue with new OpenSLL library in rawhide (f26+) # !!!WARNING!!! DO NOT USE IT FOR OLDER FEDORA RELEASES (>f26) @@ -228,6 +233,7 @@ cp %{SOURCE12} . %patch14 -p1 -b .U64 %patch15 -p1 -b .make %patch16 -p1 -b .strtok-r +%patch17 -p1 %patch100 -p1 -b .openssl %ifarch sparc64 s390 s390x @@ -536,6 +542,9 @@ rm -rf ${RPM_BUILD_ROOT} %endif %changelog +* Wed Jul 19 2017 Adam Williamson - 1:5.7.3-18 +- Fix build with MariaDB 10.2 + * Thu Jul 13 2017 Petr Pisar - 1:5.7.3-17 - perl dependency renamed to perl-interpreter