Control: tags -1 + fixed-upstream Control: forwarded -1 https://sourceforge.net/p/net-snmp/code/ci/cb268b66ee49a123ee
Hello! This issue has been fixed upstream in the above linked commit. The patch applies (with a bit offset) against the currently packaged version. Patch also attached for your convenience. Regards, Andreas Henriksson
>From cb268b66ee49a123ee36db18c1f4cdcf7bce477c Mon Sep 17 00:00:00 2001 From: Niels Baggesen <n...@users.sourceforge.net> Date: Wed, 27 Apr 2016 20:36:32 +0200 Subject: [PATCH] Detect if mysql has my_load_defaults, and use it if so. Required for MySQL 5.7 on Ubuntu 16.04. --- apps/snmptrapd_sql.c | 4 ++++ configure | 27 +++++++++++++++++++++++++++ configure.d/config_os_libs2 | 10 ++++++++++ include/net-snmp/net-snmp-config.h.in | 3 +++ 4 files changed, 44 insertions(+) diff --git a/apps/snmptrapd_sql.c b/apps/snmptrapd_sql.c index 8b10e88..90e9fdb 100644 --- a/apps/snmptrapd_sql.c +++ b/apps/snmptrapd_sql.c @@ -445,7 +445,11 @@ netsnmp_mysql_init(void) #endif /** load .my.cnf values */ +#if HAVE_MY_LOAD_DEFAULTS + my_load_defaults ("my", _sql.groups, ¬_argc, ¬_argv, 0); +#else load_defaults ("my", _sql.groups, ¬_argc, ¬_argv); +#endif for(i=0; i < not_argc; ++i) { if (NULL == not_argv[i]) continue; diff --git a/configure b/configure index 95e6ea2..1a71bd9 100755 --- a/configure +++ b/configure @@ -24114,6 +24114,33 @@ $as_echo "#define HAVE_BROKEN_LIBMYSQLCLIENT 1" >>confdefs.h fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether my_load_defaults() exists" >&5 +$as_echo_n "checking whether my_load_defaults() exists... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <my_global.h> + #include <my_sys.h> +int +main () +{ +my_load_defaults("my_init_test") + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_MY_LOAD_DEFAULTS 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CPPFLAGS="${_cppflags}" LIBS="${_libs}" diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 index 10bd414..6b8a103 100644 --- a/configure.d/config_os_libs2 +++ b/configure.d/config_os_libs2 @@ -511,6 +511,16 @@ if test "x$with_mysql" = "xyes" ; then [AC_MSG_RESULT(no) AC_DEFINE([HAVE_BROKEN_LIBMYSQLCLIENT], 1, [Define if using MY_INIT() causes a linker error])]) + AC_MSG_CHECKING([whether my_load_defaults() exists]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM( + [[#include <my_global.h> + #include <my_sys.h>]], + [[my_load_defaults("my_init_test")]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_MY_LOAD_DEFAULTS], 1, + [Define if having my_load_defaults])], + [AC_MSG_RESULT(no)]) CPPFLAGS="${_cppflags}" LIBS="${_libs}" AC_MSG_CACHE_ADD(MYSQL Trap Logging: enabled) diff --git a/include/net-snmp/net-snmp-config.h.in b/include/net-snmp/net-snmp-config.h.in index eec0dff..24ef5c6 100644 --- a/include/net-snmp/net-snmp-config.h.in +++ b/include/net-snmp/net-snmp-config.h.in @@ -464,6 +464,9 @@ /* Define to 1 if you have the <mtab.h> header file. */ #undef HAVE_MTAB_H +/* Define if having my_load_defaults */ +#undef HAVE_MY_LOAD_DEFAULTS + /* Define to 1 if you have the <nbutil.h> header file. */ #undef HAVE_NBUTIL_H -- 2.10.2