diff --git a/logwatch.spec b/logwatch.spec index 5efad64..a04a0ac 100644 --- a/logwatch.spec +++ b/logwatch.spec @@ -2,10 +2,14 @@ Summary: Analyzes and Reports on system logs Name: logwatch Version: 7.8 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://sourceforge.net/projects/logwatch/ Source0: https://sourceforge.net/projects/logwatch/files/%{name}-%{version}/%{name}-%{version}.tar.gz +# Update for BZ2192995 - should drop for 7.9 +Patch0: mdadm.patch +# Update to named reporting - should drop for 7.9 +Patch1: named.patch BuildRequires: perl-generators Requires: grep Requires: perl(Date::Manip) @@ -29,6 +33,8 @@ of the package on many systems. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build @@ -127,6 +133,10 @@ echo "# Configuration overrides for specific logfiles/services may be placed her %{_unitdir}/logwatch.timer %changelog +* Sun May 07 2023 Frank Crawford - 7.8-2 +- Add patch to mdadm to fix BZ2192995 for F38 +- Fix reports for named + * Sun Jan 22 2023 Frank Crawford - 7.8-1 - Update to 7.8 diff --git a/mdadm.patch b/mdadm.patch new file mode 100644 index 0000000..a1749d0 --- /dev/null +++ b/mdadm.patch @@ -0,0 +1,13 @@ +diff --git a/scripts/services/mdadm b/scripts/services/mdadm +index 4257977..808825b 100644 +--- a/scripts/services/mdadm ++++ b/scripts/services/mdadm +@@ -36,7 +36,7 @@ my $mdadm; + if ( + open($mdadm, "<", "/etc/mdadm.conf") or + open($mdadm, "<", "/etc/mdadm/mdadm.conf") or +- open($mdadm, "<", "mdadm --detail --scan 2>/dev/null|")) { ++ open($mdadm, "-|", "mdadm --detail --scan")) { + while (<$mdadm>) { + if (/^ARRAY/) { + push(@devices,(split())[1]); diff --git a/named.patch b/named.patch new file mode 100644 index 0000000..c0d89fd --- /dev/null +++ b/named.patch @@ -0,0 +1,51 @@ +diff --git a/scripts/services/named b/scripts/services/named +index 9c83563..0770066 100644 +--- a/scripts/services/named ++++ b/scripts/services/named +@@ -69,7 +69,7 @@ my ( + %LimitSlip, %NError, %NUR, + %NoSOA, %OtherList, %StartLog, + %UnknownCCCommands, %BadCookie, %Timeout, +-%LoopDetected, %MissingCookie, ++%LoopDetected, %MissingCookie, %FormatError, + ); + # Avoid "Use of uninitialized value" warning messages. + sub ValueOrDefault { +@@ -368,10 +368,15 @@ while (defined(my $ThisLine = )) { + # Remove port number, for proper IP sorting + $Host =~ s/#.*//; + $UnexpRCODE{$Rcode}{$Zone}{$Host}++; +- } elsif ( ($ThisLine =~ /(?:error \()?FORMERR\)? resolving '[^ ]+: [.0-9a-fA-F:#]+/) or +- ($ThisLine =~ /DNS format error from [^ ]+ resolving [^ ]+( for( client)? [^ ]+)?: .*/) ) { ++ } elsif ( ($Problem,$Addr,$Server) = ($ThisLine =~ /((?:error \()??FORMERR\)? resolving) '([^ \/]+)(?:\/[^ ]+)?': ([.0-9a-fA-F:]+)(?:#\d+)?/) ) { ++ $FormatError{$Problem}{$Addr}{$Server}++; ++ } elsif ($ThisLine =~ /(?:error \()?FORMERR\)? resolving .*/) { + chomp($ThisLine); + $FormErr{$ThisLine}++; ++ } elsif ( ($Server,$Addr,$Host,$Problem) = ($ThisLine =~ /DNS format error from ([.0-9a-fA-F:]+)(?:#\d+)? resolving ([^ \/]+)(?:\/[^ ]+)? for(?: client)? ([^ #]+)(?:#\d+)?: (.*) -- invalid response/) ) { ++ $FormatError{$Problem}{$Addr}{$Server}++; ++ } elsif ( ($Server,$Addr,$Host,$Problem) = ($ThisLine =~ /DNS format error from ([.0-9a-fA-F:]+)(?:#\d+)? resolving ([^ \/]+)(?:\/[^ ]+)? for(?: client)? ([^ #]+)(?:#\d+)?: (.*)/) ) { ++ $FormatError{$Problem}{$Addr}{$Server}++; + } elsif ( ($ThisLine =~ /found [0-9]* CPU(s)?, using [0-9]* worker thread(s)?/) ) { + chomp($ThisLine); + $StartLog{$ThisLine}++; +@@ -876,6 +881,19 @@ if (($Detail >= 5) and (keys %FormErr)) { + } + } + ++if (($Detail >= 5) and (keys %FormatError)) { ++ print "\nDNS Format Error:\n"; ++ foreach my $Problem (sort {$a cmp $b} keys %FormatError) { ++ print " " . $Problem . ":\n"; ++ foreach my $Addr (sort {$a cmp $b} keys %{$FormatError{$Problem}}) { ++ print " " . $Addr . ":\n"; ++ foreach my $Server (sort SortIP keys %{$FormatError{$Problem}{$Addr}}) { ++ print " " . $Server . ": " . $FormatError{$Problem}{$Addr}{$Server} . " Time(s)\n"; ++ } ++ } ++ } ++} ++ + if (($Detail >= 10) and (keys %StartLog)) { + print "\nNamed startup logs:\n"; + foreach my $ThisOne (keys %StartLog) {