Tuesday, March 26, 2024

Re: Update: Suricata 7.0.4 + fixes

On 03/26 09:38, Stuart Henderson wrote:
> On 2024/03/25 20:16, Jeremy Evans wrote:
> > Here's an update to Suricata 7.0.4, based on gonzalo's update
> > recently posted to ports@. After discussion with gonzalo@ and
> > sthen@, I'm adding myself as co-maintainer.
> >
> > In addition to the version update, this fixes the following issues:
> >
> > Package README recommends suricata-update, but default config is
> > overridden to not use suricata-update. Stop overriding default
> > config, so way recommended by package README does not require
> > suricata.yaml modification.
> >
> > Run SUBST_CMD on suricata.yaml.in to fix the ${LOCALSTATEDIR}
> > remaining in default installed configuration.
> >
> > suricata-update downloads to /var/lib/suricata instead of
> > /var/suricata by default, despite the local patches. Not sure yet
> > how to fix that easily, so updated package README to specify -D
> > flag so it updates the correct place. I checked OpenBSD 7.4
> > (Suricata 6.0.12) and suricata-update also defaulted to
> > /var/lib/suricata there.
> >
> > Remove now unnecessary patch for suricata/doc/Makefile.in. Remove
> > a couple unnecessary files in SUBST_CMD as well.
>
> OK.
>
> Some other possible tweaks:
>
> ${WRKSRC}/configure can be dropped from SUBST_CMD too.

I made that change.

> AUTOMAKE_VERSION is set but does nothing (the port does not use a
> CONFIGURE_STYLE which depends on automake) so probably better removed.
> Alternatively as e_rundir is only used to set the default pid path in
> suricata.yaml, that could be patched in suricata.yaml.in and avoid the
> need to re-run autoconf completely (-> CONFIGURE_STYLE=gnu and drop
> both AUTO*_VERSION lines).

I updated suricata.yaml.in to replace all of the autoconf related code
with make variables that will be updated by SUBST_CMD. I found that
suricata does not like our /etc/magic file, so I left that commented
out.

I found that autoconf is used by the build system. I made a few
attempts at patching it out, but was unsuccessful. So I left that in.

Here's a revised diff. I plan to commit this tomorrow unless I hear
objections.

Thanks,
Jeremy

Index: Makefile
===================================================================
RCS file: /cvs/ports/security/suricata/Makefile,v
retrieving revision 1.67
diff -u -p -r1.67 Makefile
--- Makefile 23 Mar 2024 13:26:40 -0000 1.67
+++ Makefile 26 Mar 2024 19:44:49 -0000
@@ -3,9 +3,8 @@ NOT_FOR_ARCHS = powerpc64 riscv64

COMMENT = high performance network IDS, IPS and security monitoring

-SURICATA_V = 7.0.3
-SUPDATE_V = 1.2.8
-REVISION = 1
+SURICATA_V = 7.0.4
+SUPDATE_V = 1.3.2

DISTNAME = suricata-${SURICATA_V}
CATEGORIES = security
@@ -13,7 +12,8 @@ SHARED_LIBS += htp

HOMEPAGE = https://suricata.io/

-MAINTAINER = Gonzalo L. R. <gonzalo@openbsd.org>
+MAINTAINER = Gonzalo L. R. <gonzalo@openbsd.org>, \
+ Jeremy Evans <jeremy@openbsd.org>

# GPLv2
PERMIT_PACKAGE= Yes
@@ -48,7 +48,6 @@ DEBUG_PACKAGES = ${BUILD_PACKAGES}

CONFIGURE_STYLE = autoconf
AUTOCONF_VERSION = 2.71
-AUTOMAKE_VERSION = 1.15

CONFIGURE_ENV = ac_cv_path_HAVE_PDFLATEX= \
ac_cv_path_HAVE_GIT_CMD= \
@@ -67,9 +66,7 @@ CONFIGURE_ARGS = --disable-gccmarch-nati
SUBST_VARS = SURICATA_V SUPDATE_V

pre-configure:
- ${SUBST_CMD} ${WRKSRC}/configure \
- ${WRKSRC}/doc/userguide/Makefile.in \
- ${WRKSRC}/suricata-update/doc/Makefile \
+ ${SUBST_CMD} ${WRKSRC}/suricata.yaml.in \
${WRKSRC}/suricata-update/suricata/update/config.py \
${WRKSRC}/suricata-update/suricata/update/parsers.py
# prevent generating revision.py
Index: distinfo
===================================================================
RCS file: /cvs/ports/security/suricata/distinfo,v
retrieving revision 1.22
diff -u -p -r1.22 distinfo
--- distinfo 22 Feb 2024 09:49:35 -0000 1.22
+++ distinfo 26 Mar 2024 19:44:49 -0000
@@ -1,2 +1,2 @@
-SHA256 (suricata-7.0.3.tar.gz) = 6gdC16mHg/GvSldmGvYGi8LYUKw+ygSzIE0ozhZeNf8=
-SIZE (suricata-7.0.3.tar.gz) = 23599903
+SHA256 (suricata-7.0.4.tar.gz) = ZABgEgAkvnDb6B9uxu/HLkYlD8s2IZ3/Z+ZBciD/Ibc=
+SIZE (suricata-7.0.4.tar.gz) = 23610769
Index: patches/patch-doc_userguide_Makefile_in
===================================================================
RCS file: patches/patch-doc_userguide_Makefile_in
diff -N patches/patch-doc_userguide_Makefile_in
--- patches/patch-doc_userguide_Makefile_in 16 Nov 2023 18:15:37 -0000 1.7
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,8 +0,0 @@
-Index: doc/userguide/Makefile.in
---- doc/userguide/Makefile.in.orig
-+++ doc/userguide/Makefile.in
-@@ -1,3 +1,4 @@
-+
- # Makefile.in generated by automake 1.16.5 from Makefile.am.
- # @configure_input@
-
Index: patches/patch-src_suricata_c
===================================================================
RCS file: /cvs/ports/security/suricata/patches/patch-src_suricata_c,v
retrieving revision 1.14
diff -u -p -r1.14 patch-src_suricata_c
--- patches/patch-src_suricata_c 18 Mar 2024 17:46:37 -0000 1.14
+++ patches/patch-src_suricata_c 26 Mar 2024 19:44:49 -0000
@@ -4,7 +4,7 @@ Suricata uses libcap-ng on Linux and run
Index: src/suricata.c
--- src/suricata.c.orig
+++ src/suricata.c
-@@ -1600,7 +1600,7 @@ static TmEcode ParseCommandLine(int argc, char** argv,
+@@ -1597,7 +1597,7 @@ static TmEcode ParseCommandLine(int argc, char** argv,
return TM_ECODE_FAILED;

No comments:

Post a Comment