From 113f7d34d8f3836fe103063f565922cdaf725c79 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 1 Jul 2026 10:57:01 +0800 Subject: [PATCH] OS (Linux): Add Astra Linux version detection Fixes #2427 --- src/detection/os/os_linux.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index d3eeb4326..6bdb37b9d 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -330,6 +330,15 @@ FF_A_UNUSED static void detectDeepinEnhancement(FFOSResult* result) { } } +FF_A_UNUSED static void detectAstraVersion(FFOSResult* result) { + // `PRETTY_NAME` is just `Astra Linux`; the version is in `VERSION_ID`, e.g. `2.12_x86-64` + ffStrbufAppendSUntilC(&result->version, result->versionID.chars, '_'); + if (result->version.length > 0) { + ffStrbufAppendC(&result->prettyName, ' '); + ffStrbufAppend(&result->prettyName, &result->version); + } +} + static void detectOS(FFOSResult* os) { #ifdef FF_CUSTOM_OS_RELEASE_PATH parseOsRelease(FF_STR(FF_CUSTOM_OS_RELEASE_PATH), os); @@ -389,6 +398,8 @@ void ffDetectOSImpl(FFOSResult* os) { } } else if (ffStrbufEqualS(&os->id, "deepin")) { detectDeepinEnhancement(os); + } else if (ffStrbufEqualS(&os->id, "astra")) { + detectAstraVersion(os); } #endif }