Processed (with 5 errors): Re: Bug#1051496: mailgraph: does not support the new syslog format

2024-03-28 Thread Debian Bug Tracking System
Processing commands for cont...@bugs.debian.org:

> severity 1051496 normal
Bug #1051496 [mailgraph] mailgraph: does not support the new syslog format
Severity set to 'normal' from 'grave'
> tags 1051496 + moreinfo
Bug #1051496 [mailgraph] mailgraph: does not support the new syslog format
Added tag(s) moreinfo.
> Hello Michael,
Unknown command or malformed arguments to command.
> thank you for spending your time helping to make Debian better with this bug
Unknown command or malformed arguments to command.
> report.
Unknown command or malformed arguments to command.
> We are using mailgraph one multiple server with Debian Bullseye, Bookworm and
Unknown command or malformed arguments to command.
> Trixie without any failure.
Unknown command or malformed arguments to command.
Too many unknown commands, stopping here.

Please contact me if you need assistance.
-- 
1051496: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051496
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#1051496: mailgraph: does not support the new syslog format

2024-03-25 Thread michael
Debian 12 Bookworm

Package: mailgraph

Version: 1.14-21

Severity: grave

Justification: renders package unusable

 

I installed mailgraph from Debian Trixie testing hoping to get the fixes
mentioned in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051496

 

However, it still fails to run correctly.

 

mailgraph -v shows:

WARNING: line not in syslog format:

For every log entry.

 

And graphs don't create.

 

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051496

Says it was resolved, but this is not correct.

 

I compared/contrasted the 1.14-20 vs 1.14-21 line by line and I only saw:

$text =~ /^(?:[\dA-F]+|[\dB-DF-HJ-NP-TV-Zb-df-hj-np-tv-z]+):

Changing to:

$text =~ /^[0-9A-Z]+:

In a number of places.

 

Any insight would be appreciated.

 

Thank you

 

Michael



Bug#1051496: mailgraph: does not support the new syslog format

2023-09-08 Thread Vincent Lefevre
Control: tags -1 patch upstream

On 2023-09-08 19:30:29 +0200, Vincent Lefevre wrote:
> mailgraph no longer works after the upgrade to bookworm, and
> this is probably due to the fact that it does not support the
> new syslog format: /usr/sbin/mailgraph contains
[...]
> and this format is no longer correct.
> 
> There's a git repository where this bug seems to have been fixed
> 5 years ago:
> 
>   https://gist.github.com/mdklapwijk/4f8d2fc39f09f4aa615cbf8ffae0379a

I've attached a patch based on these modifications.
I've made 2 changes:
  * This patch does not add a new type "rsyslog" for this new format;
so both formats are supported at the same time.
  * Fixed a variable name ($mon → $montxt) for the old format.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Description: support the rsyslog high-precision timestamp format.
 Patch based on M.D. Klapwijk's modifications for this support:
   https://gist.github.com/mdklapwijk/4f8d2fc39f09f4aa615cbf8ffae0379a
 (with some changes).
Author: Vincent Lefevre 
Bug-Debian: https://bugs.debian.org/1051496
Last-Update: 2023-09-09

--- mailgraph.pl.bak
+++ mailgraph.pl
@@ -202,27 +202,41 @@
 }
 my $file = $self->{file};
 line: while(defined (my $str = $self->_next_line)) {
-# date, time and host 
-$str =~ /^
-(\S{3})\s+(\d+)  # date  -- 1, 2
-\s
-(\d+):(\d+):(\d+)# time  -- 3, 4, 5
-(?:\s<\w+\.\w+>)?# FreeBSD's verbose-mode
-\s
-([-\w\.\@:]+)# host  -- 6
-\s+
-(?:\[LOG_[A-Z]+\]\s+)?  # FreeBSD
-(.*) # text  -- 7
-$/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);
+# date, time and host
+my ($year, $mon, $day, $hour, $min, $sec, $host, $text);
+if(($year, $mon, $day, $hour, $min, $sec, $host, $text) = $str =~ /^
+(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)\S+  # datetime
+\s+
+(\S+)   # host
+\s+
+(.*)# text
+$/x) {
+$mon--;
+$self->{year} = $year;
+}
+else {
+my $montxt;
+($montxt, $day, $hour, $min, $sec, $host, $text) = $str =~ /^
+(\S{3})\s+(\d+)  # date
+\s
+(\d+):(\d+):(\d+)# time
+(?:\s<\w+\.\w+>)?# FreeBSD's verbose-mode
+\s
+([-\w\.\@:]+)# host
+\s+
+(?:\[LOG_[A-Z]+\]\s+)?  # FreeBSD
+(.*) # text
+$/x or do
+{
+warn "WARNING: line not in syslog format: $str";
+next line;
+};
+$mon = $months_map{$montxt};
+defined $mon or croak "unknown month $montxt\n";
+$self->_year_increment($mon);
+}
 # convert to unix time
-my $time = $self->str2time($5,$4,$3,$2,$mon,$self->{year}-1900,$self->{GMT});
+my $time = $self->str2time($sec,$min,$hour,$day,$mon,$self->{year}-1900,$self->{GMT});
 if(not $self->{allow_future}) {
 # accept maximum one day in the present future
 if($time - time > 86400) {
@@ -230,7 +244,6 @@
 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};


Bug#1051496: mailgraph: does not support the new syslog format

2023-09-08 Thread Vincent Lefevre
Package: mailgraph
Version: 1.14-20
Severity: grave
Justification: renders package unusable

mailgraph no longer works after the upgrade to bookworm, and
this is probably due to the fact that it does not support the
new syslog format: /usr/sbin/mailgraph contains

sub _next_syslog($)
{
[...]
line: while(defined (my $str = $self->_next_line)) {
# date, time and host 
$str =~ /^
(\S{3})\s+(\d+)  # date  -- 1, 2
\s
(\d+):(\d+):(\d+)# time  -- 3, 4, 5
(?:\s<\w+\.\w+>)?# FreeBSD's verbose-mode
\s
([-\w\.\@:]+)# host  -- 6
\s+
(?:\[LOG_[A-Z]+\]\s+)?  # FreeBSD
(.*) # text  -- 7
$/x or do
{
warn "WARNING: line not in syslog format: $str";
next line;
};

and this format is no longer correct.

There's a git repository where this bug seems to have been fixed
5 years ago:

  https://gist.github.com/mdklapwijk/4f8d2fc39f09f4aa615cbf8ffae0379a

-- System Information:
Debian Release: 12.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-11-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mailgraph depends on:
ii  debconf [debconf-2.0]  1.5.82
ii  init-system-helpers1.65.2
ii  libfile-tail-perl  1.3-7
ii  librrds-perl   1.7.2-4+b8
ii  lsb-base   11.6
ii  perl   5.36.0-7
ii  sysvinit-utils [lsb-base]  3.06-4
ii  ucf3.0043+nmu1

Versions of packages mailgraph recommends:
ii  apache2 [httpd] 2.4.57-2
ii  postfix [mail-transport-agent]  3.7.6-0+deb12u2

mailgraph suggests no packages.

-- debconf information:
  mailgraph/start_on_boot: true
  mailgraph/ignore_localhost: false
  mailgraph/mail_log: /var/log/mail.log

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)