From 7d738392b20c6d423d71d8d13d07e419f3b23a8d Mon Sep 17 00:00:00 2001 From: boban Date: Sun, 26 Apr 2026 20:33:37 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20isInstalled()=20pr=C3=BCft=20systemd-Uni?= =?UTF-8?q?t=20statt=20Binary-Pfade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zuverlässiger auf Servern wo PHP-FPM keinen Zugriff auf /usr/bin hat. Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Ui/Security/ClamavManager.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Livewire/Ui/Security/ClamavManager.php b/app/Livewire/Ui/Security/ClamavManager.php index a22ffc5..f95dfc2 100644 --- a/app/Livewire/Ui/Security/ClamavManager.php +++ b/app/Livewire/Ui/Security/ClamavManager.php @@ -94,8 +94,20 @@ class ClamavManager extends Component private function isInstalled(): bool { - return is_executable('/usr/bin/clamscan') || is_executable('/usr/sbin/clamd') - || @file_exists('/usr/sbin/clamd') || @file_exists('/usr/bin/clamdscan'); + // Systemd-Unit ist zuverlässiger als Binary-Pfade (keine exec-Rechte nötig) + $unitPaths = [ + '/lib/systemd/system/clamav-daemon.service', + '/usr/lib/systemd/system/clamav-daemon.service', + '/etc/systemd/system/clamav-daemon.service', + ]; + foreach ($unitPaths as $p) { + if (@file_exists($p)) return true; + } + // Fallback: bekannte Binary-Pfade + foreach (['/usr/bin/clamscan', '/usr/bin/clamdscan', '/usr/sbin/clamd', '/bin/clamscan'] as $b) { + if (@file_exists($b)) return true; + } + return false; } private function serviceActive(): bool