From 3bd750bedffac3f39ef03bf030a74459befec4bc Mon Sep 17 00:00:00 2001 From: Carter Li Date: Fri, 6 Jun 2025 14:34:20 +0800 Subject: [PATCH] Host (Linux): detect Linux Binary Compatibility on FreeBSD Fix #1786 --- src/detection/host/host_linux.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/detection/host/host_linux.c b/src/detection/host/host_linux.c index 98349a642..7f8108cc8 100644 --- a/src/detection/host/host_linux.c +++ b/src/detection/host/host_linux.c @@ -93,6 +93,17 @@ const char* ffDetectHost(FFHostResult* host) }); // supported in 2.2.3 and later } } + else if (ffStrbufStartsWithS(&instance.state.platform.sysinfo.version, "FreeBSD ")) + { + ffStrbufSetStatic(&host->name, "Linux Binary Compatibility on FreeBSD"); + ffStrbufSetStatic(&host->family, "FreeBSD"); + ffStrbufSetStatic(&host->vendor, "FreeBSD Foundation"); + if (instance.config.general.detectVersion) + { + ffStrbufSetS(&host->version, instance.state.platform.sysinfo.version.chars + strlen("FreeBSD ")); + ffStrbufSubstrBeforeFirstC(&host->version, ' '); + } + } } return NULL;