You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Mehmet Can Cömert (JIRA)" <ji...@apache.org> on 2019/02/20 09:33:00 UTC

[jira] [Comment Edited] (NET-666) Pure-FTP MLSD Answer is not interpreted correctly

    [ https://issues.apache.org/jira/browse/NET-666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16772811#comment-16772811 ] 

Mehmet Can Cömert edited comment on NET-666 at 2/20/19 9:32 AM:
----------------------------------------------------------------

If I enable Trace Loggin on FileZilla, there seems to be a communication between Server and FileZilla after reply code 150 is received.

Command:	MLSD
Trace:	CTransferSocket::OnConnect
Trace:	CFtpControlSocket::OnReceive()
Response:	150 Accepted data connection
Trace:	CFtpRawTransferOpData::ParseResponse() in state 4
Trace:	CControlSocket::SendNextCommand() --> I guess FileZilla sends something here.
Trace:	CFtpRawTransferOpData::Send() in state 5
Trace:	CTransferSocket::TransferEnd(1)
Trace:	CFtpControlSocket::TransferEnd()
Trace:	CFtpControlSocket::OnReceive()
Response:	226-Options: -a -l 
Response:	226 4 matches total



was (Author: mcancomert):
If I enable Trace Loggin on File Zille, there seems to be a communication between Server and FileZilla after reply code 150 is received.

Command:	MLSD
Trace:	CTransferSocket::OnConnect
Trace:	CFtpControlSocket::OnReceive()
Response:	150 Accepted data connection
Trace:	CFtpRawTransferOpData::ParseResponse() in state 4
Trace:	CControlSocket::SendNextCommand() --> I guess FileZilla sends something here.
Trace:	CFtpRawTransferOpData::Send() in state 5
Trace:	CTransferSocket::TransferEnd(1)
Trace:	CFtpControlSocket::TransferEnd()
Trace:	CFtpControlSocket::OnReceive()
Response:	226-Options: -a -l 
Response:	226 4 matches total


> Pure-FTP MLSD Answer is not interpreted correctly
> -------------------------------------------------
>
>                 Key: NET-666
>                 URL: https://issues.apache.org/jira/browse/NET-666
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 3.6
>            Reporter: Mehmet Can Cömert
>            Priority: Major
>         Attachments: FileZillaLog.txt, ListFilesLog.txt, ListFilesTester.java
>
>
> Hello,
> For our integration tests, we made an FTPS server setup with Pure-FTP.
> It is running with a self-signed TLS certificate in a docker container.
> With FileZilla, we can make a connection and see files or we can upload/download files.
> You can see the complete FileZilla communication logs in the FileZillaLog.txt
> The part related to MLSD is like following:
> -----
> Command: MLSD
> Trace: Trying to resume existing TLS session.
> Trace: TLS Handshake successful
> Trace: TLS Session resumed
> Trace: Protocol: TLS1.2, Key exchange: ECDHE-RSA, Cipher: CHACHA20-POLY1305, MAC: AEAD
> Trace: Hostname does not match certificate SANs
> Response: 150 Accepted data connection
> Response: 226-Options: -a -l 
> Response: 226 3 matches total
> Listing: type=cdir;sizd=30;modify=20190218135100;UNIX.mode=0755;UNIX.uid=1000;UNIX.gid=1000;unique=fd0eg103ba52; .
> Listing: type=pdir;sizd=40;modify=20190218134929;UNIX.mode=0755;UNIX.uid=1000;UNIX.gid=0;unique=fd0eg81323a; ..
> Listing: type=file;size=1002;modify=20190218135100;UNIX.mode=0644;UNIX.uid=1000;UNIX.gid=1000;unique=fd0eg103ba53; test-file.txt
> Status: Directory listing of "/test" successful
> ----
> With Commons-Net I have written a small test class based on CCCTester
> The test file is available in ListFilesTester.java and complete logs in ListFilesLog.txt
> The part related to MLSD is like following:
> ---
> COMMAND: PASV
> REPLY: 227 Entering Passive Mode (192,168,52,185,117,53)
> COMMAND: MLSD
> REPLY: 150 Accepted data connection
> org.apache.commons.net.ftp.FTPConnectionClosedException: Connection closed without indication.
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:324)
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:300)
> at org.apache.commons.net.ftp.FTP.getReply(FTP.java:732)
> at org.apache.commons.net.ftp.FTPClient.completePendingCommand(FTPClient.java:1857)
> at org.apache.commons.net.ftp.FTPClient.initiateMListParsing(FTPClient.java:3452)
> at org.apache.commons.net.ftp.FTPClient.mlistDir(FTPClient.java:2546)
> at org.apache.commons.net.ftp.FTPClient.mlistDir(FTPClient.java:2533)
> at org.apache.commons.net.ftp.parser.ListFilesTester.test(ListFilesTester.java:48)
> at org.apache.commons.net.ftp.parser.ListFilesTester.main(ListFilesTester.java:103)
> ---
> Once we debug inside  __getReply method we can actually see 
> 150 Accepted data connection
> message in "_replyLines" list but it is written in the list of previous answer lines. 
> Next call to _controlInput_.readLine(); results NULL in the "line" variable and exception is thrown.
> This issue seems also very similar to 
> https://issues.apache.org/jira/browse/NET-598
> It would be nice to make Pure-FTP working together with Commons-Net.
> It is used in one of the popular Docker Images for FTP Servers and it is useful for integration tests.
> Docker Image is available under:
> https://hub.docker.com/r/stilliard/pure-ftpd/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)