Changeset 1336

Show
Ignore:
Timestamp:
08/28/08 23:53:46 (3 months ago)
Author:
scitech
Message:

maillogconvert.pl contains ilegal characters. Traffic processing fails if log file is missing. Generated traffic for crafted GET/POST is not processed

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1335 r1336  
    11ispCP ω 1.0.0 Changelog 
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     32008-08-29 Daniel Andreca 
     4        - ENGINE: 
     5                * maillogconvert.pl contains ilegal characters 
     6                * traffic processing fails if log file is missing 
     7                * Generated traffic for crafted GET/POST is not processed 
     8 
    392008-08-26 Daniel Andreca 
    410        - GUI: 
  • trunk/engine/ispcp-apache-logger

    r1329 r1336  
    111111        while ( my $log_line = <STDIN> ) { 
    112112                my ($vhost, $rhost, $rlog, $user, $date, $url_with_method, $status, $size, $referrer, $agent) = $log_line =~ 
    113                         m/^(\S+) (\S+) ([^ ]*?) ([^ ]*?) \[(\S+ \+\d{4})\] "(\S+ \S+ [^"]+)" (\d{3}) (\d+|-) "(.*?)" "([^"]+)"$/; 
    114                  
     113                        m/^(\S+) (\S+) ([^ ]*?) ([^ ]*?) \[(\S+ \+\d{4})\] "(.*?)" (\d{3}) (\d+|-) "(.*?)" "([^"]+)"$/; 
     114                if(!defined($vhost)){print "Trouble line:\n\t$log_line\n"; return 0;} 
     115                if(!defined($size)){print "Trouble line:\n\t$log_line\n"; return 0;} 
    115116                $vhost = lc($vhost) || "default"; 
    116117                if ( $vhost =~ m#[/\\]# ) { $vhost = "default" } 
     
    124125                        if ( (keys(%timestamps)+1) > $MAXFILES ) { 
    125126                                my ( $key, $value ) = sort { $timestamps{$a} <=> $timestamps{$b} } ( keys(%timestamps) ); 
    126                                 close $combined_logs{$key}; 
    127                                 close $traff_logs{$key}; 
    128                                 close $access_logs{$key}; 
     127                                if(-e "$main::cfg{'APACHE_LOG_DIR'}/$key-combined.log" && defined($combined_logs{$key})){ 
     128                                        close $combined_logs{$key}; 
     129                                } 
     130                                if(-e "$main::cfg{'APACHE_LOG_DIR'}/$key-traf.log" && defined($traff_logs{$key})){ 
     131                                        close $traff_logs{$key}; 
     132                                } 
     133                                if(-e "$main::cfg{'APACHE_USERS_LOG_DIR'}/$key-access.log" && defined($access_logs{$key})){ 
     134                                        close $access_logs{$key}; 
     135                                } 
    129136                                delete $combined_logs{$key}; 
    130137                                delete $traff_logs{$key}; 
     
    135142         
    136143                checkFileExists($vhost, \%combined_logs, $main::cfg{'APACHE_LOG_DIR'},"-combined.log",$force_open); 
    137                 checkFileExists($vhost, \%traff_logs, $main::cfg{'APACHE_LOG_DIR'},"-traff.log",$force_open); 
     144                checkFileExists($vhost, \%traff_logs, $main::cfg{'APACHE_LOG_DIR'},"-traf.log",$force_open); 
    138145                checkFileExists($vhost, \%access_logs, $main::cfg{'APACHE_USERS_LOG_DIR'},"-access.log",$force_open); 
    139146                 
  • trunk/engine/traffic/ispcp-vrl-traff

    r1232 r1336  
    126126 
    127127    my $log_file = $dest_file; 
     128 
     129    if(! -e $src_file){ 
     130        push_el(\@main::el, 'gen_log_file()', "WARNING: File '$src_file' do not exists !"); 
     131        return (0, '_no_'); 
     132    } 
    128133 
    129134    $rs = sys_command("$main::cfg{'CMD_CP'} $src_file $dest_file");