[vhffs-dev] [2232] added patches for AWStats 7.1 (Debian SID) |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 2232
Author: gradator
Date: 2013-07-04 23:12:32 +0200 (Thu, 04 Jul 2013)
Log Message:
-----------
added patches for AWStats 7.1 (Debian SID)
Added Paths:
-----------
trunk/vhffs-robots/misc/awstats_7.1_vhffs.patch
trunk/vhffs-robots/misc/repository.awstats_7.1_vhffs.patch
Added: trunk/vhffs-robots/misc/awstats_7.1_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/awstats_7.1_vhffs.patch (rev 0)
+++ trunk/vhffs-robots/misc/awstats_7.1_vhffs.patch 2013-07-04 21:12:32 UTC (rev 2232)
@@ -0,0 +1,46 @@
+--- awstats.pl.orig 2013-07-04 23:05:12.672725177 +0200
++++ awstats.pl 2013-07-04 23:06:42.623426836 +0200
+@@ -1706,29 +1706,12 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
+ my $configdir = shift;
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+
+- if ($configdir) {
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
+- }
+-
+- # If from CGI, overwriting of configdir with a value that differs from a defautl value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
+- }
+-
+- @PossibleConfigDir = ("$configdir");
+- }
++ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z\.\-]+$/ );
++ use Digest::MD5;
++ my $vhffssitehash = Digest::MD5::md5_hex( $SiteConfig );
++ my $vhffsconfigdir = '/data/web/'.substr( $vhffssitehash, 0, 2 ).'/'.substr( $vhffssitehash, 2, 2 ).'/'.substr( $vhffssitehash, 4, 2 ).'/'.$SiteConfig.'/awstats';
++ my @PossibleConfigDir=("$vhffsconfigdir");
+
+ # Open config file
+ $FileConfig = $FileSuffix = '';
+@@ -17363,7 +17346,7 @@
+ else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
+
+ # Should we link to ourselves or to a wrapper script
+-$AWScript = ( $WrapperScript ? "$WrapperScript" : "$DirCgi$PROG.$Extension" );
++$AWScript = ( $WrapperScript ? "$WrapperScript" : "/$DirCgi$PROG.$Extension" );
+ if (index($AWScript,'?')>-1)
+ {
+ $AWScript .= '&'; # $AWScript contains URL parameters
Added: trunk/vhffs-robots/misc/repository.awstats_7.1_vhffs.patch
===================================================================
--- trunk/vhffs-robots/misc/repository.awstats_7.1_vhffs.patch (rev 0)
+++ trunk/vhffs-robots/misc/repository.awstats_7.1_vhffs.patch 2013-07-04 21:12:32 UTC (rev 2232)
@@ -0,0 +1,44 @@
+--- awstats.pl.orig 2013-07-04 23:07:34.402662237 +0200
++++ awstats.pl 2013-07-04 23:07:41.530556705 +0200
+@@ -1706,29 +1706,10 @@
+ # Other possible directories : "/usr/local/etc/awstats", "/etc"
+ # FHS standard, Suse package : "/etc/opt/awstats"
+ my $configdir = shift;
+- my @PossibleConfigDir = (
+- "$DIR",
+- "/etc/awstats",
+- "/usr/local/etc/awstats", "/etc",
+- "/etc/opt/awstats"
+- );
+
+- if ($configdir) {
+- # Check if configdir is outside default values.
+- my $outsidedefaultvalue=1;
+- foreach (@PossibleConfigDir) {
+- if ($_ eq $configdir) { $outsidedefaultvalue=0; last; }
+- }
+-
+- # If from CGI, overwriting of configdir with a value that differs from a defautl value
+- # is only possible if AWSTATS_ENABLE_CONFIG_DIR defined
+- if ($ENV{'GATEWAY_INTERFACE'} && $outsidedefaultvalue && ! $ENV{"AWSTATS_ENABLE_CONFIG_DIR"})
+- {
+- error("Sorry, to allow overwriting of configdir parameter, from an AWStats CGI page, with a non default value, environment variable AWSTATS_ENABLE_CONFIG_DIR must be set to 1. For example, by adding the line 'SetEnv AWSTATS_ENABLE_CONFIG_DIR 1' in your Apache config file or into a .htaccess file.");
+- }
+-
+- @PossibleConfigDir = ("$configdir");
+- }
++ error("Wrong config name") unless( $SiteConfig =~ /^[0-9a-z]+$/ );
++ my $vhffsconfigdir = '/data/logs/repository/parsed/'.$SiteConfig.'/awstats';
++ my @PossibleConfigDir=("$vhffsconfigdir");
+
+ # Open config file
+ $FileConfig = $FileSuffix = '';
+@@ -17363,7 +17344,7 @@
+ else { @DOWIndex = ( 0, 1, 2, 3, 4, 5, 6 ); }
+
+ # Should we link to ourselves or to a wrapper script
+-$AWScript = ( $WrapperScript ? "$WrapperScript" : "$DirCgi$PROG.$Extension" );
++$AWScript = ( $WrapperScript ? "$WrapperScript" : "/$DirCgi$PROG.$Extension" );
+ if (index($AWScript,'?')>-1)
+ {
+ $AWScript .= '&'; # $AWScript contains URL parameters