[Pkg-awstats-devel] Bug#575545: A scenario that illustrates bug
Ken Neighbors
KenNeighbors at gmail.com
Thu Apr 15 05:06:35 UTC 2010
I would like to describe a scenario that illustrates when the bug occurs.
Consider two sets of awstats configuration files, where several sites
share some common directives, and several other sites share some other
common directives:
awstats.site1.domainA.com.conf contains:
Include "awstats.conf.domainA"
SiteDomain="site1.domainA.com"
awstats.site2.domainA.com.conf contains:
Include "awstats.conf.domainA"
SiteDomain="site2.domainA.com"
awstats.site3.domainB.com.conf contains:
Include "awstats.conf.domainB"
SiteDomain="site3.domainB.com.conf"
awstats.site4.domainB.com.conf contains:
Include "awstats.conf.domainB"
SiteDomain="site4.domainB.com.conf"
The config files that contain directives common to the two sets of sites
are like this:
awstats.conf.domainA contains:
Include "awstats.conf"
[directives common to sites in domainA go here]
awstats.conf.domainB contains:
Include "awstats.conf"
[directives common to sites in domainB go here]
Now, the problem is that the directives in these two files are
completely ignored because all the nested configuration files are closed
as soon as "awstats.conf" and "awstats.conf.local" have been read. This
is due to awstats.pl sharing the same filehandle for all the config
files (CONFIG_INCLUDE), so as soon as it finishes reading a nested
config file, it inadvertently closes ALL nested config files, even if it
hasn't finished reading them. This filehandle needs to be localized as
described above so that each config file has a separate filehandle.
I hope this explanation sufficiently describes the problem I am having
without incorporating too much detail. However, if you need more
information or a better test case to illustrate the bug, please let me know.
The crux of the problem is that any directives in a nested include file
that occur BELOW an Include line are ignored.
More information about the Pkg-awstats-devel
mailing list