Hi,

here is a bug report with a proposed patch concerning the specification
of services to ignore in the secure script.

Bye
Willi


-------- Weitergeleitete Nachricht --------
Betreff: Bug#824034: $ignore_services breaks on close parentheses
Weitersenden-Datum: Wed, 11 May 2016 15:15:02 +0000
Weitersenden-Von: Jonny Lamb <jo...@debian.org>
Weitersenden-An: debian-bugs-dist@lists.debian.org
Weitersenden-CC: Willi Mann <wi...@debian.org>
Datum: Wed, 11 May 2016 16:12:53 +0100
Von: Jonny Lamb <jo...@debian.org>
Antwort an: Jonny Lamb <jo...@debian.org>, 824...@bugs.debian.org
An: sub...@bugs.debian.org

Package: logwatch
Version: 7.4.3-1
Severity: normal
Tags: patch

The "secure" script's $ignore_services option is space separated but
uses \b to match items, which breaks when a service name ends in a close
parenthesis (such as "wordpress(example.com)").

Here's a patch that fixes the problem here. Use a different approach if
you fancy.

Cheerio,
-- 
Jonny Lamb

diff --git a/scripts/services/secure b/scripts/services/secure
index 31f7ba6..387f5fd 100755
--- a/scripts/services/secure
+++ b/scripts/services/secure
@@ -190,7 +190,7 @@ while (defined($ThisLine = <STDIN>)) {
    $ThisLine =~ s/\[ID [0-9]+ [a-z]+\.[a-z]+\] //;
    my $temp = $ThisLine;
    $temp =~ s/^([^[:]+).*/$1/;
-   if ($Ignore =~ /\b\Q$temp\E\b/i) { next; }
+   if ($Ignore =~ /(\s|^)\Q$temp\E(\s|$)/i) { next; }
 
    #current sarge
    if ($ThisLine =~ /^[^ :]*:( [0-9:\[\]\.]+|) \(pam_(unix|securetty)\)/i ) 
{next; }

Reply via email to