From 4f54eab672fc97c40132577fef70f0aa8f0960f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 30 Jul 2023 00:36:47 +0800 Subject: [PATCH] LM (Linux): fix gdm version detection on Ubuntu --- src/detection/lm/lm_linux.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/detection/lm/lm_linux.c b/src/detection/lm/lm_linux.c index 6b96db254..6416c80a7 100644 --- a/src/detection/lm/lm_linux.c +++ b/src/detection/lm/lm_linux.c @@ -16,8 +16,15 @@ static const char* getGdmVersion(FFstrbuf* version) "--version", NULL }); - if (error) - return error; + if (error || version->length == 0) + { + error = ffProcessAppendStdOut(version, (char* const[]) { + "gdm3", + "--version", + NULL + }); + if (error || version->length == 0) return "Failed to get GDM version"; + } // GDM 44.1 ffStrbufSubstrAfterFirstC(version, ' ');