From 2f999cbda4a52105439ac039f9e9dcd6eabe6747 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 11 Mar 2025 07:43:47 +0000 Subject: [PATCH] import CS logwatch-7.5.5-7.el9 --- SOURCES/sshd-sort-by-count.patch | 22 ++++++++++++++++++++++ SPECS/logwatch.spec | 8 +++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 SOURCES/sshd-sort-by-count.patch diff --git a/SOURCES/sshd-sort-by-count.patch b/SOURCES/sshd-sort-by-count.patch new file mode 100644 index 0000000..1a69b21 --- /dev/null +++ b/SOURCES/sshd-sort-by-count.patch @@ -0,0 +1,22 @@ +--- a/scripts/services/sshd 2021-01-22 21:59:40.000000000 +0100 ++++ b/scripts/services/sshd 2024-11-28 10:33:31.199069612 +0100 +@@ -515,7 +515,8 @@ + + if (keys %BadLogins) { + print "\nFailed logins from:\n"; +- foreach my $ip (sort SortIP keys %BadLogins) { ++ my $totalSort = TotalCountOrder(%BadLogins, \&SortIP); ++ foreach my $ip (sort $totalSort keys %BadLogins) { + my $name = LookupIP($ip); + my $totcount = 0; + foreach my $user (keys %{$BadLogins{$ip}}) { +@@ -538,7 +539,8 @@ + print " (with threshold >= $IllegalUsersThreshold)"; + } + print ":\n"; +- foreach my $ip (sort SortIP keys %IllegalUsers) { ++ my $totalSort = TotalCountOrder(%IllegalUsers, \&SortIP); ++ foreach my $ip (sort $totalSort keys %IllegalUsers) { + my $name = LookupIP($ip); + my $totcount = 0; + foreach my $user (keys %{$IllegalUsers{$ip}}) { diff --git a/SPECS/logwatch.spec b/SPECS/logwatch.spec index d059808..3ab0216 100644 --- a/SPECS/logwatch.spec +++ b/SPECS/logwatch.spec @@ -2,12 +2,13 @@ Summary: A log file analysis program Name: logwatch Version: 7.5.5 -Release: 6%{?dist} +Release: 7%{?dist} License: MIT URL: https://sourceforge.net/projects/logwatch Source0: logwatch-%{version}.tar.gz Patch0: cron.patch Patch1: systemd-deactivated.patch +Patch2: sshd-sort-by-count.patch #Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz BuildRequires: perl-generators Requires: grep @@ -35,6 +36,7 @@ of the package on many systems. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build @@ -129,6 +131,10 @@ echo "# Configuration overrides for specific logfiles/services may be placed her %{_unitdir}/logwatch.timer %changelog +* Thu Nov 28 2024 Pavel Simovec - 7.5.5-7 +- sshd: sort IP addresses reported by count +- Resolves: RHEL-69277 + * Fri Apr 14 2023 Pavel Šimovec - 7.5.5-6 - Add patch to fix systemd messages containing "Deactivated" - Resolves: rhbz:2160770