From fa65bc1c2e39853199b4c49762f96afde78bedbd Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 26 Apr 2026 21:17:24 +0200 Subject: [PATCH] Fix: ClamAV isInstalled() via file_exists statt Hardcode true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prüft /usr/sbin/clamd und systemd unit-Dateien ohne exec(). Zeigt Install-Button wenn ClamAV nicht installiert ist. Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Ui/Security/ClamavManager.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Ui/Security/ClamavManager.php b/app/Livewire/Ui/Security/ClamavManager.php index d614dae..01547f8 100644 --- a/app/Livewire/Ui/Security/ClamavManager.php +++ b/app/Livewire/Ui/Security/ClamavManager.php @@ -52,7 +52,7 @@ class ClamavManager extends Component $this->lastSuccess = ''; $this->running = $this->serviceActive(); $this->enabled = $this->serviceEnabled(); - $this->installed = true; + $this->installed = $this->isInstalled(); $this->ramMb = $this->running ? $this->readRamMb() : null; [$this->dbDate, $this->dbVersion] = $this->readDbInfo(); } @@ -128,6 +128,13 @@ class ClamavManager extends Component return [$rc === 0, $msg]; } + private function isInstalled(): bool + { + return file_exists('/usr/sbin/clamd') + || file_exists('/lib/systemd/system/clamav-daemon.service') + || file_exists('/usr/lib/systemd/system/clamav-daemon.service'); + } + private function serviceActive(): bool { $exit = null;