version 1.17, 2007/03/02 23:17:48
|
version 1.18, 2007/03/02 23:43:29
|
Line 37 use IO::Socket;
|
Line 37 use IO::Socket;
|
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); |
my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); |
my %iphost=&Apache::lonnet::get_iphost(); |
my @hostids= &Apache::lonnet::get_hosts_from_ip($reqhost); |
my $hostids=$iphost{$reqhost}; |
if (!@hostids && $reqhost ne '127.0.0.1' ) { |
if (!$hostids && $reqhost ne '127.0.0.1' ) { |
|
$r->log_reason("Unable to find a host for ". |
$r->log_reason("Unable to find a host for ". |
$r->get_remote_host(REMOTE_NOLOOKUP)); |
$r->get_remote_host(REMOTE_NOLOOKUP)); |
return FORBIDDEN; |
return FORBIDDEN; |
Line 58 sub handler {
|
Line 57 sub handler {
|
while ($readline=<$fh>) { |
while ($readline=<$fh>) { |
$readline=~s/\s*$//; |
$readline=~s/\s*$//; |
my ($id,$domain,$role,$name)=split(/:/,$readline); |
my ($id,$domain,$role,$name)=split(/:/,$readline); |
foreach my $hostid (@{$hostids}) { |
foreach my $hostid (@hostids) { |
my $hostname=&Apache::lonnet::hostname($hostid); |
my $hostname=&Apache::lonnet::hostname($hostid); |
if ($name =~ /^\Q$hostname\E$/i) { |
if ($name =~ /^\Q$hostname\E$/i) { |
return OK; |
return OK; |
Line 67 sub handler {
|
Line 66 sub handler {
|
} |
} |
|
|
} |
} |
$r->log_reason("Invalid request for user file transfer from $reqhost (".join(",",@{$hostids}).")", |
$r->log_reason("Invalid request for user file transfer from $reqhost (".join(",",@hostids).")", |
$r->filename); |
$r->filename); |
return FORBIDDEN; |
return FORBIDDEN; |
} |
} |