$msg |
This usually means something went wrong with the trace. All the bugs
are not out yet! It may work the next time -- use your back button to try again.
EOF
if($extended) {
print <
$extendedEOF } print <
You should enter the names of any trusted backbones or networks in the TRUSTED DOMAINS entry, space-separated. We tried to insert your provider to begin with. If you are connected through one or more other networks then you probably will want to include them in the field.
Traceroutes that go through the backbones hosting this CGI will not generate complaints to those upstreams.
Check the generated complaint for correctness and then send the results to sendmail or some other mailer. Often you will want to trim the To: field -- if the program doesn't find an injecting host, you will probably want to discard the results.
Send comments, problems, kudos, and complaints to: nospam\@minivend.com
You are welcome to the source for these programs, but due to lack
of time there will be absolutely no questions answered about it.
Don't download these unless you know Perl and are prepared for some
heavy going. (program) (CGI front-end)
EOF
}
if($ENV{REQUEST_METHOD} eq "GET") {
print_form();
exit;
}
elsif($ENV{REQUEST_METHOD} eq "HEAD") {
exit;
}
elsif($ENV{REQUEST_METHOD} ne "POST") {
die_page "Unrecognized request method.\n";
}
my $q = new CGI_Lite ();
#$q->set_directory($UPLOAD_DIR)
# or die_page "Couldn't set directory to $UPLOAD_DIR: $!\n";
my $data = $q->parse_form_data();
my $file;
if($$data{send_method} eq 'clip') {
$file = $$data{clipped_message};
}
elsif($$data{send_method} eq 'file' or $$data{'first_file'}) {
$q->set_file_type ("handle");
$file = $$data{'first_file'};
}
elsif($$data{clipped_message}) {
$file = $$data{clipped_message};
}
die_page("No data! Check the file you sent or what you pasted in.") unless $file;
my $trusted = $$data{'trusted'};
my $trace_mode = $$data{'trace_mode'};
my $whois_mode = $$data{'whois_mode'};
my $debug_mode = $$data{'debug_mode'};
my $click_check = $$data{'click_check'};
$trace_mode = '-a' if $trace_mode;
$whois_mode = '-w' if $whois_mode;
$debug_mode = '' unless $debug_mode eq '-D';
$click_check = '' unless $click_check =~ /-C/;
if($trusted) {
$trusted =~ tr/,/ /;
$trusted =~ m/($Nothost)/ and do {
my $char = $1;
die_page ("Bad character $char in trusted hosts field.");
};
$trusted = "-t '$trusted'";
}
if ($file =~ /\r\n/) {
$file =~ s/\r//g;
}
else {
$file =~ s/\r/\n/g;
}
my $infile = POSIX::tmpnam();
my $errfile = "$infile.err";
open(IN, ">$infile") or die_page( "Couldn't open output file: $!\n");
print IN $file;
close IN;
open(NAILEM, "$NAILPROG $trusted $whois_mode $click_check $trace_mode $debug_mode $infile 2>$errfile|")
or die "cannot fork: $!";
print $status_line;
print <
\n"; open(OUT, $errfile) or warn "Couldn't open error file: $!\n"; while () { $msg .= "$_" } close OUT; $msg .= "\n"; } } unlink $errfile;