25f594
Fix misparsing of userhelper log entries for hddtemp that specify a device
25f594
using a name that includes a slash (e.g. '/usr/sbin/hddtemp -n -q /dev/sda').
25f594
Additional slashes after the process name confuse logwatch as it considers the
25f594
last word behind the last slash the process' name.
25f594
25f594
Author: Jan Synacek <jsynacek@redhat.com>
25f594
RH-Bugzilla: #867290
25f594
25f594
--- logwatch-svn110/scripts/services/secure.orig	2012-10-18 11:13:33.000000000 +0200
25f594
+++ logwatch-svn110/scripts/services/secure	2012-10-18 11:31:08.987571713 +0200
25f594
@@ -843,8 +843,13 @@ if (keys %Executed_app) {
25f594
    print "\nUserhelper executed applications:\n";
25f594
    foreach (keys %Executed_app) {
25f594
      ($longapp,$asuser,$user) = split ",";
25f594
+     $longapp_orig = $longapp;
25f594
+     $i = index($longapp, " ");
25f594
+     if ($i > 0) {
25f594
+        $longapp = substr($longapp, 0, $i);
25f594
+     }
25f594
      $app = substr($longapp,rindex($longapp,"/")+1);
25f594
-     print "   $user -> $app as $asuser:  ".$Executed_app{"$longapp,$asuser,$user"}." Time(s)\n";
25f594
+     print "   $user -> $app as $asuser:  ".$Executed_app{"$longapp_orig,$asuser,$user"}." Time(s)\n";
25f594
    }
25f594
 }
25f594