From 0178f52636696c601a4ed421c645370624731995 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Thu, 7 Mar 2024 14:18:33 +0800 Subject: net-snmp: upgrade 5.9.3 -> 5.9.4 ChangeLog: https://github.com/net-snmp/net-snmp/blob/V5-9-patches/CHANGES * Refresh patches * Drop backport CVE patch * Drop 0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch as the issue has been fixed upstream. * Add a patch to fix build on musl Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- .../recipes-protocols/net-snmp/files/init | 0 ...d-noreturn-attribute-to-netsnmp_pci_error.patch | 32 --- ...rch_path.m4-keep-consistent-between-32bit.patch | 38 --- .../0001-config_os_headers-Error-Fix.patch | 35 --- .../0001-get_pid_from_inode-Include-limit.h.patch | 27 -- ...snmp-add-knob-whether-nlist.h-are-checked.patch | 38 +++ ...tools.c-Don-t-check-for-return-from-EVP_M.patch | 36 --- .../0002-net-snmp-fix-libtool-finish.patch | 36 +++ ...3-testing-add-the-output-format-for-ptest.patch | 37 +++ .../0004-config_os_headers-Error-Fix.patch | 37 +++ .../0004-configure-fix-incorrect-variable.patch | 28 -- ...tools.c-Don-t-check-for-return-from-EVP_M.patch | 37 +++ .../0006-get_pid_from_inode-Include-limit.h.patch | 29 ++ .../0007-configure-fix-incorrect-variable.patch | 30 +++ ...-net-snmp-fix-engineBoots-value-on-SIGHUP.patch | 46 ++++ .../0009-net-snmp-fix-for-disable-des.patch | 32 +++ ...eproducibility-Don-t-check-build-host-for.patch | 34 +++ ...ch_path.m4-keep-consistent-between-32bit-.patch | 40 +++ ...Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch | 43 +++ .../net-snmp/CVE-2022-44792-CVE-2022-44793.patch | 121 --------- .../net-snmp/net-snmp/fix-libtool-finish.patch | 34 --- ...nmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch | 44 --- ...snmp-add-knob-whether-nlist.h-are-checked.patch | 36 --- .../net-snmp/net-snmp-fix-for-disable-des.patch | 30 --- ...p-testing-add-the-output-format-for-ptest.patch | 35 --- .../net-snmp/reproducibility-have-printcap.patch | 32 --- .../recipes-protocols/net-snmp/net-snmp/run-ptest | 0 .../recipes-protocols/net-snmp/net-snmp_5.9.3.bb | 294 -------------------- .../recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 295 +++++++++++++++++++++ 29 files changed, 734 insertions(+), 822 deletions(-) mode change 100755 => 100644 meta-networking/recipes-protocols/net-snmp/files/init delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2022-44792-CVE-2022-44793.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch mode change 100755 => 100644 meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest delete mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.3.bb create mode 100644 meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb diff --git a/meta-networking/recipes-protocols/net-snmp/files/init b/meta-networking/recipes-protocols/net-snmp/files/init old mode 100755 new mode 100644 diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch deleted file mode 100644 index 6fbace75a5..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 5719f40db65a72624a0b0f08e546d12bf823bd1e Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 18 Jan 2023 14:38:44 -0800 -Subject: [PATCH] Add noreturn attribute to netsnmp_pci_error() - -Fixes build with clang16 -| mibgroup/if-mib/data_access/interface_linux.c:152:23: error: incompatible function pointer types assigning to 'void (*)(char *, ...) __attribute__((noreturn))' from 'void (char *, ...)' [-Wincompatible-function-pointer-types] -| pci_access->error = netsnmp_pci_error; -| ^ ~~~~~~~~~~~~~~~~~ - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - agent/mibgroup/if-mib/data_access/interface_linux.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c -index c6cc54e..12eb865 100644 ---- a/agent/mibgroup/if-mib/data_access/interface_linux.c -+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c -@@ -31,7 +31,7 @@ static struct pci_access *pci_access; - /* Avoid letting libpci call exit(1) when no PCI bus is available. */ - static int do_longjmp =0; - static jmp_buf err_buf; --static void -+__attribute__((noreturn)) static void - netsnmp_pci_error(char *msg, ...) - { - va_list args; --- -2.39.1 - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch deleted file mode 100644 index 0eeddf752c..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 98c62e24fdd05d7e8bd8149840bad8eb0feb3fb1 Mon Sep 17 00:00:00 2001 -From: Mingli Yu -Date: Fri, 29 Jan 2021 08:49:15 +0000 -Subject: [PATCH] ac_add_search_path.m4: keep consistent between 32bit and - 64bit - -With configure option "--with-openssl=${STAGING_EXECPREFIXDIR}", it behaves -differently between 32bit and 64bit system as the openssl lib resides under -/build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib64 -for 64bit system, but resides under [1] for 32bit system. - -So add the patch to fix the gap between 32bit and 64bit system. - -[1] /build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib - -Upstream-Status: Inappropriate [configuration specific] - -Signed-off-by: Mingli Yu - ---- - m4/ac_add_search_path.m4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4 -index 8e0a819..e9585bc 100644 ---- a/m4/ac_add_search_path.m4 -+++ b/m4/ac_add_search_path.m4 -@@ -3,8 +3,8 @@ dnl Add a search path to the LIBS and CPPFLAGS variables - dnl - AC_DEFUN([AC_ADD_SEARCH_PATH],[ - if test "x$1" != x -a -d $1; then -- if test -d $1/lib; then -- LDFLAGS="-L$1/lib $LDFLAGS" -+ if test -d $1/${libdir:5}; then -+ LDFLAGS="-L$1/${libdir:5} $LDFLAGS" - fi - if test -d $1/include; then - CPPFLAGS="-I$1/include $CPPFLAGS" diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch deleted file mode 100644 index 5aea52788c..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-config_os_headers-Error-Fix.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e86d5fd52f19b85da0b7cce660c6e65ec4c0f9bb Mon Sep 17 00:00:00 2001 -From: Li xin -Date: Fri, 21 Aug 2015 18:23:13 +0900 -Subject: [PATCH] config_os_headers: Error Fix - -ERROR: This autoconf log indicates errors, it looked at host include -and/or library paths while determining system capabilities. -cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories] -conftest.c:168:17: fatal error: pkg.h: No such file or directory - #include - ^ - -Upstream-Status: Pending - -Signed-off-by: Li Xin - ---- - configure.d/config_os_headers | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers -index 01c3376..6edd85f 100644 ---- a/configure.d/config_os_headers -+++ b/configure.d/config_os_headers -@@ -395,8 +395,8 @@ then - unset ac_cv_header_pkg_h - netsnmp_save_CPPFLAGS="$CPPFLAGS" - netsnmp_save_LDFLAGS="$LDFLAGS" -- CPPFLAGS="$CPPFLAGS -I/usr/local/include" -- LDFLAGS="$LDFLAGS -L/usr/local/lib" -+ CPPFLAGS="$CPPFLAGS" -+ LDFLAGS="$LDFLAGS" - AC_CHECK_HEADERS(pkg.h, - NETSNMP_SEARCH_LIBS(pkg_init, pkg, - AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng]))) diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch deleted file mode 100644 index a7881a8713..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-get_pid_from_inode-Include-limit.h.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8097734b27fd146f358a4edd0d1a0d28309bd9a4 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 22 Jul 2016 18:34:39 +0000 -Subject: [PATCH] get_pid_from_inode: Include limit.h - -PATH_MAX and NAME_MAX are required by this file - -Upstream-Status: Pending - -Signed-off-by: Khem Raj - ---- - agent/mibgroup/util_funcs/get_pid_from_inode.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c -index 5788e1d..ea380a6 100644 ---- a/agent/mibgroup/util_funcs/get_pid_from_inode.c -+++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c -@@ -6,6 +6,7 @@ - #include - - #include -+#include - #include - #ifdef HAVE_STDLIB_H - #include diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch new file mode 100644 index 0000000000..ea9dccac28 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch @@ -0,0 +1,38 @@ +From 787269b337e70f073e194c3b361eaf4d5f2291ce Mon Sep 17 00:00:00 2001 +From: Chong Lu +Date: Thu, 28 May 2020 09:46:34 -0500 +Subject: [PATCH] net-snmp: add knob whether nlist.h are checked + +Previously, it still was checked when there was no nlish.h in sysroots directory. +Add knob to decide whether nlist.h are checked or not. + +Upstream-Status: Pending + +Signed-off-by: Chong Lu +--- + configure.d/config_os_headers | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers +index 584064e..c0688f8 100644 +--- a/configure.d/config_os_headers ++++ b/configure.d/config_os_headers +@@ -37,6 +37,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl + [sys/timeb.h ]) + + # Library and Agent: ++if test "x$with_elf" != "xno"; then + AC_CHECK_HEADERS([nlist.h],,,[ + AC_INCLUDES_DEFAULT + [ +@@ -44,6 +45,7 @@ AC_INCLUDES_DEFAULT + #define LIBBSD_DISABLE_DEPRECATED 1 + #endif + ]]) ++fi + + # Library: + AC_CHECK_HEADERS([crt_externs.h ] dnl +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch deleted file mode 100644 index 6450c1cc92..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch +++ /dev/null @@ -1,36 +0,0 @@ -From f4e1acd4f509dd26cf88da872bd5adcf884f4a5f Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Fri, 18 Sep 2015 00:28:45 -0400 -Subject: [PATCH] snmplib/keytools.c: Don't check for return from - - EVP_MD_CTX_init() - -EVP_MD_CTX_init() API returns void, it fixes errors with new compilers - -snmplib/keytools.c: In function 'generate_Ku': error: invalid use of void expression - -Signed-off-by: Khem Raj -Signed-off-by: Ovidiu Panait - ---- -Upstream-Status: Pending - - snmplib/keytools.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/snmplib/keytools.c b/snmplib/keytools.c -index 14a452a..fb1694b 100644 ---- a/snmplib/keytools.c -+++ b/snmplib/keytools.c -@@ -183,10 +183,7 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, - ctx = EVP_MD_CTX_create(); - #else - ctx = malloc(sizeof(*ctx)); -- if (!EVP_MD_CTX_init(ctx)) { -- rval = SNMPERR_GENERR; -- goto generate_Ku_quit; -- } -+ EVP_MD_CTX_init(ctx); - #endif - if (!EVP_DigestInit(ctx, hashfn)) { - rval = SNMPERR_GENERR; diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch new file mode 100644 index 0000000000..e951537b04 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0002-net-snmp-fix-libtool-finish.patch @@ -0,0 +1,36 @@ +From 5f002c3cc46ecf4d4a29571309f2cc0d3d34330f Mon Sep 17 00:00:00 2001 +From: "Roy.Li" +Date: Fri, 16 Jan 2015 14:14:01 +0800 +Subject: [PATCH] net-snmp: fix "libtool --finish" + +LIB_LDCONFIG_CMD failed since it is using a host dir $(libdir) +which is /usr/lib64 does not exist on host when compile 64bit +image. + +In fact, configuring dynamic linker run-time bindings is meaningless +at this step, If it is needed, Poky would write ldconfig scripts to +rpm-postinst for each recipe while do_package, in package.bbclass. + +Upstream-Status: Inappropriate [cross compile specific] + +Signed-off-by: Roy.Li +--- + Makefile.top | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.top b/Makefile.top +index d1b3923..53e0392 100644 +--- a/Makefile.top ++++ b/Makefile.top +@@ -89,7 +89,7 @@ LIBREVISION = 1 + LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) @LD_NO_UNDEFINED@ -o + LIB_EXTENSION = la + LIB_VERSION = +-LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir) ++LIB_LDCONFIG_CMD = echo "do not ldconfig\n" + LINK = $(LIBTOOL) --mode=link $(LINKCC) + # RANLIB = @RANLIB@ + RANLIB = : +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch new file mode 100644 index 0000000000..ab54492934 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0003-testing-add-the-output-format-for-ptest.patch @@ -0,0 +1,37 @@ +From 2a1a2b58af09c6c03026474f1fd0db7d36e977c7 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Wed, 14 Jan 2015 15:10:06 +0800 +Subject: [PATCH] testing: add the output format for ptest + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jackie Huang +--- + testing/RUNTESTS | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/testing/RUNTESTS b/testing/RUNTESTS +index 6715831..a2b6fb8 100755 +--- a/testing/RUNTESTS ++++ b/testing/RUNTESTS +@@ -17,13 +17,17 @@ failed_count=0 + rm -f failed_tests + for i in "${srcdir}"/testing/fulltests/default/T*$1*; do + echo "RUNNING $i" ++ test_name=`basename $i` + ${srcdir}/testing/fulltests/support/simple_run $i + if [ $? = 0 ]; then ++ echo "PASS: $test_name" + success_count=`expr $success_count + 1` + else ++ echo "FAIL: $test_name" + failed_count=`expr $failed_count + 1` + echo "$i" >> failed_tests + fi ++ echo + done + + if [ -f failed_tests ]; then +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch new file mode 100644 index 0000000000..e2269bc3e8 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-config_os_headers-Error-Fix.patch @@ -0,0 +1,37 @@ +From b1c941c20577578aa5ff3450d9d8d7a23c55d14a Mon Sep 17 00:00:00 2001 +From: Li xin +Date: Fri, 21 Aug 2015 18:23:13 +0900 +Subject: [PATCH] config_os_headers: Error Fix + +ERROR: This autoconf log indicates errors, it looked at host include +and/or library paths while determining system capabilities. +cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories] +conftest.c:168:17: fatal error: pkg.h: No such file or directory + #include + ^ + +Upstream-Status: Pending + +Signed-off-by: Li Xin +--- + configure.d/config_os_headers | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers +index c0688f8..f68713c 100644 +--- a/configure.d/config_os_headers ++++ b/configure.d/config_os_headers +@@ -395,8 +395,8 @@ then + unset ac_cv_header_pkg_h + netsnmp_save_CPPFLAGS="$CPPFLAGS" + netsnmp_save_LDFLAGS="$LDFLAGS" +- CPPFLAGS="$CPPFLAGS -I/usr/local/include" +- LDFLAGS="$LDFLAGS -L/usr/local/lib" ++ CPPFLAGS="$CPPFLAGS" ++ LDFLAGS="$LDFLAGS" + AC_CHECK_HEADERS(pkg.h, + NETSNMP_SEARCH_LIBS(pkg_init, pkg, + AC_DEFINE(HAVE_LIBPKG, 1, [define if you have BSD pkg-ng]))) +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch deleted file mode 100644 index 6e224188a4..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/0004-configure-fix-incorrect-variable.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 6d655ba677563ac9d62d4d8eee59fdb39d486c02 Mon Sep 17 00:00:00 2001 -From: Wenlin Kang -Date: Wed, 24 May 2017 17:10:20 +0800 -Subject: [PATCH] configure: fix incorrect variable - -For cross compile platform, this variable will not be correct, so fix it. - -Upstream-Status: Inappropriate [cross compile specific] - -Signed-off-by: Wenlin Kang - ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index f1cbbf5..1545be3 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -173,7 +173,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt - # - # override LD_RUN_PATH to avoid dependencies on the build directory - perlmodules: perlmakefiles subdirs -- @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \ -+ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{installprivlib}/CORE);'`") ; \ - if test $$? != 0 ; then \ - exit 1 ; \ - fi diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch new file mode 100644 index 0000000000..7a6b35460e --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch @@ -0,0 +1,37 @@ +From c790411f9aa82064fea9bbf23b499fb6b7f22c4f Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 18 Sep 2015 00:28:45 -0400 +Subject: [PATCH] snmplib/keytools.c: Don't check for return from + EVP_MD_CTX_init() + +EVP_MD_CTX_init() API returns void, it fixes errors with new compilers + +snmplib/keytools.c: In function 'generate_Ku': error: invalid use of void expression + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +Signed-off-by: Ovidiu Panait +--- + snmplib/keytools.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/snmplib/keytools.c b/snmplib/keytools.c +index 388e655..5a66898 100644 +--- a/snmplib/keytools.c ++++ b/snmplib/keytools.c +@@ -183,10 +183,7 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, + ctx = EVP_MD_CTX_create(); + #else + ctx = malloc(sizeof(*ctx)); +- if (!EVP_MD_CTX_init(ctx)) { +- rval = SNMPERR_GENERR; +- goto generate_Ku_quit; +- } ++ EVP_MD_CTX_init(ctx); + #endif + if (!EVP_DigestInit(ctx, hashfn)) { + rval = SNMPERR_GENERR; +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch new file mode 100644 index 0000000000..6a0161ae27 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0006-get_pid_from_inode-Include-limit.h.patch @@ -0,0 +1,29 @@ +From 95868615a04b4a6f0dd5997c9726422828426116 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 22 Jul 2016 18:34:39 +0000 +Subject: [PATCH] get_pid_from_inode: Include limit.h + +PATH_MAX and NAME_MAX are required by this file + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + agent/mibgroup/util_funcs/get_pid_from_inode.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c +index 5788e1d..ea380a6 100644 +--- a/agent/mibgroup/util_funcs/get_pid_from_inode.c ++++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c +@@ -6,6 +6,7 @@ + #include + + #include ++#include + #include + #ifdef HAVE_STDLIB_H + #include +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch new file mode 100644 index 0000000000..5d394eec14 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0007-configure-fix-incorrect-variable.patch @@ -0,0 +1,30 @@ +From 385fa343cf178ccfe2c9a9fd7795d0db3c959fdd Mon Sep 17 00:00:00 2001 +From: Wenlin Kang +Date: Wed, 24 May 2017 17:10:20 +0800 +Subject: [PATCH] configure: fix incorrect variable + +For cross compile platform, this variable will not be correct, so fix it. + +Upstream-Status: Inappropriate [cross compile specific] + +Signed-off-by: Wenlin Kang +--- + Makefile.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.in b/Makefile.in +index 1c1182e..f947b8c 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -173,7 +173,7 @@ OTHERCLEANTODOS=perlclean @PYTHONCLEANTARGS@ cleanfeatures perlcleanfeatures pyt + # + # override LD_RUN_PATH to avoid dependencies on the build directory + perlmodules: perlmakefiles subdirs +- @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{archlibexp}/CORE);'`") ; \ ++ @(cd perl ; $(MAKE) LD_RUN_PATH="$(libdir):`$(PERL) -e 'use Config; print qq($$Config{installprivlib}/CORE);'`") ; \ + if test $$? != 0 ; then \ + exit 1 ; \ + fi +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch new file mode 100644 index 0000000000..a57c4c8f14 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch @@ -0,0 +1,46 @@ +From b5cbe0953a7e7a3c77c7ec69dfe81254475f08c0 Mon Sep 17 00:00:00 2001 +From: Zheng Ruoqin +Date: Wed, 9 Jun 2021 15:47:30 +0900 +Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP + +Upstream-Status: Pending + +Signed-off-by: Marian Florea +Signed-off-by: Li Zhou +Signed-off-by: Ovidiu Panait +--- + agent/snmpd.c | 1 + + snmplib/snmpv3.c | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/agent/snmpd.c b/agent/snmpd.c +index fe31c87..d9f68dd 100644 +--- a/agent/snmpd.c ++++ b/agent/snmpd.c +@@ -1169,6 +1169,7 @@ snmpd_reconfig(void) + snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", + netsnmp_get_version()); + update_config(); ++ snmp_store(app_name); + send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3); + #ifdef HAVE_SIGPROCMASK + ret = sigprocmask(SIG_UNBLOCK, &set, NULL); +diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c +index be9256f..d17d2e3 100644 +--- a/snmplib/snmpv3.c ++++ b/snmplib/snmpv3.c +@@ -1071,9 +1071,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, + /* + * if our engineID has changed at all, the boots record must be set to 1 + */ +- if (engineIDLen != oldEngineIDLength || ++ if (oldEngineIDLength != (size_t)0 && (engineIDLen != oldEngineIDLength || + oldEngineID == NULL || c_engineID == NULL || +- memcmp(oldEngineID, c_engineID, engineIDLen) != 0) { ++ memcmp(oldEngineID, c_engineID, engineIDLen) != 0)) { + engineBoots = 1; + } + +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch new file mode 100644 index 0000000000..36a676fb02 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0009-net-snmp-fix-for-disable-des.patch @@ -0,0 +1,32 @@ +From aa1f157c675da248ed186e020d17cb2528d0be12 Mon Sep 17 00:00:00 2001 +From: Jackie Huang +Date: Thu, 22 Jun 2017 10:25:08 +0800 +Subject: [PATCH] net-snmp: fix for --disable-des + +Include des.h only if it's found in openssl so that +the --disable-des works correctly. + +Upstream-Status: Submitted [net-snmp-coders@lists.sourceforge.net] + +Signed-off-by: Jackie Huang +--- + snmplib/scapi.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/snmplib/scapi.c b/snmplib/scapi.c +index ac77004..7545bfa 100644 +--- a/snmplib/scapi.c ++++ b/snmplib/scapi.c +@@ -86,7 +86,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support); + #include + #include + #include ++#ifdef HAVE_OPENSSL_DES_H + #include ++#endif + #ifdef HAVE_AES + #include + #endif +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch new file mode 100644 index 0000000000..246ce2b8d9 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch @@ -0,0 +1,34 @@ +From a96140995d10660046146d9fa75faa5f7faabab0 Mon Sep 17 00:00:00 2001 +From: "douglas.royds" +Date: Wed, 21 Nov 2018 13:52:18 +1300 +Subject: [PATCH] net-snmp: Reproducibility: Don't check build host for + +Reproducible build: Don't check for /etc/printcap on the build machine when +cross-compiling. Use AC_CHECK_FILE to set the cached variable +ac_cv_file__etc_printcap instead. When cross-compiling, this variable should be +set in the environment to "yes" or "no" as appropriate for the target platform. + +Upstream-Status: Pending +--- + configure.d/config_os_misc4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.d/config_os_misc4 b/configure.d/config_os_misc4 +index 4c445d6..099257f 100644 +--- a/configure.d/config_os_misc4 ++++ b/configure.d/config_os_misc4 +@@ -99,9 +99,9 @@ if test x$LPSTAT_PATH != x; then + [Path to the lpstat command]) + AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available]) + fi +-if test -r /etc/printcap; then ++AC_CHECK_FILE([/etc/printcap], + AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists]) +-fi ++) + + + # Check ps args +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch new file mode 100644 index 0000000000..1e845c4e63 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch @@ -0,0 +1,40 @@ +From 85a6c5017a2cd18a5a66afcb3f6a02276c101ad0 Mon Sep 17 00:00:00 2001 +From: Mingli Yu +Date: Fri, 29 Jan 2021 08:49:15 +0000 +Subject: [PATCH] ac_add_search_path.m4: keep consistent between 32bit and + 64bit + +With configure option "--with-openssl=${STAGING_EXECPREFIXDIR}", it behaves +differently between 32bit and 64bit system as the openssl lib resides under +/build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib64 +for 64bit system, but resides under [1] for 32bit system. + +So add the patch to fix the gap between 32bit and 64bit system. + +[1] /build/tmp/work/corei7-64-wrs-linux/net-snmp/5.9-r0/recipe-sysroot/usr/lib + +Upstream-Status: Inappropriate [configuration specific] + +Signed-off-by: Mingli Yu +--- + m4/ac_add_search_path.m4 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/m4/ac_add_search_path.m4 b/m4/ac_add_search_path.m4 +index 8e0a819..e9585bc 100644 +--- a/m4/ac_add_search_path.m4 ++++ b/m4/ac_add_search_path.m4 +@@ -3,8 +3,8 @@ dnl Add a search path to the LIBS and CPPFLAGS variables + dnl + AC_DEFUN([AC_ADD_SEARCH_PATH],[ + if test "x$1" != x -a -d $1; then +- if test -d $1/lib; then +- LDFLAGS="-L$1/lib $LDFLAGS" ++ if test -d $1/${libdir:5}; then ++ LDFLAGS="-L$1/${libdir:5} $LDFLAGS" + fi + if test -d $1/include; then + CPPFLAGS="-I$1/include $CPPFLAGS" +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch new file mode 100644 index 0000000000..9d4b769930 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch @@ -0,0 +1,43 @@ +From 21ea0b9ce5cc9445f7ffd7a9020b816681e16284 Mon Sep 17 00:00:00 2001 +From: Adam Gajda +Date: Mon, 2 Oct 2023 16:40:31 +0200 +Subject: [PATCH] Fix configuration of NETSNMP_FD_MASK_TYPE + +Upstream-Status: Backport +[https://github.com/net-snmp/net-snmp/commit/af1b7f77975bbb2fcbdb3f005f8cb010d1d33cd3] + +Signed-off-by: Yi Zhao +--- + configure | 2 +- + configure.d/config_project_types | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 907d441..f4468c6 100755 +--- a/configure ++++ b/configure +@@ -31638,7 +31638,7 @@ CFLAGS="$CFLAGS -Werror" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5 + printf %s "checking for the type of fd_set::fds_bits... " >&6; } +-for type in __fd_mask __int32_t unknown; do ++for type in __fd_mask __int32_t long\ int unknown; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +diff --git a/configure.d/config_project_types b/configure.d/config_project_types +index 1b4c66b..a78e8eb 100644 +--- a/configure.d/config_project_types ++++ b/configure.d/config_project_types +@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + + AC_MSG_CHECKING([for the type of fd_set::fds_bits]) +-for type in __fd_mask __int32_t unknown; do ++for type in __fd_mask __int32_t long\ int unknown; do + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + #include + #include +-- +2.25.1 + diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2022-44792-CVE-2022-44793.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2022-44792-CVE-2022-44793.patch deleted file mode 100644 index b18d4dc292..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/CVE-2022-44792-CVE-2022-44793.patch +++ /dev/null @@ -1,121 +0,0 @@ -From d13302656d9ff0807c5defe18623adc947f43a2b Mon Sep 17 00:00:00 2001 -From: Narpat Mali -Date: Wed, 8 Feb 2023 13:15:39 +0000 -Subject: [PATCH] agent: Disallow SET requests with any NULL varbind Merge pull - request #490 from fenner/set-null - -fixes: #474 and #475 - -CVE: CVE-2022-44792, CVE-2022-44793 - -Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/be804106fd0771a7d05236cff36e199af077af57] - -Signed-off-by: Narpat Mali ---- - agent/snmp_agent.c | 32 +++++++++++++++++++ - apps/snmpset.c | 1 + - .../default/T0142snmpv2csetnull_simple | 31 ++++++++++++++++++ - 3 files changed, 64 insertions(+) - create mode 100644 testing/fulltests/default/T0142snmpv2csetnull_simple - -diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c -index 867d0c1..3f678fe 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 - */ -diff --git a/apps/snmpset.c b/apps/snmpset.c -index 48e14bd..d542713 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': -diff --git a/testing/fulltests/default/T0142snmpv2csetnull_simple b/testing/fulltests/default/T0142snmpv2csetnull_simple -new file mode 100644 -index 0000000..0f1b8f3 ---- /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 --- -2.34.1 - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch deleted file mode 100644 index 409c1e03c8..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/fix-libtool-finish.patch +++ /dev/null @@ -1,34 +0,0 @@ -From ab1d77c52e84746e75506a2870783806bc77f396 Mon Sep 17 00:00:00 2001 -From: "Roy.Li" -Date: Fri, 16 Jan 2015 14:14:01 +0800 -Subject: [PATCH] net-snmp: fix "libtool --finish" - -LIB_LDCONFIG_CMD failed since it is using a host dir $(libdir) -which is /usr/lib64 does not exist on host when compile 64bit -image. - -In fact, configuring dynamic linker run-time bindings is meaningless -at this step, If it is needed, Poky would write ldconfig scripts to -rpm-postinst for each recipe while do_package, in package.bbclass. - -Upstream-Status: Inappropriate [cross compile specific] - -Signed-off-by: Roy.Li - ---- - Makefile.top | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.top b/Makefile.top -index a962c54..1ba5607 100644 ---- a/Makefile.top -+++ b/Makefile.top -@@ -89,7 +89,7 @@ LIBREVISION = 0 - LIB_LD_CMD = $(LIBTOOL) --mode=link $(LINKCC) $(CFLAGS) -rpath $(libdir) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) @LD_NO_UNDEFINED@ -o - LIB_EXTENSION = la - LIB_VERSION = --LIB_LDCONFIG_CMD = $(LIBTOOL) --mode=finish $(INSTALL_PREFIX)$(libdir) -+LIB_LDCONFIG_CMD = echo "do not ldconfig\n" - LINK = $(LIBTOOL) --mode=link $(LINKCC) - # RANLIB = @RANLIB@ - RANLIB = : diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch deleted file mode 100644 index 35e93d636e..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 5ad4eab43c1ea63ff343bba64d576440e8783e75 Mon Sep 17 00:00:00 2001 -From: Zheng Ruoqin -Date: Wed, 9 Jun 2021 15:47:30 +0900 -Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP - -Upstream-Status: Pending - -Signed-off-by: Marian Florea -Signed-off-by: Li Zhou -Signed-off-by: Ovidiu Panait - ---- - agent/snmpd.c | 1 + - snmplib/snmpv3.c | 4 ++-- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/agent/snmpd.c b/agent/snmpd.c -index 90de12d..1ccc4db 100644 ---- a/agent/snmpd.c -+++ b/agent/snmpd.c -@@ -1169,6 +1169,7 @@ snmpd_reconfig(void) - snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", - netsnmp_get_version()); - update_config(); -+ snmp_store(app_name); - send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3); - #ifdef HAVE_SIGPROCMASK - ret = sigprocmask(SIG_UNBLOCK, &set, NULL); -diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c -index 7b1746b..4a17e0d 100644 ---- a/snmplib/snmpv3.c -+++ b/snmplib/snmpv3.c -@@ -1059,9 +1059,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, - /* - * if our engineID has changed at all, the boots record must be set to 1 - */ -- if (engineIDLen != oldEngineIDLength || -+ if (oldEngineIDLength != (size_t)0 && (engineIDLen != oldEngineIDLength || - oldEngineID == NULL || c_engineID == NULL || -- memcmp(oldEngineID, c_engineID, engineIDLen) != 0) { -+ memcmp(oldEngineID, c_engineID, engineIDLen) != 0)) { - engineBoots = 1; - } - diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch deleted file mode 100644 index 3152ce288a..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-add-knob-whether-nlist.h-are-checked.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ad65b106d3cb3c6e595381be1c45a73c1ef6eb5e Mon Sep 17 00:00:00 2001 -From: Chong Lu -Date: Thu, 28 May 2020 09:46:34 -0500 -Subject: [PATCH] net-snmp: add knob whether nlist.h are checked - -Previously, it still was checked when there was no nlish.h in sysroots directory. -Add knob to decide whether nlist.h are checked or not. - -Upstream-Status: Pending - -Signed-off-by: Chong Lu - ---- - configure.d/config_os_headers | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/configure.d/config_os_headers b/configure.d/config_os_headers -index b9c8c31..01c3376 100644 ---- a/configure.d/config_os_headers -+++ b/configure.d/config_os_headers -@@ -37,6 +37,7 @@ AC_CHECK_HEADERS([getopt.h pthread.h regex.h ] dnl - [sys/timeb.h ]) - - # Library and Agent: -+if test "x$with_elf" != "xno"; then - AC_CHECK_HEADERS([nlist.h],,,[ - AC_INCLUDES_DEFAULT - [ -@@ -44,6 +45,7 @@ AC_INCLUDES_DEFAULT - #define LIBBSD_DISABLE_DEPRECATED 1 - #endif - ]]) -+fi - - # Library: - AC_CHECK_HEADERS([crt_externs.h ] dnl diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch deleted file mode 100644 index c382c02d89..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-fix-for-disable-des.patch +++ /dev/null @@ -1,30 +0,0 @@ -From b1b9980853b1083f0c8b9f628f8b4c3a484d4f91 Mon Sep 17 00:00:00 2001 -From: Jackie Huang -Date: Thu, 22 Jun 2017 10:25:08 +0800 -Subject: [PATCH] net-snmp: fix for --disable-des - -Include des.h only if it's found in openssl so that -the --disable-des works correctly. - -Upstream-Status: Submitted [net-snmp-coders@lists.sourceforge.net] - -Signed-off-by: Jackie Huang - ---- - snmplib/scapi.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/snmplib/scapi.c b/snmplib/scapi.c -index 54fdd5c..0f7e931 100644 ---- a/snmplib/scapi.c -+++ b/snmplib/scapi.c -@@ -85,7 +85,9 @@ netsnmp_feature_child_of(usm_scapi, usm_support); - #include - #include - #include -+#ifdef HAVE_OPENSSL_DES_H - #include -+#endif - #ifdef HAVE_AES - #include - #endif diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch deleted file mode 100644 index 09ca532a7f..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-testing-add-the-output-format-for-ptest.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 36a5656db7ea75dd15f35a6c1728937c6e2b901c Mon Sep 17 00:00:00 2001 -From: Jackie Huang -Date: Wed, 14 Jan 2015 15:10:06 +0800 -Subject: [PATCH] testing: add the output format for ptest - -Upstream-Status: Inappropriate [OE specific] - -Signed-off-by: Jackie Huang - ---- - testing/RUNTESTS | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/testing/RUNTESTS b/testing/RUNTESTS -index 6715831..a2b6fb8 100755 ---- a/testing/RUNTESTS -+++ b/testing/RUNTESTS -@@ -17,13 +17,17 @@ failed_count=0 - rm -f failed_tests - for i in "${srcdir}"/testing/fulltests/default/T*$1*; do - echo "RUNNING $i" -+ test_name=`basename $i` - ${srcdir}/testing/fulltests/support/simple_run $i - if [ $? = 0 ]; then -+ echo "PASS: $test_name" - success_count=`expr $success_count + 1` - else -+ echo "FAIL: $test_name" - failed_count=`expr $failed_count + 1` - echo "$i" >> failed_tests - fi -+ echo - done - - if [ -f failed_tests ]; then diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch deleted file mode 100644 index 5fbb411a5f..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp/reproducibility-have-printcap.patch +++ /dev/null @@ -1,32 +0,0 @@ -From b923cd38e2503b86aedf66b767fd7f51c9f25645 Mon Sep 17 00:00:00 2001 -From: "douglas.royds" -Date: Wed, 21 Nov 2018 13:52:18 +1300 -Subject: [PATCH] net-snmp: Reproducibility: Don't check build host for - -Reproducible build: Don't check for /etc/printcap on the build machine when -cross-compiling. Use AC_CHECK_FILE to set the cached variable -ac_cv_file__etc_printcap instead. When cross-compiling, this variable should be -set in the environment to "yes" or "no" as appropriate for the target platform. - ---- -Upstream-Status: Pending - - configure.d/config_os_misc4 | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.d/config_os_misc4 b/configure.d/config_os_misc4 -index b6864d9..07ca922 100644 ---- a/configure.d/config_os_misc4 -+++ b/configure.d/config_os_misc4 -@@ -99,9 +99,9 @@ if test x$LPSTAT_PATH != x; then - [Path to the lpstat command]) - AC_DEFINE(HAVE_LPSTAT, 1, [Set if the lpstat command is available]) - fi --if test -r /etc/printcap; then -+AC_CHECK_FILE([/etc/printcap], - AC_DEFINE(HAVE_PRINTCAP, 1, [Set if /etc/printcap exists]) --fi -+) - - - # Check ps args diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest b/meta-networking/recipes-protocols/net-snmp/net-snmp/run-ptest old mode 100755 new mode 100644 diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.3.bb deleted file mode 100644 index 6f1c114177..0000000000 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.3.bb +++ /dev/null @@ -1,294 +0,0 @@ -SUMMARY = "Various tools relating to the Simple Network Management Protocol" -HOMEPAGE = "http://www.net-snmp.org/" -SECTION = "net" -LICENSE = "BSD-3-Clause & MIT" - -LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687" - -DEPENDS = "openssl" -DEPENDS:append:class-target = " pciutils" - -SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ - file://init \ - file://snmpd.conf \ - file://snmptrapd.conf \ - file://snmpd.service \ - file://snmptrapd.service \ - file://net-snmp-add-knob-whether-nlist.h-are-checked.patch \ - file://fix-libtool-finish.patch \ - file://net-snmp-testing-add-the-output-format-for-ptest.patch \ - file://run-ptest \ - file://0001-config_os_headers-Error-Fix.patch \ - file://0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \ - file://0001-get_pid_from_inode-Include-limit.h.patch \ - file://0004-configure-fix-incorrect-variable.patch \ - file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \ - file://net-snmp-fix-for-disable-des.patch \ - file://reproducibility-have-printcap.patch \ - file://0001-ac_add_search_path.m4-keep-consistent-between-32bit.patch \ - file://0001-Add-noreturn-attribute-to-netsnmp_pci_error.patch \ - file://CVE-2022-44792-CVE-2022-44793.patch \ - " -SRC_URI[sha256sum] = "2097f29b7e1bf3f1300b4bae52fa2308d0bb8d5d3998dbe02f9462a413a2ef0a" - -UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/" -UPSTREAM_CHECK_REGEX = "/net-snmp/(?P\d+(\.\d+)+)/" - -inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest multilib_script multilib_header - -EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'" - -PARALLEL_MAKE = "" -CCACHE = "" -CLEANBROKEN = "1" - -TARGET_CC_ARCH += "${LDFLAGS}" - -PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} des smux" -PACKAGECONFIG[des] = "--enable-des, --disable-des" -PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils" -PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6" -PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl" -PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no, perl" -PACKAGECONFIG[smux] = "" -PACKAGECONFIG[systemd] = "--with-systemd, --without-systemd" - -EXTRA_OECONF = " \ - --enable-shared \ - --disable-manuals \ - --with-defaults \ - --with-install-prefix=${D} \ - --with-persistent-directory=${localstatedir}/lib/net-snmp \ - --with-endianness=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ - --with-mib-modules='${MIB_MODULES}' \ -" - -MIB_MODULES = "" -MIB_MODULES:append = " ${@bb.utils.filter('PACKAGECONFIG', 'smux', d)}" - -CACHED_CONFIGUREVARS = " \ - ac_cv_header_valgrind_valgrind_h=no \ - ac_cv_header_valgrind_memcheck_h=no \ - ac_cv_ETC_MNTTAB=/etc/mtab \ - lt_cv_shlibpath_overrides_runpath=yes \ - ac_cv_path_UNAMEPROG=${base_bindir}/uname \ - ac_cv_path_PSPROG=${base_bindir}/ps \ - ac_cv_file__etc_printcap=no \ - NETSNMP_CONFIGURE_OPTIONS= \ -" -PERLPROG = "${bindir}/env perl" -PERLPROG:class-native = "${bindir_native}/env perl" -PERLPROG:append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}" -export PERLPROG - -HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}" - -PTEST_BUILD_HOST_FILES += "net-snmp-config gen-variables" - -do_configure:prepend() { - sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \ - "${S}"/configure \ - "${S}"/configure.d/config_os_libs2 - - if [ "${HAS_PERL}" = "1" ]; then - # this may need to be changed when package perl has any change. - cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/Config.pm ${WORKDIR}/ - cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/*/Config_heavy.pl ${WORKDIR}/ - sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \ - -e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \ - -e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \ - -e "s@sitearchexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \ - -e "s@sitelibexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \ - -e "s@vendorarchexp => '/usr@vendorarchexp => '${STAGING_DIR_TARGET}/usr@g" \ - -e "s@vendorlibexp => '/usr@vendorlibexp => '${STAGING_DIR_TARGET}/usr@g" \ - -i ${WORKDIR}/Config.pm - fi - -} - -do_configure:append() { - sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \ - -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \ - -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L${STAGING_DIR_TARGET}\$\{libdir\} @g" \ - -i ${B}/net-snmp-config -} - -do_install:append() { - install -d ${D}${sysconfdir}/snmp - install -d ${D}${sysconfdir}/init.d - install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd - install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/ - install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/ - install -d ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system - install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system - sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \ - -i ${D}${bindir}/net-snmp-create-v3-user - sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \ - -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ - -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ - -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ - -e 's@[^ ]*--sysroot=[^ "]*@@g' \ - -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \ - -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \ - -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \ - -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \ - -i ${D}${bindir}/net-snmp-config - - sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ - -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ - -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ - -i ${D}${libdir}/pkgconfig/netsnmp*.pc - - # ${STAGING_DIR_HOST} is empty for native builds, and the sed command below - # will result in errors if run for native. - if [ "${STAGING_DIR_HOST}" ]; then - sed -e 's@${STAGING_DIR_HOST}@@g' \ - -i ${D}${bindir}/net-snmp-config ${D}${libdir}/pkgconfig/netsnmp*.pc - fi - - sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \ - -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \ - -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L\$\{libdir\} @g" \ - -i ${D}${bindir}/net-snmp-config - - oe_multilib_header net-snmp/net-snmp-config.h - - if [ "${HAS_PERL}" = "1" ]; then - find ${D}${libdir}/ -type f -name "perllocal.pod" | xargs rm -f - fi -} - -do_install_ptest() { - install -d ${D}${PTEST_PATH} - for i in ${S}/dist ${S}/include ${B}/include ${S}/mibs ${S}/configure \ - ${B}/net-snmp-config ${S}/testing; do - if [ -e "$i" ]; then - cp -R --no-dereference --preserve=mode,links -v "$i" ${D}${PTEST_PATH} - fi - done - echo `autoconf -V|awk '/autoconf/{print $NF}'` > ${D}${PTEST_PATH}/dist/autoconf-version - - rmdlist="${D}${PTEST_PATH}/dist/net-snmp-solaris-build" - for i in $rmdlist; do - if [ -d "$i" ]; then - rm -rf "$i" - fi - done -} - -SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" -SNMP_DBGDIR = "${TARGET_DBGSRC_DIR}" - -net_snmp_sysroot_preprocess () { - if [ -e ${D}${bindir}/net-snmp-config ]; then - install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ - install -m 755 ${D}${bindir}/net-snmp-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ - sed -e "s@-I/usr/include@-I${STAGING_INCDIR}@g" \ - -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}${prefix}@g" \ - -e "s@^exec_prefix=.*@exec_prefix=${STAGING_EXECPREFIXDIR}@g" \ - -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ - -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ - -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=${S}@g" \ - -e "s@-ffile-prefix-map=${SNMP_DBGDIR}@-ffile-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ - -e "s@-fdebug-prefix-map=${SNMP_DBGDIR}@-fdebug-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ - -e "s@-fdebug-prefix-map= -fdebug-prefix-map=@-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ - -fdebug-prefix-map=${STAGING_DIR_HOST}=@g" \ - -e "s@--sysroot=@--sysroot=${STAGING_DIR_HOST}@g" \ - -e "s@--with-libtool-sysroot=@--with-libtool-sysroot=${STAGING_DIR_HOST}@g" \ - -e "s@--with-install-prefix=@--with-install-prefix=${D}@g" \ - -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/net-snmp-config - fi -} - -PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \ - ${PN}-server-snmpd ${PN}-server-snmptrapd \ - ${PN}-lib-netsnmp ${PN}-lib-agent ${PN}-lib-helpers \ - ${PN}-lib-mibs ${PN}-lib-trapd" - -# perl module -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl-modules', '', d)}" - -ALLOW_EMPTY:${PN} = "1" -ALLOW_EMPTY:${PN}-server = "1" -ALLOW_EMPTY:${PN}-libs = "1" - -FILES:${PN}-perl-modules = "${libdir}/perl?/*" -RDEPENDS:${PN}-perl-modules = "perl" - -FILES:${PN}-libs = "" -FILES:${PN}-mibs = "${datadir}/snmp/mibs" -FILES:${PN}-server-snmpd = "${sbindir}/snmpd \ - ${sysconfdir}/snmp/snmpd.conf \ - ${sysconfdir}/init.d \ - ${systemd_unitdir}/system/snmpd.service \ -" - -FILES:${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ - ${sysconfdir}/snmp/snmptrapd.conf \ - ${systemd_unitdir}/system/snmptrapd.service \ -" - -FILES:${PN}-lib-netsnmp = "${libdir}/libnetsnmp${SOLIBS}" -FILES:${PN}-lib-agent = "${libdir}/libnetsnmpagent${SOLIBS}" -FILES:${PN}-lib-helpers = "${libdir}/libnetsnmphelpers${SOLIBS}" -FILES:${PN}-lib-mibs = "${libdir}/libnetsnmpmibs${SOLIBS}" -FILES:${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}" - -FILES:${PN} = "" -FILES:${PN}-client = "${bindir}/* ${datadir}/snmp/" -FILES:${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" -FILES:${PN}-dev += "${bindir}/mib2c \ - ${bindir}/mib2c-update \ - ${bindir}/net-snmp-config \ - ${bindir}/net-snmp-create-v3-user \ -" - -CONFFILES:${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" -CONFFILES:${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" - -INITSCRIPT_PACKAGES = "${PN}-server-snmpd" -INITSCRIPT_NAME:${PN}-server-snmpd = "snmpd" -INITSCRIPT_PARAMS:${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ." - -SYSTEMD_PACKAGES = "${PN}-server-snmpd \ - ${PN}-server-snmptrapd" - -SYSTEMD_SERVICE:${PN}-server-snmpd = "snmpd.service" -SYSTEMD_SERVICE:${PN}-server-snmptrapd = "snmptrapd.service" - -RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}" -RDEPENDS:${PN} += "net-snmp-client" -RDEPENDS:${PN}-server-snmpd += "net-snmp-mibs" -RDEPENDS:${PN}-server-snmptrapd += "net-snmp-server-snmpd ${PN}-lib-trapd" -RDEPENDS:${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" -RDEPENDS:${PN}-client += "net-snmp-mibs net-snmp-libs" -RDEPENDS:${PN}-libs += "libpci \ - ${PN}-lib-netsnmp \ - ${PN}-lib-agent \ - ${PN}-lib-helpers \ - ${PN}-lib-mibs \ -" -RDEPENDS:${PN}-ptest += "perl \ - perl-module-test \ - perl-module-file-basename \ - perl-module-getopt-long \ - perl-module-file-temp \ - perl-module-data-dumper \ -" -RDEPENDS:${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" -RRECOMMENDS:${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" - -RPROVIDES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" -RREPLACES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" -RCONFLICTS:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" - -RPROVIDES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" -RREPLACES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" -RCONFLICTS:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" - -LEAD_SONAME = "libnetsnmp.so" - -MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config" - -BBCLASSEXTEND = "native" diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb new file mode 100644 index 0000000000..5da06bb6d7 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb @@ -0,0 +1,295 @@ +SUMMARY = "Various tools relating to the Simple Network Management Protocol" +HOMEPAGE = "http://www.net-snmp.org/" +SECTION = "net" +LICENSE = "BSD-3-Clause & MIT" + +LIC_FILES_CHKSUM = "file://COPYING;md5=9d100a395a38584f2ec18a8275261687" + +DEPENDS = "openssl" +DEPENDS:append:class-target = " pciutils" + +SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ + file://init \ + file://snmpd.conf \ + file://snmptrapd.conf \ + file://snmpd.service \ + file://snmptrapd.service \ + file://run-ptest \ + file://0001-net-snmp-add-knob-whether-nlist.h-are-checked.patch \ + file://0002-net-snmp-fix-libtool-finish.patch \ + file://0003-testing-add-the-output-format-for-ptest.patch \ + file://0004-config_os_headers-Error-Fix.patch \ + file://0005-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \ + file://0006-get_pid_from_inode-Include-limit.h.patch \ + file://0007-configure-fix-incorrect-variable.patch \ + file://0008-net-snmp-fix-engineBoots-value-on-SIGHUP.patch \ + file://0009-net-snmp-fix-for-disable-des.patch \ + file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \ + file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \ + file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \ + " +SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544" + +UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/net-snmp/files/net-snmp/" +UPSTREAM_CHECK_REGEX = "/net-snmp/(?P\d+(\.\d+)+)/" + +inherit autotools-brokensep update-rc.d siteinfo systemd pkgconfig perlnative ptest multilib_script multilib_header + +EXTRA_OEMAKE = "INSTALL_PREFIX=${D} OTHERLDFLAGS='${LDFLAGS}' HOST_CPPFLAGS='${BUILD_CPPFLAGS}'" + +PARALLEL_MAKE = "" +CCACHE = "" +CLEANBROKEN = "1" + +TARGET_CC_ARCH += "${LDFLAGS}" + +PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 systemd', d)} des smux" +PACKAGECONFIG[des] = "--enable-des, --disable-des" +PACKAGECONFIG[elfutils] = "--with-elf, --without-elf, elfutils" +PACKAGECONFIG[ipv6] = "--enable-ipv6, --disable-ipv6" +PACKAGECONFIG[libnl] = "--with-nl, --without-nl, libnl" +PACKAGECONFIG[perl] = "--enable-embedded-perl --with-perl-modules=yes, --disable-embedded-perl --with-perl-modules=no, perl" +PACKAGECONFIG[smux] = "" +PACKAGECONFIG[systemd] = "--with-systemd, --without-systemd" + +EXTRA_OECONF = " \ + --enable-shared \ + --disable-manuals \ + --with-defaults \ + --with-install-prefix=${D} \ + --with-persistent-directory=${localstatedir}/lib/net-snmp \ + --with-endianness=${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'little', 'big', d)} \ + --with-mib-modules='${MIB_MODULES}' \ +" + +MIB_MODULES = "" +MIB_MODULES:append = " ${@bb.utils.filter('PACKAGECONFIG', 'smux', d)}" + +CACHED_CONFIGUREVARS = " \ + ac_cv_header_valgrind_valgrind_h=no \ + ac_cv_header_valgrind_memcheck_h=no \ + ac_cv_ETC_MNTTAB=/etc/mtab \ + lt_cv_shlibpath_overrides_runpath=yes \ + ac_cv_path_UNAMEPROG=${base_bindir}/uname \ + ac_cv_path_PSPROG=${base_bindir}/ps \ + ac_cv_file__etc_printcap=no \ + NETSNMP_CONFIGURE_OPTIONS= \ +" +PERLPROG = "${bindir}/env perl" +PERLPROG:class-native = "${bindir_native}/env perl" +PERLPROG:append = "${@bb.utils.contains('PACKAGECONFIG', 'perl', ' -I${WORKDIR}', '', d)}" +export PERLPROG + +HAS_PERL = "${@bb.utils.contains('PACKAGECONFIG', 'perl', '1', '0', d)}" + +PTEST_BUILD_HOST_FILES += "net-snmp-config gen-variables" + +do_configure:prepend() { + sed -i -e "s|I/usr/include|I${STAGING_INCDIR}|g" \ + "${S}"/configure \ + "${S}"/configure.d/config_os_libs2 + + if [ "${HAS_PERL}" = "1" ]; then + # this may need to be changed when package perl has any change. + cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/Config.pm ${WORKDIR}/ + cp -f ${STAGING_DIR_TARGET}/usr/lib*/perl?/*/*/Config_heavy.pl ${WORKDIR}/ + sed -e "s@libpth => '/usr/lib.*@libpth => '${STAGING_DIR_TARGET}/${libdir} ${STAGING_DIR_TARGET}/${base_libdir}',@g" \ + -e "s@privlibexp => '/usr@privlibexp => '${STAGING_DIR_TARGET}/usr@g" \ + -e "s@scriptdir => '/usr@scriptdir => '${STAGING_DIR_TARGET}/usr@g" \ + -e "s@sitearchexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \ + -e "s@sitelibexp => '/usr@sitearchexp => '${STAGING_DIR_TARGET}/usr@g" \ + -e "s@vendorarchexp => '/usr@vendorarchexp => '${STAGING_DIR_TARGET}/usr@g" \ + -e "s@vendorlibexp => '/usr@vendorlibexp => '${STAGING_DIR_TARGET}/usr@g" \ + -i ${WORKDIR}/Config.pm + fi + +} + +do_configure:append() { + sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=${STAGING_DIR_TARGET}\$\{includedir\}@g" \ + -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L${STAGING_DIR_TARGET}\$\{libdir\}@g" \ + -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L${STAGING_DIR_TARGET}\$\{libdir\} @g" \ + -i ${B}/net-snmp-config +} + +do_install:append() { + install -d ${D}${sysconfdir}/snmp + install -d ${D}${sysconfdir}/init.d + install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd + install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/ + install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/ + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system + sed -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \ + -i ${D}${bindir}/net-snmp-create-v3-user + sed -e 's@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g' \ + -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*--sysroot=[^ "]*@@g' \ + -e 's@[^ ]*--with-libtool-sysroot=[^ "]*@@g' \ + -e 's@[^ ]*--with-install-prefix=[^ "]*@@g' \ + -e 's@[^ ]*PKG_CONFIG_PATH=[^ "]*@@g' \ + -e 's@[^ ]*PKG_CONFIG_LIBDIR=[^ "]*@@g' \ + -i ${D}${bindir}/net-snmp-config + + sed -e 's@[^ ]*-ffile-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fdebug-prefix-map=[^ "]*@@g' \ + -e 's@[^ ]*-fmacro-prefix-map=[^ "]*@@g' \ + -i ${D}${libdir}/pkgconfig/netsnmp*.pc + + # ${STAGING_DIR_HOST} is empty for native builds, and the sed command below + # will result in errors if run for native. + if [ "${STAGING_DIR_HOST}" ]; then + sed -e 's@${STAGING_DIR_HOST}@@g' \ + -i ${D}${bindir}/net-snmp-config ${D}${libdir}/pkgconfig/netsnmp*.pc + fi + + sed -e "s@^NSC_INCLUDEDIR=.*@NSC_INCLUDEDIR=\$\{includedir\}@g" \ + -e "s@^NSC_LIBDIR=-L.*@NSC_LIBDIR=-L\$\{libdir\}@g" \ + -e "s@^NSC_LDFLAGS=\"-L.* @NSC_LDFLAGS=\"-L\$\{libdir\} @g" \ + -i ${D}${bindir}/net-snmp-config + + sed -i -e 's:${HOSTTOOLS_DIR}/::g' ${D}${bindir}/net-snmp-create-v3-user + + oe_multilib_header net-snmp/net-snmp-config.h + + if [ "${HAS_PERL}" = "1" ]; then + find ${D}${libdir}/ -type f -name "perllocal.pod" | xargs rm -f + fi +} + +do_install_ptest() { + install -d ${D}${PTEST_PATH} + for i in ${S}/dist ${S}/include ${B}/include ${S}/mibs ${S}/configure \ + ${B}/net-snmp-config ${S}/testing; do + if [ -e "$i" ]; then + cp -R --no-dereference --preserve=mode,links -v "$i" ${D}${PTEST_PATH} + fi + done + echo `autoconf -V|awk '/autoconf/{print $NF}'` > ${D}${PTEST_PATH}/dist/autoconf-version + + rmdlist="${D}${PTEST_PATH}/dist/net-snmp-solaris-build" + for i in $rmdlist; do + if [ -d "$i" ]; then + rm -rf "$i" + fi + done +} + +SYSROOT_PREPROCESS_FUNCS += "net_snmp_sysroot_preprocess" +SNMP_DBGDIR = "${TARGET_DBGSRC_DIR}" + +net_snmp_sysroot_preprocess () { + if [ -e ${D}${bindir}/net-snmp-config ]; then + install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + install -m 755 ${D}${bindir}/net-snmp-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/ + sed -e "s@-I/usr/include@-I${STAGING_INCDIR}@g" \ + -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}${prefix}@g" \ + -e "s@^exec_prefix=.*@exec_prefix=${STAGING_EXECPREFIXDIR}@g" \ + -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ + -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ + -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=${S}@g" \ + -e "s@-ffile-prefix-map=${SNMP_DBGDIR}@-ffile-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ + -e "s@-fdebug-prefix-map=${SNMP_DBGDIR}@-fdebug-prefix-map=${WORKDIR}=${SNMP_DBGDIR}@g" \ + -e "s@-fdebug-prefix-map= -fdebug-prefix-map=@-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ + -fdebug-prefix-map=${STAGING_DIR_HOST}=@g" \ + -e "s@--sysroot=@--sysroot=${STAGING_DIR_HOST}@g" \ + -e "s@--with-libtool-sysroot=@--with-libtool-sysroot=${STAGING_DIR_HOST}@g" \ + -e "s@--with-install-prefix=@--with-install-prefix=${D}@g" \ + -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/net-snmp-config + fi +} + +PACKAGES += "${PN}-libs ${PN}-mibs ${PN}-server ${PN}-client \ + ${PN}-server-snmpd ${PN}-server-snmptrapd \ + ${PN}-lib-netsnmp ${PN}-lib-agent ${PN}-lib-helpers \ + ${PN}-lib-mibs ${PN}-lib-trapd" + +# perl module +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'perl', '${PN}-perl-modules', '', d)}" + +ALLOW_EMPTY:${PN} = "1" +ALLOW_EMPTY:${PN}-server = "1" +ALLOW_EMPTY:${PN}-libs = "1" + +FILES:${PN}-perl-modules = "${libdir}/perl?/*" +RDEPENDS:${PN}-perl-modules = "perl" + +FILES:${PN}-libs = "" +FILES:${PN}-mibs = "${datadir}/snmp/mibs" +FILES:${PN}-server-snmpd = "${sbindir}/snmpd \ + ${sysconfdir}/snmp/snmpd.conf \ + ${sysconfdir}/init.d \ + ${systemd_unitdir}/system/snmpd.service \ +" + +FILES:${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ + ${sysconfdir}/snmp/snmptrapd.conf \ + ${systemd_unitdir}/system/snmptrapd.service \ +" + +FILES:${PN}-lib-netsnmp = "${libdir}/libnetsnmp${SOLIBS}" +FILES:${PN}-lib-agent = "${libdir}/libnetsnmpagent${SOLIBS}" +FILES:${PN}-lib-helpers = "${libdir}/libnetsnmphelpers${SOLIBS}" +FILES:${PN}-lib-mibs = "${libdir}/libnetsnmpmibs${SOLIBS}" +FILES:${PN}-lib-trapd = "${libdir}/libnetsnmptrapd${SOLIBS}" + +FILES:${PN} = "" +FILES:${PN}-client = "${bindir}/* ${datadir}/snmp/" +FILES:${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" +FILES:${PN}-dev += "${bindir}/mib2c \ + ${bindir}/mib2c-update \ + ${bindir}/net-snmp-config \ + ${bindir}/net-snmp-create-v3-user \ +" + +CONFFILES:${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" +CONFFILES:${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" + +INITSCRIPT_PACKAGES = "${PN}-server-snmpd" +INITSCRIPT_NAME:${PN}-server-snmpd = "snmpd" +INITSCRIPT_PARAMS:${PN}-server-snmpd = "start 90 2 3 4 5 . stop 60 0 1 6 ." + +SYSTEMD_PACKAGES = "${PN}-server-snmpd \ + ${PN}-server-snmptrapd" + +SYSTEMD_SERVICE:${PN}-server-snmpd = "snmpd.service" +SYSTEMD_SERVICE:${PN}-server-snmptrapd = "snmptrapd.service" + +RDEPENDS:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'net-snmp-perl-modules', '', d)}" +RDEPENDS:${PN} += "net-snmp-client" +RDEPENDS:${PN}-server-snmpd += "net-snmp-mibs" +RDEPENDS:${PN}-server-snmptrapd += "net-snmp-server-snmpd ${PN}-lib-trapd" +RDEPENDS:${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" +RDEPENDS:${PN}-client += "net-snmp-mibs net-snmp-libs" +RDEPENDS:${PN}-libs += "libpci \ + ${PN}-lib-netsnmp \ + ${PN}-lib-agent \ + ${PN}-lib-helpers \ + ${PN}-lib-mibs \ +" +RDEPENDS:${PN}-ptest += "perl \ + perl-module-test \ + perl-module-file-basename \ + perl-module-getopt-long \ + perl-module-file-temp \ + perl-module-data-dumper \ +" +RDEPENDS:${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" +RRECOMMENDS:${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" + +RPROVIDES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" +RREPLACES:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" +RCONFLICTS:${PN}-server-snmpd += "${PN}-server-snmpd-systemd" + +RPROVIDES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" +RREPLACES:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" +RCONFLICTS:${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" + +LEAD_SONAME = "libnetsnmp.so" + +MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/net-snmp-config" + +BBCLASSEXTEND = "native" -- cgit 1.2.3-korg