Bug#688203: logwatch: http_rc_detail_rep-$code facility broken-as-designed

2012-09-21 Thread Thorsten Glaser
On Thu, 20 Sep 2012, Thorsten Glaser wrote:

 attached, “should” fix the issue.

This one indeed works and comes with a NEWS entry, which you’d
obviously have to adjust to Debian packaging (I just deployed
that locally, that’s why).

bye,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-314
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Boris Esser, Sebastian Manckediff -Nru logwatch-7.4.0+svn20120502rev103/debian/NEWS 
logwatch-7.4.0+svn20120502rev103/debian/NEWS
--- logwatch-7.4.0+svn20120502rev103/debian/NEWS2012-05-05 
21:20:43.0 +0200
+++ logwatch-7.4.0+svn20120502rev103/debian/NEWS2012-09-21 
10:43:16.0 +0200
@@ -1,3 +1,14 @@
+logwatch (7.4.0+svn20120502rev103-1tarent2) unstable; urgency=low
+
+  The http_rc_detail_rep facility is now documented and works,
+  although, for this, the upstream use of a hyphen-minus needs
+  to be replaced by an underscore as that is valid syntax. So,
+  for example, to get all 404 errors only as a summary, append
+  $http_rc_detail_rep_404 = 20 to an appropriate config file
+  like /etc/logwatch/conf/services/http.conf or override.conf.
+
+ -- Thorsten Glaser t.gla...@tarent.de  Fri, 21 Sep 2012 10:43:10 +0200
+
 logwatch (7.1-1) unstable; urgency=low
 
   * This version will remove untouched configuration files in 
