From 74e61ead3c68ebaec84f2c6a23bd8a49be4f80ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Kl=C3=AD=C4=8D?= Date: Wed, 3 Feb 2010 10:57:06 +0000 Subject: [PATCH] Added patch from #555735 - DHCPDv6 --- logwatch-7.3.6-dhcpd.patch | 14 ------ logwatch-7.3.6-dhcpd2.patch | 92 +++++++++++++++++++++++++++++++++++++ logwatch.spec | 6 ++- 3 files changed, 96 insertions(+), 16 deletions(-) delete mode 100644 logwatch-7.3.6-dhcpd.patch create mode 100644 logwatch-7.3.6-dhcpd2.patch diff --git a/logwatch-7.3.6-dhcpd.patch b/logwatch-7.3.6-dhcpd.patch deleted file mode 100644 index 8489ea2..0000000 --- a/logwatch-7.3.6-dhcpd.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -up logwatch-7.3.6/scripts/services/dhcpd.p logwatch-7.3.6/scripts/services/dhcpd ---- logwatch-7.3.6/scripts/services/dhcpd.p 2006-10-20 23:12:27.000000000 +0200 -+++ logwatch-7.3.6/scripts/services/dhcpd 2009-11-03 14:15:43.000000000 +0100 -@@ -127,6 +127,10 @@ while (my $line = ) { - if ($Detail >= 3) { - $data{'Warnings'}{$line}++; - } -+ } elsif ($line =~ s/uid lease ([\d.]*) for client ([^ ]*) is duplicate on ([^ ]*)/uid lease $1 for client $2 is duplicate/) { -+ if ($Detail >= 3) { -+ $data{'Duplicate lease'}{$line}++; -+ } - } else { - $data{'Unknown Entries'}{$line}++; - } diff --git a/logwatch-7.3.6-dhcpd2.patch b/logwatch-7.3.6-dhcpd2.patch new file mode 100644 index 0000000..47c4c9f --- /dev/null +++ b/logwatch-7.3.6-dhcpd2.patch @@ -0,0 +1,92 @@ +--- logwatch/scripts/services/dhcpd 2009-08-11 21:59:52.000000000 +1000 ++++ dhcpd 2010-01-18 09:39:55.000000000 +1100 +@@ -16,6 +16,8 @@ + + my %data; + ++my %clientrequest; ++ + # This filter is very basic... much more could be done with it + + while (my $line = ) { +@@ -46,13 +48,22 @@ + ($line =~ /^DHCPDISCOVER/) or + ($line =~ /^DHCPREQUEST/) or + ($line =~ /^DHCPRELEASE/) or ++ ($line =~ /^Solicit message from/) or ++ ($line =~ /^Sending Advertise to/) or + ($line =~ /^pool [0-9a-f]+ /) + ) { + # Ignore these lines + } elsif ($line =~ s/Listening on\s+//) { ++ if ($line =~ /\/[0-9a-fA-F:]+\/\d+$/) { ++ $data{'DHCP Server Listening On'}{'Configured for DHCPv6 (IPv6)'}++; ++ } else { ++ $data{'DHCP Server Listening On'}{'Configured for DHCPD (IPv4)'}++; ++ } ++ $data{'DHCP Server Listening On'}{$line}++; ++ } elsif ($line =~ s/Bound to\s+/IPv6 Port /) { + $data{'DHCP Server Listening On'}{$line}++; + } elsif ( +- ($line =~ /^you want, please write a subnet declaration/) or ++ ($line =~ /^you want, please write a subnet6? declaration/) or + ($line =~ /^in your dhcpd.conf file for the network segment/) or + ($line =~ /^to which interface [a-z\d]+ is attached./) or + +@@ -81,7 +92,11 @@ + $data{'Generic error'}{$line}++; + } elsif ($line =~ s/^\*\* Ignoring requests on ([a-z\d]+). If this is not what\s*$/Ignoring interface $1/) { + $data{'Config error'}{$line}++; +- } elsif ($line =~ s/^No subnet declaration for ([a-z\d]+) ([()\d.]+).\s*$/No subnet declaration for $1 $2/) { ++ } elsif ($line =~ s/^No subnet6? declaration for ([a-z\d]+) ([()\d.ia-fA-F:]+).\s*$/No subnet declaration for $1 $2/) { ++ $data{'Config error'}{$line}++; ++ } elsif ($line =~ s/^WARNING: (Host declarations are global).\s+.*$/\1/) { ++ $data{'Config error'}{$line}++; ++ } elsif ($line =~ s/Not searching LDAP\s+.*$/No support for LDAP configured/) { + $data{'Config error'}{$line}++; + } elsif ($line =~ s/^DHCPOFFER on ([\d\.]+) to ([a-f\d:]+) via (\S+)\s*$/$1 -> $2 ($3)/) { + if ($Detail >= 5) { +@@ -99,6 +114,24 @@ + if ($Detail >= 5) { + $data{'Addresses Leased'}{$line}++; + } ++ } elsif ($line =~ /^(Request|Confirm|Rebind|Renew|Release) message from ([0-9a-fA-F:]+)/) { ++ $clientrequest{$2} = $1; ++ } elsif ($line =~ s/^Sending Reply to ([0-9a-fA-F:]+) port \d+/$1 (IPv6)/) { ++ my $clientrequest = $clientrequest{$1}; ++ undef($clientrequest{$1}); ++ if (($Detail >= 5) and ($clientrequest eq 'Request')) { ++ $data{'Addresses Leased'}{$line}++; ++ } elsif (($Detail >= 10) and ($clientrequest =~ /Rebind|Renew/)) { ++ $data{"Addresses $clientrequest"}{$line}++; ++ } ++ } elsif ($line =~ /^Client ([0-9a-fA-F:]+) releases address ([0-9a-fA-F:]+), which is not leased to it.$/) { ++ if ($Detail >= 5) { ++ $data{'Warnings'}{$line}++; ++ } ++ } elsif ($line =~ s/^Client ([0-9a-fA-F:]+) releases address ([0-9a-fA-F:]+)$/$1\n -> $2 (IPv6)/) { ++ if ($Detail >= 5) { ++ $data{'Addresses Released'}{$line}++; ++ } + } elsif ($line =~ s/^added reverse map from ([\d]+).([\d]+).([\d]+).([\d]+).in-addr.arpa. to ([a-zA-Z\d._-]+)\s*$/Add reverse $4.$3.$2.$1 -> $5/) { + if ($Detail >= 7) { + $data{'DNS Mappings'}{$line}++; +@@ -127,13 +160,17 @@ + if ($Detail >= 3) { + $data{'Warnings'}{$line}++; + } ++ } elsif ($line =~ s/^uid lease ([\da-fA-F.:]+) for client ([\da-fA-F:]+) is duplicate on ([\da-fA-F.:\/]+)/Host $2: duplicate $1 (range $3)\n - probably both static and dynamic leases/) { ++ if ($Detail >= 3) { ++ $data{'Warnings'}{$line}++; ++ } + } else { + $data{'Unknown Entries'}{$line}++; + } + } + + if (keys %data) { +- foreach my $type (keys %data) { ++ foreach my $type (sort keys %data) { + print "$type:\n"; + foreach my $entry (sort {$a cmp $b} keys %{$data{$type}}) { + print " $entry: $data{$type}{$entry} Time(s)\n"; diff --git a/logwatch.spec b/logwatch.spec index 5d2b6ef..b938e26 100644 --- a/logwatch.spec +++ b/logwatch.spec @@ -63,9 +63,9 @@ Patch61: logwatch-7.3.6-audit4.patch Patch62: logwatch-7.3.6-dovecot2.patch Patch63: logwatch-7.3.6-openvpn4.patch Patch64: logwatch-7.3.6-pam_unix4.patch -Patch65: logwatch-7.3.6-dhcpd.patch Patch66: logwatch-7.3.6-named6.patch Patch67: logwatch-7.3.6-sshd3.patch +Patch68: logwatch-7.3.6-dhcpd2.patch Requires: textutils sh-utils grep mailx Requires: perl(Date::Manip) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -134,9 +134,9 @@ of the package on many systems. %patch62 -p1 %patch63 -p1 %patch64 -p1 -%patch65 -p1 %patch66 -p1 %patch67 -p1 +%patch68 -p1 rm -f scripts/services/*.orig %build @@ -262,6 +262,8 @@ rm -rf %{buildroot} %changelog * Mon Feb 1 2010 Karel Klic 7.3.6-50 - Added patch from #555750: Not all methods to deny login via sshd are reported +- Added patch from #555735: DHCPDv6 messages are not recognised +- Removed logwatch-7.3.6-dhcpd.patch, obsoleted by #555735 * Wed Dec 2 2009 Karel Klic 7.3.6-49 - Add 802.1q subinterface support to iptables report; iptables.patch (#507743)