From dcf9a8d3e929f54fc316e9d226c2c67c441c6e61 Mon Sep 17 00:00:00 2001 From: boban Date: Fri, 31 Oct 2025 04:32:24 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20Mailbox=20Stats=20=C3=BCber=20Dovecot=20?= =?UTF-8?q?mit=20config/mailpool.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php b/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php index d394cfd..b42b0bf 100644 --- a/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php +++ b/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php @@ -160,8 +160,8 @@ WHERE bantime < 0 ORDER BY timeofban DESC; SQL; - $q = sprintf($sql, $this->sql($jail)); - $cmd = "$sudo -n $sqlite -readonly ".escapeshellarg($db).' '.escapeshellarg($q).' 2>&1'; + $qSql = str_replace(':JAIL:', $this->sql($jail), $sql); + $cmd = "$sudo -n $sqlite -readonly ".escapeshellarg($db).' '.escapeshellarg($qSql).' 2>&1'; $out = trim((string)@shell_exec($cmd)); if ($out === '') return []; @@ -236,7 +236,11 @@ SQL; private function getDbFile(): string { [, $out] = $this->f2b('get dbfile'); - $path = trim($out); + // nimm die letzte nicht-leere Zeile + $lines = array_values(array_filter(array_map('trim', preg_split('/\r?\n/', $out)))); + $path = end($lines) ?: ''; + // fail2ban zeigt manchmal "`- /pfad" → führende Zeichen abschneiden + $path = preg_replace('/^`?-?\s*/', '', $path); return $path !== '' ? $path : '/var/lib/fail2ban/fail2ban.sqlite3'; }