Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- run: git config --global --add safe.directory /__w/suricata/suricata
- run: ./scripts/bundle.sh
- run: ./autogen.sh
- run: ./configure --enable-warnings
- run: ./configure --enable-warnings --enable-mimetype
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder : could this be a plugin ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To rephrase, what are we missing in Suricata so that it could be a plugin ?..

- name: Checking bindgen output
working-directory: rust
run: |
Expand Down
20 changes: 20 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,28 @@ install-conf:
install -d "$(DESTDIR)$(e_rundir)"
install -m 770 -d "$(DESTDIR)$(e_localstatedir)"
install -m 770 -d "$(DESTDIR)$(e_datadir)"
if INSTALL_MIMETYPE_FILES
install -m 770 -d "$(DESTDIR)$(e_datadir)/mimetype"
@test -e "$(DESTDIR)$(e_datadir)/mimetype/magic" || \
install -m 600 "$(top_srcdir)/etc/mimetype/magic" "$(DESTDIR)$(e_datadir)/mimetype"
@test -e "$(DESTDIR)$(e_datadir)/mimetype/aliases" || \
install -m 600 "$(top_srcdir)/etc/mimetype/aliases" "$(DESTDIR)$(e_datadir)/mimetype"
@test -e "$(DESTDIR)$(e_datadir)/mimetype/subclasses" || \
install -m 600 "$(top_srcdir)/etc/mimetype/subclasses" "$(DESTDIR)$(e_datadir)/mimetype"
endif

install -m 770 -d "$(DESTDIR)$(e_sghcachedir)"

upgrade-data:
if INSTALL_MIMETYPE_FILES
install -d "$(DESTDIR)$(e_datadir)/mimetype"
install -m 600 "$(top_srcdir)/etc/mimetype/magic" "$(DESTDIR)$(e_datadir)/mimetype"
install -m 600 "$(top_srcdir)/etc/mimetype/aliases" "$(DESTDIR)$(e_datadir)/mimetype"
install -m 600 "$(top_srcdir)/etc/mimetype/subclasses" "$(DESTDIR)$(e_datadir)/mimetype"
else
@echo "Not installing Mime type files as mimetype support not enabled or gpl data are embedded in the binary."
endif

install-rules:
if INSTALL_SURICATA_UPDATE
LD_LIBRARY_PATH=$(libdir) $(DESTDIR)$(bindir)/suricata-update \
Expand Down
30 changes: 30 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1765,6 +1765,34 @@
fi
fi

# mimetype
AC_ARG_ENABLE(mimetype,
AS_HELP_STRING([--enable-mimetype], [Enable mimetype support [default=no]]),
[enable_mimetype="$enableval"],[enable_mimetype=no])
install_mimetype_files="no"
AS_IF([test "x$enable_mimetype" = "xyes"], [
install_mimetype_files="yes"
AC_DEFINE([HAVE_MIMETYPE],[1],(Mimetype support enabled))
AC_ARG_ENABLE(bundled-gpl-mimetype,
AS_HELP_STRING([--enable-bundled-gpl-mimetype], [Embed GPL data in mimetype support [default=no]]),
[enable_gpl_mimetype="$enableval"],[enable_gpl_mimetype=no])
AS_IF([test "x$enable_gpl_mimetype" = "xyes"], [
WITH_GPL_DATA="\"with-gpl-data\""
AC_SUBST(WITH_GPL_DATA)
AC_DEFINE([HAVE_GPL_MIMETYPE],[1],[Embedded GPL data for Mimetype support enabled])
install_mimetype_files="no"
])
AM_CONDITIONAL([HAVE_MIMETYPE], [true])
],
[
AM_CONDITIONAL([HAVE_MIMETYPE], [false])
]
)
if test "x$enable_gpl_mimetype" != "xyes"; then
enable_gpl_mimetype="no"
fi
AM_CONDITIONAL([INSTALL_MIMETYPE_FILES], [test "x$install_mimetype_files" = "xyes"])

# Napatech - Using the 3GD API
AC_ARG_ENABLE(napatech,
AS_HELP_STRING([--enable-napatech],[Enable Napatech Devices]),
Expand Down Expand Up @@ -2578,6 +2606,8 @@ SURICATA_BUILD_CONF="Suricata Configuration:
Detection enabled: ${enable_detection}

Libmagic support: ${enable_magic}
mimetype support: ${enable_mimetype}
GPL Mimetype DB inclusion: ${enable_gpl_mimetype}
libjansson support: ${enable_jansson}
hiredis support: ${enable_hiredis}
hiredis async with libevent: ${enable_hiredis_async}
Expand Down
Loading