From dab02f176fb372b51ad7b232999f0eff0a4b2dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sun, 3 Nov 2024 09:51:13 +0800 Subject: [PATCH] OS (Linux): improve performance of proxmox version detection Fix #1370 --- src/detection/os/os_linux.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/detection/os/os_linux.c b/src/detection/os/os_linux.c index c7ede9b16..700e18e76 100644 --- a/src/detection/os/os_linux.c +++ b/src/detection/os/os_linux.c @@ -186,13 +186,13 @@ static bool detectDebianDerived(FFOSResult* result) ffStrbufSetS(&result->name, "Proxmox VE"); ffStrbufClear(&result->versionID); if (ffProcessAppendStdOut(&result->versionID, (char* const[]) { - "/usr/bin/pveversion", + "/usr/bin/dpkg-query", + "--showformat=${version}", + "--show", + "pve-manager", NULL, - }) == NULL) // pve-manager/8.2.2/9355359cd7afbae4 (running kernel: 6.8.4-2-pve) - { - ffStrbufSubstrBeforeLastC(&result->versionID, '/'); - ffStrbufSubstrAfterFirstC(&result->versionID, '/'); - } + }) == NULL) // 8.2.2 + ffStrbufTrimRightSpace(&result->versionID); ffStrbufSetF(&result->prettyName, "Proxmox VE %s", result->versionID.chars); return true; }