Commit e597fc5317e0 ("daemon/yara: fix undefined behavior due to Yara 4.0
API changes", 2021-10-12) prevents the daemon from using such a Yara
version that precedes 4.0.0.
If only yara < 4 is found, treat the library as absent, rather than
attempting and failing to compile the yara module of the daemon. Note the
version requirement in the documentation too.
Suggested-by: Eric Blake <eblake(a)redhat.com>
Suggested-by: Richard W.M. Jones <rjones(a)redhat.com>
Signed-off-by: Laszlo Ersek <lersek(a)redhat.com>
---
docs/guestfs-building.pod | 2 +-
m4/guestfs-daemon.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/guestfs-building.pod b/docs/guestfs-building.pod
index 1f872700e367..803b89fd5ea6 100644
--- a/docs/guestfs-building.pod
+++ b/docs/guestfs-building.pod
@@ -387,7 +387,7 @@ Optional. For tab-completion of commands in bash.
Optional. Library for filesystem forensics analysis.
-=item yara
+=item yara E<ge> 4.0.0
Optional. Tool for categorizing files based on their content.
diff --git a/m4/guestfs-daemon.m4 b/m4/guestfs-daemon.m4
index 316a811d30a9..4dec4fa67995 100644
--- a/m4/guestfs-daemon.m4
+++ b/m4/guestfs-daemon.m4
@@ -134,7 +134,7 @@ AC_CHECK_LIB([tsk],[tsk_version_print],[
],[AC_MSG_WARN([The Sleuth Kit library (libtsk) not found])])
dnl yara library (optional)
-PKG_CHECK_MODULES([YARA], [yara],[
+PKG_CHECK_MODULES([YARA], [yara >= 4.0.0],[
AC_SUBST([YARA_CFLAGS])
AC_SUBST([YARA_LIBS])
AC_DEFINE([HAVE_YARA],[1],[yara library found at compile time.])
--
2.19.1.3.g30247aa5d201