Permalink
Browse files

Don't try to come up with the e-mail address of the user as

the anonymous password.  Patch by Eduardo P�rez <eperez@dei.inf.uc3m.es>.
  • Loading branch information...
1 parent 3054984 commit 7f1e29d534018ccdd863bf6806168ecce3d1caea @gisle gisle committed Dec 30, 2001
Showing with 8 additions and 21 deletions.
  1. +8 −21 URI/ftp.pm
View
@@ -5,8 +5,6 @@ require URI::_userpass;
@ISA=qw(URI::_server URI::_userpass);
use strict;
-use vars qw($whoami $fqdn);
-use URI::Escape qw(uri_unescape);
sub default_port { 21 }
@@ -31,25 +29,14 @@ sub password
my $user = $self->user;
if ($user eq 'anonymous' || $user eq 'ftp') {
# anonymous ftp login password
- unless (defined $fqdn) {
- eval {
- require Net::Domain;
- $fqdn = Net::Domain::hostfqdn();
- };
- if ($@) {
- $fqdn = '';
- }
- }
- unless (defined $whoami) {
- $whoami = $ENV{USER} || $ENV{LOGNAME} || $ENV{USERNAME};
- unless ($whoami) {
- if ($^O eq 'MSWin32') { $whoami = Win32::LoginName() }
- else {
- $whoami = getlogin || getpwuid($<) || 'unknown';
- }
- }
- }
- $pass = "$whoami\@$fqdn";
+ # If there is no ftp anonymous password specified
+ # then we'll just use 'anonymous@'
+ # We don't try to send the read e-mail address because:
+ # - We want to remain anonymous
+ # - We want to stop SPAM
+ # - We don't want to let ftp sites to discriminate by the user,
+ # host, country or ftp client being used.
+ $pass = 'anonymous@';
}
}
$pass;

0 comments on commit 7f1e29d

Please sign in to comment.