~ubuntu-branches/ubuntu/dapper/awstats/dapper

« back to all changes in this revision

Viewing changes to wwwroot/cgi-bin/plugins/hashfiles.pm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2005-02-05 17:13:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050205171348-h8uy32bhbcnhciie
Tags: 6.3-1
* New upstream release. Closes: bug#293702, #293668 (thanks to Nelson
  A. de Oliveira <naoliv@biolinux.df.ibilce.unesp.br>).
  + Includes upstream fix for security bug fixed in 6.2-1.1.
  + Includes upstream fix for most of security bug fixed in 6.2-1.1.
* Acknowledge NMUs. Closes: bug#291064, #294488 (thanks to Martin
  Schulze <joey@infodrom.org>, Martin Pitt <mpitt@debian.org>, Ubuntu,
  Joey Hess <joeyh@debian.org>, Frank Lichtenheld <djpig@debian.org> and Steve
  Langasek <vorlon@debian.org>).
* Include patch for last parts of security bug fixed in 6.2-1.1:
  01_sanitize_more.patch.
* Patch (02) to include snapshot of recent development:
  + Fix security hole that allowed a user to read log file content
    even when plugin rawlog was not enabled.
  + Fix a possible use of AWStats for a DoS attack.
  + configdir option was broken on windows servers.
  + DebugMessages is by default set to 0 for security reasons.
  + Minor fixes.
* References:
  CAN-2005-0435 - read server logs via loadplugin and pluginmode
  CAN-2005-0436 - code injection via PluginMode
  CAN-2005-0437 - directory traversal via loadplugin
  CAN-2005-0438 - information leak via debug

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
#-----------------------------------------------------------------------------
7
7
# Perl Required Modules: Storable
8
8
#-----------------------------------------------------------------------------
9
 
# $Revision: 1.10 $ - $Author: eldy $ - $Date: 2003/07/26 15:32:31 $
 
9
# $Revision: 1.11 $ - $Author: eldy $ - $Date: 2004/05/21 21:16:54 $
10
10
 
11
11
 
12
12
# <-----
64
64
                my ($tmp1b,$tmp2b,$tmp3b,$tmp4b,$tmp5b,$tmp6b,$tmp7b,$tmp8b,$tmp9b,$datehash,$tmp10b,$tmp11b,$tmp12b) = stat("${searchdir}$dnscachefile$filesuffix.hash");
65
65
                if ($datesource && $datehash < $datesource) {
66
66
                        $PluginHashfilesUpToDate=0;
67
 
                        debug(" Hash file not up to date. Will use source file $filetoload instead.");
 
67
                        debug(" Plugin hashfiles: Hash file not up to date. Will use source file $filetoload instead.");
68
68
                }
69
69
                else {
70
70
                        # There is no source file or there is and hash file is up to date. We can just load hash file
73
73
        }
74
74
        elsif ($filetoload) {
75
75
                $PluginHashfilesUpToDate=0;
76
 
                debug(" Hash file not found. Will use source file $filetoload instead.");
 
76
                debug(" Plugin hashfiles: Hash file not found. Will use source file $filetoload instead.");
77
77
        }
78
78
        # Change calling params
79
79
        $_[4]=$filetoload;
101
101
        my ($filetosave,$hashtosave,$testifuptodate,$nbmaxofelemtosave,$nbofelemsaved)=@_;
102
102
        if (! $testifuptodate || ! $PluginHashfilesUpToDate) {
103
103
                $filetosave =~ s/(\.\w+)$//; $filetosave.=".hash";
104
 
                debug(" Save data ".($nbmaxofelemtosave?"($nbmaxofelemtosave records max)":"(all records)")." into hash file $filetosave");
 
104
                debug(" Plugin hashfiles: Save data ".($nbmaxofelemtosave?"($nbmaxofelemtosave records max)":"(all records)")." into hash file $filetosave");
105
105
                if (! $nbmaxofelemtosave || (scalar keys %$hashtosave <= $nbmaxofelemtosave)) {
106
106
                        # Save all hash array
107
107
                        eval('store(\%$hashtosave, "$filetosave");');
108
108
                        $_[4]=scalar keys %$hashtosave;
109
109
                }
110
110
                else {
111
 
                        debug(" We need to resize hash to save from ".(scalar keys %$hashtosave)." to $nbmaxofelemtosave");
 
111
                        debug(" Plugin hashfiles: We need to resize hash to save from ".(scalar keys %$hashtosave)." to $nbmaxofelemtosave");
112
112
                        # Save part of hash array
113
113
                        my $counter=0;
114
114
                        my %newhashtosave=();