* [PATCH] firewallog.dat: Fix bug13068 - remove blocklist entries from firewall log
@ 2025-03-02 9:26 Adolf Belka
0 siblings, 0 replies; only message in thread
From: Adolf Belka @ 2025-03-02 9:26 UTC (permalink / raw)
To: development
[-- Attachment #1: Type: text/plain, Size: 2767 bytes --]
- The blocklist log entries are also under kernel: and so currently also show up in the
firewall logs as well as in the ip blocklist logs menus. If there are a lot of
blocklist entries it can make it very difficult to go through the firewall logs.
- This bugfix excxludes any kernel: log entries that have a chain starting with BLKLST.
- Tested out on physical and vm IPFire systems.
Fixes: bug13068
Tested-by: Adolf Belka <adolf.belka(a)ipfire.org>
Signed-off-by: Adolf Belka <adolf.belka(a)ipfire.org>
---
html/cgi-bin/logs.cgi/firewalllog.dat | 30 ++++++++++++++-------------
1 file changed, 16 insertions(+), 14 deletions(-)
mode change 100644 => 100755 html/cgi-bin/logs.cgi/firewalllog.dat
diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/firewalllog.dat
old mode 100644
new mode 100755
index 01dcdc7d4..aafbe3db7
--- a/html/cgi-bin/logs.cgi/firewalllog.dat
+++ b/html/cgi-bin/logs.cgi/firewalllog.dat
@@ -176,23 +176,25 @@ while ($gzindex >=0 && $loop) {
READ:while (<FILE>) {
my $line = $_;
if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:.*IN=.*$/) {
- # when standart viewing, just keep in memory the correct slice
- # it starts a '$start' and size is $viewport
- # If export, then keep all lines...
- if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
- $log[$lines++] = "$line";
- } else {
- if ($lines++ < ($start + $Header::viewsize)) {
- push(@log,"$line");
- if (@log > $Header::viewsize) {
- shift (@log);
+ unless ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:\sBLKLST.*IN=.*$/) {
+ # when standart viewing, just keep in memory the correct slice
+ # it starts a '$start' and size is $viewport
+ # If export, then keep all lines...
+ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}){
+ $log[$lines++] = "$line";
+ } else {
+ if ($lines++ < ($start + $Header::viewsize)) {
+ push(@log,"$line");
+ if (@log > $Header::viewsize) {
+ shift (@log);
+ }
+ #} else { dont do this optimisation, need to count lines !
+ # $datetime = $maxtime; # we have read viewsize lines, stop main loop
+ # last READ; # exit read file
}
- #} else { dont do this optimisation, need to count lines !
- # $datetime = $maxtime; # we have read viewsize lines, stop main loop
- # last READ; # exit read file
}
+ $search_for_end = 1; # we find the start of slice, can look for end now
}
- $search_for_end = 1; # we find the start of slice, can look for end now
} else {
if ($search_for_end == 1) {
#finish read files when date is over (test month equality only)
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-02 9:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-02 9:26 [PATCH] firewallog.dat: Fix bug13068 - remove blocklist entries from firewall log Adolf Belka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox