Net::FTP : Passive mode does not work as documented.

Net::FTP : Passive mode does not work as documented.

am 20.06.2006 11:39:42 von ro.naldfi.scher

A few of our servers reject connection via Net::FTP with the error

"PASV is disabled"

>From the wording I guessed that this means that our client program
tries to establish the connection via passive mode, but the server
only supports active mode.

>From the perldoc documentation of Net::FTP I concluded that active
mode is the default when creating a Net::FTP object (unless one
explicitly sets Passive=>0 in the constructor, which we don't). So
it seems that the documentation for Net::FTP does not match the
implementation.

(Additional note:

To double-check this, I ran the client again, but now with setting
the environment variable FTP_PASSIVE to zero. The transfer
now works.

Similarily, if I set FTP_PASSIVE to 1 makes the error message
reappear, as does an explicit call to the pasv method).

Ronald

Re: Net::FTP : Passive mode does not work as documented.

am 30.06.2006 10:58:24 von chris-usenet

ro.naldfi.scher@gmail.com wrote:
> A few of our servers reject connection via Net::FTP with the error
> "PASV is disabled"

> From the perldoc documentation of Net::FTP I concluded that active
> mode is the default when creating a Net::FTP object (unless one
> explicitly sets Passive=>0 in the constructor, which we don't). So
> it seems that the documentation for Net::FTP does not match the
> implementation.

The default value for Passive is actually derived via the settings in
Net::Config, which would have been configured when the Net:: modules
were first built and installed.

# Passive default for internal hosts
perl -MNet::Config -e 'print $Net::Config::NetConfig{ftp_int_passive},"\n"'

# Passive default for external hosts
perl -MNet::Config -e 'print $Net::Config::NetConfig{ftp_ext_passive},"\n"'

Chris