From 8ebb6d209831c894c308b994611cd39aa6bca1ae Mon Sep 17 00:00:00 2001 From: Jan Synacek Date: Thu, 3 May 2012 14:29:16 +0200 Subject: [PATCH] Add sshd-undef patch (rhbz#783528) --- logwatch-sshd-undef.patch | 24 ++++++++++++++++++++++++ logwatch.spec | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 logwatch-sshd-undef.patch diff --git a/logwatch-sshd-undef.patch b/logwatch-sshd-undef.patch new file mode 100644 index 0000000..99c5d9e --- /dev/null +++ b/logwatch-sshd-undef.patch @@ -0,0 +1,24 @@ +--- scripts/services/sshd.orig 2012-04-27 10:13:45.000000000 +0200 ++++ scripts/services/sshd 2012-04-27 13:57:36.880932891 +0200 +@@ -450,8 +450,19 @@ while (defined(my $ThisLine = )) + + foreach my $Host (keys %PotentialIllegalUsers) { + foreach my $User (keys %{$PotentialIllegalUsers{$Host}}) { +- while ($IllegalUsers{$Host}{$User} < $PotentialIllegalUsers{$Host}{$User}) { +- $IllegalUsers{$Host}{$User}++; ++ my @user_hosts = grep { $PotentialIllegalUsers{$_}{$User} } keys %PotentialIllegalUsers; ++ ++ if ($Host eq "undef") { ++ if ((scalar @user_hosts) == 1 && $user_hosts[0] == "undef") { ++ # Report illegal user from "undef" only if there are no other hosts ++ # for the given user ++ $IllegalUsers{"undef"}{$User}++; ++ } ++ } ++ else { ++ while ($IllegalUsers{$Host}{$User} < $PotentialIllegalUsers{$Host}{$User}) { ++ $IllegalUsers{$Host}{$User}++; ++ } + } + } + } diff --git a/logwatch.spec b/logwatch.spec index 5f7d9d5..bebc5b9 100644 --- a/logwatch.spec +++ b/logwatch.spec @@ -33,6 +33,8 @@ Patch12: logwatch-secure-update.patch Patch13: logwatch-mail-headers.patch # not yet in upstream Patch14: logwatch-systemd-logind.patch +# not yet in upstream +Patch15: logwatch-sshd-undef.patch Requires: textutils sh-utils grep mailx Requires: perl(Date::Manip) BuildArchitectures: noarch @@ -59,6 +61,7 @@ of the package on many systems. %patch12 -p0 %patch13 -p0 %patch14 -p0 +%patch15 -p0 rm -f scripts/services/*.orig %build @@ -155,6 +158,7 @@ echo "# Configuration overrides for specific logfiles/services may be placed her - Add secure-update patch (rhbz#809314) - Add mail-headers patch (rhbz#811185) - Add systemd-logind patch (rhbz#812880) +- Add sshd-undef patch (rhbz#783528) * Wed Apr 25 2012 Jan Synáček - 7.4.0-10.20120425svn100 - Update to revision 100