Upgrade to new upstream version

This commit is contained in:
Frank Crawford 2023-05-07 17:47:55 +10:00
parent 49946c98f5
commit c6116e54cb
3 changed files with 75 additions and 1 deletions

View File

@ -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 <frank@crawford.emu.id.au> - 7.8-2
- Add patch to mdadm to fix BZ2192995 for F38
- Fix reports for named
* Sun Jan 22 2023 Frank Crawford <frank@crawford.emu.id.au> - 7.8-1
- Update to 7.8

13
mdadm.patch Normal file
View File

@ -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]);

51
named.patch Normal file
View File

@ -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 = <STDIN>)) {
# 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) {