version 1.6, 2002/08/08 13:45:21
|
version 1.9, 2003/08/01 17:25:40
|
Line 33 use Apache::Constants qw(:common :remote
|
Line 33 use Apache::Constants qw(:common :remote
|
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::File(); |
use Apache::File(); |
|
|
|
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
my $reqhost; |
my $reqhost = $r->get_remote_host(REMOTE_DOUBLE_REV); |
unless ($reqhost=$r->get_remote_host(REMOTE_DOUBLE_REV)) { |
if (!$reqhost && $r->get_remote_host(REMOTE_NOLOOKUP) eq $r->get_server_name()) { |
$r->log_reason("Spoof request ".$reqhost); |
$reqhost = $r->get_server_name(); |
return FORBIDDEN; |
} |
|
unless ($reqhost) { |
|
$r->log_reason("Spoof request from ". $reqhost); |
|
return FORBIDDEN; |
} |
} |
if ($reqhost eq 'localhost.localdomain') { |
if ($reqhost eq 'localhost.localdomain') { |
$r->register_cleanup(\&removefile); |
|
return OK; |
return OK; |
} |
} |
my $readline; |
my $readline; |
Line 55 sub handler {
|
Line 58 sub handler {
|
while ($readline=<$fh>) { |
while ($readline=<$fh>) { |
my ($id,$domain,$role,$name,$ip)=split(/:/,$readline); |
my ($id,$domain,$role,$name,$ip)=split(/:/,$readline); |
if ($name =~ /$reqhost/i) { |
if ($name =~ /$reqhost/i) { |
$r->register_cleanup(\&removefile); |
|
return OK; |
return OK; |
} |
} |
} |
} |