--- loncom/auth/lonracc.pm 2005/02/05 22:20:56 1.14 +++ loncom/auth/lonracc.pm 2005/02/06 07:23:40 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network # Access Handler for File Transfers # -# $Id: lonracc.pm,v 1.14 2005/02/05 22:20:56 albertel Exp $ +# $Id: lonracc.pm,v 1.15 2005/02/06 07:23:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,9 +52,12 @@ sub subscribed { sub handler { my $r = shift; - my $reqhost = $r->get_remote_host(REMOTE_HOST); + my $reqhost = $r->get_remote_host(REMOTE_NOLOOKUP); + my $netaddr=inet_aton($reqhost); + ($reqhost) = gethostbyaddr($netaddr,AF_INET); if (!$reqhost) { - $r->log_reason("Unable to do hostname lookup for ".$ENV{'REMOTE_ADDR'}); + $r->log_reason("Unable to do hostname $reqhost lookup for ".$r->get_remote_host(REMOTE_NOLOOKUP)); + return FORBIDDEN; } if ($reqhost eq 'localhost.localdomain') { return OK; @@ -63,7 +66,7 @@ sub handler { my @ids=(); my $id; foreach $id (keys %Apache::lonnet::hostname) { - if ($Apache::lonnet::hostname{$id} =~ /\Q$reqhost\E/i) { + if ($Apache::lonnet::hostname{$id} =~ /^\Q$reqhost\E$/i) { my $filename=$r->filename; my $uri =$r->uri; if ((-e "$filename.$id") ||