From patchwork Sun Aug 1 21:51:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1512160 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GdFGk4t1nz9sT6 for ; Mon, 2 Aug 2021 07:52:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 48DA2838D7; Sun, 1 Aug 2021 21:52:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IVIczbCVa_Ds; Sun, 1 Aug 2021 21:52:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 6ADD9838AF; Sun, 1 Aug 2021 21:52:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8B9AD1BF36B for ; Sun, 1 Aug 2021 21:52:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 7B0434046B for ; Sun, 1 Aug 2021 21:52:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZsVSSKHg0zzC for ; Sun, 1 Aug 2021 21:52:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp4.osuosl.org (Postfix) with ESMTPS id C690C40466 for ; Sun, 1 Aug 2021 21:52:06 +0000 (UTC) Received: (Authenticated sender: thomas.petazzoni@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 33DFD20003; Sun, 1 Aug 2021 21:52:03 +0000 (UTC) From: Thomas Petazzoni To: Fabrice Fontaine , "Yann E. MORIN" , Buildroot List Date: Sun, 1 Aug 2021 23:51:58 +0200 Message-Id: <20210801215159.2435224-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/libmodsecurity: fix build with libmaxminddb X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frank Vanbever , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Fabrice Fontaine Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788 So revert this commit until upstream answer to comment to https://github.com/SpiderLabs/ModSecurity/issues/2131 Reverting this commit requires autoreconfiguring, which itself causes lots of warnings as configure.ac queries git to know the version of various parts of libmodsecurity. However, it turns out that those versions are only used to be displayed in the output of the configure script, which is quite useless. The only one that is referenced elsewhere is LIBINJECTION_VERSION, but it's in fact a different thing: it is defined by others/libinjection/src/libinjection_sqli.c. The only variable that was AC_SUBST() and therefore visible elsewhere was MSC_GIT_VERSION, but it is not used anywhere in the code base, except in the configure script itself. Note that one patch is 0001 and the other 0003, because there was already a 0002 patch. Fixes: - http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c Signed-off-by: Fabrice Fontaine Signed-off-by: Thomas Petazzoni --- ...-drop-usage-of-git-at-configure-time.patch | 79 +++++++++++++++++++ ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++ package/libmodsecurity/libmodsecurity.mk | 2 + 3 files changed, 109 insertions(+) create mode 100644 package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch create mode 100644 package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch diff --git a/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch b/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch new file mode 100644 index 0000000000..14767fb28e --- /dev/null +++ b/package/libmodsecurity/0001-configure.ac-drop-usage-of-git-at-configure-time.patch @@ -0,0 +1,79 @@ +From a2116312068b6b2c5732dfebde19b751cc81d4f3 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 1 Aug 2021 23:21:35 +0200 +Subject: [PATCH] configure.ac: drop usage of git at configure time + +The usage of git is only to print some messages at configure time, +which is not very useful, and causes a significant number of warning +when regenerating the configure script. + +Signed-off-by: Thomas Petazzoni +--- + configure.ac | 23 ----------------------- + 1 file changed, 23 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 20163e1e..14e5892a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3,7 +3,6 @@ + + # Get the hash of the last commit, to be used if it is not an + # official release. +-AC_DEFUN([MSC_GIT_HASH], m4_esyscmd_s(git log -1 --format="%h" --abbrev-commit)) + AC_DEFUN([MSC_MAJOR], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_MAJOR " | awk {'print $3'} | sed 's/\"//g')) + AC_DEFUN([MSC_MINOR], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_MINOR " | awk {'print $3'} | sed 's/\"//g')) + AC_DEFUN([MSC_PATCHLEVEL], m4_esyscmd_s(cat headers/modsecurity/modsecurity.h | grep "define MODSECURITY_PATCHLEVEL " | awk {'print $3'} | sed 's/\"//g')) +@@ -25,9 +24,6 @@ m4_define([msc_version], + m4_define([msc_version_with_patchlevel], + [msc_version_major.msc_version_minor.msc_version_patchlevel]) + +-m4_define([msc_version_git], +- [m4_esyscmd_s(git describe)]) +- + m4_define([msc_version_info], + [msc_version_c_plus_a:msc_version_patchlevel:msc_version_minor]) + +@@ -73,11 +69,6 @@ AC_MSG_ERROR([\ + + ]) + fi +-# Libinjection version +-AC_DEFUN([LIBINJECTION_VERSION], m4_esyscmd_s(cd "others/libinjection" && git describe && cd ../..)) +- +-# SecLang test version +-AC_DEFUN([SECLANG_TEST_VERSION], m4_esyscmd_s(cd "test/test-cases/secrules-language-tests" && git log -1 --format="%h" --abbrev-commit && cd ../../..)) + + + # Check for yajl +@@ -217,10 +208,6 @@ AC_SUBST([MSC_VERSION_WITH_PATCHLEVEL]) + MSC_VERSION=msc_version + AC_SUBST([MSC_VERSION]) + +-MSC_GIT_VERSION=msc_version_git +-AC_SUBST([MSC_GIT_VERSION]) +- +- + AC_ARG_ENABLE(debug-logs, + [AC_HELP_STRING([--disable-debug-logs],[Turn off the SecDebugLog feature])], + +@@ -412,16 +399,6 @@ AC_OUTPUT + + + # Print a fancy summary +-echo " " +-echo " " +-echo "ModSecurity - ${MSC_GIT_VERSION} for $PLATFORM" +-echo " " +-echo " Mandatory dependencies" +-echo -n " + libInjection ...." +-echo LIBINJECTION_VERSION +-echo -n " + SecLang tests ...." +-echo SECLANG_TEST_VERSION +- + echo " " + echo " Optional dependencies" + +-- +2.31.1 + diff --git a/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch b/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file mode 100644 index 0000000000..9608e3d935 --- /dev/null +++ b/package/libmodsecurity/0003-Revert-Fix-maxminddb-link-on-FreeBSD.patch @@ -0,0 +1,28 @@ +From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 16 Jul 2021 19:12:51 +0200 +Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD" + +This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788. + +Signed-off-by: Fabrice Fontaine +--- + build/libmaxmind.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4 +index 656fc250..02820b5a 100644 +--- a/build/libmaxmind.m4 ++++ b/build/libmaxmind.m4 +@@ -10,7 +10,7 @@ dnl MAXMIND_VERSION + AC_DEFUN([PROG_MAXMIND], [ + + # Possible names for the maxmind library/package (pkg-config) +-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind" ++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind" + + # Possible extensions for the library + MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib" +-- +2.30.2 + diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk index b2637257b6..66e7e522a1 100644 --- a/package/libmodsecurity/libmodsecurity.mk +++ b/package/libmodsecurity/libmodsecurity.mk @@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0 LIBMODSECURITY_LICENSE_FILES = LICENSE LIBMODSECURITY_CPE_ID_VENDOR = trustwave LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity +# We're patching build/libmaxmind.m4 +LIBMODSECURITY_AUTORECONF = YES LIBMODSECURITY_DEPENDENCIES = pcre LIBMODSECURITY_CONF_OPTS = \