You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-dev@incubator.apache.org by "Evgueni Smoliar (JIRA)" <ji...@apache.org> on 2006/05/17 10:36:07 UTC
[jira] Created: (FTPSERVER-42) Listing of non-existing files cause
the problems
Listing of non-existing files cause the problems
-------------------------------------------------
Key: FTPSERVER-42
URL: http://issues.apache.org/jira/browse/FTPSERVER-42
Project: FtpServer
Type: Bug
Reporter: Evgueni Smoliar
list of non-existing files cause connection problems in stead of just returing empty result list
File Not exists is not syntax error!
org.apache.ftpserver.DirectoryLister.java
----
all calls like :
try {
files = m_fileSystemView.listFiles(m_file);
}
catch(FtpException ex) {
}
if(files == null) {
return false;
}
should be changed to :
try {
files = m_fileSystemView.listFiles(m_file);
}
catch(FtpException ex) {
}
if(files == null) {
return true;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (FTPSERVER-42) Listing of non-existing files cause
the problems
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=all ]
Sergey Vladimirov updated FTPSERVER-42:
---------------------------------------
Attachment: patch1.txt
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Type: Bug
> Reporter: Evgueni Smoliar
> Attachments: patch1.txt, patch2.txt
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (FTPSERVER-42) Listing of non-existing files
cause the problems
Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=comments#action_12430022 ]
Niklas Gustavsson commented on FTPSERVER-42:
--------------------------------------------
The FileZilla server returns 550 for LIST:
ftp> cd test
250 CWD successful. "/test" is current directory.
ftp> dir
200 Port command successful
150 Opening data channel for directory list.
-rw-r--r-- 1 ftp ftp 5 Aug 23 16:54 foo
226 Transfer OK
ftp: 54 bytes received in 0,00Seconds 54000,00Kbytes/sec.
ftp> dir bar
200 Port command successful
550 Directory not found.
Same result on NLST:
ftp> ls
200 Port command successful
150 Opening data channel for directory list.
foo
226 Transfer OK
ftp: 5 bytes received in 0,02Seconds 0,31Kbytes/sec.
ftp> ls bar
200 Port command successful
550 Directory not found
Looks like they do not follow the spec as 550 should not be allowed.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Issue Type: Bug
> Reporter: Evgueni Smoliar
> Attachments: patch1.txt, patch2.txt
>
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FTPSERVER-42) Listing of non-existing files
cause the problems
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=comments#action_12412156 ]
Sergey Vladimirov commented on FTPSERVER-42:
--------------------------------------------
Acording to RFC959, possible return codes from LIST, NLST commands are
125, 150
226, 250
425, 426, 451
450
500, 501, 502, 421, 530
In case of no-such-file thre possbile return codes are... 150,250,450
150 - File status okay; about to open data connection.
250 - Requested file action okay, completed.
450 - Requested file action not taken. File unavailable (e.g., file busy).
550 code (Requested action not taken. File unavailable (e.g., file not found, no access).) is not possible return code for LIST commands.
I think using the "250" return code and empty return list is the most appropriate, as proposed by Evgeniy. Need to test with other FTP servers.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Type: Bug
> Reporter: Evgueni Smoliar
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (FTPSERVER-42) Listing of non-existing files
cause the problems
Posted by "Mark Reynolds (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=comments#action_12430366 ]
Mark Reynolds commented on FTPSERVER-42:
----------------------------------------
vsftpd on Linux returns 226:
C:\>ftp ftp.suse.com
Connected to ftp.suse.com.
220 "Welcome to the SUSE ftp server: Please login as user 'ftp'"
User (ftp.suse.com:(none)): anonymous
331 Please send your email address as a password.
Password:
230 Login successful. Have a lot of fun.
ftp> ls /foo.bar
200 PORT command successful. Consider using PASV.
150 Listing
226 Directory send OK.
ftp> quit
221 Goodbye.
WS_FTP returns 226:
C:\>ftp ftp.ipswitch.com
Connected to ftp.ipswitch.com.
220 ftp6.ipswitch.com X2 WS_FTP Server 5.0.4 (2147660457)
User (ftp.ipswitch.com:(none)): anonymous
331 Password required
Password:
230 user logged in
ftp> ls /foo.bar
200 command successful
150 Opening ASCII data connection for directory listing
226 transfer complete
ftp> quit
221 Good-Bye
ProFTPD Server returns 450:
C:\>ftp ftp.proftpd.org
Connected to ftp.proftpd.org.
220 ProFTPD 1.3.0 Server (proftpd.org Project) [81.223.20.36]
User (ftp.proftpd.org:(none)): anonymous
331 Anonymous login ok, send your complete email address as your password.
Password:
230 Anonymous access granted, restrictions apply.
ftp> ls /foo.bar
200 PORT command successful
450 /foo.bar: No such file or directory
ftp> quit
221 Goodbye.
Serv-U FTP Server returns 550:
C:\>ftp ftp.serv-u.com
Connected to ftp.serv-u.com.
220 Serv-U FTP Server v6.3 for WinSock ready...
User (ftp.serv-u.com:(none)): anonymous
331 User name okay, please send complete E-mail address as password.
Password:
230 User logged in, proceed.
ftp> ls /foo.bar
200 PORT Command successful.
550 /foo.bar: No such file or directory.
ftp> quit
221 Goodbye!
Microsoft FTP Service returns 550:
C:\>ftp ftp.microsoft.com
Connected to ftp.microsoft.com.
220 Microsoft FTP Service
User (ftp.microsoft.com:(none)): anonymous
331 Anonymous access allowed, send identity (e-mail name) as password.
Password:
230-Welcome to FTP.MICROSOFT.COM. Also visit http://www.microsoft.com/downloads.
230 Anonymous user logged in.
ftp> ls /foo.bar
200 PORT command successful.
150 Opening ASCII mode data connection for file list.
550 /foo.bar: The system cannot find the file specified.
ftp> quit
221 Thank you for using Microsoft products.
Globalscape FTP Server returns 550:
C:\>ftp ftp.cuteftp.com
Connected to ftp.cuteftp.com.
220 GlobalSCAPE Secure FTP Server (v. 3.0)
User (ftp.cuteftp.com:(none)): anonymous
331 Password required for anonymous.
Password:
230 Login OK. Proceed.
ftp> ls /foo.bar
200 Command okay.
550 Permission denied.
ftp> quit
221 Service closing control connection.
NcFTPd Server returns 550:
C:\>ftp ftp.ncftp.com
Connected to ncftp.com.
220 ncftpd.com NcFTPd Server (licensed copy) ready.
User (ncftp.com:(none)): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230-You are user #1 of 16 simultaneous users allowed.
230-
230 Logged in anonymously.
ftp> ls /foo.bar
200 PORT command successful.
550 No such file or directory.
ftp> quit
221 Goodbye.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Issue Type: Bug
> Reporter: Evgueni Smoliar
> Attachments: patch1.txt, patch2.txt
>
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (FTPSERVER-42) Listing of non-existing files
cause the problems
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=comments#action_12412157 ]
Sergey Vladimirov commented on FTPSERVER-42:
--------------------------------------------
Tested with upload.sourceforge.net:
ftp> open upload.sourceforge.net
Connected to osdn.dl.sourceforge.net.
220-********************************************************************
220- SourceForge.net FTP server - San Jose (osdn.dl.sourceforge.net)
220- Additional access is at http://osdn.dl.sourceforge.net/pub/mirrors/
220- Mirrors, try 'rsync osdn.dl.sourceforge.net::'
220-
220- Got a fat pipe and something to prove? Host a SourceForge download
220- server! Email ftpadmin@sourceforge.net for opportunities.
220-
220- On This Site:
220- /incoming SourceForge.net Project File Upload
220- *********************************************************************
220
User (osdn.dl.sourceforge.net:(none)): anonymous
331 Please specify the password.
Password:
230 Login successful.
ftp> dir incoming
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwx-wx-wx 2 ftp ftp 81920 May 17 05:17 incoming
226 Directory send OK.
ftp: 66 bytes received in 0,00Seconds 66000,00Kbytes/sec.
ftp> dir incoming2
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
It seems 226 code is used.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Type: Bug
> Reporter: Evgueni Smoliar
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (FTPSERVER-42) Listing of non-existing files cause
the problems
Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=all ]
Sergey Vladimirov updated FTPSERVER-42:
---------------------------------------
Attachment: patch2.txt
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Type: Bug
> Reporter: Evgueni Smoliar
> Attachments: patch1.txt, patch2.txt
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (FTPSERVER-42) Listing of non-existing files
cause the problems
Posted by "Clinton Foster (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=comments#action_12438827 ]
Clinton Foster commented on FTPSERVER-42:
-----------------------------------------
To state the problem in another way, if the filepath argument for either LIST or NLST is a non-existent file or directory, a 501 error is returned. Thereafter, the conversation with the server is out of sync, and sending any command to the server causes strange results. Here is a sample debug client session:
ftp> ls nosuch
---> EPSV
229 Entering Passive Mode (|||55501|)
---> EPRT |2|::1|55503|
200 Command EPRT okay.
---> LIST nosuch
150 File status okay; about to open data connection.
501 Syntax error in parameters or arguments.
ftp> pwd
---> PWD
226 Closing data connection.
ftp> pwd
---> PWD
257 "/" is current directory.
ftp> ls
---> EPRT |2|::1|55505|
257 "/" is current directory.
---> LIST
200 Command EPRT okay.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Issue Type: Bug
> Reporter: Evgueni Smoliar
> Attachments: patch1.txt, patch2.txt
>
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (FTPSERVER-42) Listing of non-existing files cause
the problems
Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/FTPSERVER-42?page=all ]
Niklas Gustavsson closed FTPSERVER-42.
--------------------------------------
Resolution: Fixed
Assignee: Niklas Gustavsson
This bug is now fixed. FtpServer will now return an empty listing and a 226 return code.
> Listing of non-existing files cause the problems
> ------------------------------------------------
>
> Key: FTPSERVER-42
> URL: http://issues.apache.org/jira/browse/FTPSERVER-42
> Project: FtpServer
> Issue Type: Bug
> Reporter: Evgueni Smoliar
> Assigned To: Niklas Gustavsson
> Attachments: patch1.txt, patch2.txt
>
>
> list of non-existing files cause connection problems in stead of just returing empty result list
> File Not exists is not syntax error!
> org.apache.ftpserver.DirectoryLister.java
> ----
> all calls like :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return false;
> }
> should be changed to :
> try {
> files = m_fileSystemView.listFiles(m_file);
> }
> catch(FtpException ex) {
> }
> if(files == null) {
> return true;
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira