From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH] firewallog.dat: Fix bug13068 - remove blocklist entries from firewall log Date: Sun, 02 Mar 2025 09:26:14 +0000 Message-ID: <20250228112731.5437-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1849668149784756768==" List-Id: --===============1849668149784756768== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable - 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 lo= t 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 wi= th BLKLST. - Tested out on physical and vm IPFire systems. Fixes: bug13068 Tested-by: Adolf Belka Signed-off-by: Adolf Belka --- html/cgi-bin/logs.cgi/firewalllog.dat | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) mode change 100644 =3D> 100755 html/cgi-bin/logs.cgi/firewalllog.dat diff --git a/html/cgi-bin/logs.cgi/firewalllog.dat b/html/cgi-bin/logs.cgi/fi= rewalllog.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 >=3D0 && $loop) { READ:while () { my $line =3D $_; if ($line =3D~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:.*IN=3D.*$= /) { - # 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++] =3D "$line"; - } else { - if ($lines++ < ($start + $Header::viewsize)) { - push(@log,"$line"); - if (@log > $Header::viewsize) { - shift (@log); + unless ($line =3D~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ kernel:\sBLK= LST.*IN=3D.*$/) { + # 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++] =3D "$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 =3D $maxtime; # we have read viewsize lines, stop main loop + # last READ; # exit read file } - #} else { dont do this optimisation, need to count lines ! - # $datetime =3D $maxtime; # we have read viewsize lines, stop main loop - # last READ; # exit read file } + $search_for_end =3D 1; # we find the start of slice, can look for end n= ow } - $search_for_end =3D 1; # we find the start of slice, can look for end now } else { if ($search_for_end =3D=3D 1) { #finish read files when date is over (test month equality only) --=20 2.48.1 --===============1849668149784756768==--