Changeset 1336
- 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
| r1335 |
r1336 |
|
| 1 | 1 | ispCP ω 1.0.0 Changelog |
|---|
| 2 | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 3 | 2008-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 | |
|---|
| 3 | 9 | 2008-08-26 Daniel Andreca |
|---|
| 4 | 10 | - GUI: |
|---|
| r1329 |
r1336 |
|
| 111 | 111 | while ( my $log_line = <STDIN> ) { |
|---|
| 112 | 112 | 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;} |
|---|
| 115 | 116 | $vhost = lc($vhost) || "default"; |
|---|
| 116 | 117 | if ( $vhost =~ m#[/\\]# ) { $vhost = "default" } |
|---|
| … | … | |
| 124 | 125 | if ( (keys(%timestamps)+1) > $MAXFILES ) { |
|---|
| 125 | 126 | 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 | } |
|---|
| 129 | 136 | delete $combined_logs{$key}; |
|---|
| 130 | 137 | delete $traff_logs{$key}; |
|---|
| … | … | |
| 135 | 142 | |
|---|
| 136 | 143 | 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); |
|---|
| 138 | 145 | checkFileExists($vhost, \%access_logs, $main::cfg{'APACHE_USERS_LOG_DIR'},"-access.log",$force_open); |
|---|
| 139 | 146 | |
|---|
| r1232 |
r1336 |
|
| 126 | 126 | |
|---|
| 127 | 127 | 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 | } |
|---|
| 128 | 133 | |
|---|
| 129 | 134 | $rs = sys_command("$main::cfg{'CMD_CP'} $src_file $dest_file"); |
|---|
|