[Pkg-awstats-devel] Bug#575545: awstats: nested includes prematurely closed
Ken Neighbors
debian3 at ken.nsds.com
Fri Mar 26 17:57:56 UTC 2010
Package: awstats
Version: 6.7.dfsg-5.1
Severity: normal
Tags: patch
When using nested includes in awstats configuration files, all lines
BELOW each include line are ignored (except for the include lines in
the top level configuration file). This bug has been reported here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1408271&group_id=13764&atid=113764
The problem is that a global filehandle is being used for all the
include files. When the lowest level include file is closed it
actually closes all the other include files as well, even though they
have not been completely read in.
A more simple fix is described here:
http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q4.6.html
Which I implemented. Here's the patch:
diff -urNad awstats-6.7.dfsg.orig/wwwroot/cgi-bin/awstats.pl awstats-6.7.dfsg/wwwroot/cgi-bin/awstats.pl
--- awstats-6.7.dfsg.orig/wwwroot/cgi-bin/awstats.pl 2007-07-07 11:00:06.000000000 +0000
+++ awstats-6.7.dfsg/wwwroot/cgi-bin/awstats.pl 2010-03-26 16:54:32.000000000 +0000
@@ -1220,6 +1220,7 @@
# Correct relative include files
if ($FileConfig =~ /^(.*[\\\/])[^\\\/]*$/) { $includeFile = "$1$includeFile"; }
}
+ local( *CONFIG_INCLUDE );
if ( open( CONFIG_INCLUDE, $includeFile ) ) {
&Parse_Config( *CONFIG_INCLUDE , $level+1, $includeFile);
close( CONFIG_INCLUDE );
diff -urNad awstats-6.7.dfsg.orig/tools/awstats_buildstaticpages.pl awstats-6.7.dfsg/tools/awstats_buildstaticpages.pl
--- awstats-6.7.dfsg.orig/tools/awstats_buildstaticpages.pl 2008-12-10 12:11:27.000000000 +0000
+++ awstats-6.7.dfsg/tools/awstats_buildstaticpages.pl 2010-03-26 17:23:06.000000000 +0000
@@ -193,6 +193,7 @@
warning("Warning: Perl versions before 5.6 cannot handle nested includes");
next;
}
+ local( *CONFIG_INCLUDE );
if ( open( CONFIG_INCLUDE, $includeFile ) ) {
&Parse_Config( *CONFIG_INCLUDE , $level+1, $includeFile);
close( CONFIG_INCLUDE );
-- System Information:
Debian Release: 5.0.4
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-2-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages awstats depends on:
ii perl [libtime-hires-perl 5.10.0-19lenny2 Larry Wall's Practical Extraction
Versions of packages awstats recommends:
ii libnet-xwhois-perl 0.90-3 Whois Client Interface for Perl5
Versions of packages awstats suggests:
pn apache | httpd <none> (no description available)
pn libgeo-ipfree-perl <none> (no description available)
pn libnet-dns-perl <none> (no description available)
pn libnet-ip-perl <none> (no description available)
-- no debconf information
More information about the Pkg-awstats-devel
mailing list