You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
logwatch/SOURCES/sshd-sort-by-count.patch

23 lines
876 B

--- a/scripts/services/sshd 2022-12-29 01:34:28.000000000 +0100
+++ b/scripts/services/sshd 2024-11-27 13:33:50.590755283 +0100
@@ -548,7 +548,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}}) {
@@ -571,7 +572,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}}) {