From 1f587d56a72aa7997322c9c06d076863e64575ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:26:48 +0100 Subject: Upgrade Parse::Syslog to version 1.11 --- debian/changelog | 8 ++ debian/patches/120_syslog-parse-upgrade.patch | 175 ++++++++++++++++++++++++++ debian/patches/series | 3 +- 3 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 debian/patches/120_syslog-parse-upgrade.patch diff --git a/debian/changelog b/debian/changelog index dc81e50..fb30af0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +mailgraph (1.14-23) UNRELEASED; urgency=medium + + * Upgrade Parse::Syslog to version 1.11 to support RFC3339 or + syslog-ng ISO dates (Closes: #1089039). + (Thanks to Dimitar Angelov ) + + -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 + mailgraph (1.14-22) unstable; urgency=medium * Refresh debian/patches/0100-new_syslog_format.patch: diff --git a/debian/patches/120_syslog-parse-upgrade.patch b/debian/patches/120_syslog-parse-upgrade.patch new file mode 100644 index 0000000..e815a0b --- /dev/null +++ b/debian/patches/120_syslog-parse-upgrade.patch @@ -0,0 +1,175 @@ +Index: mailgraph-1.14/mailgraph.pl +=================================================================== +--- mailgraph-1.14.orig/mailgraph.pl ++++ mailgraph-1.14/mailgraph.pl +@@ -5,7 +5,7 @@ + # copyright (c) 2000-2007 David Schweikert + # released under the GNU General Public License + +-######## Parse::Syslog 1.09 (automatically embedded) ######## ++######## Parse::Syslog 1.11 (automatically embedded) ######## + package Parse::Syslog; + use Carp; + use Symbol; +@@ -13,6 +13,7 @@ use Time::Local; + use IO::File; + use strict; + use vars qw($VERSION); ++use warnings; + my %months_map = ( + 'Jan' => 0, 'Feb' => 1, 'Mar' => 2, + 'Apr' => 3, 'May' => 4, 'Jun' => 5, +@@ -23,7 +24,7 @@ my %months_map = ( + 'jul' => 6, 'aug' => 7, 'sep' => 8, + 'oct' => 9, 'nov' =>10, 'dec' =>11, + ); +-sub is_dst_switch($$$) ++sub is_dst_switch + { + my ($self, $t, $time) = @_; + # calculate the time in one hour and see if the difference is 3600 seconds. +@@ -57,7 +58,7 @@ sub is_dst_switch($$$) + # fast timelocal, cache minute's timestamp + # don't cache more than minute because of daylight saving time switch + # 0: sec, 1: min, 2: h, 3: day, 4: month, 5: year +-sub str2time($$$$$$$$) ++sub str2time + { + my $self = shift @_; + my $GMT = pop @_; +@@ -75,6 +76,12 @@ sub str2time($$$$$$$$) + my $time; + if($GMT) { + $time = timegm(@_); ++ # with explicit timezone: ++ if($GMT =~ /^([\+\-])(\d\d):(\d\d)$/) { ++ my $off_secs = 60 * (60*$2 + $3); ++ $off_secs *= -1 if ($1 eq '+'); ++ $time += $off_secs; ++ } + } + else { + $time = timelocal(@_); +@@ -109,7 +116,7 @@ sub str2time($$$$$$$$) + $self->{last_time} = $time; + return $time+($self->{dst_comp}||0); + } +-sub _use_locale($) ++sub _use_locale + { + use POSIX qw(locale_h strftime); + my $old_locale = setlocale(LC_TIME); +@@ -121,7 +128,7 @@ sub _use_locale($) + } + setlocale(LC_TIME, $old_locale); + } +-sub new($$;%) ++sub new + { + my ($class, $file, %data) = @_; + croak "new() requires one argument: file" unless defined $file; +@@ -140,11 +147,11 @@ sub new($$;%) + } + elsif(! ref $file) { + if($file eq '-') { +- my $io = new IO::Handle; ++ my $io = IO::Handle->new(); + $data{file} = $io->fdopen(fileno(STDIN),"r"); + } + else { +- $data{file} = new IO::File($file, "<"); ++ $data{file} = IO::File->new($file, "<"); + defined $data{file} or croak "can't open $file: $!"; + } + } +@@ -164,7 +171,7 @@ sub new($$;%) + } + return bless \%data, $class; + } +-sub _year_increment($$) ++sub _year_increment + { + my ($self, $mon) = @_; + # year change +@@ -182,7 +189,7 @@ sub _year_increment($$) + } + $self->{_last_mon} = $mon; + } +-sub _next_line($) ++sub _next_line + { + my $self = shift; + my $f = $self->{file}; +@@ -193,7 +200,7 @@ sub _next_line($) + return $f->getline; + } + } +-sub _next_syslog($) ++sub _next_syslog + { + my ($self) = @_; + while($self->{_repeat}>0) { +@@ -213,16 +220,33 @@ sub _next_syslog($) + \s+ + (?:\[LOG_[A-Z]+\]\s+)? # FreeBSD + (.*) # text -- 7 ++ $/x or ++ $str =~ /^ ++ (\d\d\d\d)-(\d\d)-(\d\d) # RFC3339 or syslog-ng ISO date -- 1, 2, 3 ++ T ++ (\d+):(\d+):(\d+)(?:\.\d+)? # time (optional frac_sec) -- 4, 5, 6 ++ (Z|[\+\-]\d\d:\d\d) # TZ -- 7 ++ \s ++ ([-\w\.\@:]+) # host -- 8 ++ \s+ ++ (.*) # text -- 9 + $/x or do + { + warn "WARNING: line not in syslog format: $str"; + next line; + }; +- my $mon = $months_map{$1}; +- defined $mon or croak "unknown month $1\n"; +- $self->_year_increment($mon); ++ my ($time, $host, $text); + # convert to unix time +- my $time = $self->str2time($5,$4,$3,$2,$mon,$self->{year}-1900,$self->{GMT}); ++ if (defined($months_map{$1})) { # BSD Syslog ++ my $mon = $months_map{$1}; ++ defined $mon or croak "unknown month $1\n"; ++ $self->_year_increment($mon); ++ $time = $self->str2time($5,$4,$3,$2,$mon,$self->{year}-1900,$self->{GMT}); ++ ($host, $text) = ($6, $7); ++ } else { # RFC3339/syslog-ng ++ $time = $self->str2time($6,$5,$4,$3,$2-1,$1-1900,$7); ++ ($host, $text) = ($8, $9); ++ } + if(not $self->{allow_future}) { + # accept maximum one day in the present future + if($time - time > 86400) { +@@ -230,7 +254,6 @@ sub _next_syslog($) + next line; + } + } +- my ($host, $text) = ($6, $7); + # last message repeated ... times + if($text =~ /^(?:last message repeated|above message repeats) (\d+) time/) { + next line if defined $self->{repeat} and not $self->{repeat}; +@@ -287,7 +310,7 @@ sub _next_syslog($) + } + return undef; + } +-sub _next_metalog($) ++sub _next_metalog + { + my ($self) = @_; + my $file = $self->{file}; +@@ -341,7 +364,7 @@ sub _next_metalog($) + } + return undef; + } +-sub next($) ++sub next + { + my ($self) = @_; + if($self->{type} eq 'syslog') { diff --git a/debian/patches/series b/debian/patches/series index 4bc9277..b0267f0 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -7,4 +7,5 @@ #103_postfix-long-queue-IDs.diff #105_postscreen.diff #110_mailgraph.cgi.patch -0100-new_syslog_format.patch +#0100-new_syslog_format.patch +120_syslog-parse-upgrade.patch -- cgit v1.2.3 From 4b7eedaef4a0b096a3239ce754f3b71e4942fc13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:28:06 +0100 Subject: Declare compliance with Debian Policy 4.7.2 --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index fb30af0..5c90dd7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ mailgraph (1.14-23) UNRELEASED; urgency=medium * Upgrade Parse::Syslog to version 1.11 to support RFC3339 or syslog-ng ISO dates (Closes: #1089039). (Thanks to Dimitar Angelov ) + * Declare compliance with Debian Policy 4.7.2 (No changes needed). -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 diff --git a/debian/control b/debian/control index fd5095c..98a5992 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Jörg Frings-Fürst Build-Depends: debhelper-compat (= 13), po-debconf -Standards-Version: 4.6.2.0 +Standards-Version: 4.7.2 Homepage: https://mailgraph.schweikert.ch Vcs-Git: git://git.jff.email/mailgraph.git Vcs-Browser: https://git.jff.email/cgit/mailgraph.git -- cgit v1.2.3 From a713d7f1ae35edf73a2d3e7fa80b6cf3c5b8dd4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:29:53 +0100 Subject: d/control: Change Vcs-Git from git: to https: --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5c90dd7..e4099cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ mailgraph (1.14-23) UNRELEASED; urgency=medium syslog-ng ISO dates (Closes: #1089039). (Thanks to Dimitar Angelov ) * Declare compliance with Debian Policy 4.7.2 (No changes needed). + * debian/control: + - Change Vcs-Git from git: to https:. -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 diff --git a/debian/control b/debian/control index 98a5992..42f0c19 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: po-debconf Standards-Version: 4.7.2 Homepage: https://mailgraph.schweikert.ch -Vcs-Git: git://git.jff.email/mailgraph.git +Vcs-Git: https://git.jff.email/cgit/mailgraph.git Vcs-Browser: https://git.jff.email/cgit/mailgraph.git Rules-Requires-Root: no -- cgit v1.2.3 From 921c50e872a106309d95afef957c9e9cca4107fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:31:44 +0100 Subject: d/copyright: Add year 2025 to myself --- debian/changelog | 2 ++ debian/copyright | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index e4099cf..bcc4460 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ mailgraph (1.14-23) UNRELEASED; urgency=medium * Declare compliance with Debian Policy 4.7.2 (No changes needed). * debian/control: - Change Vcs-Git from git: to https:. + * debian/copyright: + - Add year 2025 to myself. -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 diff --git a/debian/copyright b/debian/copyright index b081433..74257d5 100644 --- a/debian/copyright +++ b/debian/copyright @@ -11,7 +11,7 @@ License: GPL-2 Files: debian/* Copyright: 2002-2008 Norbert Tretkowski 2010-2012 Julien Valroff - 2014-2023 Jörg Frings-Fürst + 2014-2025 Jörg Frings-Fürst License: GPL-2 Files: debian/patches/0100-new_syslog_format.patch -- cgit v1.2.3 From 5ebf084ce2dea1ffc86c21f10f1deaaff17bed17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:35:14 +0100 Subject: New debian/lrc.config for overright lrc tests --- debian/changelog | 1 + debian/lrc.config | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 debian/lrc.config diff --git a/debian/changelog b/debian/changelog index bcc4460..d432426 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,7 @@ mailgraph (1.14-23) UNRELEASED; urgency=medium - Change Vcs-Git from git: to https:. * debian/copyright: - Add year 2025 to myself. + * New debian/lrc.config for overright lrc tests. -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 diff --git a/debian/lrc.config b/debian/lrc.config new file mode 100644 index 0000000..e605943 --- /dev/null +++ b/debian/lrc.config @@ -0,0 +1,2 @@ +mailgraph.cgi +mailgraph.pl -- cgit v1.2.3 From 6bc223665d48142a070e7f9ba62931839bd66294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 18 Mar 2025 17:43:13 +0100 Subject: d/changelog: Change distribution to unstable, Change date and time --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d432426..75724f0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mailgraph (1.14-23) UNRELEASED; urgency=medium +mailgraph (1.14-23) unstable; urgency=medium * Upgrade Parse::Syslog to version 1.11 to support RFC3339 or syslog-ng ISO dates (Closes: #1089039). @@ -10,7 +10,7 @@ mailgraph (1.14-23) UNRELEASED; urgency=medium - Add year 2025 to myself. * New debian/lrc.config for overright lrc tests. - -- Jörg Frings-Fürst Mon, 1 Jul 2024 19:29:48 +0200 + -- Jörg Frings-Fürst Tue, 18 Mar 2025 17:42:22 +0100 mailgraph (1.14-22) unstable; urgency=medium -- cgit v1.2.3