Small inconsistency in URI::URL's anonymous FTP password

Ben Gertzfield (che@debian.org)
26 Jun 1998 00:55:02 -0700


(I'm not on this list; please Cc: me with any responses.)

When URI::URL generates an anonymous FTP password, like with the
code below:

#!/usr/bin/perl -w

use URI::URL;

my $url = new URI::URL "ftp://ftp.debian.org/";

print $url->password(), "\n";

the results of $url->password are often not what many FTP
servers expect.

On a box with /etc/hosts of:

127.0.0.1       localhost che che.got.net

this code gives me as output:

che@che.got.net

All well and good -- this sort of password works just fine for
anonymous logins to any FTP server. However, on a different
box with /etc/hosts of:

127.0.0.1	localhost
128.114.24.113	gilgamesh.cse.ucsc.edu	gilgamesh

the code gives me:

che@gilgamesh

This may or may not be URI::URL's fault, but I know many FTP servers
expect a fully-qualified domain name on the right-hand side of an
anonymous FTP password. In any case, this causes the Debian Linux FTP
package-fetching routines to croak when they try to log in
to a server anonymously on a system like this.

Actually, looking through URI::URL::ftp.pm, I see (in sub password):

            unless (defined $fqdn) {
                eval {
                    require Net::Domain;
                    $fqdn = Net::Domain::hostfqdn();
                };
                if ($@) {
                    $fqdn = '';
                }
            }

which seems to say that once again the lovely Net:: modules are
to blame.

Sigh.

So is the problem URI::URL's for naively assuming the Net:: modules
actually work? :)

Should I be reporting this to Graham Barr?

Ben

-- 
Brought to you by the letters N and U and the number 19.
"Mmm.. incapacitating.." -- Homer Simpson
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.