Guichaguri / MinimalFTP

A lightweight, simple FTP server. Pure Java, no dependencies.
Apache License 2.0
160 stars 45 forks source link

Error on MLSD when using filezilla client #1

Closed proofrock closed 7 years ago

proofrock commented 7 years ago

Hello, first of all, thanks for sharing your work. I imported the sources and called it with the suggested code:

public static void main(String[] argv) throws IOException { File root = new File(System.getProperty("user.dir")); NativeFileSystem fs = new NativeFileSystem(root); NoOpAuthenticator auth = new NoOpAuthenticator(fs); FTPServer server = new FTPServer(auth); server.listenSync(21); }

When connecting to localhost:21 from Filezilla client, it fails almost immediately:

Comando: PWD Risposta: 257 "/" CWD Name Comando: TYPE I Risposta: 200 Type set to I Comando: EPSV Risposta: 229 Enabled Passive Mode (|||52773|) Comando: MLSD Risposta: 501 Missing parameters Errore: Non è stato possibile leggere il contenuto della cartella

Sorry for the italian, the last line means "it wasn't possible to read the contents of the folder". Am I missing something?

Cheers, and thanks again,

  Germano
Guichaguri commented 7 years ago

MLSD is currently broken, you can disable the command and Filezilla will use LIST instead of MLSD for now.

I'll try to fix it tomorrow, thanks for reporting the issue :)

Guichaguri commented 7 years ago

Turns out the issue was the date format, it was using the "day of year" (3 characters) instead of "day of month" (2 characters), which makes the format use one more character. Filezilla is very strict about MLSx commands.

Edit: A new version (1.0.4) was released.

proofrock commented 7 years ago

Good!! Now it works also in firefox, that yesterday didn't. It gave a "wrong permission" error, maybe it was related? It still doesn't work in Chrome, though: index for / is empty. Should I open a bug? I don't even know if it's supposed to work, does Chrome have a FTP client?

Thanks a lot!!

proofrock commented 7 years ago

Also about Chrome: it keeps loading "forever", it doesn't stop.

Guichaguri commented 7 years ago

About Chrome, see more about it here: https://bugs.chromium.org/p/chromium/issues/detail?id=706905 I can add a workaround to make it work, but it's definitely an issue in Chrome's side.

proofrock commented 7 years ago

It's ok for me - about the workaround, it's your choice, I personally don't think it's always good to make something work just for the sake of it. I'll use other clients. Thanks again!

Guichaguri commented 7 years ago

I just pushed the workaround in c93b9c7cc29c98ff17ed73c8abc8d8bf48c4cd58