Patrick Andrieu: Kein Fehler im Modul, Fehlkonfiguration des FTP-Dämons bei 1&1?

Beitrag lesen

Hallo Christian!

Dieser Beitrag nur noch zur Info. Vielleicht interessiert er auch Alexander (HH), da wir uns schon mal über 1&1-Konfigurationen gewundert haben ;)

Und zwar dem Autor ;)

Wie Mittwoch erwähnt, habe ich es gemacht, Dan Muey gab mir einige Tests zu machen.

Erster:

print "DEBUG\n".$ftp->site('CHMOD',600,'TESTNETFTP.txt')."\n";
  print "DEBUG\n".$ftp->message()."\n";

Ausgabe:

DEBUG
  2
  DEBUG
  SITE CHMOD command successful

Im zweiten Test ging es darum, die if-Abfrage der Sub »Net::FTP::chmod» wie folgt zu ergänzen:

if ($ftp->supported('CHMOD') || $ftp->supported('SITE CHMOD')) {

Ich erhielt aber immer noch die Response (beim selben Aufruf wie im Ausgangsposting):

Unknown command SITE SITE CHMOD

Dann folgten zwei Tests direkt auf der Kommandozeile:

Tests you asked me to do (with results):
    Notice: I had to invert ' to " and " to ' because the call does'nt work on
    WinXP's cmd.exe if first args are not included inbetween ""...

first:

C:>perl -MData::Dumper -Mstrict -MNe
    t::FTP -le "my $ftp=Net::FTP->new(shift @ARGV);$ftp->login(@ARGV) or die $ftp->m
    essage;print Dumper [$ftp->supported('CHMOD')];print Dumper [$ftp->message];" HOST USER PASSW
    $VAR1 = [
              0
            ];

$VAR1 = [
              'Unknown command 'CHMOD'
    '
            ];

second:

C:>perl -MData::Dumper -Mstrict -MNe
    t::FTP -le "my $ftp=Net::FTP->new(shift @ARGV);$ftp->login(@ARGV) or die $ftp->m
    essage;print Dumper [$ftp->supported('SITE CHMOD')];print Dumper [$ftp->message];" HOST USER PASSW
    $VAR1 = [
              0
            ];

$VAR1 = [
              'Unknown command 'SITE SITE CHMOD'
    '
            ];

Bei Dan:

$ perl -MData::Dumper -Mstrict -MNet::FTP -le 'my $ftp=Net::FTP->new(shift @ARGV);$ftp->login(@ARGV) or die $ftp->message;print Dumper [$ftp->supported("CHMOD")];my @x = $ftp->message;chomp @x;print Dumper @x;' HOST USER PASS
$VAR1 = [
          1
        ];

$VAR1 = [
          'The following SITE commands are recognized',
          ' ALIAS',
          ' CHMOD',
          ' IDLE',
          ' UTIME',
          'Pure-FTPd - http://pureftpd.org/'
        ];

$ perl -MData::Dumper -Mstrict -MNet::FTP -le 'my $ftp=Net::FTP->new(shift @ARGV);$ftp->login(@ARGV) or die $ftp->message;print Dumper [$ftp->supported("SITE CHMOD")];my @x = $ftp->message;chomp @x;print Dumper @x;' HOST USER PASS
$VAR1 = [
          1
        ];

$VAR1 = [
          'The following SITE commands are recognized',
          ' ALIAS',
          ' CHMOD',
          ' IDLE',
          ' UTIME',
          'Pure-FTPd - http://pureftpd.org/'
        ];

Hier die restliche Antwort von Dan:

<cite>
What FTP daemon is running on it?

I ask because its telling you it can't do it but it can apparently and its looking for it backwards
That FTP daemon appears to be misconfigured.

I can't change chmod() to blindly issue a SITE CHMOD (IE remove that if statement)  since some don't support it (think window's based FTP servers) and issueing invalid commands can cause issues.

Plus, if you look at the tests I sent for you to run:

a) it's not using Net::FTP::File (IE problem is not in chmod()'s logic)
 b) The server says it doesn't support it (but then apparently it does):
    - Unknown command 'CHMOD'
    - Unknown command 'SITE SITE CHMOD'
c) the server does not add a SITE on the first one and appends it *again* if it has one already.
</cite>

Die Statuscodes in der FTP.log sind immer 502 (Command not implemented). Im Erfolgsfall (bei meinem Würgaround, bei einem zweiten kommentiere ich direkt in einer Modulkopie File2.pm die if-$ftp->supported-Abfrage) ist es ja 200.

Viele Grüße aus Frankfurt/Main,
Patrick

--

_ - jenseits vom delirium - _
[link:hatehtehpehdoppelpunktslashslashwehwehwehpunktatomicminuseggspunktcomslash]
Nichts ist unmöglich? Doch!
Heute schon gegökt?