diff -Nru logwatch-7.4.0+svn20120502rev103/debian/changelog 
logwatch-7.4.0+svn20120502rev103/debian/changelog
--- logwatch-7.4.0+svn20120502rev103/debian/changelog   2012-05-05 
21:20:43.0 +0200
+++ logwatch-7.4.0+svn20120502rev103/debian/changelog   2012-09-21 
10:43:20.0 +0200
@@ -1,3 +1,9 @@
+logwatch (7.4.0+svn20120502rev103-1tarent2) unstable; urgency=low
+
+  * Unbreak and document http_rc_detail_rep (Closes: #688203)
+
+ -- Thorsten Glaser t.gla...@tarent.de  Fri, 21 Sep 2012 10:43:18 +0200
+
 logwatch (7.4.0+svn20120502rev103-1) unstable; urgency=low
 
   * Set VDate in logwatch.pl to svn date for svn snapshots
diff -Nru 
logwatch-7.4.0+svn20120502rev103/debian/patches/0007-fix-http_rc_detail_rep.patch
 
logwatch-7.4.0+svn20120502rev103/debian/patches/0007-fix-http_rc_detail_rep.patch
--- 
logwatch-7.4.0+svn20120502rev103/debian/patches/0007-fix-http_rc_detail_rep.patch
   1970-01-01 01:00:00.0 +0100
+++ 
logwatch-7.4.0+svn20120502rev103/debian/patches/0007-fix-http_rc_detail_rep.patch
   2012-09-21 09:27:39.0 +0200
@@ -0,0 +1,35 @@
+Description: Unbreak and document http_rc_detail_rep
+ The http_rc_detail_rep facility was never documented and does
+ not work anyway because it uses a hyphen-minus in an environment
+ variable which is not allowed syntax in many environments.
+Author: Thorsten Glaser t.gla...@tarent.de
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688203
+Last-Update: 2012-09-20
+
+--- a/conf/services/http.conf
 b/conf/services/http.conf
+@@ -68,5 +68,13 @@ $HTTP_USER_DISPLAY = 0
+ # To display all user accesses except Unauthorized:
+ # $HTTP_USER_DISPLAY = $field{http_rc} != 401
+ 
++# To raise the needed level of detail for one or more specific
++# error codes to display a summary instead of listing each
++# occurrence, set a variable like the following ones:
++# Raise 403 codes to detail level High
++#$http_rc_detail_rep_403 = 10
++# Always show only summary for 404 codes
++#$http_rc_detail_rep_404 = 20
++
+ 
+ # vi: shiftwidth=3 tabstop=3 et
+--- a/scripts/services/http
 b/scripts/services/http
+@@ -735,7 +735,7 @@ if (keys %needs_exam) {
+   if (not defined $StatusCode{$code}) {
+  $StatusCode{$code} = \(undefined\);
+   }
+-  if( ($ENV{http_rc_detail_rep-$code} || $detail)  $detail ) {
++  if( ($ENV{http_rc_detail_rep_$code} || $detail)  $detail ) {
+   # only display summary for this code
+  my $t = 0;
+  my $u = 0;
diff -Nru logwatch-7.4.0+svn20120502rev103/debian/patches/series 
logwatch-7.4.0+svn20120502rev103/debian/patches/series
--- logwatch-7.4.0+svn20120502rev103/debian/patches/series  2012-05-05 
21:20:43.0 +0200
+++ logwatch-7.4.0+svn20120502rev103/debian/patches/series  2012-09-21 
09:27:21.0 +0200
@@ -4,3 +4,4 @@
 0004-Bug-656806-Support-alternative-OoM-kernel-message-in.patch
 0005-bug-571163-Handle-changes-in-dovecot-logging-Updated.patch
 0006-Bug-624271-Add-nginx-log-file-location-to-httpd.patch
+0007-fix-http_rc_detail_rep.patch


Bug#688203: logwatch: http_rc_detail_rep-$code facility broken-as-designed

2012-09-20 Thread Thorsten Glaser
Package: logwatch
Version: 7.4.0+svn20120502rev103-1
Severity: important

Hi,

/usr/share/logwatch/scripts/services/http wants to read an
environment variable http_rc_detail_rep-$code, but this
variable is not passed on through the environment because
it doesn’t match the allowed syntax. Changing the hyphen-minus
into an underscore makes things work.


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-3-686-pae (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/mksh-static

Versions of packages logwatch depends on:
ii  perl5.14.2-13
ii  postfix [mail-transport-agent]  2.9.3-2.1

Versions of packages logwatch recommends:
pn  libdate-manip-perl  none

Versions of packages logwatch suggests:
pn  fortune-mod  none

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#688203: logwatch: http_rc_detail_rep-$code facility broken-as-designed

2012-09-20 Thread Thorsten Glaser
tags 688203 + patch
thanks

Hi,

logwatch-7.4.0+svn20120502rev103/debian/patches/0007-fix-http_rc_detail_rep.patch
attached, “should” fix the issue.

bye,
//mirabilos
-- 
tarent solutions GmbH
Rochusstraße 2-4, D-53123 Bonn • http://www.tarent.de/
Tel: +49 228 54881-393 • Fax: +49 228 54881-314
HRB 5168 (AG Bonn) • USt-ID (VAT): DE122264941
Geschäftsführer: Boris Esser, Sebastian ManckeDescription: Unbreak and document http_rc_detail_rep
 The http_rc_detail_rep facility was never documented and does
 not work anyway because it uses a hyphen-minus in an environment
 variable which is not allowed syntax in many environments.
Author: Thorsten Glaser t.gla...@tarent.de
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688203
Last-Update: 2012-09-20

Index: logwatch-7.4.0+svn20120502rev103/conf/services/http.conf
===
--- logwatch-7.4.0+svn20120502rev103.orig/conf/services/http.conf	2011-08-13 11:37:02.0 +0200
+++ logwatch-7.4.0+svn20120502rev103/conf/services/http.conf	2012-09-20 11:04:46.0 +0200
@@ -68,5 +68,13 @@
 # To display all user accesses except Unauthorized:
 # $HTTP_USER_DISPLAY = $field{http_rc} != 401
 
+# To raise the needed level of detail for one or more specific
+# error codes to display a summary instead of listing each
+# occurrence, set a variable like the following ones:
+# Raise 403 codes to detail level High
+#$http_rc_detail_rep_403 = 10
+# Always show only summary for 404 codes
+#$http_rc_detail_rep_404 = 20
+
 
 # vi: shiftwidth=3 tabstop=3 et
Index: logwatch-7.4.0+svn20120502rev103/scripts/services/http
===
--- logwatch-7.4.0+svn20120502rev103.orig/scripts/services/http	2012-05-04 20:42:37.0 +0200
+++ logwatch-7.4.0+svn20120502rev103/scripts/services/http	2012-09-20 11:04:47.0 +0200
@@ -735,7 +735,7 @@
   if (not defined $StatusCode{$code}) {
  $StatusCode{$code} = \(undefined\);
   }
-  if( ($ENV{http_rc_detail_rep-$code} || $detail)  $detail ) {
+  if( ($ENV{http_rc_detail_rep_$code} || $detail)  $detail ) {
   # only display summary for this code
  my $t = 0;
  my $u = 0;