Bug#852931: logwatch cannot parse postfix logs due to regex errors

2017-08-08 Thread Stefan Nobis
Niko Tyni  writes:

> Apparently something like 'postfix{,-int,-ext}' ends up in the
> $ServiceName argument to the script, and this is interpolated into
> the regular expression as-is. I doubt this ever worked;

With older version it seemed to work. Nevertheless, thank you very
much for your analysis. Indeed, the part 'postfix{,-int,-ext}' comes
from my local configuration and I fixed it. Thank you very much for
your help!

Stefan.



Bug#852931: logwatch cannot parse postfix logs due to regex errors

2017-08-08 Thread Niko Tyni
On Sat, Jan 28, 2017 at 10:56:09AM +0100, Stefan Nobis wrote:
> Package: logwatch
> Version: 7.4.3+git20161207-1
> Severity: important
> 
> Since my upgrade from jessie to stretch (a couple of days ago), logwatch
> stopped being able to parse postfix logs. The old jessie version worked
> fine, but with the current stretch system I get the following output
> from logwatch for postfix logs:
> 
> - Postfix Begin  
> 
> Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m/^... .. ..:..:..[ ]*[^ ]* postfix{ <-- HERE 
> ,-int,-ext}/[-a-zA-Z\d]*(\[[0123456789]*\])?:? / at 
> /usr/share/logwatch/scripts/shared/onlyservice line 32,  line 1.
> Unescaped left brace in regex is deprecated, passed through in regex; marked 
> by <-- HERE in m/^... .. ..:..:.. [^ ]* [^ ]*(\[[0123456789]*\])?: \[ID 
> [0-9]+ postfix{ <-- HERE ,-int,-ext}/[-a-zA-Z\d]*/ at 
> /usr/share/logwatch/scripts/shared/onlyservice line 35,  line 1.
> 
> -- Postfix End - 

Hi, I'm not the logwatch maintainer, just noticed this bug by chance.

Apparently something like 'postfix{,-int,-ext}' ends up in the
$ServiceName argument to the script, and this is interpolated into the
regular expression as-is. I doubt this ever worked; it looks like shell
syntax for listing three strings, but {N,M} has a totally different meaning
in regexps. So the warning seems appropriate and highlights a real issue.

I suggest logwatch insert \Q...\E quoting (see perlre(1)) to the
$ServiceName interpolation to fix these warnings (which are fatal in
Perl 5.26 btw), but whatever is passing the 'postfix{,-int,-ext}' parts
(probably local configuration?) may well need fixing too.

Hope this helps a bit,
-- 
Niko Tyni   nt...@debian.org



Bug#852931: logwatch cannot parse postfix logs due to regex errors

2017-01-28 Thread Stefan Nobis
Package: logwatch
Version: 7.4.3+git20161207-1
Severity: important

Since my upgrade from jessie to stretch (a couple of days ago), logwatch
stopped being able to parse postfix logs. The old jessie version worked
fine, but with the current stretch system I get the following output
from logwatch for postfix logs:

- Postfix Begin  

Unescaped left brace in regex is deprecated, passed through in regex; marked by 
<-- HERE in m/^... .. ..:..:..[ ]*[^ ]* postfix{ <-- HERE 
,-int,-ext}/[-a-zA-Z\d]*(\[[0123456789]*\])?:? / at 
/usr/share/logwatch/scripts/shared/onlyservice line 32,  line 1.
Unescaped left brace in regex is deprecated, passed through in regex; marked by 
<-- HERE in m/^... .. ..:..:.. [^ ]* [^ ]*(\[[0123456789]*\])?: \[ID [0-9]+ 
postfix{ <-- HERE ,-int,-ext}/[-a-zA-Z\d]*/ at 
/usr/share/logwatch/scripts/shared/onlyservice line 35,  line 1.

-- Postfix End - 

Nevertheless thank you for your great work.